/* ============================================================================
   ui.css：看板 UI 精修层（165i-web-ui 会话负责，2026-10-19 起）
   - 只管视觉和交互，不改数据和功能；放在 style.css 之后加载，靠层叠覆盖。
   - style.css 里标了"用户 10-xx"的决定一律保留（块间隙 3px、手机左右 3px、筛选区字号不大于 14px、
     第一列锁定、红涨绿跌等），这里不推翻，只在它们之上精修。
   - 分三段：通用 → 电脑（≥ 701px）→ 手机（≤ 700px）。
   ============================================================================ */

/* ---------------------------------------------------------------- 通用 */
:root, [data-theme="dark"] {
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --shadow: none; --shadow-pop: 0 10px 30px rgba(0,0,0,.45);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 45%, transparent);
  --glass: color-mix(in srgb, var(--header) 82%, transparent);
}
[data-theme="light"] {
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.03);
  --shadow-pop: 0 12px 32px rgba(16,24,40,.16);
}
@media (prefers-color-scheme: light) {
  [data-theme="auto"] { --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.03); --shadow-pop: 0 12px 32px rgba(16,24,40,.16); }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
/* 数字等宽：表格、键值、大数字上下对齐，自动刷新时数字跳动不再左右抖 */
table, .kv, .big, .chg-badge, .ohlc, .dl-head, .kc-tip, #updated, .regime .lv, .bd { font-variant-numeric: tabular-nums; }

/* 键盘操作看得到焦点；鼠标点击不出框 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
a:focus:not(:focus-visible), button:focus:not(:focus-visible) { outline: none; }

/* 卡片、表格容器：圆角统一、白天模式有一点点投影，层次更清楚 */
.card, .tbl-wrap { border-radius: var(--r-md); box-shadow: var(--shadow); }

/* 按钮、选项：过渡和按下反馈 */
button, a.tag, .seg a, .subtabs a, nav#tabs a, .kc-n, .bd-more, #totop, #coinback {
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s, transform .1s, opacity .15s;
}
button:hover:not(:disabled) { border-color: var(--muted); }
button:active:not(:disabled), a.tag:active, .seg a:active, #totop:active, #coinback:active { transform: scale(.96); }
.icon-btn { width: 34px; height: 32px; border-radius: 8px; }

/* 选项标签：选中态更明确（原来选中和没选中的底色只差一点点） */
a.tag:hover { color: var(--text); background: var(--chip-on); }
a.tag.on, a.tag.on:hover { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); font-weight: 600; }
.dl-opts .tag.dl-collapse:hover { background: var(--accent-soft); }
.seg a:hover { border-color: var(--muted); }
.seg a.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* 二级导航 */
.subtabs a { transition: background-color .15s, color .15s; }
.subtabs a:hover { color: var(--text); }
.subtabs a.on { color: var(--text); background: var(--panel); box-shadow: 0 0 0 1px var(--line), var(--shadow); }

/* 表格 */
th { font-size: 12px; letter-spacing: .02em; }
table.wide thead th { border-bottom-color: var(--line); }
/* 展开的那一行和下面的明细连成一块 */
tr.click:has(+ tr.detail) > td { background: var(--hover); border-bottom-color: transparent; }
tr.detail > td { box-shadow: inset 3px 0 0 var(--accent-line); }
.chg-badge { border-radius: 6px; letter-spacing: .01em; }

/* 加载中：转圈 + 文字（原来只有一行灰字） */
#view > p.muted:only-child, .dl-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 12px; margin: 0; }
#view > p.muted:only-child::before, .dl-loading::before {
  content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none;
}
/* 顶部细进度条：页面在取数据时（含自动刷新）顶栏下沿走一条细线，知道"正在更新" */
#ui-progress { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 400; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .25s; }
#ui-progress::before { content: ''; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: ui-slide 1.1s ease-in-out infinite; }
body.ui-loading #ui-progress { opacity: 1; transition-delay: .25s; }   /* 缓存秒回时不闪 */
@keyframes ui-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* 内容切换时淡入一下，减少整块替换的生硬感（自动刷新不淡入，免得闪） */
#view.ui-enter { animation: ui-fade .18s ease-out; }
@keyframes ui-fade { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* 错误框 */
.err-box { border-radius: var(--r-sm); display: flex; gap: 8px; align-items: flex-start; }
.err-box::before { content: '!'; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--bad); color: #fff; font-weight: 700; font-size: 12px; line-height: 18px; text-align: center; margin-top: 1px; }

/* 设置面板：淡入 */
.modal-mask { animation: ui-fade-in .15s ease-out; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.modal { box-shadow: var(--shadow-pop); animation: ui-pop .18s ease-out; }
.modal h3 a { font-weight: normal; font-size: 14px; }
@keyframes ui-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* 登录页 */
.login { width: 340px; padding: 32px 28px; border-radius: var(--r-lg); box-shadow: var(--shadow-pop); gap: 14px; }
.login input { padding: 11px 12px; border-radius: 8px; transition: border-color .15s, box-shadow .15s; }
.login input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login button { padding: 11px; border-radius: 8px; font-weight: 600; }
.login button:hover { filter: brightness(1.08); }
#loginTitle::before { content: ''; display: block; width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 14px; background: url(icons/icon.svg) center / cover; box-shadow: 0 0 0 1px var(--line); }

/* 返回顶部 / 返回：毛玻璃 */
#totop, #coinback { background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow-pop); }

/* 自选星：点起来更顺手 */
.fav { transition: color .15s, transform .15s; display: inline-block; }
.fav:hover { color: var(--warn); }
.fav.on { transform: scale(1.05); }

/* 横向滚动条细一点（电脑） */
.tbl-wrap { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.tbl-wrap::-webkit-scrollbar { height: 8px; } .tbl-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; } .tbl-wrap::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 电脑（≥ 701px） */
@media (min-width: 701px) {
  /* 顶栏：半透明毛玻璃，内容滚到下面时还能隐约看到 */
  header { background: var(--glass); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); }
  nav#tabs a { transition: color .15s, background-color .15s; }
  nav#tabs a:hover:not(.on) { background: var(--hover); }
  .tools { gap: 10px; }
  #updated { font-size: 12px; min-width: 9.5em; text-align: right; }

  /* 二级导航：下面一条分隔线、选中项是浮起的小块 */
  .subtabs { gap: 2px; padding-bottom: 10px; }
  .subtabs a { padding: 5px 14px; }

  /* 区块标题：左边一条短色条，扫一眼就能分区 */
  h2 { font-size: 15px; margin: 26px 0 10px; }
  #view h2::before { content: ''; align-self: center; width: 3px; height: 14px; border-radius: 2px; background: var(--accent); flex: none; margin-right: -2px; }
  .md h2.md-h::before { display: none; }

  /* 表格行：鼠标停留整行高亮（宽表的第一列锁定格也一起变） */
  table.wide tbody tr:hover > td, table.cards tbody tr:hover > td { background: var(--hover); }
  table.wide tbody tr.sub-row:hover > td, table.wide tbody tr.has-sub:hover > td { background: inherit; }
  table.wide tbody tr:hover > td:first-child { background: var(--hover); }

  /* 长说明文字：限制行长，太长的一行读起来累 */
  .dl-note, .bd-note, .rmean { max-width: 80em; }

  /* 卡片标题 */
  .card h3 { font-size: 13.5px; }
  .bd-card { transition: box-shadow .15s, border-color .15s; }
  .bd-card:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
  table.bd tr:hover td { background: var(--hover); }

  /* 设置面板居中靠上一点 */
  .modal-mask { padding-top: 10vh; }
}

/* ---------------------------------------------------------------- 手机（≤ 700px） */
@media (max-width: 700px) {
  /* 顶栏、底部导航：毛玻璃 */
  header { background: var(--glass); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); }
  .icon-btn { width: 38px; height: 36px; border-radius: 10px; }

  nav#tabs { background: var(--glass); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); padding-top: 6px; }
  nav#tabs a { gap: 3px; padding: 2px 0 2px; }
  /* 选中项：图标后面一块浅色胶囊（Material 3 / 新版 iOS 的做法），比只变色更好认 */
  nav#tabs .ti { box-sizing: content-box; padding: 3px 16px; border-radius: 14px; transition: background-color .2s, color .2s; }
  nav#tabs a.on .ti { background: var(--accent-soft); }
  nav#tabs a:active .ti { background: var(--chip-on); }
  nav#tabs a span { font-size: 11px; letter-spacing: .02em; }

  /* 二级导航：横滑时左右边缘渐隐，提示还有更多（ui.js 按滚动位置切换） */
  .subtabs { gap: 4px; scroll-behavior: smooth; scroll-padding: 0 24px; }
  .subtabs.ui-fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .subtabs.ui-fade-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px); mask-image: linear-gradient(to right, transparent, #000 28px); }
  .subtabs.ui-fade-l.ui-fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
  .subtabs a { border-radius: 999px; padding: 7px 14px; }
  .subtabs a.on { color: var(--accent); background: var(--accent-soft); box-shadow: none; }

  /* 键值列表：原来手机上"名称一行、数值一行"，一屏只能看几项；改成左名右值两栏，长内容在右栏里换行 */
  .kv { grid-template-columns: fit-content(8.5em) 1fr; gap: 5px 14px; align-items: baseline; }
  .kv span:nth-child(odd) { margin-top: 0; font-size: 13px; }
  .kv span:nth-child(even) { min-width: 0; overflow-wrap: anywhere; }
  .rkv { grid-template-columns: fit-content(6em) 1fr; }

  /* 卡片列表：每张卡片按下时有反馈，展开的那张和明细连成一体 */
  table.cards tr.click:active { background: var(--hover); }
  table.cards tr.click:has(+ tr.detail) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  table.cards tr.click:has(+ tr.detail) > td { background: transparent; }
  .tbl-wrap:has(table.cards) { box-shadow: none; }
  table.cards tr { box-shadow: var(--shadow); }
  table.cards td:first-child { font-weight: 600; }
  table.cards tr.detail > td { box-shadow: none; }

  /* 筛选区：搜索框占一整行（输入框按 iPhone 要求 16px，再缩放成 14px 显示，见 style.css） */
  .ml-filter input { width: 114.3%; margin-right: -14.3%; flex: 0 0 auto; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 7px 10px; }
  .coin-search input { border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }

  /* 设置面板：改成从底部升起的面板，拇指够得着 */
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: none; max-height: 86vh; border-radius: 18px 18px 0 0; border-bottom: 0; animation: ui-sheet .24s cubic-bezier(.2,.8,.2,1); }
  .modal::before { content: ''; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; }
  .modal-body { padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); }
  .seg a { padding: 10px 8px; }
  @keyframes ui-sheet { from { transform: translateY(100%); } to { transform: none; } }

  /* 下拉刷新（只在装成 App 的全屏模式里启用，见 ui.js） */
  #ui-ptr { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 56px); z-index: 160; width: 34px; height: 34px; margin-left: -17px; border-radius: 50%;
    background: var(--panel); box-shadow: var(--shadow-pop); display: flex; align-items: center; justify-content: center; color: var(--accent);
    transform: translateY(-80px); opacity: 0; pointer-events: none; }
  #ui-ptr .ic { width: 18px; height: 18px; }
  #ui-ptr.ready .ic { color: var(--accent); }
  #ui-ptr.spin .ic { animation: spin .8s linear infinite; }

  /* 返回顶部 / 返回 按钮略小一点，少挡内容 */
  #totop, #coinback { width: 40px; height: 40px; }

  /* 登录页 */
  .login { width: min(340px, calc(100vw - 32px)); }
}

/* ================================================================ 第二批（10-19） */
/* 二级导航搬进顶栏（ui.js 每次渲染后挪进 #ui-subnav），跟着顶栏吸顶 */
#ui-subnav:empty { display: none; }
#ui-subnav .subtabs { margin: 0; border: 0; padding: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#ui-subnav .subtabs::-webkit-scrollbar { display: none; }
#ui-subnav .subtabs a { white-space: nowrap; flex: none; }
#view { min-height: calc(100vh - 160px); }   /* 加载中时页脚不跑到屏幕中间 */

/* K 线十字线（拖动 / 鼠标移动时跟着走） */
.kchart { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.kchart line.ui-xh { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; pointer-events: none; }
.kc-tip { color: var(--text); }

@media (min-width: 701px) {
  /* 顶栏第二行：整条用页面底色，选中的一级标签向下接进这一条（原来是接进内容区） */
  header.ui-has-sub nav#tabs { position: relative; z-index: 1; }
  #ui-subnav { order: 10; flex: 0 0 auto; width: calc(100% + 2 * max(18px, env(safe-area-inset-left))); position: relative; z-index: 0;
    margin: 0 calc(-1 * max(18px, env(safe-area-inset-right))) 0 calc(-1 * max(18px, env(safe-area-inset-left)));
    padding: 8px max(18px, env(safe-area-inset-right)) 8px max(18px, env(safe-area-inset-left));
    background: var(--bg); border-top: 1px solid var(--line); }
  header.ui-has-sub { row-gap: 0; }
  #ui-subnav .subtabs { max-width: 1764px; margin: 0 auto; }   /* 和 main 的 1800 - 左右内边距对齐 */
  #ui-subnav .subtabs a { padding: 4px 14px; font-size: 14px; }
  #ui-subnav.ui-single { display: none; }   /* 只有一个子页（时机）不占一行 */
  header.ui-has-sub:has(#ui-subnav.ui-single) nav#tabs { margin-bottom: -1px; }
  main { padding-top: 14px; }
}

@media (max-width: 700px) {
  /* 手机：二级导航放进顶栏那一行（logo 后面），logo 文字收起来省地方；整行就是"板块内导航 + 刷新 / 设置" */
  header.ui-has-sub { flex-wrap: nowrap; gap: 6px; }
  header.ui-has-sub .brand { font-size: 0; gap: 0; flex: none; }
  header.ui-has-sub .brand .logo { width: 28px; height: 28px; }
  #ui-subnav { flex: 1 1 auto; min-width: 0; align-self: center; }
  #ui-subnav .subtabs { gap: 2px; padding: 2px 0; }
  #ui-subnav .subtabs a { padding: 6px 11px; font-size: 15px; }
  #ui-subnav.ui-single .subtabs a.on { background: transparent; color: var(--text); padding-left: 4px; font-size: 17px; }   /* 只有一个子页：当标题显示 */
  header.ui-has-sub .tools { flex: none; gap: 6px; }
  main { padding-top: 6px; }
}
@media (max-width: 700px) {
  /* 手机卡片：一格里有好几段（文字 + 几个 div，如链路「情况」的交接检查）时，原来 flex 把它们横排挤成几列窄条；
     改成网格：字段名在左上，内容各段在右边一栏上下排 */
  table.cards tr:not(.detail) td:not(:first-child) { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: baseline; justify-items: end; }
  table.cards tr:not(.detail) td:not(:first-child)::before { grid-column: 1; justify-self: start; max-width: 42vw; }
  table.cards tr:not(.detail) td:not(:first-child) > * { grid-column: 2; }
  table.cards.ch-grid tr:not(.sub-row) td { display: block; justify-items: normal; }   /* 10-21：清掉上面 grid 规则留下的 justify-items: end，否则格子里的第二行小字被推到右边 */
}
/* K 线读数浮在图的上方（原来在图下面，电脑上常在屏幕外，要滚下去才看得到）；没选中时不显示 */
.card:has(> svg.kchart) { position: relative; }
.card:has(> svg.kchart) > .kc-tip { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); z-index: 2; margin: 0; min-height: 0; max-width: calc(100% - 24px);
  padding: 4px 10px; border-radius: 8px; background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line); box-shadow: var(--shadow-pop); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.card:has(> svg.kchart) > .kc-tip:empty { display: none; }
@media (max-width: 700px) { .card:has(> svg.kchart) > .kc-tip { white-space: normal; text-align: center; top: 36px; width: max-content; } }

/* 电脑表格：第一列带说明文字（.rmean，如链路的程序、Redis 的 key）时，后面不换行的长内容会把它挤成窄条（用户 10-19 截图"挤成一团"）。
   第一列保底宽度；链路表的「情况」列、Redis 表的说明允许换行，长内容往下排，不再横向撑宽 */
@media (min-width: 701px) {
  table.cards td:first-child:has(> .rmean), table.cards td:first-child:has(.rmean) { min-width: 260px; width: 26%; }
  table.cards td .rmean { line-height: 1.5; margin-top: 2px; }
  table:has(> tbody > tr[data-row^="ch:"]) > tbody > tr > td:last-child { white-space: normal; min-width: 280px; overflow-wrap: anywhere; }
  table:has(> tbody > tr[data-row^="ch:"]) > tbody > tr > td:not(:first-child):not(:last-child) { width: 1%; }   /* 类型、最近一次按内容收紧 */
  table:has(> tbody > tr[data-row^="ch:"]) .handoff { margin-top: 3px; }
}
@media (min-width: 701px) {
  /* 链路：各项目一张表，统一列宽，上下几张表的列对齐 */
  table:has(> tbody > tr[data-row^="ch:"]) { table-layout: fixed; }
  table:has(> tbody > tr[data-row^="ch:"]) > thead th:nth-child(1) { width: 30%; }
  table:has(> tbody > tr[data-row^="ch:"]) > thead th:nth-child(2) { width: 170px; }
  table:has(> tbody > tr[data-row^="ch:"]) > thead th:nth-child(3) { width: 110px; }
  table:has(> tbody > tr[data-row^="ch:"]) > tbody > tr > td { white-space: normal; overflow-wrap: anywhere; }
  table:has(> tbody > tr[data-row^="ch:"]) > tbody > tr > td:not(:first-child):not(:last-child) { width: auto; }
  table:has(> tbody > tr[data-row^="ch:"]) td:first-child { min-width: 0; width: auto; }
}

/* ================================================================ 第三批（10-19） */
@media (max-width: 700px) {
  /* 手机卡片按内容排版（ui.js compactCards）：字段值都短的表改成两列 / 三列小格，字段名在上、数值在下 */
  table.cards:is(.ui-g2, .ui-g3) tr:not(.detail):not(.sub-row) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 10px 12px; }
  table.cards.ui-g3 tr:not(.detail):not(.sub-row) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; }
  table.cards:is(.ui-g2, .ui-g3) tr:not(.detail):not(.sub-row) > td:first-child { grid-column: 1 / -1; margin-bottom: 0; padding: 0 0 8px; }
  table.cards:is(.ui-g2, .ui-g3) tr:not(.detail):not(.sub-row) > td:not(:first-child) { display: block; justify-items: normal; padding: 0; text-align: left; font-size: 14px; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
  table.cards:is(.ui-g2, .ui-g3) tr:not(.detail):not(.sub-row) > td:not(:first-child)::before { display: block; max-width: none; font-size: 11px; line-height: 1.3; margin-bottom: 2px; }
  table.cards:is(.ui-g2, .ui-g3) td > div, table.cards:is(.ui-g2, .ui-g3) td .rflow { text-align: left; justify-content: flex-start; }

  /* 卡片列表上面的排序下拉框：做成和筛选标签一样的胶囊 */
  .sortbar { display: flex; align-items: center; gap: 8px; font-size: 13px; }
  .sortbar select { -webkit-appearance: none; appearance: none; border-radius: 999px; padding: 6px 30px 6px 12px !important; border: 1px solid var(--line);
    background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237d8794' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
    transform: scale(.875); transform-origin: left center; margin-right: -12px; }

  /* JSON 原文（开仓计划等）在手机上换行显示，不用左右滑 */
  pre.json { white-space: pre-wrap; word-break: break-all; max-height: 320px; font-size: 12px !important; }
}
@media (max-width: 700px) {
  table.cards:is(.ui-g2, .ui-g3) tr:not(.detail):not(.sub-row) > td.ui-span { grid-column: 1 / -1; }
}

/* ================================================================ 第四批（10-19，总控新排的页面） */
/* 表格分隔线：合并边框模式下行高有小数像素时，各格的线会上下错 1px、看起来断开（尤其锁定的第一列）；改成每格自己画 */
table { border-collapse: separate; border-spacing: 0; }
@media (max-width: 700px) {
  /* 卡片里的表格贴到卡片左右边上：原来卡片内边距 + 表格边框两层，表格窄了一圈、还多一道框 */
  .card > .tbl-wrap, .card > div > .tbl-wrap, details.card > .tbl-wrap, .card .ch-rules > .tbl-wrap { margin-left: -12px; margin-right: -12px; border-left: 0; border-right: 0; border-radius: 0; box-shadow: none; }
  .card > .tbl-wrap:last-child { margin-bottom: -12px; border-bottom: 0; border-radius: 0 0 var(--r-md) var(--r-md); }
  .card .tbl-wrap:has(table.cards) { margin-left: 0; margin-right: 0; }
  /* 卡片标题右边的来源 / 时间：换行后不要粗体，看着像第二个标题 */
  .card > h3 > :last-child:not(:first-child) { font-size: 12px; font-weight: normal; }
}
/* 横向滑动的表：右边还有内容时边缘渐隐，提示可以往右滑；滑到头就消失（ui.js 按滚动位置切换） */
.tbl-wrap.ui-more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), rgba(0,0,0,.2)); mask-image: linear-gradient(to right, #000 calc(100% - 28px), rgba(0,0,0,.2)); }

/* 登录页（app.js showLogin 给 body 加 login-mode）：不显示底部导航（手机上导航被挪到 body 末尾，style.css 只藏了顶栏和页脚）、
   顶栏按钮、回到顶部 / 返回、表头浮层、进度条；也不给底部导航留空白。登录后去掉 login-mode 自动恢复（用户 10-19） */
body.login-mode nav#tabs, body.login-mode header, body.login-mode .tools, body.login-mode #totop, body.login-mode #coinback,
body.login-mode .thead-float, body.login-mode #ui-progress, body.login-mode #ui-ptr { display: none !important; }
body.login-mode main { padding-bottom: max(12px, env(safe-area-inset-bottom)) !important; }
body.login-mode #view { min-height: 0; }

/* 时机 → 观察类分组（总控 10-21）：h3「观察类」→ h4.ch-group（K 线形态 / 相对强弱 / 特质波动）→ div.ch-win（窗口 24h…）→ 规则表。
   分组标题：比 h3 小一档、前面一条短色条（和区块标题同一种视觉）；窗口：小号胶囊标签，贴着下面那张表 */
h4.ch-group { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }
h4.ch-group::before { content: ''; width: 3px; height: 13px; border-radius: 2px; background: var(--accent); opacity: .75; flex: none; }
h4.ch-group > .muted { font-size: 12px; font-weight: normal; }
h3 + h4.ch-group { margin-top: 10px; }
.ch-win { display: inline-flex; align-items: center; margin: 10px 0 5px; padding: 1px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 20px; letter-spacing: .02em; }
h4.ch-group + .ch-win { margin-top: 0; }
@media (max-width: 700px) {
  h4.ch-group { font-size: 15px; margin: 16px 0 8px; }
  h4.ch-group > .muted { font-size: 13px; }
  .ch-win { font-size: 13px; line-height: 22px; margin: 12px 0 6px; }
}
/* 标题里的说明（h3 / 卡片标题右边的灰字）：常规字重、小一号，不和标题抢（10-21） */
#view h3 > .muted { font-weight: normal; font-size: 12px; }
@media (max-width: 700px) { #view h3 > .muted { font-size: 13px; } }
