/* 翰契 · 合同管理中台 —— 新古典纸感设计系统 */

@view-transition { navigation: auto; }

:root {
  --paper: #f6f1e7;
  --paper-2: #efe7d8;
  --paper-3: #e9dfce;
  --card: #fffcf6;
  --card-2: #fbf6ec;
  --ink: #1d2621;
  --ink-2: #3f4841;
  --ink-3: #586057;
  --muted: #8a8375;
  --faint: #b3ab9c;
  --line: #e4dacb;
  --line-2: #d5c7b2;
  --gold: #a9824e;
  --gold-deep: #8c6839;
  --gold-2: #c6a876;
  --gold-3: #e7d6b8;
  --gold-wash: #f4ecde;
  --pine: #18251f;
  --pine-2: #22352c;
  --pine-3: #2c4136;
  --sage: #5f7a66;
  --sage-2: #7e9884;
  --sage-wash: #eaf0e9;
  --clay: #aa6a4e;
  --clay-wash: #f7ebe3;
  --wine: #833d3d;
  --wine-wash: #f5e7e5;
  --blue: #5c6f7a;
  --blue-wash: #eaf0f2;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --shadow: 0 30px 60px -48px rgba(52, 40, 22, 0.55);
  --shadow-lift: 0 34px 70px -44px rgba(52, 40, 22, 0.5);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --sidebar: 258px;
  --topbar: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 600px at 78% -10%, rgba(255, 253, 247, 0.9), transparent 60%),
    radial-gradient(900px 500px at 8% 100%, rgba(233, 223, 206, 0.55), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.nav-open { overflow: hidden; }

::selection { background: rgba(169, 130, 78, 0.22); color: var(--ink); }

h1, h2, h3, h4, h5, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 3px;
  border-radius: 4px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d9cdbb; border-radius: 20px; border: 3px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: #c3b298; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.serif { font-family: var(--serif); }
.money { font-family: var(--serif); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.ico { width: 16px; height: 16px; flex: 0 0 auto; }
.nowrap { white-space: nowrap; }
.mono-num { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ————— 整体骨架 ————— */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.page {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 34px 40px 28px;
  flex: 1;
  min-width: 0;
}

/* ————— 侧边栏 ————— */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--pine);
  background-image:
    radial-gradient(120% 70% at -10% 0%, rgba(198, 168, 118, 0.16), transparent 55%),
    radial-gradient(90% 70% at 110% 105%, rgba(95, 122, 102, 0.14), transparent 58%);
  color: #cfc8b8;
  border-right: 1px solid rgba(198, 168, 118, 0.16);
  z-index: 60;
  overflow: hidden;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.sidebar::after {
  content: "契";
  position: absolute;
  right: -34px;
  bottom: 54px;
  font-family: var(--serif);
  font-size: 270px;
  line-height: 1;
  color: rgba(198, 168, 118, 0.055);
  pointer-events: none;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 30px 24px 22px;
  z-index: 1;
}

.seal {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  color: var(--gold-2);
  border: 1px solid rgba(198, 168, 118, 0.55);
  background: linear-gradient(145deg, rgba(198, 168, 118, 0.14), rgba(198, 168, 118, 0.02));
}

.seal::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(198, 168, 118, 0.3);
}

.seal span {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1;
  transform: translateY(-1px);
}

.brand-text { min-width: 0; }
.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.24em;
  color: #f3ead9;
  line-height: 1.3;
  white-space: nowrap;
}
.brand-sub {
  margin-top: 4px;
  font-size: 9.5px;
  letter-spacing: 0.34em;
  color: rgba(198, 168, 118, 0.72);
}

.side-scroll {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 14px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(198, 168, 118, 0.25) transparent;
}
.side-scroll::-webkit-scrollbar { width: 4px; }
.side-scroll::-webkit-scrollbar-thumb { background: rgba(198, 168, 118, 0.25); border: 0; }

.nav-label {
  margin: 20px 12px 7px;
  font-size: 9.5px;
  letter-spacing: 0.3em;
  color: rgba(233, 220, 196, 0.3);
  white-space: nowrap;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 12px;
  margin: 2px 0;
  border-radius: 9px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #c3bcab;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-link .ico { width: 17px; height: 17px; flex: 0 0 17px; opacity: 0.62; transition: opacity 0.2s, color 0.2s; }
.nav-link:hover { color: #f2e9d9; background: rgba(255, 255, 255, 0.045); }
.nav-link:hover .ico { opacity: 0.9; }
.nav-link.is-active {
  color: #f6eedf;
  background: linear-gradient(90deg, rgba(198, 168, 118, 0.19), rgba(198, 168, 118, 0.025));
  box-shadow: inset 0 0 0 1px rgba(198, 168, 118, 0.17);
}
.nav-link.is-active .ico { color: var(--gold-2); opacity: 1; }
.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--gold-2), transparent);
}
.nav-badge {
  margin-left: auto;
  min-width: 19px;
  height: 18px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: var(--gold-2);
  color: var(--pine);
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.nav-badge--wine { background: #c98d7f; color: #2a1616; }

.side-foot {
  position: relative;
  z-index: 1;
  padding: 14px 18px 20px;
  border-top: 1px solid rgba(198, 168, 118, 0.14);
  background: linear-gradient(to top, rgba(9, 16, 12, 0.42), transparent);
}

.side-note {
  padding: 12px 13px 13px;
  border: 1px solid rgba(198, 168, 118, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  margin-bottom: 14px;
}
.side-note-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.side-note-top span { font-size: 10px; letter-spacing: 0.14em; color: rgba(233, 220, 196, 0.48); }
.side-note-top strong { font-family: var(--serif); font-size: 14px; font-weight: 500; color: #e9dcc6; }
.side-note .meter { margin: 9px 0 6px; height: 3px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.side-note .meter i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #8f6f42, var(--gold-2)); }
.side-note small { font-size: 9.5px; color: rgba(233, 220, 196, 0.36); letter-spacing: 0.04em; }

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 3px;
  border-radius: 10px;
}
.side-user:hover { background: rgba(255, 255, 255, 0.04); }
.side-user .avatar { width: 34px; height: 34px; flex-basis: 34px; font-size: 13px; }
.side-user-meta { min-width: 0; line-height: 1.4; }
.side-user-meta b { display: block; font-size: 12.5px; font-weight: 500; color: #eee4d3; letter-spacing: 0.05em; }
.side-user-meta span { display: block; font-size: 10px; color: rgba(233, 220, 196, 0.42); letter-spacing: 0.1em; }
.side-user .ico { margin-left: auto; width: 15px; height: 15px; opacity: 0.35; }

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 22, 18, 0.5);
  backdrop-filter: blur(2px);
  z-index: 55;
}

/* ————— 顶栏 ————— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar);
  flex: 0 0 var(--topbar);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 40px;
  background: rgba(246, 241, 231, 0.82);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  border-bottom: 1px solid rgba(213, 199, 178, 0.62);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}
.breadcrumb a:hover { color: var(--gold-deep); }
.breadcrumb .sep { color: var(--line-2); font-size: 10px; }
.breadcrumb b { font-weight: 500; color: var(--ink-2); }

.topbar-spacer { flex: 1; }

.search-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 286px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.62);
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.search-trigger:hover {
  border-color: var(--gold-3);
  background: var(--card);
  box-shadow: 0 8px 24px -18px rgba(80, 60, 30, 0.4);
}
.search-trigger .ico { width: 15px; height: 15px; color: var(--gold); }
.search-trigger span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keycap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--card);
  color: var(--faint);
  font-size: 10px;
  line-height: 1;
}

.top-date {
  font-family: var(--serif);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-right: 2px;
}

.top-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 252, 246, 0.6);
  color: var(--ink-3);
  transition: all 0.2s var(--ease);
}
.icon-btn:hover { background: var(--card); border-color: var(--gold-3); color: var(--gold-deep); transform: translateY(-1px); }
.icon-btn .ico { width: 17px; height: 17px; }
.icon-btn .dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wine);
  box-shadow: 0 0 0 2px var(--paper);
}
.icon-btn.is-on { background: var(--gold-wash); border-color: var(--gold-3); color: var(--gold-deep); }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2c4136, #18251f);
  color: #e9dcc6;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(198, 168, 118, 0.4);
}
.avatar--gold { background: linear-gradient(145deg, #d8bd92, #a9824e); color: #2a2115; }
.avatar--light { background: var(--gold-wash); color: var(--gold-deep); box-shadow: inset 0 0 0 1px var(--gold-3); }
.avatar--sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 12px; }
.avatar--lg { width: 46px; height: 46px; flex-basis: 46px; font-size: 16px; }
.avatar--ring { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--gold-3); }

.menu-toggle { display: none; }

/* ————— 页头 ————— */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 26px;
  position: relative;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--gold-deep);
  white-space: nowrap;
}
.eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--gold-2);
  transform: rotate(45deg);
  flex: 0 0 5px;
}
.page-title {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: 0.015em;
  color: var(--ink);
}
.page-title .accent { color: var(--gold-deep); }
.page-lede {
  margin-top: 9px;
  max-width: 700px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.head-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.page-index {
  font-family: var(--serif);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.2em;
  margin-left: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--line-2);
  white-space: nowrap;
}

/* ————— 按钮 ————— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: all 0.22s var(--ease);
  user-select: none;
}
.btn .ico { width: 15px; height: 15px; }
.btn-primary {
  background: var(--pine);
  color: #f6eddc;
  box-shadow: 0 14px 30px -20px rgba(24, 37, 31, 0.75);
}
.btn-primary:hover { background: var(--pine-2); transform: translateY(-1px); box-shadow: 0 18px 34px -20px rgba(24, 37, 31, 0.8); }
.btn-primary .ico { color: var(--gold-2); }
.btn-gold {
  background: linear-gradient(135deg, #b58e58, #96703f);
  color: #fffaf0;
  box-shadow: 0 14px 30px -20px rgba(140, 104, 57, 0.7);
}
.btn-gold:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 252, 246, 0.55);
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: var(--gold-3); background: var(--card); color: var(--gold-deep); }
.btn-quiet { color: var(--muted); padding: 0 10px; }
.btn-quiet:hover { color: var(--gold-deep); background: var(--gold-wash); }
.btn-sm { height: 33px; padding: 0 13px; font-size: 11.5px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.42; pointer-events: none; }
.btn.is-loading { pointer-events: none; opacity: 0.7; }
.btn .arrow { font-family: var(--sans); transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(3px); }

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--gold-deep);
  letter-spacing: 0.05em;
  transition: gap 0.2s;
}
.link-more:hover { gap: 9px; }
.link-more .ico { width: 13px; height: 13px; }

/* ————— 通用标签 ————— */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 23px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-weight: 500;
  vertical-align: middle;
}
.tag::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}
.tag--none::before { display: none; }
.tag--run { background: var(--sage-wash); color: #47634e; border-color: #d8e3d6; }
.tag--wait { background: var(--gold-wash); color: #8b6532; border-color: #eadcc4; }
.tag--sign { background: var(--clay-wash); color: #965a3e; border-color: #eddacd; }
.tag--muted { background: #f2eee5; color: #7c7568; border-color: #e7dfd1; }
.tag--danger { background: var(--wine-wash); color: #863f3f; border-color: #ecd5d2; }
.tag--draft { background: #f4f0e8; color: #777064; border: 1px dashed #d8cdbb; }
.tag--blue { background: var(--blue-wash); color: #526671; border-color: #dae3e7; }
.tag--outline { background: transparent; border-color: var(--line-2); color: var(--muted); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.55);
  color: var(--ink-3);
  font-size: 11.5px;
  transition: all 0.18s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--gold-3); background: var(--card); color: var(--gold-deep); }
.chip.is-active { background: var(--pine); border-color: var(--pine); color: #f3ead9; }
.chip .count { font-size: 10px; opacity: 0.6; font-variant-numeric: tabular-nums; }
.chip.is-active .count { opacity: 0.8; }
.chip .ico { width: 13px; height: 13px; }

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  background: transparent;
}

/* ————— 卡片 ————— */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card--flat { box-shadow: none; }
.card--ink {
  background: linear-gradient(150deg, #1c2b24, #121c17 72%);
  border-color: rgba(198, 168, 118, 0.22);
  color: #e9dfcc;
  overflow: hidden;
}
.card--gold {
  background: linear-gradient(145deg, #f8f1e3, #f1e5d0);
  border-color: var(--gold-3);
}
.card--flush { overflow: hidden; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}
.card-head--row { align-items: center; }
.card-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.card-title .ico { width: 16px; height: 16px; color: var(--gold); }
.card-sub { margin-top: 5px; font-size: 11px; color: var(--muted); letter-spacing: 0.03em; }
.card-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 18px 24px 24px; }
.card-body--tight { padding: 14px 24px 20px; }
.card-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}

.hairline { height: 1px; background: var(--line); border: 0; margin: 20px 0; }
.hairline--soft { background: #efe7d9; }

/* ————— 统计卡 ————— */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.stat {
  position: relative;
  padding: 20px 22px 18px;
  min-height: 128px;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--line-2); }
.stat-label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-label .ico { width: 14px; height: 14px; color: var(--gold); }
.stat-value {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.stat-value .unit { font-size: 12px; font-weight: 400; color: var(--muted); font-family: var(--sans); letter-spacing: 0.06em; }
.stat-meta { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--muted); }
.stat-index {
  position: absolute;
  right: 16px;
  bottom: 8px;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
  color: rgba(169, 130, 78, 0.11);
  pointer-events: none;
}
.stat--ink { background: linear-gradient(150deg, #22352c, #15211b 78%); border-color: rgba(198, 168, 118, 0.28); }
.stat--ink .stat-label { color: rgba(233, 220, 196, 0.56); }
.stat--ink .stat-value { color: #f3e8d5; }
.stat--ink .stat-value .unit { color: rgba(233, 220, 196, 0.55); }
.stat--ink .stat-meta { color: rgba(233, 220, 196, 0.44); }
.stat--ink .stat-index { color: rgba(198, 168, 118, 0.16); }
.stat--ink::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -58px;
  top: -62px;
  border: 1px solid rgba(198, 168, 118, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(198, 168, 118, 0.035), 0 0 0 40px rgba(198, 168, 118, 0.022);
}
.stat--gold { background: linear-gradient(150deg, #f8f0e1, #f2e5cf); border-color: var(--gold-3); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.trend--up { color: var(--sage); }
.trend--down { color: var(--wine); }
.spark { position: absolute; right: 16px; bottom: 14px; width: 100px; height: 34px; opacity: 0.4; }
.stat--ink .spark { opacity: 0.55; }

/* ————— 仪表盘大横幅 ————— */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, 0.7fr);
  gap: 24px;
  padding: 36px 40px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background:
    radial-gradient(90% 130% at 100% 0%, rgba(231, 214, 184, 0.55), transparent 58%),
    linear-gradient(118deg, #fcf8ef 0%, #f6edde 55%, #f2e6d3 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(169, 130, 78, 0.13);
  border-radius: 18px;
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 2; min-width: 0; }
.hero-title {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.hero-title .accent { color: var(--gold-deep); }
.hero-sub {
  margin-top: 12px;
  max-width: 640px;
  font-size: 12.5px;
  line-height: 2;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.hero-sub b { font-weight: 500; color: var(--gold-deep); }
.hero-actions { display: flex; align-items: center; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.hero-footnote {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.hero-footnote::before { content: ""; width: 26px; height: 1px; background: var(--gold-2); }
.hero-side {
  position: relative;
  z-index: 2;
  padding-left: 28px;
  border-left: 1px solid rgba(169, 130, 78, 0.22);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-date-label { font-size: 10px; letter-spacing: 0.28em; color: var(--gold-deep); }
.hero-day {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
}
.hero-day .num {
  font-family: var(--serif);
  font-size: 66px;
  font-weight: 500;
  line-height: 0.95;
  color: var(--pine);
  letter-spacing: -0.02em;
}
.hero-day .meta { padding-top: 12px; font-size: 11px; line-height: 1.9; color: var(--muted); letter-spacing: 0.1em; }
.hero-day .meta b { display: block; color: var(--ink-2); font-weight: 500; }
.hero-countdown {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(169, 130, 78, 0.2);
  display: flex;
  gap: 24px;
}
.hero-countdown div { line-height: 1.4; }
.hero-countdown span { display: block; font-size: 9.5px; letter-spacing: 0.12em; color: var(--muted); }
.hero-countdown b { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); }
.hero-countdown b em { font-style: normal; font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.hero-art {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 430px;
  height: 290px;
  color: rgba(169, 130, 78, 0.28);
  pointer-events: none;
  z-index: 1;
}
.hero-side { background: transparent; }
.hero-seal {
  position: absolute;
  right: 46px;
  bottom: 26px;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(131, 61, 61, 0.35);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(131, 61, 61, 0.5);
  font-family: var(--serif);
  font-size: 24px;
  transform: rotate(-8deg);
  letter-spacing: 0.05em;
  box-shadow: inset 0 0 0 4px rgba(131, 61, 61, 0.08);
  pointer-events: none;
}
.hero-seal::before {
  content: "合同专用";
  position: absolute;
  bottom: -15px;
  font-size: 7px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

/* ————— 网格 ————— */
.grid { display: grid; gap: 18px; }
.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--main { grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); align-items: start; }
.grid--wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.grid--aside { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
.grid--detail { grid-template-columns: minmax(0, 1.9fr) minmax(280px, 0.82fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-0 { margin-top: 0 !important; } .mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; }
.mt-14 { margin-top: 14px; } .mt-18 { margin-top: 18px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-10 { margin-bottom: 10px; } .mb-18 { margin-bottom: 18px; }

/* ————— 图表 ————— */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: #ece3d4; stroke-width: 1; stroke-dasharray: 2 5; }
.chart-axis { fill: var(--faint); font-size: 9.5px; font-family: var(--sans); letter-spacing: 0.04em; }
.chart-line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: var(--card); stroke: var(--gold); stroke-width: 1.6; }
.chart-peak { fill: var(--pine); stroke: var(--card); stroke-width: 2; }
.chart-baseline { stroke: var(--line-2); stroke-width: 1; }
.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 110px;
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(24, 37, 31, 0.94);
  color: #f2e8d7;
  font-size: 10.5px;
  line-height: 1.7;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%) translateY(-10px);
  transition: opacity 0.15s;
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.chart-tooltip b { font-family: var(--serif); font-size: 13px; font-weight: 500; }
.chart-tooltip.is-on { opacity: 1; }
.chart-hover-line { stroke: var(--gold-2); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0; }
.chart-hover-dot { opacity: 0; }
.chart-note {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
}
.legend { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted); }
.legend-swatch { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px; }
.legend-item b { font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { position: relative; width: 156px; height: 156px; flex: 0 0 156px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1.3;
}
.donut-center b { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--ink); }
.donut-center span { font-size: 9px; letter-spacing: 0.16em; color: var(--muted); }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--ink-3); }
.donut-legend .sw { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.donut-legend .val { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.donut-legend .val b { color: var(--ink-2); font-weight: 500; }

.bars { display: flex; flex-direction: column; gap: 15px; }
.bar-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) 62px; align-items: center; gap: 11px; font-size: 10.5px; }
.bar-row .nm { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 6px; border-radius: 6px; background: #efe7d9; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #c9ad80, #a9824e); transform-origin: left; animation: barGrow 1.1s var(--ease) both; }
.bar-row .vl { text-align: right; font-family: var(--serif); font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar-row:nth-child(even) .bar-fill { background: linear-gradient(90deg, #9fb2a2, #5f7a66); }
@keyframes barGrow { from { transform: scaleX(0); } }

/* ————— 列表与时间线 ————— */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #f0e8db;
  min-width: 0;
}
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .grow { min-width: 0; }
.list-title { font-size: 12px; color: var(--ink); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-sub { margin-top: 3px; font-size: 10px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.list-sub .dot-sep { color: var(--line-2); }
.list-amount { font-family: var(--serif); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.list-arrow { color: var(--faint); width: 14px; height: 14px; flex: 0 0 14px; }

.timeline { position: relative; padding-left: 2px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(to bottom, var(--gold-3), #ece3d4 75%, transparent);
}
.tl-item { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 5px;
  margin-left: 0.5px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--card);
}
.tl-item.is-done .tl-dot { background: var(--gold-2); border-color: var(--gold-2); box-shadow: 0 0 0 4px var(--gold-wash); }
.tl-item.is-now .tl-dot { background: var(--wine); border-color: var(--wine); box-shadow: 0 0 0 4px var(--wine-wash); }
.tl-item.is-now .tl-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(131, 61, 61, 0.35);
  border-radius: 50%;
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 0% { transform: scale(0.8); opacity: 0.8; } 70% { transform: scale(1.5); opacity: 0; } 100% { opacity: 0; } }
.tl-date { font-size: 9.5px; letter-spacing: 0.08em; color: var(--faint); font-variant-numeric: tabular-nums; }
.tl-title { margin-top: 2px; font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.tl-desc { margin-top: 4px; font-size: 10.5px; color: var(--muted); line-height: 1.7; }
.tl-item.is-done .tl-title { color: var(--ink); }
.tl-item.is-now .tl-title { color: var(--wine); font-weight: 500; }

.progress { height: 5px; border-radius: 6px; background: #efe6d7; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #c8ab7d, var(--gold)); }
.progress--sage i { background: linear-gradient(90deg, #91a997, #5f7a66); }
.progress--wine i { background: linear-gradient(90deg, #b47c74, var(--wine)); }
.progress-line { display: flex; align-items: center; gap: 9px; }
.progress-line .progress { flex: 1; }
.progress-line span { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 27px; text-align: right; }

.meter-row { display: flex; align-items: center; gap: 12px; }
.meter-row + .meter-row { margin-top: 13px; }
.meter-row .label { font-size: 10.5px; color: var(--muted); width: 66px; flex: 0 0 66px; }
.meter-row .progress { flex: 1; }
.meter-row .value { font-family: var(--serif); font-size: 11.5px; color: var(--ink-2); width: 40px; text-align: right; }

.ring { position: relative; width: 118px; height: 118px; flex: 0 0 118px; }
.ring svg { transform: rotate(-90deg); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-center b { font-family: var(--serif); font-size: 25px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.ring-center span { font-size: 8.5px; letter-spacing: 0.12em; color: var(--muted); }

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 30px;
}
.kv { padding: 13px 0; border-bottom: 1px solid #f0e8db; display: flex; gap: 14px; align-items: baseline; min-width: 0; }
.kv dt { flex: 0 0 62px; font-size: 10px; letter-spacing: 0.08em; color: var(--muted); }
.kv dd { margin: 0; font-size: 12px; color: var(--ink-2); min-width: 0; line-height: 1.65; word-break: break-word; }
.kv dd b { font-weight: 500; color: var(--ink); }

.note {
  display: flex;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid var(--gold-3);
  border-radius: var(--r-sm);
  background: var(--gold-wash);
  font-size: 11px;
  line-height: 1.8;
  color: #715633;
}
.note .ico { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 2px; color: var(--gold-deep); }
.note b { font-weight: 500; }
.note--wine { background: var(--wine-wash); border-color: #ecd5d2; color: #76403c; }
.note--wine .ico { color: var(--wine); }
.note--sage { background: var(--sage-wash); border-color: #d8e3d6; color: #46604c; }
.note--sage .ico { color: var(--sage); }

/* ————— 表格 ————— */
.table-card { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
.table { min-width: 880px; }
.table th {
  padding: 12px 16px;
  background: #faf5ea;
  border-top: 1px solid #eee5d7;
  border-bottom: 1px solid #e8dece;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}
.table th:first-child { padding-left: 24px; }
.table th:last-child { padding-right: 24px; text-align: right; }
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0e8db;
  font-size: 11.5px;
  color: var(--ink-2);
  vertical-align: middle;
}
.table td:first-child { padding-left: 24px; }
.table td:last-child { padding-right: 24px; text-align: right; }
.table tbody tr { transition: background 0.16s; }
.table tbody tr:hover { background: #fcf7ed; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.is-selected { background: #faf3e5; }
.table .cell-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.table .cell-name b { font-weight: 500; font-size: 12px; color: var(--ink); line-height: 1.55; }
.table .cell-name span { font-size: 9.5px; color: var(--faint); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.table .amount { font-family: var(--serif); font-size: 12.5px; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .amount small { font-size: 9px; color: var(--muted); font-family: var(--sans); margin-left: 2px; }
.table .actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.table .row-link { font-size: 10.5px; color: var(--gold-deep); white-space: nowrap; }
.table .row-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.table .sub { font-size: 9.5px; color: var(--faint); margin-top: 2px; }
.table--plain { min-width: 0; }
.table--plain th { background: transparent; border-top: 0; }
.table--plain td { padding-left: 0; padding-right: 0; }
.table--plain th:first-child, .table--plain td:first-child { padding-left: 0; }
.table--plain th:last-child, .table--plain td:last-child { padding-right: 0; }

.check {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  appearance: none;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--card);
  cursor: pointer;
  transition: all 0.15s;
  vertical-align: middle;
}
.check:hover { border-color: var(--gold-2); }
.check:checked { background: var(--pine); border-color: var(--pine); }
.check:checked::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid #f3e8d5;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(42deg);
}
.check[type="radio"] { border-radius: 50%; }
.check[type="radio"]:checked::after {
  left: 4px;
  top: 4px;
  width: 5px;
  height: 5px;
  border: 0;
  border-radius: 50%;
  background: #f3e8d5;
  transform: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.pager { display: flex; align-items: center; gap: 4px; }
.pager button {
  min-width: 29px;
  height: 29px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 11px;
  color: var(--muted);
  transition: all 0.15s;
}
.pager button:hover { border-color: var(--line); background: var(--card); color: var(--ink); }
.pager button.is-active { background: var(--pine); border-color: var(--pine); color: #f3e8d5; }
.pager button[disabled] { opacity: 0.35; pointer-events: none; }

.bulkbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: var(--gold-wash);
  border-top: 1px solid var(--gold-3);
  border-bottom: 1px solid var(--gold-3);
  font-size: 11px;
  color: var(--gold-deep);
}
.bulkbar b { font-weight: 600; font-variant-numeric: tabular-nums; }
.bulkbar .btn { margin-left: 4px; }
.bulkbar .spacer { flex: 1; }

.filters {
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}
.filter-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.filter-field > label { font-size: 9px; letter-spacing: 0.12em; color: var(--muted); padding-left: 2px; }
.filter-search { position: relative; flex: 1 1 220px; min-width: 180px; }
.filter-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); pointer-events: none; }
.filter-search input { padding-left: 34px; width: 100%; }

.input, .select, .textarea {
  height: 38px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.8);
  font-size: 11.5px;
  color: var(--ink-2);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold-2);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(169, 130, 78, 0.11);
}
.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8375' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.8; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.03em; display: flex; gap: 5px; align-items: baseline; }
.field > label .req { color: var(--wine); font-size: 10px; }
.field .hint { font-size: 9.5px; color: var(--faint); line-height: 1.6; }
.field .with-unit { position: relative; }
.field .with-unit .input { padding-right: 46px; }
.field .with-unit .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 10px; color: var(--muted); pointer-events: none; }
.input--sm, .select--sm { height: 33px; font-size: 11px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  font-size: 10.5px;
  color: var(--ink-3);
  transition: all 0.16s;
}
.chip-toggle:hover { border-color: var(--gold-3); }
.chip-toggle.is-on { background: var(--gold-wash); border-color: var(--gold-3); color: var(--gold-deep); }
.chip-toggle .ico { width: 12px; height: 12px; }

/* ————— 标签页 / 分段控件 ————— */
.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 15px;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.18s;
}
.tab:hover { color: var(--ink-2); }
.tab.is-active { color: var(--ink); font-weight: 500; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.tab .count {
  min-width: 17px;
  height: 16px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--paper-2);
  font-size: 9px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tab.is-active .count { background: var(--gold-wash); color: var(--gold-deep); }

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(239, 231, 216, 0.5);
  gap: 2px;
}
.segmented button {
  height: 28px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--muted);
  transition: all 0.18s;
  white-space: nowrap;
}
.segmented button:hover { color: var(--ink-2); }
.segmented button.is-active { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px -4px rgba(50, 40, 20, 0.35); }

/* ————— 步骤条 ————— */
.steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 4px 6px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.steps::-webkit-scrollbar { display: none; }
.step {
  position: relative;
  flex: 1;
  min-width: 118px;
  padding: 0 8px 20px;
  text-align: center;
}
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 16px;
  left: calc(50% + 22px);
  right: calc(-50% + 22px);
  height: 1px;
  background: var(--line);
}
.step.is-done:not(:last-child)::after { background: linear-gradient(90deg, var(--gold-2), var(--gold-3)); }
.step .num {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--serif);
  font-size: 12px;
  color: var(--muted);
  transition: all 0.2s;
}
.step.is-active .num { background: var(--pine); border-color: var(--pine); color: #f3e8d5; box-shadow: 0 0 0 4px var(--gold-wash); }
.step.is-done .num { background: var(--gold-wash); border-color: var(--gold-2); color: var(--gold-deep); }
.step .txt { margin-top: 8px; font-size: 10.5px; color: var(--faint); letter-spacing: 0.06em; white-space: nowrap; }
.step.is-active .txt { color: var(--ink); }
.step.is-done .txt { color: var(--ink-3); }
.step .sub { display: block; margin-top: 2px; font-size: 8.5px; color: var(--faint); letter-spacing: 0.02em; }

/* ————— 审批 / 详情 ————— */
.approval-layout { display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 18px; align-items: start; }
.approval-list { padding: 8px; }
.approval-item {
  width: 100%;
  text-align: left;
  display: block;
  padding: 14px 14px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: all 0.18s;
  position: relative;
}
.approval-item:hover { background: var(--card-2); border-color: var(--line); }
.approval-item.is-active { background: #faf4e7; border-color: var(--gold-3); box-shadow: inset 3px 0 0 var(--gold-2); }
.approval-item + .approval-item { margin-top: 2px; }
.ap-top { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.ap-title { font-size: 12px; font-weight: 500; color: var(--ink); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-meta { margin-top: 6px; display: flex; align-items: center; gap: 7px; font-size: 9.5px; color: var(--muted); flex-wrap: wrap; }
.ap-bottom { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ap-amount { font-family: var(--serif); font-size: 13px; color: var(--ink-2); }
.ap-sla { font-size: 9px; letter-spacing: 0.04em; color: var(--wine); background: var(--wine-wash); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.ap-sla--calm { color: var(--muted); background: #f2eee5; }
.approval-detail { min-height: 500px; }
.approval-hero { padding: 26px 28px 22px; border-bottom: 1px solid var(--line); position: relative; }
.approval-hero h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.45; max-width: 680px; }
.approval-hero .meta { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); }
.approval-hero .amount { position: absolute; right: 28px; bottom: 24px; text-align: right; }
.approval-hero .amount b { font-family: var(--serif); font-size: 25px; font-weight: 600; color: var(--ink); display: block; line-height: 1.2; }
.approval-hero .amount span { font-size: 9px; color: var(--muted); letter-spacing: 0.1em; }
.flow { display: flex; flex-direction: column; gap: 0; }
.flow-node { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; }
.flow-node:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 50px;
  bottom: -2px;
  width: 1px;
  background: var(--line);
}
.flow-node.is-done:not(:last-child)::before { background: var(--gold-3); }
.flow-node .avatar { margin-top: 1px; }
.flow-name { font-size: 12px; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flow-role { font-size: 9.5px; color: var(--faint); margin-top: 2px; }
.flow-comment { margin-top: 7px; padding: 9px 11px; border-radius: 8px; background: var(--card-2); border: 1px solid #efe6d7; font-size: 10.5px; color: var(--ink-3); line-height: 1.75; }
.flow-time { font-size: 9px; color: var(--faint); white-space: nowrap; padding-top: 3px; }
.flow-node.is-wait .flow-name { color: var(--muted); }
.flow-node.is-wait .avatar { opacity: 0.55; }
.approval-actions {
  padding: 16px 28px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  background: #fdf9f1;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.approval-actions .note-inline { margin-left: auto; font-size: 9.5px; color: var(--faint); }

.person-card { display: flex; align-items: center; gap: 12px; }
.person-name { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.person-meta { font-size: 9.5px; color: var(--muted); margin-top: 2px; }

.attachment {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border: 1px solid #efe6d7;
  border-radius: 9px;
  background: #fdf9f1;
  transition: all 0.18s;
}
.attachment:hover { border-color: var(--gold-3); background: var(--card); }
.attachment .ext {
  width: 30px;
  height: 36px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--gold-wash);
  color: var(--gold-deep);
  font-family: var(--serif);
  font-size: 10px;
  border: 1px solid var(--gold-3);
}
.attachment .nm { font-size: 10.5px; color: var(--ink-2); line-height: 1.5; }
.attachment .sz { font-size: 8.5px; color: var(--faint); margin-top: 2px; }
.attachment .ico { width: 13px; height: 13px; color: var(--faint); margin-left: auto; }

/* ————— 签署 / 看板 ————— */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; }
.kanban-col {
  background: rgba(239, 231, 216, 0.38);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  min-width: 0;
}
.kanban-head { display: flex; align-items: center; gap: 7px; padding: 2px 3px 12px; }
.kanban-head h3 { font-family: var(--serif); font-size: 13px; font-weight: 600; }
.kanban-head .count {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 9px;
  color: var(--muted);
}
.kcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px;
  transition: all 0.2s var(--ease);
}
.kcard + .kcard { margin-top: 9px; }
.kcard:hover { transform: translateY(-2px); box-shadow: 0 18px 32px -26px rgba(60, 45, 25, 0.5); border-color: var(--line-2); }
.kcard .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.kcard h4 { font-size: 11.5px; font-weight: 500; color: var(--ink); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard .party { font-size: 9.5px; color: var(--muted); margin-top: 6px; }
.kcard .kmeta { margin-top: 9px; padding-top: 9px; border-top: 1px dashed #eee4d5; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kcard .kamount { font-family: var(--serif); font-size: 12px; color: var(--ink-2); }
.kcard .kdate { font-size: 9px; color: var(--faint); }
.kcard .kfoot { margin-top: 9px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kavatar-stack { display: flex; }
.kavatar-stack .avatar { width: 22px; height: 22px; flex-basis: 22px; font-size: 9px; margin-left: -6px; box-shadow: 0 0 0 2px var(--card); }
.kavatar-stack .avatar:first-child { margin-left: 0; }
.kempty { padding: 26px 10px; text-align: center; font-size: 10px; color: var(--faint); border: 1px dashed var(--line-2); border-radius: 9px; }

.seal-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  background: #fdf9f1;
}
.seal-print {
  width: 92px;
  height: 92px;
  border: 2px solid rgba(131, 61, 61, 0.55);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 17px;
  color: rgba(131, 61, 61, 0.72);
  transform: rotate(-7deg);
  box-shadow: inset 0 0 0 4px rgba(131, 61, 61, 0.12);
  line-height: 1.3;
  text-align: center;
  letter-spacing: 0.08em;
}
.seal-print--block { border-radius: 6px; font-size: 14px; }
.seal-box .cap { font-size: 9px; color: var(--faint); letter-spacing: 0.12em; }

/* ————— 日历 ————— */
.calendar { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cal-title { font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: 0.08em; }
.cal-nav { display: flex; gap: 4px; }
.cal-nav button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--card);
}
.cal-nav button:hover { border-color: var(--gold-3); color: var(--gold-deep); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-week { text-align: center; padding: 5px 0 8px; font-size: 9.5px; letter-spacing: 0.1em; color: var(--muted); }
.cal-day {
  position: relative;
  aspect-ratio: auto;
  height: 46px;
  min-height: 0;
  padding: 5px 4px 3px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-family: var(--serif);
  font-size: 12px;
  color: var(--ink-2);
  text-align: center;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.cal-day:hover { background: var(--gold-wash); border-color: var(--gold-3); }
.cal-day.is-other { color: var(--faint); opacity: 0.55; }
.cal-day.is-today { background: var(--pine); color: #f3e8d5; border-color: var(--pine); }
.cal-day.is-today:hover { background: var(--pine-2); }
.cal-day.is-selected { box-shadow: inset 0 0 0 1px var(--gold-2); background: var(--gold-wash); color: var(--gold-deep); }
.cal-day.is-today.is-selected { background: var(--pine); color: #f3e8d5; }
.cal-dots { display: flex; gap: 2px; height: 4px; }
.cal-dots i { width: 3px; height: 3px; border-radius: 50%; background: var(--gold); }
.cal-dots i.t-wine { background: var(--wine); }
.cal-dots i.t-sage { background: var(--sage); }
.cal-dots i.t-clay { background: var(--clay); }
.cal-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f0e8db; font-size: 9px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }

/* ————— 文件纸页预览 ————— */
.paper {
  position: relative;
  background: #fffef9;
  border: 1px solid #e8ddcb;
  box-shadow: 0 22px 50px -40px rgba(60, 45, 25, 0.55);
  padding: 34px 36px;
  border-radius: 2px;
}
.paper::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(169, 130, 78, 0.14);
  pointer-events: none;
}
.paper-kicker { text-align: center; font-size: 8.5px; letter-spacing: 0.34em; color: var(--faint); }
.paper h3 {
  margin-top: 14px;
  text-align: center;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink);
}
.paper .paper-meta { margin-top: 10px; text-align: center; font-size: 8.5px; color: var(--faint); letter-spacing: 0.1em; }
.paper .rule-double { height: 4px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line); margin: 18px 0; }
.paper p { font-family: var(--serif); font-size: 10.5px; line-height: 2.15; color: var(--ink-3); text-align: justify; text-indent: 2em; }
.paper .clause-title { margin-top: 12px; font-family: var(--serif); font-size: 11.5px; font-weight: 600; color: var(--ink); }
.paper .sign-area { display: flex; justify-content: space-between; gap: 20px; margin-top: 30px; }
.paper .sign-block { flex: 1; font-size: 9px; color: var(--muted); line-height: 2.1; }
.paper .sign-block b { display: block; font-family: var(--serif); font-size: 10.5px; color: var(--ink-2); margin-bottom: 4px; }
.paper .paper-seal {
  position: absolute;
  right: 44px;
  bottom: 62px;
  width: 70px;
  height: 70px;
  border: 2px solid rgba(131, 61, 61, 0.4);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 11px;
  color: rgba(131, 61, 61, 0.55);
  transform: rotate(-11deg);
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0.06em;
}
.paper-preview { max-height: 440px; overflow: hidden; position: relative; }
.paper-preview::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 90px;
  background: linear-gradient(to bottom, transparent, var(--card));
}

/* ————— 勾选清单 ————— */
.checklist { display: flex; flex-direction: column; gap: 9px; }
.check-item { display: flex; align-items: flex-start; gap: 9px; font-size: 11px; color: var(--ink-3); line-height: 1.65; cursor: pointer; }
.check-item input { margin-top: 3px; }
.check-item b { font-weight: 500; color: var(--ink); }

/* ————— 开关 ————— */
.switch { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; z-index: 1; }
.switch .track {
  width: 34px;
  height: 19px;
  border-radius: 20px;
  background: #dcd2c2;
  transition: background 0.2s;
  position: relative;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 1px 3px rgba(60, 45, 25, 0.3);
  transition: transform 0.2s var(--ease);
}
.switch input:checked + .track { background: var(--pine); }
.switch input:checked + .track::after { transform: translateX(15px); }
.switch input:focus-visible + .track { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* ————— 角色 / 权限 ————— */
.role-list { display: flex; flex-direction: column; gap: 8px; }
.role-card {
  text-align: left;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  transition: all 0.18s;
}
.role-card:hover { border-color: var(--gold-3); background: #fdf9f1; }
.role-card.is-active { border-color: var(--gold-2); background: var(--gold-wash); box-shadow: inset 3px 0 0 var(--gold-2); }
.role-card .role-name { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--ink); }
.role-card .role-desc { margin-top: 4px; font-size: 9.5px; color: var(--muted); line-height: 1.6; }
.role-card .role-count { margin-top: 6px; font-size: 8.5px; color: var(--faint); }

.matrix-wrap { overflow-x: auto; }
.matrix { min-width: 640px; }
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix td { padding-top: 11px; padding-bottom: 11px; }
.matrix tbody tr:hover { background: #fcf7ed; }

.tree { font-size: 11px; }
.tree-item { display: flex; align-items: center; gap: 7px; padding: 7px 8px; border-radius: 7px; color: var(--ink-3); }
.tree-item:hover { background: var(--card-2); }
.tree-item.is-active { background: var(--gold-wash); color: var(--gold-deep); }
.tree-item .ico { width: 13px; height: 13px; color: var(--faint); }
.tree-item .count { margin-left: auto; font-size: 9px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tree-children { margin-left: 16px; padding-left: 10px; border-left: 1px solid var(--line); }

/* ————— 子导航 / 设置 ————— */
.subnav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: sticky;
  top: calc(var(--topbar) + 20px);
}
.subnav a {
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted);
  border-left: 2px solid transparent;
  transition: all 0.16s;
}
.subnav a:hover { color: var(--ink-2); background: var(--card-2); }
.subnav a.is-active { color: var(--gold-deep); background: var(--gold-wash); border-left-color: var(--gold-2); }
.setting-section { scroll-margin-top: calc(var(--topbar) + 24px); }
.setting-section + .setting-section { margin-top: 18px; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid #f0e8db;
}
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-row .st { min-width: 0; }
.setting-row .st b { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.setting-row .st span { display: block; margin-top: 3px; font-size: 9.5px; color: var(--muted); line-height: 1.7; }
.setting-row .sc { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

.integration {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: all 0.18s;
}
.integration:hover { border-color: var(--gold-3); background: #fdf9f1; }
.integration .logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--gold-wash);
  color: var(--gold-deep);
  font-family: var(--serif);
  font-size: 16px;
  border: 1px solid var(--gold-3);
}
.integration .nm { font-size: 11.5px; font-weight: 500; color: var(--ink); }
.integration .ds { font-size: 9px; color: var(--muted); margin-top: 2px; }

/* ————— 模板卡 ————— */
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tpl {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  padding: 14px;
  text-align: left;
  transition: all 0.22s var(--ease);
  overflow: hidden;
}
.tpl:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--line-2); }
.tpl.is-selected { border-color: var(--gold-2); box-shadow: 0 0 0 1px var(--gold-2), var(--shadow); }
.tpl.is-selected::after {
  content: "已选";
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--gold);
  color: #fffaf0;
  font-size: 8.5px;
  letter-spacing: 0.08em;
}
.doc-mini {
  height: 132px;
  border: 1px solid #eee4d5;
  border-radius: 6px;
  background: #fffef9;
  padding: 16px 15px;
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}
.doc-mini::before {
  content: "";
  position: absolute;
  left: 14px; right: 14px; top: 14px;
  height: 5px;
  background: #ddd0bb;
  border-radius: 2px;
  box-shadow:
    0 12px 0 -1px #e8dfd1, 0 12px 0 0 #e8dfd1,
    0 22px 0 -1px #e8dfd1, 0 22px 0 0 #e8dfd1,
    0 42px 0 -1px #ede5d8, 0 42px 0 0 #ede5d8,
    0 52px 0 -1px #ede5d8, 0 52px 0 0 #ede5d8,
    0 72px 0 -1px #ede5d8, 0 72px 0 0 #ede5d8;
}
.doc-mini::after {
  content: "契";
  position: absolute;
  right: 17px;
  bottom: 12px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(131, 61, 61, 0.3);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 10px;
  color: rgba(131, 61, 61, 0.45);
  transform: rotate(-10deg);
}
.doc-mini .mini-tag {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 2px 6px;
  background: var(--gold-wash);
  border-radius: 3px;
  font-size: 7.5px;
  letter-spacing: 0.06em;
  color: var(--gold-deep);
}
.tpl-name { font-family: var(--serif); font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.55; }
.tpl-meta { margin-top: 5px; display: flex; align-items: center; gap: 8px; font-size: 9px; color: var(--muted); flex-wrap: wrap; }
.tpl-actions { margin-top: 11px; padding-top: 10px; border-top: 1px dashed #eee4d5; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tpl-use { font-size: 10px; color: var(--gold-deep); }
.tpl-fav { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--faint); }
.tpl-fav:hover { background: var(--wine-wash); color: var(--wine); }
.tpl-fav .ico { width: 12px; height: 12px; }
.tpl-fav.is-on { color: var(--wine); }

/* ————— 上传 ————— */
.upload {
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(231, 214, 184, 0.25), transparent 66%),
    #fdfaf3;
  transition: all 0.2s;
  cursor: pointer;
}
.upload:hover { border-color: var(--gold-2); background-color: var(--gold-wash); }
.upload .ico { width: 22px; height: 22px; margin: 0 auto 8px; color: var(--gold); }
.upload b { display: block; font-size: 11px; font-weight: 500; color: var(--ink-2); }
.upload span { display: block; margin-top: 3px; font-size: 9px; color: var(--faint); }

/* ————— 命令面板 / 弹层 ————— */
.dialog {
  border: 0;
  padding: 0;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: 0 40px 100px -30px rgba(20, 26, 22, 0.5);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  color: var(--ink);
}
.dialog::backdrop { background: rgba(22, 30, 26, 0.46); backdrop-filter: blur(4px); }
.dialog[open] { animation: dialogIn 0.22s var(--ease); }
@keyframes dialogIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.dialog-head { padding: 22px 24px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.dialog-title { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.dialog-sub { margin-top: 4px; font-size: 10.5px; color: var(--muted); }
.dialog-body { padding: 18px 24px 22px; }
.dialog-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 9px; background: #fdf9f1; }
.dialog-close { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.dialog-close:hover { background: var(--paper-2); color: var(--ink); }

.palette {
  width: min(590px, calc(100vw - 32px));
  margin-top: 12vh;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 0;
  background: var(--card);
  box-shadow: 0 50px 120px -30px rgba(20, 26, 22, 0.6);
  color: var(--ink);
}
.palette::backdrop { background: rgba(22, 30, 26, 0.42); backdrop-filter: blur(5px); }
.palette[open] { animation: dialogIn 0.2s var(--ease); }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.palette-search .ico { width: 18px; height: 18px; color: var(--gold); flex: 0 0 18px; }
.palette-search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 13px; }
.palette-search input::placeholder { color: var(--faint); }
.palette-search .keycap { font-size: 9px; }
.palette-body { max-height: 56vh; overflow-y: auto; padding: 10px; }
.palette-label { padding: 8px 10px 5px; font-size: 9px; letter-spacing: 0.2em; color: var(--faint); }
.palette-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  text-align: left;
  transition: background 0.14s;
}
.palette-item:hover { background: var(--gold-wash); }
.palette-item .ico { width: 15px; height: 15px; color: var(--gold); flex: 0 0 15px; }
.palette-item b { font-size: 11.5px; font-weight: 400; color: var(--ink-2); }
.palette-item span { margin-left: auto; font-size: 9px; color: var(--faint); }
.palette-empty { padding: 30px 10px; text-align: center; font-size: 11px; color: var(--faint); }
.palette-foot { display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 9px; color: var(--faint); }

.popover-panel {
  position: fixed;
  inset: auto;
  top: 72px;
  right: 82px;
  left: auto;
  width: 340px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 30px 80px -30px rgba(20, 26, 22, 0.5);
  color: var(--ink);
  z-index: 200;
}
.popover-panel:popover-open { animation: dialogIn 0.18s var(--ease); }
.popover-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.popover-head b { font-family: var(--serif); font-size: 13px; font-weight: 600; }
.popover-head button { font-size: 9.5px; color: var(--gold-deep); }
.popover-body { padding: 6px; max-height: 330px; overflow-y: auto; }
.notice-item { display: flex; gap: 10px; padding: 10px; border-radius: 8px; width: 100%; text-align: left; }
.notice-item:hover { background: var(--card-2); }
.notice-item .ico { width: 15px; height: 15px; color: var(--gold); flex: 0 0 15px; margin-top: 2px; }
.notice-item b { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-2); line-height: 1.55; }
.notice-item span { display: block; margin-top: 2px; font-size: 9px; color: var(--muted); }
.notice-item time { display: block; margin-top: 3px; font-size: 8.5px; color: var(--faint); }
.popover-foot { padding: 9px 16px; border-top: 1px solid var(--line); text-align: center; }
.popover-foot a { font-size: 9.5px; color: var(--gold-deep); }

.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 500; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 250px;
  max-width: 380px;
  padding: 12px 15px;
  border: 1px solid rgba(198, 168, 118, 0.25);
  border-left: 3px solid var(--gold-2);
  border-radius: 10px;
  background: rgba(24, 37, 31, 0.97);
  color: #eee4d3;
  font-size: 11px;
  line-height: 1.65;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.3s var(--ease);
  pointer-events: auto;
}
.toast.is-out { animation: toastOut 0.25s var(--ease) forwards; }
.toast .ico { width: 15px; height: 15px; color: var(--gold-2); flex: 0 0 15px; margin-top: 1px; }
.toast b { display: block; font-weight: 500; color: #f7eedd; }
.toast span { color: rgba(233, 220, 196, 0.6); font-size: 9.5px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ————— 页脚 / 其他 ————— */
.footer {
  max-width: 1540px;
  margin: 0 auto;
  width: 100%;
  padding: 22px 40px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(213, 199, 178, 0.5);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--faint);
}
.footer .f-brand { font-family: var(--serif); color: var(--muted); letter-spacing: 0.18em; }

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .ico { width: 34px; height: 34px; margin: 0 auto 12px; color: var(--line-2); }
.empty b { display: block; font-family: var(--serif); font-size: 14px; font-weight: 500; color: var(--ink-3); }
.empty span { display: block; margin-top: 5px; font-size: 10px; color: var(--faint); }

.check-line { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-3); white-space: nowrap; }

.page-stamp {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 84px;
  height: 84px;
  border: 1px solid rgba(131, 61, 61, 0.22);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  color: rgba(131, 61, 61, 0.38);
  transform: rotate(-9deg);
  pointer-events: none;
  letter-spacing: 0.08em;
}

/* ————— 动效 ————— */
.reveal { transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeUp 0.6s var(--ease) both; }
.delay-1 { animation-delay: 0.06s; } .delay-2 { animation-delay: 0.12s; }
.delay-3 { animation-delay: 0.18s; } .delay-4 { animation-delay: 0.24s; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* ————— 紧凑密度 ————— */
body.compact .page { padding-top: 22px; }
body.compact .page-head { margin-bottom: 18px; }
body.compact .stat { min-height: 108px; padding: 16px 18px; }
body.compact .stat-value { font-size: 27px; margin-top: 7px; }
body.compact .table td { padding-top: 10px; padding-bottom: 10px; }
body.compact .card-head { padding-top: 18px; }
body.compact .card-body { padding-top: 14px; padding-bottom: 18px; }
body.compact .hero { padding: 28px 34px; }
body.compact .hero-title { font-size: 33px; }
body.compact .grid { gap: 14px; }

/* ————— 响应式 ————— */
@media (max-width: 1360px) {
  :root { --sidebar: 240px; }
  .page { padding-left: 30px; padding-right: 30px; }
  .topbar { padding: 0 30px; }
  .search-trigger { width: 240px; }
  .hero-art { right: -70px; opacity: 0.8; }
  .footer { padding-left: 30px; padding-right: 30px; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 272px;
    transform: translateX(-102%);
    transition: transform 0.32s var(--ease);
    box-shadow: 30px 0 80px -30px rgba(0, 0, 0, 0.5);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-scrim { display: block; }
  .menu-toggle { display: inline-grid; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--main, .grid--wide, .grid--detail, .grid--aside { grid-template-columns: minmax(0, 1fr); }
  .approval-layout { grid-template-columns: 1fr; }
  .approval-detail { min-height: 0; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr) 240px; }
  .hero-art { display: none; }
  .hero-seal { display: none; }
  .hero-title { font-size: 34px; }
  .top-date { display: none; }
  .subnav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .subnav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .subnav a.is-active { border-left: 0; border-bottom-color: var(--gold-2); }
}

@media (max-width: 860px) {
  .page { padding: 24px 20px; }
  .topbar { padding: 0 20px; height: 66px; flex-basis: 66px; }
  .footer { padding: 18px 20px 26px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .breadcrumb { max-width: 38vw; overflow: hidden; }
  .breadcrumb span:not(.sep), .breadcrumb a { overflow: hidden; text-overflow: ellipsis; }
  .breadcrumb a:first-child, .breadcrumb .sep:first-of-type { display: none; }
  .search-trigger { width: 40px; padding: 0; justify-content: center; border-radius: 50%; }
  .search-trigger span, .search-trigger .keycap { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .head-actions { width: 100%; justify-content: flex-start; }
  .page-title { font-size: 30px; }
  .hero { grid-template-columns: 1fr; padding: 28px 24px; }
  .hero-side { border-left: 0; padding-left: 0; border-top: 1px solid rgba(169, 130, 78, 0.22); padding-top: 18px; }
  .hero-day .num { font-size: 52px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { min-height: 112px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .template-grid { grid-template-columns: minmax(0, 1fr); }
  .kanban { grid-template-columns: minmax(0, 1fr); }
  .kv-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .approval-hero .amount { position: static; text-align: left; margin-top: 12px; }
  .approval-hero h2 { font-size: 19px; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
  .donut-legend { width: 100%; }
  .step { min-width: 100px; }
  .step .sub { display: none; }
  .paper { padding: 24px 20px; }
  .page-stamp { display: none; }
}

@media (max-width: 560px) {
  .cal-day { height: 38px; font-size: 10.5px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-height: 104px; padding: 16px 15px; }
  .stat-value { font-size: 25px; }
  .hero { padding: 24px 18px; }
  .hero-title { font-size: 27px; }
  .hero-sub { font-size: 11.5px; }
  .hero-day .num { font-size: 46px; }
  .page-title { font-size: 26px; }
  .page-lede { font-size: 11.5px; }
  .page { padding: 20px 14px; }
  .topbar { padding: 0 14px; gap: 9px; }
  .footer { padding-left: 14px; padding-right: 14px; }
  .top-actions { gap: 5px; }
  .icon-btn { width: 34px; height: 34px; }
  .avatar { width: 34px; height: 34px; flex-basis: 34px; }
  .breadcrumb { display: none; }
  .card-head, .card-body, .card-foot { padding-left: 18px; padding-right: 18px; }
  .pagination { padding-left: 18px; padding-right: 18px; }
  .filters { padding: 14px; }
  .table th:first-child, .table td:first-child { padding-left: 18px; }
  .table th:last-child, .table td:last-child { padding-right: 18px; }
  .kanban { gap: 10px; }
  .toast-stack { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; }
  .popover-panel { right: 14px; width: calc(100vw - 28px); }
  .head-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
