/* ============================================================
   主题 B · 古朴中国风 Chinese Antique  —— OA 办公系统主题模板
   特色：祥云纹暗底 / 回纹描边 / 印章 logo / 朱砂 · 鎏金 · 墨色 / 楷宋双体
   与「简约现代」主题共用同一套 HTML 结构，仅替换本 CSS 即可整体换肤
   响应式：移动端 / 平板 / 桌面端 自适应
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* —— 祥云纹暗底（SVG 图案，可整体替换）—— */
  --cloud: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='340' height='240' viewBox='0 0 340 240'><g fill='none' stroke='%23A98450' stroke-opacity='.20' stroke-width='1.5' stroke-linecap='round'><g transform='translate(90,78) scale(.9)'><path d='M26 0C26 13.8 13.8 24 0 24C-12.4 24 -21 12.4 -21 0C-21 -10.8 -10.8 -18 0 -18C10.8 -18 15 -9.1 15 0C15 9.1 9.1 12 0 12C-5.8 12 -9 5.8 -9 0' transform='translate(-25,2) scale(.72)'/><path d='M26 0C26 13.8 13.8 24 0 24C-12.4 24 -21 12.4 -21 0C-21 -10.8 -10.8 -18 0 -18C10.8 -18 15 -9.1 15 0C15 9.1 9.1 12 0 12C-5.8 12 -9 5.8 -9 0' transform='translate(25,2) scale(-.72,.72)'/><path d='M-42 20C-30 33 -8 33 0 22C8 33 30 33 42 20'/><path d='M-42 20C-53 11 -51 -3 -40 -10'/><path d='M42 20C53 11 51 -3 40 -10'/></g><g transform='translate(252,178) rotate(180) scale(.9)'><path d='M26 0C26 13.8 13.8 24 0 24C-12.4 24 -21 12.4 -21 0C-21 -10.8 -10.8 -18 0 -18C10.8 -18 15 -9.1 15 0C15 9.1 9.1 12 0 12C-5.8 12 -9 5.8 -9 0' transform='translate(-25,2) scale(.72)'/><path d='M26 0C26 13.8 13.8 24 0 24C-12.4 24 -21 12.4 -21 0C-21 -10.8 -10.8 -18 0 -18C10.8 -18 15 -9.1 15 0C15 9.1 9.1 12 0 12C-5.8 12 -9 5.8 -9 0' transform='translate(25,2) scale(-.72,.72)'/><path d='M-42 20C-30 33 -8 33 0 22C8 33 30 33 42 20'/><path d='M-42 20C-53 11 -51 -3 -40 -10'/><path d='M42 20C53 11 51 -3 40 -10'/></g></g></svg>");

  /* —— 回纹描边带 —— */
  --meander: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='11' viewBox='0 0 22 11'><g fill='none' stroke='%23B08D4F' stroke-opacity='.65' stroke-width='1.1'><path d='M2 10V2h8v6H6.5V4.5h2'/></g></svg>");

  /* —— 宣纸与墨色 —— */
  --paper: #F2E7D2;
  --surface: #FBF5E8;
  --surface-2: #F5ECD8;
  --surface-3: #EADFC5;
  --ink: #2A231A;
  --text: #2A231A;
  --text-2: #5E5240;
  --text-3: #94866B;
  --line: #D8C5A1;
  --line-2: #C3AC85;

  /* —— 朱砂 / 鎏金 / 青绿 / 赭黄 —— */
  --primary: #A62B1F;          /* 朱砂（主色） */
  --primary-2: #C9564A;
  --primary-hover: #8C2118;
  --primary-soft: rgba(166, 43, 31, .10);
  --primary-ring: rgba(166, 43, 31, .18);

  --gold: #B08D4F;             /* 鎏金 */
  --gold-2: #8F6F35;
  --gold-soft: rgba(176, 141, 79, .16);

  --success: #2E6B5E;  --success-soft: rgba(46, 107, 94, .13);
  --warning: #A9761B;  --warning-soft: rgba(169, 118, 27, .15);
  --danger:  #A62B1F;  --danger-soft:  rgba(166, 43, 31, .12);
  --info:    #37647A;  --info-soft:    rgba(55, 100, 122, .13);
  --violet:  #6B4A7A;  --violet-soft:  rgba(107, 74, 122, .13);
  --violet-2: #9B7BA9;

  /* 图表色 */
  --c1: #A62B1F; --c2: #2E6B5E; --c3: #A9761B; --c4: #6B4A7A; --c5: #37647A;

  /* 圆角（中式框架偏方正）/ 阴影（淡而柔） */
  --r-xs: 3px; --r-sm: 4px; --r: 5px; --r-lg: 7px; --r-full: 999px;
  --sh-1: 0 1px 0 rgba(90, 70, 40, .05);
  --sh-2: 0 3px 12px rgba(90, 70, 40, .09);
  --sh-3: 0 14px 40px rgba(60, 44, 20, .22);

  --sidebar-w: 252px;
  --topbar-h: 68px;
  --gap: 18px;

  /* 正文宋体 + 标题楷体 */
  --font: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-title: "KaiTi", "STKaiti", "Kaiti SC", "楷体", "Songti SC", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --tr: .24s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- 2. 夜色模式（墨底鎏金） ---------- */
[data-theme="dark"] {
  --cloud: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='340' height='240' viewBox='0 0 340 240'><g fill='none' stroke='%23C9A86A' stroke-opacity='.14' stroke-width='1.5' stroke-linecap='round'><g transform='translate(90,78) scale(.9)'><path d='M26 0C26 13.8 13.8 24 0 24C-12.4 24 -21 12.4 -21 0C-21 -10.8 -10.8 -18 0 -18C10.8 -18 15 -9.1 15 0C15 9.1 9.1 12 0 12C-5.8 12 -9 5.8 -9 0' transform='translate(-25,2) scale(.72)'/><path d='M26 0C26 13.8 13.8 24 0 24C-12.4 24 -21 12.4 -21 0C-21 -10.8 -10.8 -18 0 -18C10.8 -18 15 -9.1 15 0C15 9.1 9.1 12 0 12C-5.8 12 -9 5.8 -9 0' transform='translate(25,2) scale(-.72,.72)'/><path d='M-42 20C-30 33 -8 33 0 22C8 33 30 33 42 20'/><path d='M-42 20C-53 11 -51 -3 -40 -10'/><path d='M42 20C53 11 51 -3 40 -10'/></g><g transform='translate(252,178) rotate(180) scale(.9)'><path d='M26 0C26 13.8 13.8 24 0 24C-12.4 24 -21 12.4 -21 0C-21 -10.8 -10.8 -18 0 -18C10.8 -18 15 -9.1 15 0C15 9.1 9.1 12 0 12C-5.8 12 -9 5.8 -9 0' transform='translate(-25,2) scale(.72)'/><path d='M26 0C26 13.8 13.8 24 0 24C-12.4 24 -21 12.4 -21 0C-21 -10.8 -10.8 -18 0 -18C10.8 -18 15 -9.1 15 0C15 9.1 9.1 12 0 12C-5.8 12 -9 5.8 -9 0' transform='translate(25,2) scale(-.72,.72)'/><path d='M-42 20C-30 33 -8 33 0 22C8 33 30 33 42 20'/><path d='M-42 20C-53 11 -51 -3 -40 -10'/><path d='M42 20C53 11 51 -3 40 -10'/></g></g></svg>");

  --paper: #15110E;
  --surface: #1E1815;
  --surface-2: #251D18;
  --surface-3: #2E241C;
  --ink: #EFE2CA;
  --text: #EFE2CA;
  --text-2: #B9A98E;
  --text-3: #887A62;
  --line: #453629;
  --line-2: #57432F;

  --primary: #C8503F;
  --primary-2: #E0705C;
  --primary-hover: #D96452;
  --primary-soft: rgba(200, 80, 63, .17);
  --primary-ring: rgba(200, 80, 63, .26);

  --gold: #D4B075; --gold-2: #B08D4F; --gold-soft: rgba(212, 176, 117, .14);

  --success: #5FA08C;  --success-soft: rgba(95, 160, 140, .15);
  --warning: #D3A24E;  --warning-soft: rgba(211, 162, 78, .15);
  --danger:  #D96452;  --danger-soft:  rgba(217, 100, 82, .15);
  --info:    #6FA2BC;  --info-soft:    rgba(111, 162, 188, .15);
  --violet:  #A98CBB;  --violet-soft:  rgba(169, 140, 187, .15);
  --violet-2: #C4B0D0;

  --sh-1: 0 1px 0 rgba(0, 0, 0, .35);
  --sh-2: 0 4px 14px rgba(0, 0, 0, .40);
  --sh-3: 0 18px 48px rgba(0, 0, 0, .62);
}

/* ---------- 3. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--text);
  background-color: var(--paper);
  /* 祥云纹暗底：整屏平铺 */
  background-image: var(--cloud);
  background-size: 340px 240px;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--tr), color var(--tr);
}
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, .brand-text b, .stat-num, .btn, .badge, .nav-label {
  font-family: var(--font-title);
  letter-spacing: .04em;
}
h1 { font-size: 25px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor;
      stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 24px; height: 24px; }

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

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

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin var(--tr);
}

/* ----- 侧边栏（墨色 + 鎏金） ----- */
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w); z-index: 60;
  display: flex; flex-direction: column;
  color: #C7B79A;
  background: linear-gradient(180deg, #2C241B 0%, #201A14 100%);
  border-right: 1px solid var(--gold-2);
  box-shadow: 2px 0 18px rgba(40, 28, 12, .18);
  transition: transform var(--tr);
}
.brand {
  display: flex; align-items: center; gap: 12px; flex: none;
  height: var(--topbar-h); padding: 0 18px;
  border-bottom: 1px solid rgba(176, 141, 79, .30);
}
/* 印章式 logo */
.brand-logo {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 4px;
  background: linear-gradient(160deg, #B93425, #8C2118);
  border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 2px rgba(255, 245, 228, .20), 0 2px 10px rgba(140, 33, 24, .45);
  color: #FBEFE0;
  font-family: var(--font-title); font-size: 21px; font-weight: 700;
  transform: rotate(-2.5deg);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-text b { font-size: 16.5px; color: #F2E4C8; white-space: nowrap; }
.brand-text i {
  font-style: normal; font-family: var(--mono);
  font-size: 10px; color: #9C8B6F; letter-spacing: .22em;
}

.nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-label {
  font-size: 12px; color: #9C8B6F; letter-spacing: .22em;
  padding: 14px 10px 7px;
}
.nav-label::after {
  content: ""; display: block; height: 1px; margin-top: 6px;
  background: linear-gradient(90deg, rgba(176, 141, 79, .45), transparent);
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin-bottom: 4px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 15px; color: #C7B79A;
  cursor: pointer; transition: all var(--tr);
}
.nav-item:hover {
  background: rgba(176, 141, 79, .12);
  border-color: rgba(176, 141, 79, .30);
  color: #F2E4C8;
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(166, 43, 31, .92), rgba(140, 33, 24, .34));
  border-color: rgba(201, 168, 106, .52);
  color: #FBEFE0;
  box-shadow: inset 0 0 0 1px rgba(255, 245, 228, .10);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -13px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 2px 2px 0;
  background: var(--gold);
}
.nav-item .nav-badge {
  margin-left: auto; min-width: 20px; height: 19px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 3px;
  background: #8C2118; color: #FBEFE0;
  font-family: var(--mono); font-size: 11px;
  border: 1px solid rgba(201, 168, 106, .45);
}
.nav-item.active .nav-badge { background: rgba(0, 0, 0, .28); }

.sidebar-user {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(176, 141, 79, .30);
  background: rgba(0, 0, 0, .18);
}
.su-meta { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; flex: 1; }
.su-meta b { font-size: 14px; color: #F2E4C8; }
.su-meta i { font-style: normal; font-size: 11.5px; color: #9C8B6F; }
.sidebar .icon-btn { color: #9C8B6F; }
.sidebar .icon-btn:hover { background: rgba(176, 141, 79, .16); color: #F2E4C8; }

/* ----- 顶部栏（宣纸 + 回纹描边） ----- */
.topbar {
  position: sticky; top: 0; z-index: 40; flex: none;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  background: var(--surface);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .topbar { background: color-mix(in srgb, var(--surface) 88%, transparent); }
}
/* 回纹装饰条 */
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px;
  height: 10px; pointer-events: none;
  background-image: var(--meander);
  background-repeat: repeat-x;
  background-position: left top;
  opacity: .55;
}
.topbar-title { font-size: 18px; font-weight: 700; white-space: nowrap; color: var(--ink); }

.search-box {
  display: flex; align-items: center; gap: 8px;
  flex: 1; max-width: 360px; height: 38px; padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-3);
  transition: all var(--tr);
}
.search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.search-box input { border: 0; background: none; outline: none; width: 100%; font-size: 13.5px; color: var(--text); }
.search-box input::placeholder { color: var(--text-3); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm); border: 1px solid transparent;
  color: var(--text-2); transition: all var(--tr);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--primary); }
.icon-btn.has-dot::after {
  content: ""; position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); border: 2px solid var(--surface);
}

/* ----- 内容区 ----- */
.content { flex: 1; padding: 26px 24px 34px; max-width: 1440px; width: 100%; }
.view { display: none; animation: fadeIn .4s cubic-bezier(.4, 0, .2, 1); }
.view.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.page-head {
  position: relative;
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding-bottom: 15px; margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.page-head::before {
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 132px; height: 2px;
  background: linear-gradient(90deg, var(--primary), rgba(166, 43, 31, 0));
}
.page-head p { color: var(--text-2); font-size: 13.5px; margin-top: 6px; }
.page-head h1 { position: relative; padding-left: 16px; }
.page-head h1::before {
  content: ""; position: absolute; left: 0; top: .28em;
  width: 5px; height: .92em; border-radius: 1px;
  background: linear-gradient(180deg, var(--primary), var(--gold-2));
}
.page-actions { margin-left: auto; display: flex; gap: 10px; }

/* ---------- 5. 卡片（四角描金 + 云纹暗底） ---------- */
.card {
  position: relative;
  background: var(--surface);
  background-image: var(--cloud);
  background-size: 340px 240px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1), inset 0 0 0 1px rgba(255, 252, 244, .55);
  padding: 20px;
  transition: box-shadow var(--tr), border-color var(--tr), background-color var(--tr);
}
[data-theme="dark"] .card { box-shadow: var(--sh-1), inset 0 0 0 1px rgba(255, 240, 210, .05); }
/* 四角金线（左上 + 右下，中式取对角） */
.card::before, .card::after {
  content: ""; position: absolute; width: 15px; height: 15px;
  border: 1px solid var(--gold); opacity: .62; pointer-events: none;
  transition: opacity var(--tr);
}
.card::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.card::after  { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }
.card.hoverable:hover { box-shadow: var(--sh-2); border-color: var(--gold); }
.card.hoverable:hover::before, .card.hoverable:hover::after { opacity: 1; }

.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2, .card-head h3 { margin-right: auto; }
.card-head h3 { position: relative; padding-left: 13px; }
.card-head h3::before {
  content: ""; position: absolute; left: 0; top: .3em;
  width: 4px; height: .85em; border-radius: 1px;
  background: var(--primary);
}
.card-title { display: flex; align-items: center; gap: 8px; }
.card-title .ic { color: var(--gold-2); }

/* ---------- 6. 栅格 ---------- */
.grid { display: grid; gap: var(--gap); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- 7. 统计卡 ---------- */
.stat { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-ico {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 4px; color: #FBF5E8;
  border: 1px solid rgba(201, 168, 106, .55);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, .18);
}
.i-blue   { background: linear-gradient(150deg, #37718C, #27506A); }
.i-green  { background: linear-gradient(150deg, #3E8271, #245A4C); }
.i-amber  { background: linear-gradient(150deg, #C08A2A, #8E6212); }
.i-violet { background: linear-gradient(150deg, #83579A, #5B3D6B); }
.i-red    { background: linear-gradient(150deg, #B93425, #8C2118); }
.stat-num { font-size: 30px; font-weight: 700; line-height: 1.25; color: var(--ink); }
.stat-label { font-size: 13.5px; color: var(--text-2); }
.stat-foot { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.spark { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin-top: 12px; }
.spark i { flex: 1; border-radius: 1px 1px 0 0; min-height: 4px; background: var(--gold-soft); }
.spark i.on { background: linear-gradient(180deg, var(--primary-2), var(--primary)); }

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 18px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 14.5px; font-weight: 700; white-space: nowrap;
  transition: all var(--tr);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #B93425, #93231A);
  color: #FBEFE0;
  border-color: var(--gold);
  box-shadow: 0 2px 10px rgba(140, 33, 24, .28), inset 0 1px 0 rgba(255, 245, 228, .22);
}
.btn-primary:hover { background: linear-gradient(180deg, #C74031, #A0281D); }
.btn-outline { border-color: var(--line-2); background: var(--surface-2); color: var(--text-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--primary); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(166, 43, 31, .3); }
.btn-danger:hover { background: var(--danger); color: #FBEFE0; }
.btn-sm { height: 32px; padding: 0 13px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---------- 9. 标签 / 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: 3px;
  font-size: 12.5px; font-weight: 700;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.b-blue   { background: var(--info-soft);    color: #37647A; }
.b-green  { background: var(--success-soft); color: var(--success); }
.b-amber  { background: var(--warning-soft); color: var(--warning); }
.b-red    { background: var(--danger-soft);  color: var(--danger); }
.b-gray   { background: var(--surface-3);    color: var(--text-2); }
.b-violet { background: var(--violet-soft);  color: var(--violet); }
[data-theme="dark"] .b-blue { color: #6FA2BC; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13px; color: var(--text-2);
}

.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2);
}
.segmented button {
  height: 30px; padding: 0 15px; border-radius: 3px;
  font-family: var(--font-title); font-size: 14px;
  color: var(--text-2); transition: all var(--tr);
}
.segmented button:hover { color: var(--primary); }
.segmented button.active {
  background: linear-gradient(180deg, #B93425, #93231A);
  color: #FBEFE0; border: 1px solid var(--gold);
}

/* ---------- 10. 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; padding: 0 20px; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th {
  text-align: left; white-space: nowrap;
  padding: 11px 14px;
  font-family: var(--font-title);
  font-size: 14px; font-weight: 700; letter-spacing: .08em;
  color: var(--gold-2);
  background: var(--surface-2);
  border-bottom: 1.5px solid var(--gold);
}
[data-theme="dark"] .table thead th { color: var(--gold); }
.table thead th:first-child { border-radius: 3px 0 0 0; }
.table thead th:last-child  { border-radius: 0 3px 0 0; }
.table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background var(--tr); }
.table tbody tr:hover { background: var(--gold-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .ta-r { text-align: right; }
.table .strong { font-weight: 700; }
.table .mono { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); letter-spacing: 0; }

/* ---------- 11. 列表 ---------- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 2px;
  border-bottom: 1px dashed var(--line);
  transition: background var(--tr);
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--gold-soft); }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-main b {
  display: block; font-family: var(--font-title); font-size: 15px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-item .li-main span { font-size: 12.5px; color: var(--text-3); }
.li-time { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

/* ---------- 12. 头像（印章式方章） ---------- */
.avatar {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 4px;
  background: linear-gradient(160deg, #B93425, #8C2118);
  border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 1px rgba(255, 245, 228, .18);
  color: #FBEFE0;
  font-family: var(--font-title); font-size: 16px; font-weight: 700;
}
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }
.avatar.lg { width: 58px; height: 58px; font-size: 24px; }
.avatar.gray { background: var(--surface-3); color: var(--text-2); border-color: var(--line); }

/* ---------- 13. 表单 ---------- */
.form-grid { display: grid; gap: 17px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label { font-family: var(--font-title); font-size: 14.5px; font-weight: 700; color: var(--text-2); }
.field > label .req { color: var(--primary); margin-left: 3px; }
.field .hint { font-size: 12px; color: var(--text-3); }

.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 14px; outline: none;
  transition: border-color var(--tr), box-shadow var(--tr), background var(--tr);
}
.textarea { height: auto; min-height: 100px; padding: 11px 13px; resize: vertical; line-height: 1.75; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold); background: var(--surface);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394866B' stroke-width='1.7' stroke-linecap='round'><path d='M4 6.5l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input-group { display: flex; align-items: center; gap: 8px; }

.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 15px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface-2);
  font-family: var(--font-title); font-size: 14.5px; color: var(--text-2);
  cursor: pointer; transition: all var(--tr);
}
.radio-row input { display: none; }
.radio-row label:hover { border-color: var(--gold); }
.radio-row label:has(input:checked) {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(166, 43, 31, .12), rgba(166, 43, 31, .05));
  color: var(--primary); font-weight: 700;
}

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.check input { display: none; }
.check .box {
  width: 19px; height: 19px; flex: none;
  border: 1.5px solid var(--line-2); border-radius: 3px;
  background: var(--surface-2);
  display: grid; place-items: center;
  transition: all var(--tr);
}
.check input:checked + .box {
  background: linear-gradient(160deg, #B93425, #8C2118);
  border-color: var(--gold);
}
.check input:checked + .box::after {
  content: ""; width: 10px; height: 6px;
  border-left: 2px solid #FBEFE0; border-bottom: 2px solid #FBEFE0;
  transform: rotate(-45deg) translate(1px, -1px);
}

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { display: none; }
.switch .track {
  position: absolute; inset: 0; border-radius: 3px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  transition: all var(--tr);
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 19px; height: 19px; border-radius: 2px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  transition: all var(--tr);
}
.switch input:checked + .track {
  background: linear-gradient(160deg, #B93425, #8C2118);
  border-color: var(--gold);
}
.switch input:checked + .track::after { transform: translateX(20px); background: #FBEFE0; border-color: var(--gold); }

.switch-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .sr-main { flex: 1; }
.switch-row .sr-main b { display: block; font-family: var(--font-title); font-size: 15px; font-weight: 700; }
.switch-row .sr-main span { font-size: 12.5px; color: var(--text-3); }

.upload {
  display: grid; place-items: center; gap: 7px;
  padding: 28px; text-align: center;
  border: 1.5px dashed var(--line-2); border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text-3); cursor: pointer;
  transition: all var(--tr);
}
.upload:hover { border-color: var(--gold); color: var(--gold-2); background: var(--gold-soft); }
.upload b { font-family: var(--font-title); font-size: 15px; font-weight: 700; color: var(--text-2); }

/* ---------- 14. 进度 / 时间线 / 空状态 ---------- */
.progress {
  height: 8px; border-radius: 2px; overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.progress > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}
.progress.green > i { background: linear-gradient(90deg, var(--success), #4E8F7E); }
.progress.amber > i { background: linear-gradient(90deg, var(--warning), #C9A154); }

.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 1px; background: var(--line-2);
}
.timeline li { position: relative; padding-bottom: 19px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -24px; top: 6px;
  width: 11px; height: 11px; border-radius: 2px;
  background: var(--surface); border: 1.5px solid var(--line-2);
  transform: rotate(45deg);
}
.timeline li.done::before { background: var(--success); border-color: var(--success); }
.timeline li.now::before  { background: var(--primary); border-color: var(--gold); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline b { display: block; font-family: var(--font-title); font-size: 15px; font-weight: 700; }
.timeline span { font-size: 12.5px; color: var(--text-3); }

.empty { display: grid; place-items: center; gap: 10px; padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty .ic { width: 40px; height: 40px; opacity: .45; }

/* ---------- 15. 图表 ---------- */
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.chart-legend i { width: 9px; height: 9px; border-radius: 1px; display: inline-block; margin-right: 6px; }
.donut { width: 150px; height: 150px; flex: none; }
.donut .track { stroke: var(--surface-3); }
.donut .val { stroke: var(--primary); transition: stroke-dasharray .8s ease; }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut-center { position: relative; }
.donut-center .num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-title); font-size: 28px; font-weight: 700; color: var(--ink);
}
.bars { display: flex; align-items: flex-end; gap: 14px; height: 172px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; height: 100%; }
.bars .bar > i {
  width: 100%; max-width: 32px; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  border: 1px solid rgba(201, 168, 106, .5);
  transition: height .7s cubic-bezier(.4, 0, .2, 1);
}
.bars .bar > span { font-family: var(--font-title); font-size: 12.5px; color: var(--text-3); }
.bars .bar.alt > i { background: linear-gradient(180deg, #7E5E8E, #5B3D6B); }

/* ---------- 16. 快捷入口 ---------- */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick a {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 16px 8px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2);
  font-family: var(--font-title); font-size: 14px; color: var(--text-2);
  transition: all var(--tr);
}
.quick a:hover {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
}
.quick a .ic { width: 22px; height: 22px; color: var(--gold-2); }
.quick a:hover .ic { color: var(--primary); }

/* ---------- 17. 日历 ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .cal-head {
  text-align: center; padding: 6px 0;
  font-family: var(--font-title); font-size: 14px; font-weight: 700;
  color: var(--gold-2);
  border-bottom: 1px solid var(--line);
}
.cal .day {
  aspect-ratio: 1 / 1; min-height: 46px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 1px solid transparent; border-radius: 3px;
  background: var(--surface-2);
  font-size: 14px; cursor: pointer; transition: all var(--tr);
}
.cal .day:hover { border-color: var(--gold); background: var(--gold-soft); }
.cal .day.mute { color: var(--text-3); opacity: .4; }
.cal .day.today { border-color: var(--gold); color: var(--primary); font-weight: 700; }
.cal .day.sel {
  background: linear-gradient(160deg, #B93425, #8C2118);
  border-color: var(--gold); color: #FBEFE0; font-weight: 700;
}
.cal .day .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.cal .day.sel .dot { background: #FBEFE0; }

/* ---------- 18. Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 36px; z-index: 200;
  transform: translate(-50%, 24px);
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, #2C241B, #1D1712);
  border: 1px solid var(--gold);
  color: #F2E4C8;
  font-family: var(--font-title); font-size: 15px;
  box-shadow: var(--sh-3);
  opacity: 0; pointer-events: none;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ic { color: var(--gold); }

/* ---------- 19. 遮罩 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(30, 22, 12, .45);
  opacity: 0; pointer-events: none;
  transition: opacity var(--tr);
}
.overlay.show { opacity: 1; pointer-events: auto; }

/* ---------- 20. 工具类 ---------- */
.muted { color: var(--text-3); font-size: 12.5px; }
.text-2 { color: var(--text-2); }
.green { color: var(--success); }
.red { color: var(--primary); }
.amber { color: var(--warning); }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.only-mobile { display: none !important; }
.divider {
  height: 1px; margin: 18px 0;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ============================================================
   21. 响应式适配
   ============================================================ */
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1023px) {
  .sidebar {
    width: 268px;
    transform: translateX(-100%);
    box-shadow: 6px 0 28px rgba(30, 20, 8, .4);
    border-right: 1px solid var(--gold);
  }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .only-mobile { display: grid !important; }
  .content { padding: 20px 16px 30px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .search-box { max-width: none; }
}

@media (max-width: 700px) {
  body { font-size: 14px; background-size: 280px 198px; }
  h1 { font-size: 21px; }
  .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  :root { --gap: 14px; }
  .content { padding: 16px 13px 30px; }
  .card { padding: 16px; background-size: 280px 198px; }
  .card::before, .card::after { width: 12px; height: 12px; top: 5px; left: 5px; }
  .card::after { top: auto; left: auto; bottom: 5px; right: 5px; }
  .page-head { align-items: flex-start; padding-bottom: 13px; margin-bottom: 17px; }
  .page-head h1 { padding-left: 13px; }
  .page-actions { margin-left: 0; width: 100%; }
  .page-actions .btn { flex: 1; }
  .search-box { display: none; }
  .topbar, .brand { height: 60px; }
  .brand-text b { font-size: 15.5px; }
  .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .quick a { padding: 12px 4px; font-size: 12.5px; gap: 6px; }
  .stat-num { font-size: 25px; }
  .stat-ico { width: 38px; height: 38px; }
  .bars { height: 145px; gap: 8px; }
  .table-wrap { margin: 0 -16px -16px; padding: 0 16px; }
  .list-item { flex-wrap: wrap; padding: 12px 0; }
  .list-item .li-main { flex: 1 1 62%; }

  /* 表格堆叠为卡片 */
  .table.responsive thead { display: none; }
  .table.responsive tbody tr {
    display: block; padding: 14px 0;
    border-bottom: 1px dashed var(--line);
  }
  .table.responsive tbody tr:last-child { border-bottom: 0; }
  .table.responsive tbody td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; padding: 5px 0; border: 0; text-align: right !important;
  }
  .table.responsive tbody td::before {
    content: attr(data-label);
    flex: none; text-align: left;
    font-family: var(--font-title); font-size: 13.5px;
    color: var(--gold-2);
  }
  .table.responsive tbody td:first-child {
    padding-bottom: 10px; font-weight: 700;
    justify-content: flex-start; text-align: left !important;
  }
  .table.responsive tbody td:first-child::before { display: none; }
  .table.responsive td .btn { margin-left: auto; }
}

@media (max-width: 420px) {
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .donut-wrap { justify-content: center; }
  .page-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .sidebar, .topbar, .page-actions { display: none !important; }
  .main { margin-left: 0; }
  body, .card { background-image: none !important; }
  .card { box-shadow: none; border-color: #ccc; }
}
