/* ============================================================
   goupdate · 方案 B「Folio / 纸本卷宗」 公共样式
   纯静态离线：不引用任何外部字体 / CDN / 图标库
   ============================================================ */

:root /* Plan B */ {
  --bg: #F8F4EC;
  --surface: #FFFFFF; --surface-2: #FDFAF4; --sunken: #F2ECDF;
  --border: #E7DFD1; --border-strong: #D6CAB6;

  --primary: #B4532A; --primary-hover: #984421; --primary-press: #7F381B; --primary-soft: #F6E7DE;

  --text-1: #2A2520; --text-2: #6A6055; --text-3: #9C9184;

  --success: #2F7D5B; --success-soft: #E4F1EA;
  --warning: #A87314; --warning-soft: #F7ECD6;
  --danger:  #BC3B31; --danger-soft:  #F9E5E2;
  --info:    #43708C; --info-soft:    #E6EEF4;

  --online: #2F7D5B; --offline: #BDB3A6;

  --code-bg: #FBF7EF; --code-text: #43392E; --code-dim: #A2957F;

  --shadow-card: 0 1px 2px rgba(84,66,42,.05), 0 8px 24px -8px rgba(84,66,42,.14);
  --shadow-modal: 0 24px 64px -12px rgba(84,66,42,.3);
  --shadow-pop: 0 12px 32px -8px rgba(84,66,42,.24);

  --font-serif: "Songti SC", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Consolas, monospace;

  --radius-card: 14px; --radius-ctl: 10px; --radius-modal: 16px; --radius-log: 12px; --radius-badge: 8px;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* 最后保险：真正的溢出源以 min-width:0 / overflow-wrap 修复为主，clip 仅防根体裁切 */
html, body { overflow-x: clip; max-width: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
}
h1, h2, h3 { font-family: var(--font-serif); line-height: 1.3; margin: 0; }
/* [AI] hidden 属性必须是硬隐藏：.btn / .field-err 等设了 display 会覆盖浏览器默认的 [hidden]{display:none}，
   导致「完成」「保存中…」这类按钮明明标了 hidden 仍显示 */
[hidden] { display: none !important; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 600; }
p  { margin: 0 0 12px; }
a  { color: #984421; text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--primary); }
.mono { font-family: var(--font-mono); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.cap  { font-size: 13px; color: var(--text-3); }
.text2 { color: var(--text-2); }
.serif { font-family: var(--font-serif); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ic { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.ic-sm { width: 16px; height: 16px; }
mark { background: rgba(180,83,42,.18); color: inherit; border-radius: 3px; padding: 0 1px; }

/* 跳转链接 */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--surface); color: var(--text-1); border-radius: var(--radius-ctl);
  padding: 10px 18px; text-decoration: none; box-shadow: var(--shadow-pop);
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* 焦点：3px 圆角陶土环（输入框除外，用自身 ring） */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 8px; }
.input:focus-visible, textarea:focus-visible, .log-list:focus-visible { outline: none; }

/* ---------- 顶部通栏导航 ---------- */
/* [AI多软件UI] 两行结构：第一行 logo+状态区+退出登录（64px），第二行主导航（独立一行）。
   topbar 整体吸顶，border-bottom 落在导航行下方。 */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: rgba(248,244,236,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1120px; width: 100%; margin: 0 auto; height: 64px; padding: 0 32px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-1); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--primary);
  color: #fff; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(180,83,42,.35);
}
.brand-name { font-family: var(--font-serif); font-weight: 700; font-size: 18px; letter-spacing: .01em; }
.brand-tag { font-size: 12px; color: var(--text-3); border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 8px; }
/* [AI多软件UI] 退出登录钉在第一行最右（margin-left:auto 把后续元素推到右侧） */
.top-logout { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
/* [AI多软件UI] 主导航独立成行：整行居中，内容仍对齐 1120 版心 */
.topnav { width: 100%; display: flex; justify-content: center; }
.topnav-inner {
  max-width: 1120px; width: 100%; padding: 0 32px;
  display: flex; justify-content: flex-start; gap: 32px;
}
.nav-link {
  position: relative; height: 48px; display: inline-flex; align-items: center;
  font-size: 15px; color: var(--text-2); text-decoration: none; padding: 0 2px;
  transition: color .15s ease;
}
.nav-link:hover { color: var(--text-1); }
.nav-link.active { color: var(--text-1); font-weight: 600; }
.nav-link.active::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%); bottom: 10px;
  width: 22px; height: 3px; border-radius: 2px; background: var(--primary);
}
.top-status { display: flex; align-items: center; gap: 18px; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.top-status .online-note { color: var(--warning); font-size: 13px; }
/* [AI多软件] 顶栏软件切换器 */
.app-switch { display: inline-flex; align-items: center; gap: 8px; }
.app-switch-lbl { font-size: 13px; color: var(--text-3); }
.app-switch-sel {
  height: 30px; padding: 0 28px 0 10px; border: 1px solid var(--border); border-radius: var(--radius-ctl);
  background: var(--sunken); color: var(--text-1); font-size: 13px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.app-switch-sel:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(180,83,42,.12); }
.hamburger {
  display: none; width: 40px; height: 40px; border: none; border-radius: var(--radius-ctl);
  background: var(--sunken); color: var(--text-1); cursor: pointer; place-items: center;
}
/* 768 以下：汉堡下翻面板（非侧抽屉） */
.mobile-panel {
  display: none; position: absolute; left: 0; right: 0; top: 64px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-pop); padding: 8px 16px 16px;
}
.mobile-panel.open { display: block; }
.mobile-panel a {
  display: block; padding: 12px 12px; border-radius: var(--radius-ctl);
  color: var(--text-2); text-decoration: none; font-size: 16px;
}
.mobile-panel a.active { color: var(--text-1); font-weight: 600; background: var(--primary-soft); }
.mobile-panel .mp-status { padding: 12px; border-top: 1px solid var(--border); margin-top: 8px; font-size: 14px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }

/* ---------- 页面容器 ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 32px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.section { margin-top: 40px; }
.section:first-of-type { margin-top: 24px; }

/* 区块标题：衬线 h2 + 右延 1px 细线 + 线端陶土小方块（B 标志） */
.sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.sec-head .sec-line { flex: 1; height: 1px; background: var(--border); position: relative; }
.sec-head .sec-line::after {
  content: ""; position: absolute; right: 0; top: -3px;
  width: 6px; height: 6px; background: var(--primary); border-radius: 1px;
}

/* ---------- 卡片（无边框柔影） ---------- */
.card {
  background: var(--surface); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); padding: 24px;
}
.card + .card { margin-top: 24px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-family: var(--font-serif); font-weight: 600; margin-bottom: 16px; }
.card-pad-0 { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 24px; }
/* [AI] grid 内卡片间距由 gap 负责，取消相邻卡的 margin-top：否则第 2 张起被下推 24px，与首卡不等高 */
.grid > .card + .card { margin-top: 0; }
/* grid 子项默认 min-width:auto 会被长等宽/大字 nowrap 文本的 min-content 撑破容器 → 统一归零 */
.grid > *, .grid-4 > *, .grid-21 > *, .grid-2 > * { min-width: 0; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-21 { grid-template-columns: 2fr 1fr; }

/* 统计卡 */
.stat { display: flex; flex-direction: column; gap: 2px; }
/* [AI] 总览 4 卡一行：内边距收紧；height:100% 撑满 grid 行高，四卡严格等高 */
.card.stat { padding: 18px 20px; height: 100%; }
/* [AI] 末行说明贴底：各卡内容行数不同也能让说明落在同一水平线 */
.card.stat > :last-child { margin-top: auto; }
.stat-num { font-family: var(--font-serif); font-size: 30px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.stat-cap { font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }
/* [AI] 说明文字单行省略，避免长文案把卡片撑高 */
.stat-ellipsis { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 图标垫底容器（功能入口 40px） */
.icon-plate {
  width: 40px; height: 40px; border-radius: 12px; background: var(--primary-soft);
  color: var(--primary); display: grid; place-items: center; flex: none;
}
.icon-plate.square { border-radius: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 20px; border-radius: var(--radius-ctl); border: 1px solid transparent;
  font-size: 15px; font-family: var(--font-sans); cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  user-select: none; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 2px 8px -2px rgba(180,83,42,.5); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:active:not(:disabled) { background: var(--primary-press); }
.btn-secondary { background: var(--surface); color: var(--text-1); border-color: var(--border-strong); box-shadow: 0 1px 2px rgba(84,66,42,.06); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); }
.btn-danger { background: var(--danger); color: #fff; font-weight: 600; box-shadow: 0 2px 10px -2px rgba(188,59,49,.55); }
.btn-danger:hover:not(:disabled) { background: #A32F26; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-text {
  background: none; border: none; color: var(--text-2); height: auto; padding: 2px 2px;
  text-decoration: none; border-bottom: 1px dashed var(--border-strong); border-radius: 0;
}
.btn-text:hover { color: var(--primary); border-bottom-color: var(--primary); }
.icon-btn {
  width: 32px; height: 32px; padding: 0; border: none; background: none; border-radius: 8px;
  color: var(--text-3); display: inline-grid; place-items: center; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--sunken); color: var(--primary); }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn-secondary .spinner, .icon-btn .spinner { border-color: rgba(180,83,42,.25); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 输入 ---------- */
.field { margin-bottom: 20px; }
.field > label { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.input, textarea.input {
  width: 100%; min-height: 40px; background: var(--sunken);
  border: 1px solid transparent; border-radius: var(--radius-ctl);
  padding: 9px 12px; font-size: 15px; font-family: var(--font-sans); color: var(--text-1);
  transition: box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
}
textarea.input { line-height: 1.7; resize: vertical; }
.input:focus { outline: none; background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 4px rgba(180,83,42,.12); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(188,59,49,.10); }
.input::placeholder { color: var(--text-3); }
.input[readonly] { color: var(--text-2); }
.field-err { display: flex; gap: 6px; align-items: center; color: var(--danger); font-size: 13px; margin-top: 6px; }
.field-hint { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.input-group { position: relative; }
.input-group .input { padding-right: 44px; }
.input-group .tr-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.counter { font-size: 12px; color: var(--text-3); text-align: right; margin-top: 4px; font-family: var(--font-mono); }
.searchbox { position: relative; width: 240px; }
.searchbox .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.searchbox .input { padding-left: 40px; height: 36px; font-size: 14px; }

/* 只读键值 */
.kv { display: grid; grid-template-columns: 180px 1fr; row-gap: 4px; }
.kv dt, .kv dd { min-width: 0; }
.kv dt { color: var(--text-3); font-size: 14px; padding: 10px 0; border-top: 1px solid var(--border); }
.kv dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; min-height: 48px; }
.kv > dt:first-child, .kv > dd:first-of-type { border-top: none; }

/* ---------- 开关 44×24（全站唯一 180ms 弹性） ---------- */
.switch {
  width: 44px; height: 24px; border-radius: 999px; border: none; padding: 0; flex: none;
  background: var(--border-strong); position: relative; cursor: pointer;
  transition: background-color 180ms ease;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(84,66,42,.35);
  transition: transform 180ms cubic-bezier(.34, 1.56, .64, 1);
}
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch-row { display: flex; align-items: center; gap: 12px; }
.switch-label { font-size: 14px; color: var(--text-2); }

/* 分段胶囊组（sunken 底，active 白底小卡） */
.segmented { display: inline-flex; background: var(--sunken); border-radius: 12px; padding: 3px; gap: 2px; }
.segmented button {
  border: none; background: none; height: 32px; padding: 0 14px; border-radius: 9px;
  font-size: 14px; color: var(--text-2); cursor: pointer; transition: all .15s ease;
}
.segmented button.on { background: var(--surface); color: var(--text-1); font-weight: 600; box-shadow: 0 1px 3px rgba(84,66,42,.14); }

/* ---------- 徽章 / 状态点 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--radius-badge); font-size: 13px; line-height: 1;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-info    { background: var(--info-soft);    color: var(--info); }
.badge-neutral { background: var(--sunken); color: var(--text-2); }
.badge-force {
  background: var(--danger-soft); color: var(--danger); font-family: var(--font-serif);
  font-weight: 700; height: 26px; padding: 0 12px;
}
.badge-force::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.dot-online { background: var(--online); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px rgba(47,125,91,.45); }
.dot-stale  { background: var(--warning); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px rgba(168,115,20,.4); }
.dot-offline{ background: transparent; border: 1.5px solid var(--offline); }
.dot-wait   { background: transparent; border: 1.5px dashed var(--offline); }
.status-pair { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---------- 表格（宽松 52 行高） ---------- */
.tbl-wrap { overflow: visible; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl td { min-width: 0; }
.tbl caption { caption-side: top; text-align: left; }
.tbl th {
  text-align: left; font-size: 13px; font-weight: 500; color: var(--text-2);
  padding: 10px 14px; background: none; white-space: nowrap;
}
.tbl td { padding: 8px 14px; height: 52px; border-top: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr { transition: background-color .15s ease; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--primary); border-radius: 2px 0 0 2px; }
.tbl .addr { font-family: var(--font-serif); font-size: 15px; }
.tbl .num { font-family: var(--font-mono); font-size: 13px; }
.tbl .ops { white-space: nowrap; text-align: right; }
.tbl .ops .btn-text { margin-left: 12px; }
.addr { font-family: var(--font-serif); }
.copyable { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.copyable .mono { color: var(--text-2); word-break: break-all; min-width: 0; flex: 0 1 auto; }
.copyable .icon-btn { opacity: 0; transition: opacity .15s ease; flex: none; }
.copyable:hover .icon-btn, .copyable:focus-within .icon-btn { opacity: 1; }

/* 表格工具条 */
.table-tools { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }
.table-tools .left, .table-tools .right { display: flex; align-items: center; gap: 12px; }

/* ---------- 模态（520 / 上传 600，圆角 16，遮罩无 blur） ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(66,52,32,.35);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.overlay[hidden] { display: none; }
.modal {
  width: 520px; max-width: 100%; background: var(--surface);
  border-radius: var(--radius-modal); box-shadow: var(--shadow-modal);
  max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  animation: pop-in .18s ease;
}
.modal.w-lg { width: 600px; }
@keyframes pop-in { from { transform: translateY(8px) scale(.985); opacity: 0; } }
.modal-head { padding: 24px 24px 8px; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: 20px; font-weight: 700; flex: 1; }
.modal-body { padding: 12px 24px 8px; overflow-y: auto; }
.modal-foot { padding: 20px 24px 24px; display: flex; justify-content: flex-end; gap: 12px; }
.modal-note {
  display: flex; gap: 10px; background: var(--warning-soft); color: #6E4A0C;
  border-radius: 10px; padding: 12px 14px; font-size: 14px; margin: 12px 0;
}

/* ---------- 上传区（sunken 暖底 + 2px dashed + 半环弧线进度） ---------- */
.dropzone {
  background: var(--sunken); border-radius: var(--radius-log); min-height: 160px;
  display: grid; place-items: center; text-align: center; padding: 24px; cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dropzone .ring { display: block; margin: 0 auto 6px; }
.dropzone:hover, .dropzone.dragover { background: var(--primary-soft); transform: scale(1.01); }
.dropzone.dragover { outline: 2px dashed var(--primary); outline-offset: -10px; }
.dz-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--surface); color: var(--primary); display: grid; place-items: center; box-shadow: 0 2px 8px rgba(84,66,42,.12); }
.dz-hint b { color: var(--primary); font-weight: 600; }
.file-chip {
  display: flex; align-items: center; gap: 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-top: 14px;
}
.file-chip .fname { font-weight: 600; font-size: 14px; word-break: break-all; }

/* 进度条（线性） */
.progress { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 3px; background: var(--primary); transition: width .2s linear; }
.progress-pair { display: flex; align-items: center; gap: 12px; }
.progress-pair .mono { min-width: 44px; text-align: right; }

/* ---------- 日志（浅纸打印稿） ---------- */
.log { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-log); overflow: hidden; }
.log-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.log-head h3 { font-size: 16px; flex: none; }
.log-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.pill {
  height: 28px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: all .15s ease;
}
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.log-list { max-height: 460px; overflow: auto; padding: 8px 0; position: relative; }
.log-list:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.log-line {
  display: flex; gap: 10px; padding: 0 20px; font-family: var(--font-mono);
  font-size: 13px; line-height: 24px; color: var(--code-text); white-space: pre-wrap; word-break: break-all;
}
.log-line:hover { background: #F5EEE0; }
.log-line .t { color: var(--code-dim); flex: none; }
.log-line .lv { flex: none; width: 58px; font-weight: 600; }
.lv-INFO { color: var(--info); } .lv-WARN { color: var(--warning); } .lv-ERROR { color: var(--danger); }
.log-empty { padding: 40px 20px; text-align: center; color: var(--text-3); }
.jump-latest {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 5;
  height: 34px; padding: 0 16px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 13px; box-shadow: var(--shadow-pop);
}
.jump-latest[hidden] { display: none; }

/* ---------- 内联横幅 / toast ---------- */
.banner {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px;
  border-radius: var(--radius-ctl); font-size: 14px; margin-bottom: 20px;
  flex-wrap: wrap; /* 窄档允许「同步横幅」等组合行换行，避免进度条撑破 */
}
.banner .ic { margin-top: 2px; }
.banner .progress-pair { flex: 1; min-width: 160px; }
.banner-success { background: var(--success-soft); color: #1E5A40; }
.banner-warning { background: var(--warning-soft); color: #6E4A0C; }
.banner-danger  { background: var(--danger-soft);  color: #8C2A22; }
.banner-info    { background: var(--info-soft);    color: #2C556B; }
.banner[hidden] { display: none; }
.toast-zone { position: fixed; right: 24px; bottom: 24px; z-index: 120; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface); color: var(--text-1); border-radius: 12px; padding: 12px 18px;
  box-shadow: var(--shadow-pop); font-size: 14px; display: flex; gap: 10px; align-items: center;
  animation: pop-in .18s ease; max-width: 360px;
}
.toast .ic { color: var(--success); }

/* ---------- 骨架屏（米灰扫光） ---------- */
.skel {
  background: linear-gradient(90deg, #EFE8DA 25%, #F8F2E6 50%, #EFE8DA 75%);
  background-size: 200% 100%; border-radius: 8px; animation: skelflow 1.1s linear infinite;
}
@keyframes skelflow { from { background-position: 200% 0; } to { background-position: -200% 0; } }
#skeleton { position: relative; z-index: 5; }
body:not(.booting) #skeleton { display: none; }
body.booting #app, body.booting .topbar .topnav, body.booting .topbar .top-status { visibility: hidden; position: absolute; pointer-events: none; }
body.booting .topbar { border-bottom: 1px solid var(--border); }

/* ---------- 登录页 ---------- */
.login-stage { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); }
.login-brandbar { display: flex; align-items: center; gap: 10px; padding: 28px 40px; }
.login-hero { display: grid; place-items: center; grid-template-columns: minmax(0, 1fr); padding: 24px 32px 64px; }
.login-card { width: 480px; max-width: 100%; min-width: 0; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 40px; }
.login-title { text-align: center; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--text-3); font-size: 14px; margin-bottom: 32px; }
.login-demo { border-top: 1px solid var(--border); margin-top: 28px; padding-top: 20px; }
.login-demo .cap { display: block; margin-bottom: 10px; }
.login-links { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; }
.login-foot { text-align: center; padding: 0 0 28px; color: var(--text-3); font-size: 13px; }

/* ---------- 弧线进度（半环 SVG） ---------- */
.arc-wrap { position: relative; width: 132px; }
.arc-label { position: absolute; inset: auto 0 6px; text-align: center; font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--primary); }
.arc-track { stroke: var(--border); }
.arc-val { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .3s ease; }

/* ---------- 客户端更新演示（模拟桌面） ---------- */
.desktop { position: fixed; inset: 0; overflow: hidden; background: linear-gradient(160deg, #EADFC8 0%, #DCCAA9 55%, #CBB390 100%); }
.desk-icons { position: absolute; top: 24px; left: 20px; display: flex; flex-direction: column; gap: 22px; }
.desk-icon { width: 72px; text-align: center; color: #4d4234; font-size: 12px; }
.desk-icon .tile { width: 46px; height: 46px; margin: 0 auto 6px; border-radius: 12px; background: rgba(255,255,255,.65); display: grid; place-items: center; color: #7d6a4e; box-shadow: 0 2px 6px rgba(90,70,40,.18); }
.taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; background: rgba(255,255,255,.55); backdrop-filter: blur(8px); border-top: 1px solid rgba(255,255,255,.7); display: flex; align-items: center; padding: 0 16px; gap: 12px; font-size: 13px; color: #5a4d3a; }
.taskbar .clock { margin-left: auto; font-family: var(--font-mono); }
.demo-console {
  position: absolute; top: 24px; right: 24px; width: 292px; background: rgba(255,255,255,.9);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 20px; z-index: 30;
}
.demo-console h2 { font-size: 17px; margin-bottom: 4px; }
.demo-console .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; }
.upd-modal { width: 560px; }
.changelog { background: var(--code-bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; max-height: 150px; overflow-y: auto; font-size: 14px; color: var(--text-2); }
.changelog ul { margin: 0; padding-left: 20px; }
.speed-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; will-change: transform; }
.speed-row:hover { background: var(--surface-2); }
.speed-row .rank { width: 24px; color: var(--text-3); font-family: var(--font-mono); font-size: 13px; }
.speed-row .a { flex: 1; font-family: var(--font-serif); }
.speed-row .ms { font-family: var(--font-mono); font-size: 13px; width: 76px; text-align: right; color: var(--text-2); }
.speed-row.best { background: var(--success-soft); }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check-line.ok { color: var(--success); }
.check-line.fail { color: var(--danger); }

/* ============================================================
   总览 · 节点拓扑流程图 [AI]
   结构：主控根节点（nf-root）→ 竖直主干（nf-trunk）→ 按行分组（nf-row）→ 各行节点（nf-item）。
   连线全部用伪元素 + 简单定位绘制，无 SVG / 无 JS 坐标计算：
   - 每行 nf-row 顶部一条汇流横线 nf-rail（左右端点由 JS 按实际节点中心算出，末行不足 3 个也自然收口）；
   - 每个 nf-item 的 ::before 是「下垂竖线」，把节点框挂到本行横线上；
   - 行与行之间 nf-row-link 一条竖线，从上一行首列节点框底垂到下一行横线 —— 换行后连线连贯不断开。
   ============================================================ */
.node-flow { padding: 8px 16px 24px; display: flex; flex-direction: column; align-items: stretch; }

/* ---------- 根节点（主控）---------- */
.nf-root { display: flex; flex-direction: column; align-items: center; }
.nf-trunk { width: 1px; height: 22px; background: var(--border-strong); flex: none; }

/* ---------- 节点框（根 / 子节点共用）---------- */
.nf-box {
  display: flex; align-items: center; gap: 10px;
  min-width: 0; min-height: 62px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-ctl); box-shadow: 0 1px 3px rgba(84,66,42,.06);
}
.nf-icon {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  background: var(--sunken); color: var(--text-2); display: grid; place-items: center;
}

/* [AI] 节点框可点击（打开参数编辑）：手型 + 悬停浮起 + 键盘焦点环 */
.nf-click { cursor: pointer; transition: box-shadow .16s ease, transform .16s ease; }
.nf-click:hover { box-shadow: 0 4px 14px -4px rgba(84,66,42,.24); transform: translateY(-1px); }
.nf-click:active { transform: translateY(0); }
.nf-click:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.nf-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
/* [AI] 名称单行省略：窄框内长地址/名不至于逐字竖排（完整地址见 title 提示） */
.nf-name { font-size: 14px; color: var(--text-1); font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nf-sub { font-size: 12px; color: var(--text-3); line-height: 1.4; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* [AI] 连通状态改用边框表达（取消右侧状态控件）：绿=连通，红=连不通，虚线=从未上报 */
.nf-box-online { border-color: var(--success); box-shadow: 0 0 0 1px rgba(47,125,91,.16), 0 1px 3px rgba(84,66,42,.06); }
.nf-box-stale,
.nf-box-offline { border-color: var(--danger); box-shadow: 0 0 0 1px rgba(188,59,49,.15), 0 1px 3px rgba(84,66,42,.06); }
.nf-box-wait { border-style: dashed; border-color: var(--border-strong); }

/* [AI] 版本号即颜色 tag：落后转预警色，强制更新转危险色（不再单挂「落后 1 版」徽标） */
.nf-ver {
  display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  line-height: 1.55; padding: 0 6px; border-radius: 5px;
  background: var(--sunken); color: var(--text-2);
}
.nf-ver-lag { background: var(--warning-soft); color: var(--warning); }
.nf-ver-force { background: var(--danger-soft); color: var(--danger); }

/* 主控框：主色描边 + 浅底，与子节点拉开层级；加宽并留出右上角同步按钮的位置 */
.nf-box-root {
  position: relative; min-width: 320px;
  border-color: var(--primary); background: var(--primary-soft);
  box-shadow: 0 2px 10px -3px rgba(180,83,42,.35); padding: 14px 84px 14px 18px;
}
.nf-box-root .nf-icon { background: var(--primary); color: #fff; }
.nf-box-root .nf-name { font-family: var(--font-serif); font-size: 16px; }
.nf-box-root .nf-sub { color: var(--primary); }
.nf-box-root .nf-ver { background: var(--primary); color: #fff; }

/* [AI] 主控卡右上角「同步」按钮：把同步信号广播给所有分发节点 */
.nf-sync {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--primary); background: var(--surface); color: var(--primary);
  font-family: var(--font-sans); font-size: 12px; line-height: 1; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.nf-sync:hover { background: var(--primary); color: #fff; }
.nf-sync[aria-busy="true"] { opacity: .75; cursor: default; }
.ic-xs { width: 12px; height: 12px; }

/* [AI] 上传层进度条（弹窗内，横条比弧形更稳） */
.nf-up-bar {
  width: 100%; max-width: 320px; height: 8px; border-radius: 999px;
  background: var(--border); overflow: hidden;
}
.nf-up-bar > span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .18s ease; }

/* 摘除节点：灰显 + 斜纹，表示不再下发但仍可见 */
.nf-box-removed { opacity: .62; background-image: repeating-linear-gradient(135deg, transparent, transparent 8px, rgba(120,110,100,.05) 8px, rgba(120,110,100,.05) 16px); }
.nf-box-removed .nf-name { text-decoration: line-through; text-decoration-color: var(--text-3); }

/* ---------- 子节点：按行分组，每行最多 3 个；行与行之间用连接线串起（不再断线） ---------- */
.nf-children { display: flex; flex-direction: column; align-items: stretch; }

/* 单行：3 列网格 + 顶部留出连线空间；rail 为本行汇流横线（左右端点由 JS 按实际节点中心设定） */
.nf-row { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 20px; }
.nf-rail { position: absolute; top: 0; height: 1px; background: var(--border-strong); }
.nf-item { position: relative; padding: 0 7px; min-width: 0; }
.nf-item .nf-box { height: 100%; }
/* 下垂竖线：从本行横线垂到节点框顶 */
.nf-item::before {
  content: ''; position: absolute; top: -20px; left: 50%; width: 1px; height: 20px;
  background: var(--border-strong); transform: translateX(-50%);
}
/* 行间连接线：从上一行首列节点框底垂到下一行横线（首列中心对齐，换行不再断线） */
.nf-row-link { width: 1px; height: 26px; margin-left: calc(100% / 6); background: var(--border-strong); }

/* 空态占位 */
.nf-empty { display: flex; justify-content: center; align-items: center; padding: 18px 0 0; }

/* ============================================================
   响应式 1280 / 1024 / 768 / 480（桌面优先）
   ============================================================ */
@media (max-width: 1280px) {
  .page { padding: 32px 24px; }
  /* [AI] 总览 4 个统计卡保持一行（原在 1280 降为 2 列导致折成两行）；窄屏仍由 768/480 断点降级 */
}
@media (max-width: 1024px) {
  .nav-link { font-size: 14px; }
  .topnav-inner { gap: 20px; }
  .top-status .stamp { display: none; }               /* 状态摘要退短文案 */
  .top-status .online-note { display: none; }
  .grid-21, .grid-2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 150px 1fr; }
}
@media (max-width: 768px) {
  .topnav, .top-status, .top-logout { display: none; }
  .hamburger { display: grid; }
  .topbar-inner { padding: 0 16px; }
  .page { padding: 24px 16px; }
  .section { margin-top: 32px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  /* 表格 → 宽松卡片流（保留衬线地址 + 宽松行高） */
  .tbl caption { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tbody tr {
    background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card);
    margin-bottom: 16px; padding: 10px 0;
  }
  .tbl tbody tr:hover td { background: none; }
  .tbl tbody tr:hover td:first-child { box-shadow: none; }
  .tbl td { border-top: none; height: auto; min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 22px; }
  .tbl td::before { content: attr(data-label); flex: none; color: var(--text-3); font-size: 13px; }
  .tbl td.ops { text-align: left; justify-content: flex-end; border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 12px; }
  .copyable .icon-btn { opacity: 1; }
  .searchbox { width: 100%; }
  .table-tools { flex-direction: column; align-items: stretch; }
  .table-tools .right { justify-content: flex-end; }
  .login-card { padding: 28px 22px; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .page { padding: 20px 16px; }
  .card { padding: 18px; }
  .overlay { align-items: flex-end; padding: 0; }     /* 模态 → bottom-sheet */
  .modal, .modal.w-lg { width: 100%; border-radius: var(--radius-modal) var(--radius-modal) 0 0; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; min-height: 44px; }
  .btn { min-height: 44px; }
  .searchbox .input { height: 44px; }
  .speed-row { flex-wrap: wrap; }
  .speed-row .ms { width: auto; }
  .demo-console { position: static; width: auto; margin: 16px; }
  .desktop { position: static; min-height: 100vh; }
  /* 流程图节点框极窄屏：图标折行，避免挤压地址文字 */
  .nf-item { padding-left: 3px; padding-right: 3px; }
  .nf-box { flex-wrap: wrap; gap: 6px; padding: 8px; min-height: 0; }
  /* 主控卡：窄屏取消最小宽度，但仍要留出右上角同步按钮的位置 */
  .nf-box-root { min-width: 0; padding: 12px 78px 12px 12px; }
}
