/*
 * 奶油焦糖 Cream Caramel — Design System CSS v1.0
 * 从 index.html 自动抽取，与文档页保持一致
 * Extracted from index.html to stay in sync with the living doc.
 * 结构：L1 原始色板 Primitive -> L2 语义令牌 Semantic -> 基础 Base -> 组件 Components
 */

/* ============================================================
   奶油焦糖 Cream Caramel — Design System CSS v1.0
   人格：温暖 · 手作 · 有食欲感的可爱
   Warm, handcrafted, appetizingly cute.
   结构 Structure：L1 原始色板 Primitive → L2 语义令牌 Semantic → 基础 Base → 组件 Components
   组件只消费语义令牌，深色模式仅重写 L2
   Components consume semantic tokens only; dark mode rewrites L2 only.
   ============================================================ */

/* ---------- L1 原始色板 Primitive Tokens ---------- */
:root {
  --cream-50:  #FDF9F2;
  --cream-100: #FBF3E6;
  --cream-200: #F7E7CF;
  --cream-300: #F5D9B0;   /* 奶油 Cream · 品牌色 brand */
  --cream-400: #EFC68D;
  --caramel-500: #E3A868; /* 焦糖 Caramel · 品牌主色 primary */
  --caramel-600: #CE8F49;
  --toffee-700: #B97C56;  /* 太妃 Toffee · 品牌色 brand */
  --toffee-800: #9C6242;
  --cocoa-850: #80604A;
  --cocoa-900: #7C4A2D;   /* 可可 Cocoa · 品牌色 brand */
  --cocoa-950: #5C3A26;   /* 深可可 Deep cocoa · 主文字 primary text */

  --green-solid: #3F7A52; --green-text: #35674A; --green-bg: #E9F2EA; --green-border: #C4DCC9;
  --amber-solid: #B58423; --amber-text: #8F5A0D; --amber-bg: #FBF0DC; --amber-border: #EFD9AC;
  --red-solid:   #B03A2E; --red-text:   #B03A2E; --red-bg:   #F9E7E4; --red-border:   #EFC9C3;
  --blue-solid:  #4F6B8A; --blue-text:  #4F6B8A; --blue-bg:  #E9EFF4; --blue-border:  #C9D8E4;
}

/* ---------- L2 语义令牌 · 浅色 Semantic Tokens · Light ---------- */
:root {
  --bg-page: var(--cream-100);
  --bg-surface: var(--cream-50);
  --bg-subtle: var(--cream-200);
  --bg-inset: var(--cream-300);
  --bg-accent-soft: var(--cream-200);

  --text-primary: var(--cocoa-950);
  --text-secondary: var(--cocoa-850);
  --text-placeholder: #8A6C54;
  --text-disabled: #B0977F;
  --text-on-cta: #FFFFFF;
  --text-on-accent: var(--cocoa-950);

  --border: #E9D6BD;
  --border-strong: #D9BE9A;

  --primary: var(--caramel-500);
  --primary-hover: var(--cream-400);
  --primary-active: var(--cream-300);
  --primary-subtle: var(--cream-200);
  --accent: var(--toffee-700);
  --accent-hover: var(--toffee-800);
  --link: var(--cocoa-900);
  --link-hover: var(--toffee-800);

  --cta-bg: var(--cocoa-900);
  --cta-text: var(--text-on-cta);
  --cta-hover-bg: #6A3F23;
  --cta-active-bg: #57311C;

  --success-solid: var(--green-solid); --success-text: var(--green-text); --success-bg: var(--green-bg); --success-border: var(--green-border);
  --warning-solid: var(--amber-solid); --warning-text: var(--amber-text); --warning-bg: var(--amber-bg); --warning-border: var(--amber-border);
  --error-solid:   var(--red-solid);   --error-text:   var(--red-text);   --error-bg:   var(--red-bg);   --error-border:   var(--red-border);
  --info-solid:    var(--blue-solid);  --info-text:    var(--blue-text);  --info-bg:    var(--blue-bg);  --info-border:    var(--blue-border);

  --font-sans: "Nunito", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-xs: 12px; --text-sm: 13px; --text-md: 14px; --text-base: 15px;
  --text-lg: 16px; --text-xl: 18px; --text-2xl: 20px; --text-3xl: 24px;
  --text-4xl: 30px; --text-5xl: 36px;
  --leading-tight: 1.3; --leading-snug: 1.45; --leading-normal: 1.6; --leading-relaxed: 1.75;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px;

  --radius-xs: 6px; --radius-sm: 10px; --radius-md: 14px;
  --radius-lg: 20px; --radius-xl: 28px; --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(92, 51, 24, 0.06), 0 1px 3px rgba(92, 51, 24, 0.05);
  --shadow-md: 0 2px 6px rgba(92, 51, 24, 0.08), 0 8px 20px rgba(92, 51, 24, 0.07);
  --shadow-lg: 0 4px 12px rgba(92, 51, 24, 0.10), 0 16px 40px rgba(92, 51, 24, 0.12);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 140ms;
  --duration-base: 220ms;
  --duration-slow: 360ms;
}

/* ---------- L2 语义令牌 · 深色（只重写语义层） Semantic · Dark (semantic layer only) ---------- */
[data-theme="dark"] {
  --bg-page: #2A2016;
  --bg-surface: #372A1D;
  --bg-subtle: #3F3021;
  --bg-inset: #4A3826;
  --bg-accent-soft: #3D2E20;

  --text-primary: #F7E9D4;
  --text-secondary: #D3B894;
  --text-placeholder: #B39B7C;
  --text-disabled: #8F7A62;
  --text-on-cta: #3A2A1C;
  --text-on-accent: #3A2A1C;

  --border: #4A3A2A;
  --border-strong: #5F4B37;

  --primary: #E3A868;
  --primary-hover: #EFC68D;
  --primary-active: #F5D9B0;
  --primary-subtle: #3D2E20;
  --accent: #D9A876;
  --accent-hover: #E7BC8E;
  --link: #EFC68D;
  --link-hover: #F5D9B0;

  --cta-bg: #E3A868;
  --cta-text: #3A2A1C;
  --cta-hover-bg: #EFC68D;
  --cta-active-bg: #F5D9B0;

  --success-solid: #7FB08D; --success-text: #A5CFAE; --success-bg: #2E3B32; --success-border: #4C5F4F;
  --warning-solid: #E0A84E; --warning-text: #EFC98A; --warning-bg: #3D3222; --warning-border: #5F4E33;
  --error-solid:   #E07868; --error-text:   #F0A093; --error-bg:   #3E2A26; --error-border:   #5F4038;
  --info-solid:    #8FB0D1; --info-text:    #B3CBE3; --info-bg:    #27333F; --info-border:    #3F5061;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.42);
}

/* ---------- 基础 Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  transition: background var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}
h1, h2, h3, h4, h5, h6 { margin: 0 0 var(--space-3); font-weight: 600; line-height: var(--leading-tight); color: var(--text-primary); }
h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }
p { margin: 0 0 var(--space-4); }
a { color: var(--link); text-decoration: underline; text-decoration-color: var(--cream-300); text-underline-offset: 3px; transition: color var(--duration-fast) var(--ease-out); }
a:hover { color: var(--link-hover); text-decoration-color: var(--accent); }
code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }
code { background: var(--bg-subtle); padding: 2px 6px; border-radius: var(--radius-xs); color: var(--text-primary); }
hr { border: none; border-top: 1px solid var(--border); margin: var(--space-8) 0; }
::selection { background: var(--cream-300); color: var(--cocoa-950); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { flex-shrink: 0; vertical-align: -0.15em; }

/* ---------- 按钮 Button ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 10px 22px;
  font-family: inherit; font-size: var(--text-base); font-weight: 500; line-height: 1.2;
  border: 1px solid transparent; border-radius: var(--radius-full);
  cursor: pointer; user-select: none; text-decoration: none; white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--bg-inset); color: var(--text-disabled);
  border-color: var(--border); cursor: not-allowed; transform: none;
}
.btn--primary { background: var(--cta-bg); color: var(--cta-text); }
.btn--primary:hover:not(:disabled) { background: var(--cta-hover-bg); }
.btn--primary:active:not(:disabled) { background: var(--cta-active-bg); }
.btn--secondary { background: var(--primary); color: var(--text-on-accent); }
.btn--secondary:hover:not(:disabled) { background: var(--primary-hover); }
.btn--secondary:active:not(:disabled) { background: var(--primary-active); }
.btn--soft { background: var(--primary-subtle); color: var(--cocoa-900); }
.btn--soft:hover:not(:disabled) { background: var(--cream-300); }
.btn--soft:active:not(:disabled) { background: var(--cream-400); }
.btn--ghost { background: transparent; color: var(--cocoa-900); border-color: var(--border-strong); }
.btn--ghost:hover:not(:disabled) { background: var(--primary-subtle); border-color: var(--accent); }
.btn--ghost:active:not(:disabled) { background: var(--cream-300); }
.btn--danger { background: var(--error-solid); color: #FFFFFF; }
.btn--danger:hover:not(:disabled) { background: #962D25; }
.btn--danger:active:not(:disabled) { background: #7E261F; }
.btn--sm { min-height: 38px; padding: 6px 16px; font-size: var(--text-sm); }
.btn--lg { min-height: 52px; padding: 14px 30px; font-size: var(--text-lg); }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: 44px; min-height: 44px; }
.btn--icon.btn--sm { width: 38px; }
.btn[aria-busy="true"] { pointer-events: none; }

/* ---------- 表单 Form ---------- */
.field { margin-bottom: var(--space-5); }
.field__label { display: block; margin-bottom: var(--space-2); font-size: var(--text-md); font-weight: 500; }
.field__hint { margin-top: var(--space-2); font-size: var(--text-xs); color: var(--text-secondary); }
.field__error { display: flex; align-items: center; gap: var(--space-1); margin-top: var(--space-2); font-size: var(--text-xs); color: var(--error-solid); }
.input, .textarea, .select {
  width: 100%; padding: 10px 14px;
  font-family: inherit; font-size: var(--text-base); line-height: var(--leading-snug);
  color: var(--text-primary); background: var(--bg-surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.input::placeholder, .textarea::placeholder { color: var(--text-placeholder); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--accent); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227, 168, 104, 0.28);
}
.input:disabled, .textarea:disabled, .select:disabled { background: var(--bg-subtle); color: var(--text-disabled); cursor: not-allowed; }
.field--error .input, .field--error .textarea, .field--error .select { border-color: var(--error-solid); }
.field--error .input:focus, .field--error .textarea:focus, .field--error .select:focus { box-shadow: 0 0 0 3px rgba(176, 58, 46, 0.22); }
.field--success .input, .field--success .textarea { border-color: var(--success-solid); }
.textarea { min-height: 96px; resize: vertical; }
.select {
  appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%237C4A2D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center;
}
[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1.5l5 5 5-5' fill='none' stroke='%23EFC68D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.choice { display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; }
.choice + .choice { margin-top: var(--space-3); }
.choice input[type="checkbox"], .choice input[type="radio"] {
  appearance: none; flex-shrink: 0; margin: 2px 0 0;
  width: 20px; height: 20px; background: var(--bg-surface);
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-xs);
  cursor: pointer; position: relative;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.choice input[type="radio"] { border-radius: var(--radius-full); }
.choice input:checked { background: var(--cocoa-900); border-color: var(--cocoa-900); }
.choice input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 6px; top: 2.5px;
  width: 5px; height: 9px; border: solid #FFFFFF; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.choice input[type="radio"]:checked::after {
  content: ""; position: absolute; inset: 4px; border-radius: var(--radius-full); background: #FFFFFF;
}
.choice input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice__text { font-size: var(--text-md); }
.choice__desc { display: block; font-size: var(--text-xs); color: var(--text-secondary); margin-top: 2px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 46px; height: 26px; border-radius: var(--radius-full);
  background: var(--bg-inset); border: 1px solid var(--border-strong);
  transition: background var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out);
}
.switch__track::after {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 20px; height: 20px; border-radius: var(--radius-full);
  background: var(--bg-surface); box-shadow: var(--shadow-sm);
  transition: transform var(--duration-base) var(--ease-out);
}
.switch input:checked + .switch__track { background: var(--cocoa-900); border-color: var(--cocoa-900); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch__label { font-size: var(--text-md); }

/* ---------- 卡片 Card ---------- */
.card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}
.card--interactive:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card--flat { box-shadow: none; }
.card__media { border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden; }
.card__media--block { height: 132px; position: relative; background: var(--cream-200); }
.card__media--block::after {
  content: ""; position: absolute; right: 18px; bottom: -18px;
  width: 72px; height: 72px; border-radius: var(--radius-full); background: var(--cream-300); opacity: 0.85;
}
.card__body { padding: var(--space-5); }
.card__title { margin: 0 0 var(--space-2); font-size: var(--text-lg); font-weight: 600; }
.card__text { margin: 0; font-size: var(--text-md); color: var(--text-secondary); }
.card__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border); }
.card__meta { font-size: var(--text-xs); color: var(--text-secondary); }

/* ---------- 徽章 Badge / 标签 Tag ---------- */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 2px 10px; border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 500; line-height: 20px; white-space: nowrap;
}
.badge--caramel { background: var(--cream-300); color: var(--cocoa-950); }
.badge--cocoa { background: var(--cocoa-900); color: var(--cream-50); }
.badge--outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-strong); }
.badge--success { background: var(--success-bg); color: var(--success-text); }
.badge--warning { background: var(--warning-bg); color: var(--warning-text); }
.badge--error { background: var(--error-bg); color: var(--error-text); }
.badge--info { background: var(--info-bg); color: var(--info-text); }
.badge__dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; }

/* ---------- 提示 Alert ---------- */
.alert {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--bg-surface);
  font-size: var(--text-md);
}
.alert__icon { margin-top: 2px; }
.alert__title { font-weight: 600; margin-bottom: 2px; }
.alert__text { color: var(--text-secondary); margin: 0; font-size: var(--text-md); }
.alert__action { margin-left: auto; align-self: center; }
.alert--success { background: var(--success-bg); border-color: var(--success-border); }
.alert--success .alert__icon, .alert--success .alert__title { color: var(--success-text); }
.alert--warning { background: var(--warning-bg); border-color: var(--warning-border); }
.alert--warning .alert__icon, .alert--warning .alert__title { color: var(--warning-text); }
.alert--error { background: var(--error-bg); border-color: var(--error-border); }
.alert--error .alert__icon, .alert--error .alert__title { color: var(--error-text); }
.alert--info { background: var(--info-bg); border-color: var(--info-border); }
.alert--info .alert__icon, .alert--info .alert__title { color: var(--info-text); }

/* ---------- 导航 Nav / Tabs / 面包屑 Breadcrumb ---------- */
.navbar {
  display: flex; align-items: center; gap: var(--space-6);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-full);
}
.navbar__brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; font-size: var(--text-lg); color: var(--text-primary); text-decoration: none; }
.navbar__mark { width: 26px; height: 26px; border-radius: var(--radius-full); background: var(--caramel-500); position: relative; flex-shrink: 0; }
.navbar__mark::after { content: ""; position: absolute; inset: 7px; border-radius: var(--radius-full); background: var(--cream-300); }
.navbar__links { display: flex; align-items: center; gap: var(--space-5); margin-left: auto; }
.navbar__link { font-size: var(--text-md); font-weight: 500; color: var(--text-secondary); text-decoration: none; padding: var(--space-2) 0; position: relative; }
.navbar__link:hover { color: var(--text-primary); }
.navbar__link.is-active { color: var(--text-primary); }
.navbar__link.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: var(--radius-full); background: var(--caramel-500); }
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); }
.tab {
  padding: var(--space-3) var(--space-4); border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: var(--text-md); font-weight: 500; color: var(--text-secondary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  box-shadow: inset 0 -2px 0 transparent;
  transition: color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.tab:hover { color: var(--text-primary); }
.tab.is-active { color: var(--text-primary); box-shadow: inset 0 -2px 0 var(--caramel-500); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-md); color: var(--text-secondary); }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-primary); text-decoration: underline; }
.breadcrumb__sep { color: var(--text-disabled); }
.breadcrumb [aria-current="page"] { color: var(--text-primary); font-weight: 500; }
.pagination { display: flex; gap: var(--space-2); }
.pagination__btn {
  min-width: 38px; height: 38px; padding: 0 var(--space-2);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-full);
  background: var(--bg-surface); color: var(--text-secondary);
  font-family: inherit; font-size: var(--text-md); font-weight: 500; cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.pagination__btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text-primary); }
.pagination__btn.is-active { background: var(--cocoa-900); border-color: var(--cocoa-900); color: var(--cream-50); }
.pagination__btn:disabled { color: var(--text-disabled); cursor: not-allowed; }

/* ---------- 数据展示 Data Display ---------- */
.avatar {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cream-300); color: var(--cocoa-900);
  font-weight: 600; font-size: var(--text-md); position: relative; flex-shrink: 0;
}
.avatar--sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar--lg { width: 52px; height: 52px; font-size: var(--text-xl); }
.avatar__status { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: var(--radius-full); background: var(--success-solid); border: 2px solid var(--bg-surface); }
.progress { margin-bottom: var(--space-4); }
.progress__head { display: flex; justify-content: space-between; margin-bottom: var(--space-2); font-size: var(--text-sm); }
.progress__value { font-family: var(--font-mono); color: var(--text-secondary); }
.progress__track { height: 10px; border-radius: var(--radius-full); background: var(--bg-inset); overflow: hidden; }
.progress__fill { height: 100%; border-radius: var(--radius-full); background: var(--caramel-500); transition: width var(--duration-slow) var(--ease-out); }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-md); }
.table th { padding: var(--space-3) var(--space-4); text-align: left; font-size: var(--text-xs); font-weight: 500; color: var(--text-secondary); background: var(--bg-subtle); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-subtle); }
.table .num { font-family: var(--font-mono); text-align: right; }

/* ---------- 反馈 Feedback ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: var(--space-4);
  background: rgba(43, 32, 22, 0.48);
  animation: cc-fade var(--duration-base) var(--ease-out);
}
.modal-overlay[hidden] { display: none; }
.modal {
  width: min(440px, 100%); background: var(--bg-surface);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  padding: var(--space-6); animation: cc-pop var(--duration-base) var(--ease-out);
}
.modal__title { margin: 0 0 var(--space-2); font-size: var(--text-2xl); }
.modal__text { color: var(--text-secondary); margin: 0 0 var(--space-6); font-size: var(--text-md); }
.modal__actions { display: flex; justify-content: flex-end; gap: var(--space-3); }
.toast {
  position: fixed; left: 50%; bottom: var(--space-8); z-index: 110;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--cocoa-900); color: var(--cream-50);
  border-radius: var(--radius-full); box-shadow: var(--shadow-lg);
  font-size: var(--text-md); font-weight: 500;
  animation: cc-slide-up var(--duration-base) var(--ease-out);
}
.toast[hidden] { display: none; }
.toast__icon { color: var(--caramel-500); }
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-inset) 25%, var(--bg-subtle) 50%, var(--bg-inset) 75%);
  background-size: 200% 100%;
  animation: cc-shimmer 1.4s linear infinite;
}
.empty { text-align: center; padding: var(--space-10) var(--space-6); }
.empty__art { width: 72px; height: 72px; margin: 0 auto var(--space-4); position: relative; }
.empty__art::before { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); border: 2px dashed var(--border-strong); }
.empty__art::after { content: ""; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); border-radius: var(--radius-full); background: var(--cream-300); }
.empty__title { font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--space-2); }
.empty__text { color: var(--text-secondary); font-size: var(--text-md); margin-bottom: var(--space-5); }
.tip { position: relative; }
.tip::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  background: var(--cocoa-950); color: var(--cream-50);
  font-size: var(--text-xs); font-weight: 500; line-height: 1.4; white-space: nowrap;
  border-radius: var(--radius-xs); box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: opacity var(--duration-fast) var(--ease-out);
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; }
.spinner {
  width: 16px; height: 16px; border-radius: var(--radius-full);
  border: 2px solid currentColor; border-top-color: transparent;
  animation: cc-spin 0.7s linear infinite;
}

/* ---------- 动效关键帧 Motion keyframes ---------- */
@keyframes cc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cc-pop { from { opacity: 0; transform: scale(0.96) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes cc-slide-up { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes cc-shimmer { to { background-position: -200% 0; } }
@keyframes cc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skeleton { animation: none; }
  .spinner { animation-duration: 1.6s; }
  .modal-overlay, .modal, .toast { animation: none; }
}
