/* =====================================================================
 * 本科专业能力-知识全景平台 · 主题样式
 * 风格：学术风 × 科技感（深墨蓝导航 + 浅色数据面 + 网格底纹 + 精确排版）
 * 结构：设计令牌 → 基础排版 → 布局骨架 → 组件 → 图表容器 → 工具类
 * 约定：颜色/形状只在此文件与 ui.js 的 Ui.PALETTE 内定义，
 *       不进入 window.PLATFORM_DATA 数据模型。
 * ===================================================================== */

/* ---------------- 设计令牌 ---------------- */
:root {
  /* 色板（科技风的冷色系 + 学术的稳重底） */
  --ink-900: #0b1b33;
  --ink-800: #10233f;
  --ink-700: #16304f;
  --ink-600: #1e3a5f;
  --ink-500: #2b4c76;
  --ink-300: #7d94b3;
  --ink-100: #dbe4f0;

  --paper: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef3fa;
  --border: #dde5f0;
  --border-strong: #c5d2e4;

  --text-1: #16233a;
  --text-2: #46587a;
  --text-3: #7b8aa5;

  --primary: #1d4ed8;
  --primary-600: #2563eb;
  --primary-300: #7ba2f5;
  --primary-050: #e8efff;

  --accent: #0e9aa7;
  --accent-050: #e2f6f8;
  --violet: #6d4aff;
  --violet-050: #eeeaff;
  --amber: #d98a00;
  --amber-050: #fdf3e0;
  --rose: #d64545;
  --rose-050: #fdeceb;
  --green: #0f9d63;
  --green-050: #e6f7ef;
  --slate: #8593ab;
  --slate-050: #f0f2f7;

  --ok: var(--green);
  --warn: var(--amber);
  --bad: var(--rose);
  --na: var(--slate);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-1: 0 1px 2px rgba(16, 35, 63, .06), 0 1px 3px rgba(16, 35, 63, .05);
  --shadow-2: 0 4px 12px rgba(16, 35, 63, .08);
  --shadow-3: 0 18px 48px rgba(11, 27, 51, .22);
  --sidebar-w: 236px;
  --sidebar-w-collapsed: 62px;
  --topbar-h: 62px;

  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
  --sans: "Inter", "Noto Sans SC", "Microsoft YaHei", -apple-system, "Segoe UI", system-ui, sans-serif;
}

/* ---------------- 基础 ---------------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-1);
  background-color: var(--paper);
  /* 科技感网格底纹（纯装饰，不进数据模型） */
  background-image:
    linear-gradient(rgba(29, 78, 216, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 78, 216, .028) 1px, transparent 1px);
  background-size: 26px 26px, 26px 26px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c9d5e6; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #adbed6; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 布局骨架 ---------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(178deg, var(--ink-900) 0%, var(--ink-800) 58%, var(--ink-700) 100%);
  color: #dce6f5;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  transition: width .18s ease, flex-basis .18s ease;
  z-index: 30;
}
.sidebar::after {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); flex-basis: var(--sidebar-w-collapsed); }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .nav-item .label,
.sidebar.collapsed .sidebar-foot { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 9px 0; }
.sidebar.collapsed .brand { justify-content: center; padding: 14px 0; }

.brand { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; position: relative; z-index: 1; }
.brand-logo {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px;
  display: block; object-fit: contain; padding: 2px;
  background: radial-gradient(circle at 32% 26%, #f7fbff 0%, #e7f0fb 70%, #d8e6f6 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .30), 0 6px 16px rgba(88, 182, 255, .28);
}
.brand-title { font-size: 14.5px; font-weight: 650; color: #fff; letter-spacing: .01em; white-space: nowrap; }
.brand-sub { font-size: 10.5px; color: #93a9c8; margin-top: 2px; line-height: 1.35; }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px 18px; position: relative; z-index: 1; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); background-clip: content-box; }
.nav-section {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: #7d94b3; margin: 14px 8px 6px; font-family: var(--mono);
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; margin: 2px 0;
  border-radius: 8px; color: #cbd8ea; font-size: 13.2px;
  cursor: pointer; border-left: 2px solid transparent;
  transition: background .14s ease, color .14s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(88, 182, 255, .22), rgba(88, 182, 255, .04));
  border-left-color: #58b6ff; color: #fff; font-weight: 600;
}
.nav-item .ico { width: 18px; text-align: center; font-size: 14px; opacity: .95; }
.sidebar-foot { padding: 10px 16px 14px; border-top: 1px solid rgba(255, 255, 255, .07); position: relative; z-index: 1; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.collapse-btn {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: 14px; line-height: 1;
}
.collapse-btn:hover { background: var(--surface-3); }
.page-title-wrap { min-width: 180px; }
.page-title { font-size: 16px; font-weight: 650; line-height: 1.25; }
.page-sub { font-size: 11.5px; color: var(--text-3); }
.search { margin-left: auto; position: relative; }
.search-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 15px; }
.search input {
  width: 280px; padding: 7px 12px 7px 30px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-3); font-family: inherit; font-size: 13px; color: var(--text-1);
  transition: box-shadow .15s ease, border-color .15s ease, width .2s ease;
}
.search input:focus { outline: none; border-color: var(--primary-300); background: #fff; box-shadow: 0 0 0 3px var(--primary-050); width: 320px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 14px;
}
.icon-btn:hover { background: var(--surface-3); color: var(--primary); border-color: var(--primary-300); }

.content { flex: 1; padding: 20px 22px 46px; min-width: 0; }

/* ---------------- 页头 ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); letter-spacing: .02em; margin-bottom: 2px; }
.page-head h2 { font-size: 19px; }
.page-head .lead { color: var(--text-2); font-size: 13px; margin-top: 4px; max-width: 760px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-1);
  position: relative;
}
.card.pad-lg { padding: 20px; }
.card.glow { border-color: var(--primary-300); box-shadow: 0 0 0 1px var(--primary-050), var(--shadow-2); }
.card-title { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.card-title .tag-demo { margin-left: auto; }
.card-sub { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.card + .card { margin-top: 16px; }
.card-tight { padding: 12px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-autofit { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.row.center { align-items: center; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.col-2 { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.col-2-wide { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.col-3l { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1280px) {
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .col-3l, .col-2, .col-2-wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4, .grid-autofit { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------- 指标卡 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-1);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--primary-300), var(--accent));
  opacity: .85;
}
.stat-ico {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; display: grid; place-items: center;
  font-size: 17px; background: var(--primary-050); color: var(--primary);
}
.stat-ico.cyan { background: var(--accent-050); color: var(--accent); }
.stat-ico.violet { background: var(--violet-050); color: var(--violet); }
.stat-ico.amber { background: var(--amber-050); color: var(--amber); }
.stat-ico.rose { background: var(--rose-050); color: var(--rose); }
.stat-ico.green { background: var(--green-050); color: var(--green); }
.stat-num { font-size: 21px; font-weight: 700; font-family: var(--mono); letter-spacing: -.02em; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-3); }
.stat-trend { font-size: 11px; color: var(--green); margin-top: 2px; }
.stat-trend.down { color: var(--rose); }

/* ---------------- 按钮 / 表单 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 7px 13px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-1);
  font-family: inherit; font-size: 13px; line-height: 1.4; white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
}
.btn:hover { background: var(--surface-3); border-color: var(--primary-300); text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, var(--primary-600), #3f74e8); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, .25); }
.btn.primary:hover { box-shadow: 0 4px 14px rgba(37, 99, 235, .32); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { border-color: #efc3c3; color: var(--rose); background: var(--rose-050); }
.btn.danger:hover { background: #fbdcdc; }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn.xs { padding: 2px 7px; font-size: 11.5px; border-radius: 6px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn.ok { border-color: #b7e2cd; color: var(--green); background: var(--green-050); }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }

label.field { display: block; }
.field-label { font-size: 12px; color: var(--text-2); margin-bottom: 4px; display: block; }
.input, .select, textarea.input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 8px;
  font-family: inherit; font-size: 13px; color: var(--text-1); background: var(--surface);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--primary-300); box-shadow: 0 0 0 3px var(--primary-050); }
.input.sm, .select.sm { padding: 4px 8px; font-size: 12px; }
textarea.input { min-height: 90px; resize: vertical; line-height: 1.6; }
.input.mono { font-family: var(--mono); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 15px) 51%, calc(100% - 10px) 51%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; font-family: inherit; font-size: 12.5px;
  color: var(--text-2); cursor: pointer; border-right: 1px solid var(--border);
}
.seg button:last-child { border-right: 0; }
.seg button.active { background: var(--primary-050); color: var(--primary); font-weight: 600; }

/* ---------------- 徽标 / 药丸 / 状态 ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; line-height: 1.7;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.pill.primary { background: var(--primary-050); color: var(--primary); }
.pill.accent { background: var(--accent-050); color: var(--accent); }
.pill.violet { background: var(--violet-050); color: var(--violet); }
.pill.amber { background: var(--amber-050); color: var(--amber); }
.pill.rose { background: var(--rose-050); color: var(--rose); }
.pill.green { background: var(--green-050); color: var(--green); }
.pill.slate { background: var(--slate-050); color: var(--slate); }
.pill.mono { font-family: var(--mono); }
.pill.hm { min-width: 26px; justify-content: center; font-family: var(--mono); font-weight: 700; }
.pill.hm.H { background: #e4edff; color: #1b3fb8; }
.pill.hm.M { background: #e0f5f7; color: #0b7d88; }
.pill.hm.L { background: #f2eaff; color: #5b3ad6; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; }
.badge.ok { background: var(--green-050); color: var(--green); }
.badge.warn { background: var(--amber-050); color: var(--amber); }
.badge.na { background: var(--slate-050); color: var(--slate); }
.badge.info { background: var(--primary-050); color: var(--primary); }
.tag-demo {
  font-size: 10.5px; font-family: var(--mono); letter-spacing: .04em;
  padding: 1px 6px; border-radius: 4px; background: var(--amber-050); color: var(--amber);
  border: 1px dashed #e6c37a;
}

/* 达成度数字（可点击溯源） */
.achv { font-family: var(--mono); font-weight: 700; cursor: pointer; border-bottom: 1px dashed currentColor; }
.achv.ok { color: var(--green); }
.achv.warn { color: var(--amber); }
.achv.na { color: var(--slate); border-bottom-style: dotted; cursor: default; }
.achv:hover { opacity: .78; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.data-table th, .data-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-3); color: var(--text-2); font-weight: 600; font-size: 12px;
  border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.data-table tbody tr:hover { background: #f7faff; }
.data-table td.num, .data-table th.num { text-align: right; font-family: var(--mono); }
.data-table td.c, .data-table th.c { text-align: center; }
.data-table .rowhead { font-weight: 600; color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
.data-table.compact th, .data-table.compact td { padding: 5px 8px; }
.data-table tr.row-new td { background: #f2fbf6; }
.data-table tr.row-upd td { background: #f4f7ff; }
.data-table tr.row-bad td { background: #fdf3f3; color: var(--rose); }
.data-table tr.row-muted td { color: var(--text-3); background: var(--surface-2); }
.cell-input { width: 100%; border: 1px solid transparent; background: transparent; font-family: inherit; font-size: 12.8px; padding: 3px 5px; border-radius: 5px; color: inherit; }
.cell-input:hover { border-color: var(--border); background: #fff; }
.cell-input:focus { outline: none; border-color: var(--primary-300); background: #fff; box-shadow: 0 0 0 2px var(--primary-050); }

/* ---------------- 列表 / 时间线 / 空态 ---------------- */
.list { font-size: 13px; }
.list-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; border-radius: 8px; padding: 9px 8px; }
.list-item.click:hover { background: var(--surface-3); }
.list-item.sel { background: var(--primary-050); box-shadow: inset 2px 0 0 var(--primary); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; margin-top: 7px; background: var(--primary); }
.dot.ok { background: var(--green); } .dot.warn { background: var(--amber); } .dot.bad { background: var(--rose); } .dot.na { background: var(--slate); }

.timeline { position: relative; padding-left: 18px; border-left: 2px solid var(--primary-050); }
.timeline-item { position: relative; padding: 8px 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -25px; top: 15px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 3px #fff;
}
.timeline-date { font-family: var(--mono); font-size: 12px; color: var(--primary); font-weight: 600; }

.empty { text-align: center; padding: 28px 16px; color: var(--text-3); font-size: 13px; }
.empty .empty-ico { font-size: 26px; opacity: .5; display: block; margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }
.hint { font-size: 12px; color: var(--text-3); background: var(--surface-3); border-left: 3px solid var(--primary-300); padding: 8px 10px; border-radius: 0 8px 8px 0; }
.hint.warn { border-left-color: var(--amber); background: var(--amber-050); color: #8a5b00; }
.hint.bad { border-left-color: var(--rose); background: var(--rose-050); color: #97272a; }
.hint.ok { border-left-color: var(--green); background: var(--green-050); color: #0a6b45; }

/* ---------------- 图表容器 ---------------- */
.chart { width: 100%; height: 320px; }
.chart.short { height: 260px; }
.chart.tall { height: 460px; }
.chart-box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 8px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); margin-top: 6px; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.kp-legend .sw { border-radius: 50%; }

/* 知识图谱 / 拓扑 布局 */
.kg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .kg-layout { grid-template-columns: minmax(0, 1fr); } }
.kg-canvas { height: 640px; }
.detail-panel { font-size: 12.8px; }
.kv { display: flex; gap: 8px; padding: 4px 0; }
.kv .k { color: var(--text-3); flex: 0 0 78px; }
.kv .v { flex: 1; min-width: 0; word-break: break-word; }

/* ---------------- 进度条 ---------------- */
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary-600), var(--accent)); }
.bar.ok > i { background: linear-gradient(90deg, #12a86c, #46c98f); }
.bar.warn > i { background: linear-gradient(90deg, #e09b16, #f0bb4d); }
.bar.na > i { background: #c3cede; }
.gr-row { display: grid; grid-template-columns: 52px minmax(120px, 1.1fr) minmax(0, 2fr) 74px; gap: 10px; align-items: center; padding: 6px 0; }
.gr-row .gr-code { font-family: var(--mono); font-weight: 700; color: var(--primary); font-size: 12px; }
.gr-row .gr-name { font-size: 12.5px; }
.gr-row .gr-val { text-align: right; font-family: var(--mono); font-weight: 700; font-size: 12.5px; }

/* ---------------- 弹层 / 提示 ---------------- */
/* 显式兜底：任何 [hidden] 元素都必须不可见（避免被组件自身的 display 规则覆盖） */
[hidden] { display: none !important; }
.modal-mask {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(9, 21, 38, .46); backdrop-filter: blur(2px); padding: 24px;
}
.modal-mask[hidden] { display: none !important; }
.modal {
  width: min(1080px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-3);
  border: 1px solid var(--border); overflow: hidden;
}
.modal.narrow { width: min(620px, 100%); }
.modal.wide { width: min(1320px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.modal-title { font-size: 15px; font-weight: 650; flex: 1; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }

.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  padding: 10px 16px; border-radius: 10px; font-size: 13px; color: #fff; box-shadow: var(--shadow-2);
  background: var(--ink-700); max-width: 420px; animation: toastIn .22s ease;
}
.toast.ok { background: linear-gradient(135deg, #0f9d63, #14b472); }
.toast.err { background: linear-gradient(135deg, #cf3f3f, #e05959); }
.toast.warn { background: linear-gradient(135deg, #c47f00, #dd9a17); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- 静态展示版（只读）禁用外观 ---------------- */
.preview-locked {
  opacity: .45 !important;
  cursor: not-allowed !important;
  filter: grayscale(.35);
  pointer-events: none !important;      /* 视觉与交互双重禁用：不接受点击/输入 */
}
.preview-locked::after { content: ""; }
.nav-item.preview-locked { opacity: .38 !important; }
.preview-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px;
  background: var(--amber-050); color: var(--amber); border: 1px dashed #e6c37a;
  white-space: nowrap;
}

/* ---------------- 工具类 ---------------- */
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.tiny { font-size: 11.5px; }
.small { font-size: 12.5px; }
.mono-num { font-family: var(--mono); }
.bold { font-weight: 650; }
.right { text-align: right; }
.center { text-align: center; }
.mt0 { margin-top: 0; } .mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0; } .mb4 { margin-bottom: 4px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.nowrap { white-space: nowrap; }
.scroll-y { overflow-y: auto; }
.maxh-360 { max-height: 360px; } .maxh-520 { max-height: 520px; } .maxh-720 { max-height: 720px; }
.flex1 { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.selectable-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; vertical-align: -1px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.crumbs a { color: var(--text-2); }
@media print { .sidebar, .topbar { display: none; } .content { padding: 0; } }
