/* jy131.css（1.3.1）— 交易记录「实盘 / 过往」、统计区（各指标分布 / 按品种）、案例表走势 / 144-169 / VWAP / 穿过进场 / 备注。沿用 tokens.css 变量。 */
.t131-hidden { display: none !important; }

/* ---------- 交易记录 ---------- */
#t131 .t131-bar { gap: var(--space-3, 12px); flex-wrap: wrap; align-items: center; margin-bottom: var(--space-3, 12px); }
#t131 .t131-info { font-size: var(--text-xs, 12px); }
#t131 .seg button { min-height: 36px; }
.t131-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: var(--text-xs, 12px); font-weight: 600; white-space: nowrap; }
.t131-badge--live { background: var(--color-success-soft, #eaf5ee); color: var(--color-success, #25854f); }
.t131-badge--past { background: var(--color-surface-2, #f3f3f5); color: var(--color-text-2, #555); border: 1px solid var(--color-border, #e5e5e8); }
.t131-res--win { color: var(--color-success, #25854f); font-weight: 600; }
.t131-res--loss { color: var(--color-danger, #d92d20); font-weight: 600; }
.t131-res--pending { color: var(--color-text-3, #888); }
#trade-table131 tbody tr.t131-row { cursor: pointer; }
#trade-table131 td { vertical-align: top; }
#trade-table131 .t131-note { max-width: 220px; white-space: pre-wrap; word-break: break-word; }
#t131 .toolbar { justify-content: center; margin-top: var(--space-3, 12px); }
#t131-more { min-height: 40px; min-width: 200px; }
/* 窄屏：每条记录一张紧凑卡片（第 1 行 类别 / 品种 / 方向 / 结果；第 2 行 进场 / 出场 / 盈亏 / R；第 3 行 走势 / 来源；备注有才显示） */
@media (max-width: 700px) {
  #t131 .t131-scroll { overflow: visible; }
  #trade-table131, #trade-table131 tbody { display: block; width: 100%; }
  #trade-table131 thead { display: none; }
  #trade-table131 tr.t131-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 8px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--color-border, #e5e5e8); border-radius: 12px; background: var(--color-surface, #fff); align-items: start; }
  #trade-table131 tr.t131-row td { display: block; padding: 0; border: 0; min-width: 0; font-size: var(--text-sm, 13px); line-height: 1.35; }
  #trade-table131 tr.t131-row td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--color-text-3, #888); }
  #trade-table131 tr.t131-row td.t131-cat, #trade-table131 tr.t131-row td.t131-sym, #trade-table131 tr.t131-row td.t131-side, #trade-table131 tr.t131-row td.t131-res { grid-row: 1; align-self: center; font-weight: 600; }
  #trade-table131 tr.t131-row td.t131-cat::before, #trade-table131 tr.t131-row td.t131-sym::before, #trade-table131 tr.t131-row td.t131-side::before, #trade-table131 tr.t131-row td.t131-res::before { display: none; }
  #trade-table131 tr.t131-row td.t131-cat small { display: block; font-weight: 400; font-size: 10px; }
  #trade-table131 tr.t131-row td.t131-res { text-align: right; }
  #trade-table131 tr.t131-row td.t131-mv, #trade-table131 tr.t131-row td.t131-str { grid-column: span 2; }
  #trade-table131 tr.t131-row td.t131-note { grid-column: 1 / -1; max-width: none; }
  #trade-table131 tr.t131-row td.t131-note:has(> .muted:only-child) { display: none; }
  #trade-table131 tr.t131-row td.t131-ops:empty { display: none; }
  #trade-table131 tr.t131-row td.t131-ops { grid-column: 1 / -1; text-align: right; }
  #trade-table131 tr.t131-empty { display: block; } #trade-table131 tr.t131-empty td { display: block; }
}

/* ---------- 统计 ---------- */
.stat-sec.s131 { grid-template-columns: minmax(0, 1fr); }
.s131-ctl { gap: var(--space-3, 12px); flex-wrap: wrap; align-items: center; margin-bottom: var(--space-3, 12px); }
.s131-ctl .seg button { min-height: 36px; }
.s131-min { display: inline-flex; gap: 6px; align-items: center; font-size: var(--text-sm, 13px); color: var(--color-text-2, #555); }
.s131-min select { min-height: 36px; border-radius: 8px; border: 1px solid var(--color-border-strong, #d6d6db); background: var(--color-surface, #fff); color: inherit; padding: 0 6px; }
.s131-ana { background: var(--color-surface-2, #f3f3f5); border-radius: 12px; padding: 10px 14px; margin-bottom: var(--space-3, 12px); }
.s131-sum { margin: 0; padding-left: 18px; font-size: var(--text-sm, 13px); line-height: 1.65; }
.s131-few { display: inline-block; padding: 0 6px; border-radius: 6px; font-size: 11px; line-height: 18px; background: var(--color-warning-soft, #fff4e5); color: var(--color-warning, #b54708); white-space: nowrap; }
.s131-ind th.s131-k { text-align: left; vertical-align: top; white-space: nowrap; font-weight: 600; }
.s131-ind th.s131-k small { display: block; font-weight: 400; }
.s131-ind td.s131-c { font-size: var(--text-xs, 12px); color: var(--color-text-2, #555); }
.s131-ind tr.s131-no td { color: var(--color-text-2, #555); }
.s131-ind tr.s131-yes td, .s131-ind tr.s131-yes th { border-top: 1px solid var(--color-border, #e5e5e8); }
.s131-h4 { font-size: var(--text-sm, 13px); font-weight: 600; margin: var(--space-4, 16px) 0 6px; }
.s131-p { font-size: var(--text-xs, 12px); margin: 8px 0; line-height: 1.6; }
.s131-more { margin-top: var(--space-3, 12px); }
.s131-more > summary { cursor: pointer; min-height: 32px; font-size: var(--text-sm, 13px); color: var(--color-text-2, #555); padding: 6px 0; }
.s131-ul { margin: 4px 0 0; padding-left: 18px; font-size: var(--text-xs, 12px); line-height: 1.7; }
.s131-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5, 20px); }
.s131-symcol { min-width: 0; border: 1px solid var(--color-border, #e5e5e8); border-radius: 12px; padding: 12px 14px; }
.s131-symh { font-size: var(--text-md, 15px); font-weight: 700; margin: 0 0 8px; }
.s131-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.s131-kpis > div { background: var(--color-surface-2, #f3f3f5); border-radius: 10px; padding: 6px 8px; min-width: 0; }
.s131-kpis span { display: block; font-size: 11px; color: var(--color-text-3, #888); }
.s131-kpis b { display: block; font-size: var(--text-md, 15px); }
.s131-kpis small { display: block; font-size: 10px; color: var(--color-text-3, #888); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s131-symcol .s131-ana { padding: 8px 12px; }
@media (max-width: 900px) { .s131-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .s131-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .s131-symcol { padding: 10px; } }

/* ---------- 案例表 ---------- */
/* 手改过的格子：浅色底 + 角标「改」（1.1 起就打了 is-manual 类，但一直没样式，看不出来） */
#case-grid td.is-manual { background: color-mix(in srgb, var(--color-warning, #b54708) 8%, transparent) !important; position: relative; }
#case-grid td.is-manual::after { content: '改'; position: absolute; top: 1px; right: 2px; font-size: 10px; line-height: 1; color: var(--color-warning, #b54708); pointer-events: none; }
#case-grid td.is-invalid input { border-color: var(--color-danger, #d92d20) !important; }
#case-grid td.c-x select { min-width: 84px; }
/* 走势两段：并排小卡；窄屏上下叠 */
#case-grid td.c-mv { min-width: 252px; vertical-align: top; }
#case-grid .mv-wrap { display: flex; gap: 6px; }
#case-grid .mv-card { flex: 1 1 0; min-width: 118px; border: 1px solid var(--color-border, #e5e5e8); border-radius: 10px; padding: 5px 8px; background: var(--color-surface, #fff); font-size: 12px; line-height: 1.45; }
#case-grid .mv-card.is-pending { background: var(--color-surface-2, #f3f3f5); }
/* 1.3.1：「计算中 / 待补」先占住算完后的高度（4 行），后台逐行补算走势时表格不再一行行变高、把下面的交易记录 / 统计往下推（点击落空、阅读位置跳动；WebKit 没有滚动锚定更明显） */
#case-grid .mv-card { min-height: 84px; box-sizing: border-box; }
#case-grid .mv-h { font-size: 11px; color: var(--color-text-3, #888); }
#case-grid .mv-chg { font-size: 15px; font-weight: 700; }
#case-grid .mv-chg small { font-size: 11px; font-weight: 400; color: var(--color-text-3, #888); }
#case-grid .mv-hl, #case-grid .mv-ex { display: flex; gap: 8px; flex-wrap: wrap; }
#case-grid .mv-ex { font-size: 11px; }
#case-grid .mv-pend { font-weight: 600; color: var(--color-text-2, #555); }
#case-grid .mv-why { font-size: 11px; color: var(--color-text-3, #888); }
#case-grid .mv-retry { margin-top: 4px; min-height: 28px; padding: 0 10px; }
#case-grid .mv-base { font-size: 11px; margin-top: 3px; }
@media (max-width: 700px) { #case-grid td.c-mv { min-width: 150px; } #case-grid .mv-wrap { flex-direction: column; } }
/* 穿过进场：是 / 否 两个按钮 */
#case-grid .cr-seg { display: inline-flex; border: 1px solid var(--color-border-strong, #d6d6db); border-radius: 8px; overflow: hidden; }
#case-grid .cr-btn { min-width: 40px; min-height: 36px; border: 0; background: var(--color-surface, #fff); color: var(--color-text-2, #555); font: inherit; cursor: pointer; }
#case-grid .cr-btn + .cr-btn { border-left: 1px solid var(--color-border-strong, #d6d6db); }
#case-grid .cr-btn.on { background: var(--color-primary, #2563eb); color: #fff; font-weight: 600; }
/* 备注：多行文本框 */
#case-grid td.c-note { min-width: 180px; }
#case-grid td.c-note textarea { width: 180px; min-height: 44px; resize: vertical; font: inherit; font-size: 13px; line-height: 1.4; padding: 6px 8px; border: 1px solid var(--color-border, #e5e5e8); border-radius: 8px; background: var(--color-surface, #fff); color: var(--color-text, #111); display: block; }
#case-grid td.c-note textarea:focus { outline: none; border-color: var(--color-primary, #2563eb); box-shadow: var(--shadow-focus); }

/* ---------- 云同步状态 ---------- */
.s131-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; line-height: 20px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; background: var(--color-surface-2, #f3f3f5); color: var(--color-text-2, #555); }
.s131-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.s131-chip--ok { color: var(--color-success, #25854f); background: var(--color-success-soft, #eaf5ee); }
.s131-chip--busy { color: var(--color-primary, #2563eb); }
.s131-chip--wait { color: var(--color-warning, #b54708); background: var(--color-warning-soft, #fff4e5); }
.s131-chip--err { color: var(--color-danger, #d92d20); background: var(--color-danger-soft, #fdeceb); white-space: normal; }
.s131-chip--off::before { background: var(--color-text-3, #999); }
#t131 .t131-sync { margin-left: auto; min-width: 0; }
@media (max-width: 700px) { #t131 .t131-sync { margin-left: 0; flex-basis: 100%; } }
/* 1.3 备份卡片里「远程备份（服务器地址 / 口令）」不再使用：备份 / Bug / 出错 随云同步走 Cloudflare */
#jy13-remote { display: none !important; }

/* 1.3.1：文件选择框不用 hidden/display:none（个别 iOS 版本对 display:none 的 input 程序化 click 不弹选择器），改为视觉隐藏 */
.jy131-file-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;border:0!important;opacity:0!important}
