/* jy132.css（1.3.2）— 只加样式，不改任何结构。放在所有旧样式之后。 */

/* 深色模式弱文字对比度：#6e6e73 在 #141414 上只有约 3.4:1，改成 iOS secondaryLabel 的 #8e8e93（约 5.6:1，≥ 4.5:1） */
@media (prefers-color-scheme: dark) {
  :root { --color-text-3: #8e8e93; }
}

/* iPhone：输入框字号 ≥ 16px，聚焦时 Safari 不再自动放大页面（只对触屏生效，桌面密度不变；不用 maximum-scale，双指缩放照常） */
@media (hover: none) and (pointer: coarse) {
  #jy-app .jy-input, #jy-app select, #jy-app textarea,
  main input:not([type=file]):not([type=checkbox]):not([type=radio]), main select, main textarea,
  .jy-sheet input:not([type=checkbox]):not([type=radio]), .jy-sheet select, .jy-sheet textarea { font-size: 16px; }
}

/* 触屏点按区域 ≥ 44px（ui 审计 U-11 列出的控件） */
@media (pointer: coarse) {
  .jy-old-link { min-width: 44px !important; min-height: 44px !important; display: inline-grid; place-items: center; }
  .jy-seg button, .jy-seg a { min-height: 44px !important; }
  .jy-chip { height: 44px !important; }
  #jy13-sz-sm, a.link[role=button] { display: inline-block; padding: 13px 4px; margin: -13px -4px; }
  summary { min-height: 44px !important; display: flex; align-items: center; } /* !important：盖过 jy13.css / jy131.css 里 #jy-app 前缀、32px 的旧规则 */
  #t131-seg button { min-height: 44px !important; }
  .cr-btn { min-height: 44px !important; min-width: 44px !important; }
  .jy-stepper button { height: 44px !important; }
  .jy-back, .jy13-add, .jy13-tagbtn { min-width: 44px !important; min-height: 44px !important; display: inline-flex; align-items: center; justify-content: center; }
  #case-grid td.ops .btn { min-width: 44px !important; min-height: 44px !important; }
}

/* 交易记录按行删除 */
#trade-table131 .t131-del { min-width: 44px; min-height: 44px; color: var(--color-danger, #d70015); }
#trade-table131 td.t131-ops { white-space: nowrap; }
@media (max-width: 720px) { #trade-table131 tr.t131-row td.t131-ops { grid-column: 1 / -1; text-align: right; } }

/* 共用「撤销」提示条（js/v132/undo.js） */
.jy132-undo { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h, 56px) + 12px + env(safe-area-inset-bottom, 0px)); z-index: 1000;
  display: inline-flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); padding: 0 6px 0 16px; min-height: 48px; border-radius: 999px;
  background: var(--color-ink, #1d1d1f); color: var(--color-on-ink, #fff); font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.2); pointer-events: auto; }
.jy132-undo__msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jy132-undo__btn { min-height: 44px; min-width: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: inherit; font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (min-width: 1101px) { .jy132-undo { bottom: 32px; } }

/* ---------- 1.3.2 交互改动（jy-audit132/ux.md，22 条） ---------- */
/* 所有新加的按钮 / 链接点按区域 ≥ 44px（手机、桌面都一样） */
.jy132-range button, #t131-sort button, .t131-edit, .jy132-back, .jy132-nodata .jy-btn, .jy132-x, .jy132-symtoggle, .jy132-tocase, .jy13-ck-force, .jy132-szuse,
.jy132-sheetlinks a, #jy132-editbar .btn, #btn-case-add-top, #case-grid .mv-line, .jy132-desc > summary, .jy132-health > summary, #jy132-to-statsec, .t131-empty .btn { min-height: 44px !important; min-width: 44px; box-sizing: border-box; }
/* #3 已成交照实记录 */
.jy13-ck-force { width: 100%; margin: 4px 0 10px; border: 1px dashed var(--color-warning, #b54708); color: var(--color-warning, #b54708); background: transparent; font-weight: 600; }
/* #4 */
.jy132-tocase { display: flex; align-items: center; justify-content: center; margin-top: 12px; text-decoration: none; }
/* #7 录入弹层底下两条直达 */
.jy132-sheetlinks { display: flex; flex-wrap: wrap; gap: 0 16px; margin: -8px 0 12px; }
.jy132-sheetlinks a { display: inline-flex; align-items: center; color: var(--color-primary, #0071e3); text-decoration: none; }
/* #8 数据健康折叠 */
details.jy132-health > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
details.jy132-health > summary::-webkit-details-marker { display: none; }
details.jy132-health > summary::after { content: '›'; color: var(--color-text-3, #888); transition: transform .15s; }
details.jy132-health[open] > summary::after { transform: rotate(90deg); }
/* #9 新设备提示 */
.jy132-nodata { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.jy132-nodata__acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.jy132-x { background: transparent; border: 0; font-size: 20px; cursor: pointer; color: inherit; }
.t131-empty .btn { margin: 4px 4px 0 0; }
/* #11 / #15 回到原处 */
.jy132-back { position: fixed; left: 12px; bottom: calc(var(--tabbar-h, 56px) + 12px + env(safe-area-inset-bottom, 0px)); z-index: 999; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--color-ink, #1d1d1f); color: var(--color-on-ink, #fff); font-size: 14px; font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,.2); cursor: pointer; }
@media (min-width: 1101px) { .jy132-back { bottom: 32px; left: calc(var(--sidebar-w, 220px) + 16px); } }
body.jy-app-open .jy132-back { display: none; }
.jy132-hl, tr.jy132-hl > td { background: color-mix(in srgb, var(--color-warning, #b54708) 18%, transparent) !important; transition: background .3s; }
/* #13 / #14 */
.jy132-range, #t131-sort { flex-wrap: wrap; }
#jy13-mis .jy132-range { margin: 0 0 10px; }
.jy13-mis-main[data-misgo] { cursor: pointer; }
.jy132-misdet { line-height: 1.5; }
/* #10 */
.jy132-ddhint p { margin: 4px 0 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* #18 */
.jy132-symtoggle { cursor: pointer; font: inherit; background: transparent; color: inherit; }
/* #22 改 */
.jy132-editbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--color-warning, #b54708) 12%, transparent); color: var(--color-text, #1d1d1f); font-size: 14px; }
#trade-table131 .t131-edit { margin-right: 4px; }
/* #6 案例说明（窄屏收进「说明」） */
.jy132-desc > summary { cursor: pointer; color: var(--color-text-2, #555); display: flex; align-items: center; }
/* #20 案例表窄屏：品种 + 时间两列吸左；走势一行 */
#case-grid .mv-line { display: none; }
@media (max-width: 640px) {
  #case-grid th.c-sym, #case-grid td.c-sym { position: sticky; left: 0; z-index: 2; width: 92px; min-width: 92px; max-width: 92px; box-sizing: border-box; } /* 1.3.2a：时间列改短格式后腾出宽度，品种列 64→92（原来 iPhone 上只看到「E ▾」「X ▾」） */
  #case-grid th.c-time, #case-grid td.c-time { position: sticky; left: 92px; z-index: 2; box-shadow: 2px 0 0 var(--color-border, #e5e5e8); }
  #case-grid td.c-sym, #case-grid td.c-time { background: var(--color-surface, #fff); }
  #case-grid thead th.c-time { background: var(--color-surface-2, #f3f3f5); }
  #case-grid thead th.c-sym, #case-grid thead th.c-time { z-index: 3; }
  #case-grid td.c-sym select { width: 100%; min-width: 0; padding-left: 8px; padding-right: 22px; background-position: right 6px center; }
  #case-grid td.c-mv { min-width: 132px; }
  #case-grid .mv-line { display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid var(--color-border, #e5e5e8); border-radius: 8px; background: transparent; color: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
  #case-grid .mv-line + .mv-wrap, #case-grid .mv-line ~ .mv-base { display: none; }
  #case-grid td.c-mv.is-open .mv-line + .mv-wrap { display: flex; margin-top: 4px; }
  #case-grid td.c-mv.is-open .mv-line ~ .mv-base { display: block; }
}

