/* 方寸匣想 UI 组件库 v1 · fs-ui.css
   用法：先引 tokens.css，再引这个文件；要图表、弹窗、提示等交互再引 fs-ui.js。
     <link rel="stylesheet" href="tokens.css"><link rel="stylesheet" href="fs-ui.css"><script src="fs-ui.js" defer></script>
   类名都以 fs- 开头，不会和你自己的样式打架。深色：<html data-theme="dark">，或不写、跟系统走。 */

/* ── 语义颜色（界面用这些，不直接用品牌色阶） ── */
:root {
  --fs-bg: var(--fs-gray-50);
  --fs-surface: #fff;
  --fs-surface-2: var(--fs-gray-100);
  --fs-text: var(--fs-gray-900);
  --fs-text-2: var(--fs-gray-600);
  --fs-text-3: var(--fs-gray-500);
  --fs-border: var(--fs-gray-200);
  --fs-border-2: var(--fs-gray-300);
  --fs-accent: var(--fs-yellow-500);
  --fs-accent-hover: var(--fs-yellow-400);
  --fs-accent-text: var(--fs-ink);
  --fs-accent-soft: var(--fs-yellow-50);
  --fs-accent-ink: var(--fs-yellow-800);
  --fs-focus: 0 0 0 3px rgba(247,181,44,.45);
  --fs-chart-grid: var(--fs-gray-200);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --fs-bg: var(--fs-night);
  --fs-surface: var(--fs-night-2);
  --fs-surface-2: #302C38;
  --fs-text: #F3F0EB;
  --fs-text-2: #B9B2A7;
  --fs-text-3: #8C857B;
  --fs-border: #38343F;
  --fs-border-2: #4A4552;
  --fs-accent-soft: rgba(247,181,44,.12);
  --fs-accent-ink: var(--fs-yellow-300);
  --fs-success-bg: rgba(46,157,107,.16); --fs-warning-bg: rgba(224,154,18,.16); --fs-danger-bg: rgba(217,68,58,.16); --fs-info-bg: rgba(58,123,213,.16);
  --fs-chart-grid: #38343F;
  --fs-shadow-md: 0 6px 16px -4px rgba(0,0,0,.5); --fs-shadow-lg: 0 18px 40px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fs-bg: var(--fs-night); --fs-surface: var(--fs-night-2); --fs-surface-2: #302C38;
    --fs-text: #F3F0EB; --fs-text-2: #B9B2A7; --fs-text-3: #8C857B; --fs-border: #38343F; --fs-border-2: #4A4552;
    --fs-accent-soft: rgba(247,181,44,.12); --fs-accent-ink: var(--fs-yellow-300);
    --fs-success-bg: rgba(46,157,107,.16); --fs-warning-bg: rgba(224,154,18,.16); --fs-danger-bg: rgba(217,68,58,.16); --fs-info-bg: rgba(58,123,213,.16);
    --fs-chart-grid: #38343F;
    --fs-shadow-md: 0 6px 16px -4px rgba(0,0,0,.5); --fs-shadow-lg: 0 18px 40px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

/* ── 基础 ── */
.fs, .fs-app { font-family: var(--fs-font-cn); font-size: var(--fs-text-body); line-height: var(--fs-leading); color: var(--fs-text); background: var(--fs-bg);
               -webkit-font-smoothing: antialiased; }
.fs *, .fs-app * { box-sizing: border-box; }
.fs-num { font-family: var(--fs-font-display); font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.fs-muted { color: var(--fs-text-2); } .fs-faint { color: var(--fs-text-3); }
.fs-small { font-size: var(--fs-text-small); } .fs-tiny { font-size: var(--fs-text-tiny); }
.fs-h1 { font-size: 30px; font-weight: 900; line-height: 1.2; margin: 0; }
.fs-h2 { font-size: 22px; font-weight: 700; line-height: 1.3; margin: 0; }
.fs-h3 { font-size: 16px; font-weight: 700; line-height: 1.4; margin: 0; }
.fs-row { display: flex; align-items: center; gap: var(--fs-space-3); flex-wrap: wrap; }
.fs-stack { display: flex; flex-direction: column; gap: var(--fs-space-4); }
.fs-spacer { flex: 1; }
.fs-grid { display: grid; gap: var(--fs-space-4); grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
@media (max-width: 900px) { .fs-grid { grid-template-columns: repeat(min(var(--cols, 3), 2), minmax(0, 1fr)); } }
@media (max-width: 560px) { .fs-grid { grid-template-columns: 1fr; } }
.fs-divider { height: 1px; background: var(--fs-border); border: 0; margin: var(--fs-space-4) 0; }
.fs-kbd { font: 500 11px var(--fs-font-mono); padding: 1px 6px; border: 1px solid var(--fs-border-2); border-bottom-width: 2px; border-radius: 5px; color: var(--fs-text-2); }
.fs-icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ── 卡片 ── */
.fs-card { background: var(--fs-surface); border: 1px solid var(--fs-border); border-radius: var(--fs-radius-lg); padding: var(--fs-space-5); }
.fs-card-head { display: flex; align-items: center; gap: var(--fs-space-3); margin-bottom: var(--fs-space-4); }
.fs-card-head .fs-h3 { flex: 1; }
.fs-card.flat { border: 0; background: var(--fs-surface-2); }
.fs-card.hover { transition: box-shadow .15s, border-color .15s; } .fs-card.hover:hover { box-shadow: var(--fs-shadow-md); border-color: var(--fs-border-2); }

/* ── 按钮 ── */
.fs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: var(--fs-radius-md);
          border: 1px solid var(--fs-border-2); background: var(--fs-surface); color: var(--fs-text); font: 500 14px/1 var(--fs-font-cn); cursor: pointer;
          text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s; }
.fs-btn:hover { background: var(--fs-surface-2); }
.fs-btn:active { transform: translateY(1px); }
.fs-btn:focus-visible { outline: none; box-shadow: var(--fs-focus); }
.fs-btn:disabled, .fs-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.fs-btn.primary { background: var(--fs-accent); border-color: var(--fs-accent); color: var(--fs-accent-text); font-weight: 700; }
.fs-btn.primary:hover { background: var(--fs-accent-hover); }
.fs-btn.dark { background: var(--fs-ink); border-color: var(--fs-ink); color: #fff; }
.fs-btn.ghost { border-color: transparent; background: transparent; color: var(--fs-text-2); }
.fs-btn.ghost:hover { background: var(--fs-surface-2); color: var(--fs-text); }
.fs-btn.danger { color: var(--fs-danger); border-color: color-mix(in srgb, var(--fs-danger) 40%, transparent); }
.fs-btn.danger.solid { background: var(--fs-danger); color: #fff; border-color: var(--fs-danger); }
.fs-btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: var(--fs-radius-sm); }
.fs-btn.lg { height: 44px; padding: 0 22px; font-size: 15px; }
.fs-btn.icon { width: 36px; padding: 0; } .fs-btn.icon.sm { width: 30px; }
.fs-btn.loading { color: transparent !important; position: relative; pointer-events: none; }
.fs-btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor;
                         border-color: var(--fs-text) transparent var(--fs-text) transparent; animation: fs-spin .8s linear infinite; }
.fs-btn.primary.loading::after { border-color: var(--fs-ink) transparent var(--fs-ink) transparent; }
.fs-btn-group { display: inline-flex; } .fs-btn-group .fs-btn { border-radius: 0; margin-left: -1px; }
.fs-btn-group .fs-btn:first-child { border-radius: var(--fs-radius-md) 0 0 var(--fs-radius-md); margin-left: 0; }
.fs-btn-group .fs-btn:last-child { border-radius: 0 var(--fs-radius-md) var(--fs-radius-md) 0; }
@keyframes fs-spin { to { transform: rotate(360deg); } }

/* ── 徽标、标签 ── */
.fs-badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
            background: var(--fs-surface-2); color: var(--fs-text-2); white-space: nowrap; }
.fs-badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.fs-badge.ok { background: var(--fs-success-bg); color: var(--fs-success); }
.fs-badge.warn { background: var(--fs-warning-bg); color: var(--fs-warning); }
.fs-badge.bad { background: var(--fs-danger-bg); color: var(--fs-danger); }
.fs-badge.info { background: var(--fs-info-bg); color: var(--fs-info); }
.fs-badge.brand { background: var(--fs-accent-soft); color: var(--fs-accent-ink); }
.fs-badge.solid { background: var(--fs-accent); color: var(--fs-ink); }
.fs-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--fs-danger); color: #fff;
            font: 600 11px/1 var(--fs-font-display); }
/* 建筑档案吊牌 */
.fs-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 12px 0 19px; position: relative; color: #fff; background: var(--fs-yellow-500);
          font: 600 13px/1 var(--fs-font-display); letter-spacing: .06em; clip-path: polygon(11px 0, 100% 0, 100% 100%, 11px 100%, 0 50%); border-radius: 0 5px 5px 0; white-space: nowrap; }
.fs-tag::before { content: ""; position: absolute; left: 8px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: #fff; }
.fs-tag b { font: 700 11px var(--fs-font-cn); letter-spacing: .08em; margin-right: 6px; }
.fs-tag.ink { background: var(--fs-ink); } .fs-tag.ink span { color: var(--fs-yellow-500); }
.fs-tag.orange { background: var(--fs-orange-500); }
.fs-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--fs-border-2);
           background: var(--fs-surface); font-size: 13px; cursor: pointer; color: var(--fs-text-2); }
.fs-chip[aria-pressed="true"], .fs-chip.on { background: var(--fs-ink); border-color: var(--fs-ink); color: #fff; }
:root[data-theme="dark"] .fs-chip.on, :root[data-theme="dark"] .fs-chip[aria-pressed="true"] { background: var(--fs-accent); border-color: var(--fs-accent); color: var(--fs-ink); }

/* ── 头像 ── */
.fs-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--fs-ink);
             background: var(--fs-yellow-200); flex: none; overflow: hidden; }
.fs-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fs-avatar.sm { width: 24px; height: 24px; font-size: 11px; } .fs-avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.fs-avatars { display: inline-flex; } .fs-avatars .fs-avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--fs-surface); } .fs-avatars .fs-avatar:first-child { margin-left: 0; }

/* ── 表单 ── */
.fs-field { display: flex; flex-direction: column; gap: 6px; }
.fs-field > span, .fs-label { font-size: 13px; font-weight: 500; color: var(--fs-text-2); }
.fs-field .fs-help { font-size: 12px; color: var(--fs-text-3); }
.fs-field .fs-error { font-size: 12px; color: var(--fs-danger); }
.fs-input, .fs-select, .fs-textarea { width: 100%; height: 38px; padding: 0 12px; border-radius: var(--fs-radius-md); border: 1px solid var(--fs-border-2);
          background: var(--fs-surface); color: var(--fs-text); font: 14px var(--fs-font-cn); transition: border-color .12s, box-shadow .12s; }
.fs-textarea { height: auto; min-height: 90px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.fs-select { appearance: none; padding-right: 34px; cursor: pointer;
             background: var(--fs-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23857D70' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center/16px; }
.fs-input:focus, .fs-select:focus, .fs-textarea:focus { outline: none; border-color: var(--fs-accent); box-shadow: var(--fs-focus); }
.fs-input::placeholder, .fs-textarea::placeholder { color: var(--fs-text-3); }
.fs-field.invalid .fs-input, .fs-input[aria-invalid="true"] { border-color: var(--fs-danger); }
.fs-input-group { display: flex; } .fs-input-group > * { border-radius: 0; margin-left: -1px; }
.fs-input-group > :first-child { border-radius: var(--fs-radius-md) 0 0 var(--fs-radius-md); margin-left: 0; }
.fs-input-group > :last-child { border-radius: 0 var(--fs-radius-md) var(--fs-radius-md) 0; }
.fs-input-group .fs-addon { display: grid; place-items: center; padding: 0 12px; background: var(--fs-surface-2); border: 1px solid var(--fs-border-2); color: var(--fs-text-2); font-size: 13px; }
.fs-search { position: relative; } .fs-search .fs-input { padding-left: 36px; }
.fs-search .fs-icon { position: absolute; left: 11px; top: 10px; color: var(--fs-text-3); }
.fs-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.fs-check input { appearance: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid var(--fs-border-2); border-radius: 5px; background: var(--fs-surface);
                  display: grid; place-items: center; cursor: pointer; transition: .12s; flex: none; }
.fs-check input[type="radio"] { border-radius: 50%; }
.fs-check input:checked { background: var(--fs-accent); border-color: var(--fs-accent); }
.fs-check input[type="checkbox"]:checked::after { content: ""; width: 9px; height: 5px; border: solid var(--fs-ink); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.fs-check input[type="radio"]:checked::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fs-ink); }
.fs-check input:focus-visible { box-shadow: var(--fs-focus); }
.fs-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.fs-switch input { appearance: none; width: 38px; height: 22px; margin: 0; border-radius: 999px; background: var(--fs-border-2); position: relative; cursor: pointer; transition: .15s; flex: none; }
.fs-switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--fs-shadow-sm); transition: .15s; }
.fs-switch input:checked { background: var(--fs-accent); } .fs-switch input:checked::after { left: 19px; }
.fs-switch input:focus-visible { box-shadow: var(--fs-focus); }
.fs-seg { display: inline-flex; padding: 3px; border-radius: var(--fs-radius-md); background: var(--fs-surface-2); gap: 2px; }
.fs-seg button { height: 30px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--fs-text-2); font: 500 13px var(--fs-font-cn); cursor: pointer; }
.fs-seg button[aria-pressed="true"] { background: var(--fs-surface); color: var(--fs-text); box-shadow: var(--fs-shadow-sm); }
.fs-range { width: 100%; accent-color: var(--fs-yellow-500); }
.fs-drop { border: 1.5px dashed var(--fs-border-2); border-radius: var(--fs-radius-lg); padding: 28px; text-align: center; color: var(--fs-text-2); background: var(--fs-surface);
           cursor: pointer; transition: .15s; }
.fs-drop:hover, .fs-drop.over { border-color: var(--fs-accent); background: var(--fs-accent-soft); }
.fs-drop b { color: var(--fs-text); }

/* ── 导航 ── */
.fs-topbar { display: flex; align-items: center; gap: var(--fs-space-5); height: 60px; padding: 0 var(--fs-space-5); background: var(--fs-surface); border-bottom: 1px solid var(--fs-border); }
.fs-topbar .fs-brand img { height: 36px; display: block; }
.fs-topbar nav { display: flex; gap: 4px; }
.fs-topbar nav a { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--fs-text-2); font-size: 14px; }
.fs-topbar nav a:hover { background: var(--fs-surface-2); color: var(--fs-text); }
.fs-topbar nav a[aria-current="page"] { color: var(--fs-text); font-weight: 700; background: var(--fs-accent-soft); }
.fs-side { width: 232px; padding: var(--fs-space-4) var(--fs-space-3); background: var(--fs-surface); border-right: 1px solid var(--fs-border); display: flex; flex-direction: column; gap: 2px; }
.fs-side .fs-side-group { font-size: 11px; color: var(--fs-text-3); padding: 14px 10px 6px; letter-spacing: .06em; }
.fs-side a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--fs-text-2); text-decoration: none; font-size: 14px; }
.fs-side a:hover { background: var(--fs-surface-2); color: var(--fs-text); }
.fs-side a[aria-current="page"] { background: var(--fs-accent-soft); color: var(--fs-text); font-weight: 700; box-shadow: inset 3px 0 0 var(--fs-accent); }
.fs-side a .fs-count { margin-left: auto; }
.fs-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--fs-border); overflow-x: auto; scrollbar-width: none; }
.fs-tabs button, .fs-tabs a { position: relative; padding: 10px 0 12px; border: 0; background: none; color: var(--fs-text-2); font: 500 14px var(--fs-font-cn); cursor: pointer;
                              text-decoration: none; white-space: nowrap; }
.fs-tabs [aria-selected="true"] { color: var(--fs-text); font-weight: 700; }
.fs-tabs [aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--fs-accent); }
.fs-crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--fs-text-3); flex-wrap: wrap; }
.fs-crumbs a { color: var(--fs-text-2); text-decoration: none; } .fs-crumbs a:hover { color: var(--fs-text); }
.fs-crumbs > *:not(:last-child)::after { content: "/"; margin-left: 8px; color: var(--fs-border-2); }
.fs-pager { display: flex; gap: 4px; align-items: center; }
.fs-pager button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--fs-text-2);
                   font: 600 13px var(--fs-font-display); cursor: pointer; }
.fs-pager button:hover { background: var(--fs-surface-2); }
.fs-pager button[aria-current="page"] { background: var(--fs-ink); color: #fff; }
.fs-steps { display: flex; counter-reset: step; }
.fs-steps li { flex: 1; list-style: none; position: relative; padding-top: 34px; font-size: 13px; color: var(--fs-text-3); text-align: center; }
.fs-steps li::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 50%; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%;
                       display: grid; place-items: center; background: var(--fs-surface-2); color: var(--fs-text-3); font: 600 13px var(--fs-font-display); z-index: 1; }
.fs-steps li:not(:first-child)::after { content: ""; position: absolute; top: 12px; right: 50%; width: 100%; height: 2px; background: var(--fs-border); }
.fs-steps li.done, .fs-steps li.now { color: var(--fs-text); }
.fs-steps li.done::before { content: "✓"; background: var(--fs-accent); color: var(--fs-ink); }
.fs-steps li.done::after, .fs-steps li.now::after { background: var(--fs-accent); }
.fs-steps li.now::before { background: var(--fs-ink); color: #fff; box-shadow: 0 0 0 4px var(--fs-accent-soft); }
.fs-steps { padding: 0; margin: 0; }

/* ── 页头 ── */
.fs-pagehead { display: flex; align-items: flex-end; gap: var(--fs-space-4); flex-wrap: wrap; margin-bottom: var(--fs-space-5); }
.fs-pagehead > div:first-child { flex: 1; min-width: 220px; }
.fs-pagehead p { margin: 4px 0 0; color: var(--fs-text-2); font-size: 14px; }

/* ── 反馈 ── */
.fs-alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--fs-radius-md); background: var(--fs-info-bg); color: var(--fs-text); font-size: 14px; border: 1px solid transparent; }
.fs-alert .fs-icon { color: var(--fs-info); margin-top: 1px; }
.fs-alert b { display: block; margin-bottom: 2px; }
.fs-alert.ok { background: var(--fs-success-bg); } .fs-alert.ok .fs-icon { color: var(--fs-success); }
.fs-alert.warn { background: var(--fs-warning-bg); } .fs-alert.warn .fs-icon { color: var(--fs-warning); }
.fs-alert.bad { background: var(--fs-danger-bg); } .fs-alert.bad .fs-icon { color: var(--fs-danger); }
.fs-alert.brand { background: var(--fs-night); color: #fff; } .fs-alert.brand .fs-icon { color: var(--fs-yellow-500); }
.fs-toasts { position: fixed; z-index: 1000; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.fs-toast { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 10px; background: var(--fs-ink); color: #fff; font-size: 14px; box-shadow: var(--fs-shadow-lg);
            animation: fs-up .2s ease-out; pointer-events: auto; max-width: min(520px, 92vw); }
.fs-toast.ok .fs-icon { color: #6FD3A2; } .fs-toast.bad .fs-icon { color: #FF8F86; } .fs-toast .fs-icon { color: var(--fs-yellow-500); }
.fs-toast.out { opacity: 0; transform: translateY(8px); transition: .2s; }
@keyframes fs-up { from { opacity: 0; transform: translateY(10px); } }
.fs-modal { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; background: rgba(28,26,34,.45); backdrop-filter: blur(3px); animation: fs-fade .15s; }
.fs-dialog { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--fs-surface); border-radius: var(--fs-radius-xl); box-shadow: var(--fs-shadow-lg);
             padding: var(--fs-space-6); animation: fs-up .18s ease-out; }
.fs-dialog h2 { font-size: 20px; margin: 0 0 8px; } .fs-dialog p { color: var(--fs-text-2); margin: 0; }
.fs-dialog .fs-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: var(--fs-space-5); }
.fs-drawer { position: fixed; z-index: 900; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--fs-surface); box-shadow: var(--fs-shadow-lg); padding: var(--fs-space-5);
             overflow: auto; animation: fs-slide .2s ease-out; }
@keyframes fs-fade { from { opacity: 0; } } @keyframes fs-slide { from { transform: translateX(30px); opacity: 0; } }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap;
        padding: 6px 10px; border-radius: 7px; background: var(--fs-ink); color: #fff; font: 12px/1.3 var(--fs-font-cn); z-index: 50; pointer-events: none; }
.fs-menu { position: absolute; z-index: 800; min-width: 180px; padding: 6px; border-radius: var(--fs-radius-md); background: var(--fs-surface); border: 1px solid var(--fs-border);
           box-shadow: var(--fs-shadow-lg); animation: fs-up .12s; }
.fs-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--fs-text);
                  font: 14px var(--fs-font-cn); cursor: pointer; text-align: left; }
.fs-menu button:hover, .fs-menu button:focus-visible { background: var(--fs-surface-2); outline: none; }
.fs-menu button.danger { color: var(--fs-danger); } .fs-menu hr { border: 0; height: 1px; background: var(--fs-border); margin: 5px 0; }
/* 进度条：层纹样式 */
.fs-progress { height: 8px; border-radius: 999px; background: var(--fs-surface-2); overflow: hidden; }
.fs-progress > i { display: block; height: 100%; width: var(--v, 0%); border-radius: inherit; background: var(--fs-accent); transition: width .4s; }
.fs-progress.layers > i { background: repeating-linear-gradient(90deg, var(--fs-accent) 0 14px, var(--fs-yellow-300) 14px 16px); }
.fs-progress.ok > i { background: var(--fs-success); } .fs-progress.bad > i { background: var(--fs-danger); } .fs-progress.orange > i { background: var(--fs-orange-500); }
.fs-progress.lg { height: 14px; }
.fs-spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--fs-surface-2); border-top-color: var(--fs-accent); animation: fs-spin .8s linear infinite; display: inline-block; }
.fs-skel { border-radius: 6px; background: linear-gradient(90deg, var(--fs-surface-2) 25%, var(--fs-border) 50%, var(--fs-surface-2) 75%); background-size: 200% 100%; animation: fs-shim 1.4s infinite; }
@keyframes fs-shim { to { background-position: -200% 0; } }
/* 空状态：一扇还没开灯的门 */
.fs-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 20px; color: var(--fs-text-2); }
.fs-empty .door { width: 56px; aspect-ratio: 1 / 1.47; border-radius: 999px 999px 4px 4px; background: var(--fs-surface-2); position: relative; margin-bottom: 8px; }
.fs-empty .door::after { content: ""; position: absolute; left: 100%; bottom: 0; width: 70px; height: 26px; background: linear-gradient(117deg, rgba(244,156,28,.35), transparent 70%);
                         transform: skewX(-63deg); transform-origin: bottom left; }
.fs-empty b { color: var(--fs-text); font-size: 16px; }

/* ── 数据展示 ── */
.fs-stat { display: flex; flex-direction: column; gap: 4px; }
.fs-stat .k { font-size: 13px; color: var(--fs-text-2); display: flex; align-items: center; gap: 6px; }
.fs-stat .v { font: 600 34px/1.1 var(--fs-font-display); letter-spacing: .01em; color: var(--fs-text); font-variant-numeric: tabular-nums; }
.fs-stat .v small { font-size: 16px; color: var(--fs-text-3); margin-left: 3px; font-weight: 500; }
.fs-stat .d { font-size: 12px; color: var(--fs-text-3); display: flex; align-items: center; gap: 6px; }
.fs-delta { display: inline-flex; align-items: center; gap: 2px; font: 600 13px var(--fs-font-display); }
.fs-delta.up { color: var(--fs-success); } .fs-delta.down { color: var(--fs-danger); } .fs-delta.flat { color: var(--fs-text-3); }
.fs-delta.up::before { content: "▲"; font-size: 9px; } .fs-delta.down::before { content: "▼"; font-size: 9px; }
.fs-kpi { position: relative; overflow: hidden; }
.fs-kpi .fs-spark { position: absolute; right: 16px; bottom: 16px; width: 96px; height: 34px; }
.fs-kpi.feature { background: var(--fs-night); border-color: var(--fs-night); color: #fff; }
.fs-kpi.feature .k, .fs-kpi.feature .d { color: rgba(255,255,255,.6); } .fs-kpi.feature .v { color: #fff; }
.fs-kpi.feature::after { content: ""; position: absolute; right: -40px; bottom: -30px; width: 200px; height: 90px; background: linear-gradient(117deg, rgba(244,156,28,.5), transparent 70%); transform: skewX(-50deg); }
.fs-statrow { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); border: 1px solid var(--fs-border); border-radius: var(--fs-radius-lg); background: var(--fs-surface); }
.fs-statrow > * { padding: 18px 20px; } .fs-statrow > * + * { border-left: 1px solid var(--fs-border); }
@media (max-width: 720px) { .fs-statrow { grid-template-columns: repeat(2, 1fr); } .fs-statrow > *:nth-child(odd) { border-left: 0; } .fs-statrow > *:nth-child(n+3) { border-top: 1px solid var(--fs-border); } }
/* 表格 */
.fs-table-wrap { overflow: auto; border: 1px solid var(--fs-border); border-radius: var(--fs-radius-lg); background: var(--fs-surface); }
.fs-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fs-table th { position: sticky; top: 0; z-index: 1; background: var(--fs-surface-2); text-align: left; font-size: 12px; font-weight: 600; color: var(--fs-text-2); padding: 10px 14px;
               white-space: nowrap; border-bottom: 1px solid var(--fs-border); }
.fs-table th[data-sort] { cursor: pointer; user-select: none; } .fs-table th[data-sort]:hover { color: var(--fs-text); }
.fs-table th[aria-sort="ascending"]::after { content: " ↑"; color: var(--fs-accent-ink); } .fs-table th[aria-sort="descending"]::after { content: " ↓"; color: var(--fs-accent-ink); }
.fs-table td { padding: 11px 14px; border-bottom: 1px solid var(--fs-border); vertical-align: middle; }
.fs-table tr:last-child td { border-bottom: 0; }
.fs-table tbody tr:hover { background: color-mix(in srgb, var(--fs-accent) 6%, transparent); }
.fs-table .num { text-align: right; font-family: var(--fs-font-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.fs-table.compact td { padding: 7px 12px; } .fs-table.striped tbody tr:nth-child(even) { background: var(--fs-bg); }
.fs-table tr.sel { background: var(--fs-accent-soft); }
.fs-cellbar { display: flex; align-items: center; gap: 8px; } .fs-cellbar i { height: 6px; border-radius: 3px; background: var(--fs-accent); min-width: 2px; }
/* 描述列表 */
.fs-kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; font-size: 14px; }
.fs-kv dt { color: var(--fs-text-3); } .fs-kv dd { margin: 0; }
/* 列表 */
.fs-list { list-style: none; margin: 0; padding: 0; }
.fs-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--fs-border); }
.fs-list li:last-child { border-bottom: 0; }
.fs-list .t { flex: 1; min-width: 0; } .fs-list .t b { display: block; font-size: 14px; } .fs-list .t span { font-size: 12px; color: var(--fs-text-3); }
/* 排行 */
.fs-rank li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; }
.fs-rank .n { font: 600 16px var(--fs-font-display); color: var(--fs-text-3); text-align: center; }
.fs-rank li:nth-child(1) .n { color: var(--fs-yellow-600); } .fs-rank li:nth-child(2) .n { color: var(--fs-orange-500); } .fs-rank li:nth-child(3) .n { color: var(--fs-brown); }
.fs-rank .bar { height: 6px; border-radius: 3px; background: var(--fs-surface-2); margin-top: 6px; } .fs-rank .bar i { display: block; height: 100%; border-radius: 3px; background: var(--fs-accent); }
/* 时间线 */
.fs-timeline { list-style: none; margin: 0; padding: 0; }
.fs-timeline li { position: relative; padding: 0 0 20px 26px; font-size: 14px; }
.fs-timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--fs-surface); border: 2px solid var(--fs-border-2); }
.fs-timeline li::after { content: ""; position: absolute; left: 9px; top: 21px; bottom: 2px; width: 2px; background: var(--fs-border); }
.fs-timeline li:last-child::after { display: none; }
.fs-timeline li.ok::before { border-color: var(--fs-success); background: var(--fs-success); } .fs-timeline li.now::before { border-color: var(--fs-accent); background: var(--fs-accent); box-shadow: 0 0 0 4px var(--fs-accent-soft); }
.fs-timeline li.bad::before { border-color: var(--fs-danger); background: var(--fs-danger); }
.fs-timeline time { display: block; font-size: 12px; color: var(--fs-text-3); }
/* 看板 */
.fs-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: var(--fs-space-4); overflow-x: auto; }
.fs-col { background: var(--fs-surface-2); border-radius: var(--fs-radius-lg); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.fs-col-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; padding: 2px 4px; }
.fs-col-head .fs-faint { font-weight: 500; }
.fs-task { background: var(--fs-surface); border-radius: var(--fs-radius-md); padding: 12px; box-shadow: var(--fs-shadow-sm); font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.fs-task b { font-size: 14px; }
/* 作品卡（建筑档案） */
.fs-work { background: var(--fs-surface); border: 1px solid var(--fs-border); border-radius: var(--fs-radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.fs-work .pic { aspect-ratio: 1 / 1; background: var(--fs-sand); position: relative; overflow: hidden; }
.fs-work .pic img, .fs-work .pic .arch { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }   /* 照片铺满（.arch 是旧写法，也铺满） */
.fs-work .pic .arch img { position: static; }
.fs-work .pic .fs-tag { position: absolute; right: 10px; top: 10px; }
.fs-work .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.fs-work .body b { font-size: 15px; } .fs-work .meta { display: flex; gap: 10px; font-size: 12px; color: var(--fs-text-3); flex-wrap: wrap; }
/* 打印机卡（农场） */
.fs-printer { background: var(--fs-surface); border: 1px solid var(--fs-border); border-radius: var(--fs-radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.fs-printer .head { display: flex; align-items: center; gap: 10px; } .fs-printer .head b { flex: 1; }
.fs-printer .cam { aspect-ratio: 16 / 9; border-radius: var(--fs-radius-md); background: #2A2731 center/cover; position: relative; overflow: hidden; }
.fs-printer .cam span { position: absolute; left: 8px; top: 8px; font: 600 11px var(--fs-font-display); color: #fff; background: rgba(0,0,0,.45); padding: 2px 6px; border-radius: 4px; }
.fs-printer .spools { display: flex; gap: 6px; } .fs-printer .spools i { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(0,0,0,.12); }
.fs-printer.done { box-shadow: 0 0 0 2px var(--fs-accent); } .fs-printer.fail { box-shadow: 0 0 0 2px var(--fs-danger); }
/* 环形进度 / 仪表 */
.fs-ring { --v: 0; --c: var(--fs-accent); width: 88px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
           background: radial-gradient(closest-side, var(--fs-surface) 76%, transparent 77%), conic-gradient(var(--c) calc(var(--v) * 1%), var(--fs-surface-2) 0); }
.fs-ring b { font: 600 20px var(--fs-font-display); } .fs-ring.sm { width: 56px; } .fs-ring.sm b { font-size: 14px; }
/* 图表外壳 */
.fs-chart { position: relative; width: 100%; }
.fs-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.fs-chart text { font: 11px var(--fs-font-display); fill: var(--fs-text-3); }
.fs-chart .grid line { stroke: var(--fs-chart-grid); stroke-dasharray: 2 4; }
.fs-chart .axis line { stroke: var(--fs-border-2); }
.fs-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--fs-text-2); margin-top: 10px; }
.fs-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.fs-chart-tip { position: absolute; pointer-events: none; z-index: 5; background: var(--fs-ink); color: #fff; font-size: 12px; line-height: 1.5; padding: 8px 10px; border-radius: 8px;
                box-shadow: var(--fs-shadow-md); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .1s; }
.fs-chart-tip.on { opacity: 1; } .fs-chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.fs-heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.fs-heat i { width: 12px; height: 12px; border-radius: 3px; background: var(--fs-surface-2); }
.fs-heat i[data-l="1"] { background: var(--fs-yellow-100); } .fs-heat i[data-l="2"] { background: var(--fs-yellow-300); }
.fs-heat i[data-l="3"] { background: var(--fs-yellow-500); } .fs-heat i[data-l="4"] { background: var(--fs-orange-600); }
.fs-funnel { display: flex; flex-direction: column; gap: 6px; }
.fs-funnel .st { display: grid; grid-template-columns: 90px 1fr 70px; gap: 12px; align-items: center; font-size: 13px; }
.fs-funnel .st .b { height: 30px; border-radius: 6px; background: var(--fs-accent); margin: 0 auto; display: flex; align-items: center; justify-content: center;
                    font: 600 13px var(--fs-font-display); color: var(--fs-ink); min-width: 40px; }
.fs-funnel .st .r { font: 600 12px var(--fs-font-display); color: var(--fs-text-3); text-align: right; }
.fs-bullet { position: relative; height: 22px; border-radius: 4px; background: linear-gradient(90deg, var(--fs-surface-2) 0 60%, var(--fs-border) 60% 85%, var(--fs-border-2) 85%); }
.fs-bullet i { position: absolute; left: 0; top: 7px; height: 8px; width: var(--v); background: var(--fs-ink); border-radius: 2px; }
.fs-bullet b { position: absolute; top: 3px; bottom: 3px; width: 3px; left: var(--t); background: var(--fs-orange-500); border-radius: 2px; }
:root[data-theme="dark"] .fs-bullet i { background: var(--fs-yellow-500); }
