/* ============================================================
   AI 写小说平台 · 文艺科幻浅调 · 设计系统
   colors_and_type.css
   概念种子：「晨雾中的稿纸」— 雾蓝与香芋紫的弥散雾气里
   漂浮着半透明书页碎片与星光，文字像被光晕托起。
   ============================================================ */

/* ============================================================
   1. Design Tokens
   ============================================================ */
:root {
  /* --- 底色层（米白哑光 off-white matte） --- */
  --bg-page: #F4F1EC;
  --bg-elevated: #FBFAF7;
  --bg-sunken: #ECE8E1;
  --bg-glass: rgba(255, 255, 255, .55);
  --bg-glass-deep: rgba(252, 250, 247, .72);

  /* --- 主色 · 雾蓝 mist --- */
  --mist: #8FB1C9;
  --mist-deep: #5E89A6;
  --mist-deeper: #44687F;
  --mist-soft: #BCD0DC;
  --mist-glow: rgba(143, 177, 201, .35);

  /* --- 辅色 · 香芋紫 taro --- */
  --taro: #B7A8C9;
  --taro-deep: #8E7BAA;
  --taro-soft: #D8CFE3;
  --taro-glow: rgba(183, 168, 201, .32);

  /* --- 文字（在 #F4F1EC 上 AA 验证） --- */
  --text-primary: #2E3340;
  --text-secondary: #5A6172;
  --text-muted: #8B92A3;
  --text-on-mist: #FBFAF7;
  --text-disabled: #B5B9C4;

  /* --- 边框 / 线 --- */
  --border-faint: rgba(94, 137, 166, .12);
  --border: rgba(94, 137, 166, .16);
  --border-strong: rgba(94, 137, 166, .30);
  --border-glass: rgba(255, 255, 255, .60);
  --border-gradient: linear-gradient(135deg, rgba(168, 191, 209, .55), rgba(201, 188, 227, .35) 50%, rgba(255, 255, 255, .60));

  /* --- 语义色（低饱和柔化） --- */
  --success: #7BAE8C;
  --success-soft: rgba(123, 174, 140, .14);
  --warning: #D4A661;
  --warning-soft: rgba(212, 166, 97, .14);
  --danger: #C97C7C;
  --danger-deep: #A85959;
  --danger-soft: rgba(201, 124, 124, .14);
  --info: var(--mist-deep);
  --info-soft: var(--mist-glow);

  /* --- 多层弥散阴影 --- */
  --shadow-sm: 0 1px 2px rgba(46, 51, 64, .04), 0 2px 8px rgba(46, 51, 64, .04);
  --shadow-md: 0 2px 8px rgba(46, 51, 64, .06), 0 8px 24px rgba(94, 137, 166, .08);
  --shadow-lg: 0 4px 16px rgba(46, 51, 64, .08), 0 16px 48px rgba(94, 137, 166, .10);
  --shadow-xl: 0 8px 32px rgba(46, 51, 64, .10), 0 24px 64px rgba(94, 137, 166, .12);
  --shadow-glow-mist: 0 0 32px rgba(143, 177, 201, .20);
  --shadow-glow-taro: 0 0 32px rgba(183, 168, 201, .20);
  --shadow-inset-hi: inset 0 1px 0 rgba(255, 255, 255, .70);

  /* --- 圆角（分级） --- */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --radius-glass: 18px;
  --radius-card: 14px;

  /* --- 动效曲线 --- */
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-curtain: cubic-bezier(0.16, 1, 0.30, 1);
  --ease-snap: cubic-bezier(0.85, 0, 0.15, 1);
  --dur-fast: 150ms;
  --dur-base: 240ms;
  --dur-slow: 480ms;
  --dur-curtain: 720ms;

  /* --- 字体族 --- */
  --font-serif: 'EB Garamond', 'Noto Serif SC', Georgia, serif;
  --font-ui: 'Manrope', 'Noto Sans SC', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* ============================================================
     Semantic aliases — fill-html-head.mjs / Tailwind bridge
     ============================================================ */
  --background: #F4F1EC;
  --foreground: #2E3340;
  --card: #FBFAF7;
  --card-foreground: #2E3340;
  --popover: #FBFAF7;
  --popover-foreground: #2E3340;
  --primary: #5E89A6;
  --primary-foreground: #FBFAF7;
  --secondary: #B7A8C9;
  --secondary-foreground: #FBFAF7;
  --muted: #ECE8E1;
  --muted-foreground: #8B92A3;
  --accent: #D8CFE3;
  --accent-foreground: #2E3340;
  --destructive: #C97C7C;
  --destructive-foreground: #FBFAF7;
  --input: rgba(94, 137, 166, .16);
  --ring: #5E89A6;

  /* --- 热力图色阶 --- */
  --heatmap-1: rgba(143, 177, 201, .20);
  --heatmap-2: rgba(143, 177, 201, .40);
  --heatmap-3: rgba(143, 177, 201, .65);

  /* --- Diff 背景 --- */
  --diff-add-bg: rgba(123, 174, 140, .10);
  --diff-remove-bg: rgba(201, 124, 124, .10);
  --diff-modify-bg: rgba(212, 166, 97, .10);
}

/* ============================================================
   2. Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  overflow-x: hidden;
  min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--mist-deep); text-decoration: none; transition: color var(--dur-fast) var(--ease-soft); }
a:hover { color: var(--mist); }

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--mist-deep);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--mist-soft); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--mist); }

/* Selection */
::selection { background: var(--mist-soft); color: var(--text-primary); }

/* ============================================================
   3. Typography
   ============================================================ */
.font-serif { font-family: var(--font-serif); }
.font-ui { font-family: var(--font-ui); }
.font-mono { font-family: var(--font-mono); }

.fs-display {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.fs-h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.fs-h2 {
  font-family: var(--font-ui);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.fs-h3 {
  font-family: var(--font-ui);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}
.fs-body {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
}
.fs-reader {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.01em;
}
.fs-small {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}
.fs-caption {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}
.fs-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-mist { color: var(--mist-deep); }
.text-taro { color: var(--taro-deep); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger-deep); }

/* ============================================================
   4. Glassmorphism System
   ============================================================ */
.glass-card {
  position: relative;
  border-radius: var(--radius-glass);
  background: var(--bg-glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--shadow-md), var(--shadow-inset-hi);
}
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--border-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.glass-deep {
  position: relative;
  border-radius: var(--radius-glass);
  background: var(--bg-glass-deep);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow-lg), var(--shadow-inset-hi);
}
.glass-deep::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--border-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.glass-input {
  position: relative;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .45);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: var(--shadow-sm), var(--shadow-inset-hi);
  border: 1px solid var(--border);
  transition: border-color var(--dur-base) var(--ease-soft),
              box-shadow var(--dur-base) var(--ease-soft);
}
.glass-input:focus-within {
  border-color: var(--mist);
  box-shadow: var(--shadow-sm), var(--shadow-inset-hi), 0 0 0 3px rgba(143, 177, 201, .15);
}

.glass-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(244, 241, 236, .60);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

/* ============================================================
   5. Decoration System
   ============================================================ */

/* --- 5.1 Mesh 流体光晕 --- */
.mesh-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(143, 177, 201, .18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 15%, rgba(183, 168, 201, .15), transparent 55%),
    radial-gradient(ellipse 60% 80% at 50% 95%, rgba(143, 177, 201, .10), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(183, 168, 201, .08), transparent 55%);
  animation: mesh-drift 24s var(--ease-soft) infinite alternate;
  opacity: .9;
}

.mesh-top-band {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 280px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 100% at 20% 0%, rgba(143, 177, 201, .12), transparent 70%),
    radial-gradient(ellipse 50% 100% at 80% 0%, rgba(183, 168, 201, .10), transparent 70%);
  z-index: 0;
}

/* --- 5.2 流动文字光带 --- */
.marquee-band {
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: inline-block;
  animation: marquee 60s linear infinite;
  will-change: transform;
}
.marquee-item {
  display: inline-block;
  padding: 0 2.5rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-muted);
  opacity: .6;
}

/* --- 5.3 悬浮虚化书页 --- */
.float-page {
  position: absolute;
  pointer-events: none;
  border-radius: 2px;
  background: rgba(255, 255, 255, .35);
  box-shadow: 0 8px 32px rgba(143, 177, 201, .12);
  filter: blur(.5px);
  animation: float-page 18s var(--ease-soft) infinite alternate;
}
.float-page::after {
  content: '';
  position: absolute;
  inset: 8px;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 6px,
    rgba(143, 177, 201, .08) 6px,
    rgba(143, 177, 201, .08) 7px
  );
  border-radius: 1px;
}

/* --- 5.4 微弱星光粒子 --- */
.starlight {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(143, 177, 201, .5), transparent),
    radial-gradient(1px 1px at 28% 42%, rgba(183, 168, 201, .4), transparent),
    radial-gradient(1.5px 1.5px at 45% 12%, rgba(143, 177, 201, .35), transparent),
    radial-gradient(1px 1px at 62% 68%, rgba(183, 168, 201, .3), transparent),
    radial-gradient(1.5px 1.5px at 78% 28%, rgba(143, 177, 201, .45), transparent),
    radial-gradient(1px 1px at 88% 55%, rgba(183, 168, 201, .35), transparent),
    radial-gradient(1px 1px at 8% 75%, rgba(143, 177, 201, .3), transparent),
    radial-gradient(1.5px 1.5px at 35% 85%, rgba(183, 168, 201, .4), transparent),
    radial-gradient(1px 1px at 55% 38%, rgba(143, 177, 201, .25), transparent),
    radial-gradient(1px 1px at 92% 88%, rgba(183, 168, 201, .3), transparent);
  animation: twinkle 6s ease-in-out infinite alternate;
  opacity: .5;
}

/* --- 5.5 纤细发光剧情连线 --- */
.plot-line-svg {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 0 3px rgba(143, 177, 201, .35));
}
.plot-line-svg path {
  fill: none;
  stroke: var(--mist);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 4 3;
  animation: dash-flow 20s linear infinite;
}
.plot-line-svg .glow-path {
  stroke: var(--mist-glow);
  stroke-width: 3;
  opacity: .5;
}

/* --- 5.6 轻柔弥散光影 --- */
.diffuse-light {
  position: absolute;
  pointer-events: none;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .35), transparent 65%);
  mix-blend-mode: soft-light;
  z-index: 0;
}

/* ============================================================
   6. Components
   ============================================================ */

/* --- 6.1 Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-ui);
  font-size: .875rem;
  font-weight: 500;
  padding: .625rem 1.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--dur-base) var(--ease-soft);
  white-space: nowrap;
  position: relative;
}
.btn-primary {
  background: var(--mist-deep);
  color: var(--text-on-mist);
  box-shadow: 0 2px 12px rgba(94, 137, 166, .24);
}
.btn-primary:hover {
  background: var(--mist);
  box-shadow: 0 4px 20px rgba(94, 137, 166, .32);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn:disabled, .btn[disabled], .btn-disabled {
  opacity: .5; cursor: not-allowed; pointer-events: none; box-shadow: none; transform: none;
}
.btn-primary:disabled, .btn-primary[disabled] { background: var(--mist-soft); color: var(--text-on-mist); }

.btn-ghost {
  background: rgba(255, 255, 255, .40);
  color: var(--text-secondary);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, .60);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-taro {
  background: var(--taro-deep);
  color: var(--text-on-mist);
  box-shadow: 0 2px 12px rgba(142, 123, 170, .22);
}
.btn-taro:hover {
  background: var(--taro);
  box-shadow: 0 4px 20px rgba(142, 123, 170, .30);
  transform: translateY(-1px);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--dur-base) var(--ease-soft);
}
.btn-icon:hover {
  background: rgba(143, 177, 201, .12);
  color: var(--mist-deep);
}

/* --- 6.2 Tags & Badges --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .75rem;
  font-weight: 500;
  padding: .25rem .625rem;
  border-radius: var(--radius-pill);
  line-height: 1.4;
}
.tag-mist { background: rgba(143, 177, 201, .16); color: var(--mist-deep); }
.tag-taro { background: rgba(183, 168, 201, .16); color: var(--taro-deep); }
.tag-success { background: var(--success-soft); color: var(--success); }
.tag-warning { background: var(--warning-soft); color: var(--warning); }
.tag-danger { background: var(--danger-soft); color: var(--danger-deep); }
.tag-neutral { background: var(--bg-sunken); color: var(--text-secondary); }

.badge-dot {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--mist);
  box-shadow: 0 0 6px var(--mist-glow);
}

/* --- 6.3 Progress --- */
.progress {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--bg-sunken);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--mist), var(--mist-deep));
  box-shadow: 0 0 8px var(--mist-glow);
  transition: width var(--dur-slow) var(--ease-soft);
  position: relative;
  transform-origin: left center;
  animation: progress-grow var(--dur-slow) var(--ease-curtain) both;
}
@keyframes progress-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
  animation: shimmer 2s linear infinite;
}

.progress-taro .progress-fill {
  background: linear-gradient(90deg, var(--taro), var(--taro-deep));
  box-shadow: 0 0 8px var(--taro-glow);
}

/* --- 6.4 Cards --- */
.content-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-faint);
  transition: all var(--dur-base) var(--ease-soft);
}
.content-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
  transform: translateY(-2px);
}

/* --- 6.5 Input --- */
.input-field {
  width: 100%;
  padding: .75rem 1rem;
  font-size: .9375rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, .50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--dur-base) var(--ease-soft);
  outline: none;
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus {
  border-color: var(--mist);
  background: rgba(255, 255, 255, .70);
  box-shadow: 0 0 0 3px rgba(143, 177, 201, .12);
}

/* --- 6.6 Divider --- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  border: none;
}
.divider-vertical {
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border), transparent);
}

/* --- 6.7 Sidebar nav item --- */
.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem .875rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease-soft);
  position: relative;
}
.nav-item:hover {
  background: rgba(143, 177, 201, .10);
  color: var(--mist-deep);
}
.nav-item.active {
  background: rgba(143, 177, 201, .14);
  color: var(--mist-deep);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: var(--radius-pill);
  background: var(--mist-deep);
}

/* --- 6.8 Icon (mask-based) --- */
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  background-color: currentColor;
  flex-shrink: 0;
}

/* --- 6.9 Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--bg-elevated) 50%, var(--bg-sunken) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

/* --- 6.10 Section eyebrow --- */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.section-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--mist);
  opacity: .6;
}

/* ============================================================
   7. Motion — Keyframes
   ============================================================ */
@keyframes mesh-drift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(2%, -1%) scale(1.05); }
  66%  { transform: translate(-1%, 2%) scale(0.98); }
  100% { transform: translate(1%, 1%) scale(1.02); }
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes float-page {
  0%   { transform: translate(0, 0) rotate(-2deg); }
  50%  { transform: translate(8px, -12px) rotate(1deg); }
  100% { transform: translate(-6px, 8px) rotate(-1deg); }
}

@keyframes twinkle {
  0%   { opacity: .3; }
  50%  { opacity: .6; }
  100% { opacity: .4; }
}

@keyframes dash-flow {
  0%   { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -100; }
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes curtain-up {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100%); opacity: 0; }
}

@keyframes fade-in-up {
  0%   { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes slide-up {
  0%   { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50%      { opacity: .7; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(143, 177, 201, .15); }
  50%      { box-shadow: 0 0 28px rgba(143, 177, 201, .28); }
}

/* --- Animation utility classes --- */
.anim-fade-in-up { animation: fade-in-up var(--dur-slow) var(--ease-soft) both; }
.anim-fade-in { animation: fade-in var(--dur-base) var(--ease-soft) both; }
.anim-slide-up { animation: slide-up var(--dur-slow) var(--ease-curtain) both; }
.anim-pulse-soft { animation: pulse-soft 2.5s ease-in-out infinite; }
.anim-glow-pulse { animation: glow-pulse 3s ease-in-out infinite; }

.curtain-veil {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(180deg, var(--bg-page), var(--mist-soft));
  animation: curtain-up var(--dur-curtain) var(--ease-curtain) forwards;
  animation-delay: .3s;
  pointer-events: none;
}

/* Scroll-driven reveal — 带 @supports 守卫，不支持浏览器降级为可见 */
@supports (animation-timeline: view()) {
  .reveal, .reveal-up {
    opacity: 0;
    animation: fade-in-up var(--dur-slow) var(--ease-soft) both;
    animation-timeline: view();
    animation-range: entry 0% entry 45%;
  }
  .reveal-up {
    transform: translateY(28px);
    animation-name: slide-up;
    animation-duration: var(--dur-slow);
    animation-timing-function: var(--ease-curtain);
  }
  .reveal[style*="--reveal-i"], .reveal-up[style*="--reveal-i"] {
    animation-delay: calc(var(--reveal-i, 0) * 80ms);
  }
}
@supports not (animation-timeline: view()) {
  .reveal, .reveal-up { opacity: 1; transform: none; }
}

/* ============================================================
   8. Reduced Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 50ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 50ms !important;
    scroll-behavior: auto !important;
  }
  .mesh-ambient,
  .starlight,
  .marquee-track,
  .float-page,
  .progress-fill::after,
  .skeleton,
  .curtain-veil,
  .reveal {
    animation: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   9. Responsive — Glass Degradation
   ============================================================ */
@media (max-width: 768px) {
  .glass-card,
  .glass-deep,
  .glass-input,
  .glass-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-elevated);
  }
  .glass-overlay {
    background: rgba(244, 241, 236, .92);
  }
  .mesh-ambient {
    opacity: .4;
  }
  .starlight {
    display: none;
  }
  .float-page {
    display: none;
  }
  .marquee-band {
    display: none;
  }
}

@media (max-width: 1024px) {
  .mesh-ambient {
    opacity: .6;
  }
}

/* ============================================================
   10. Utility Helpers
   ============================================================ */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

.gradient-text {
  background: linear-gradient(135deg, var(--mist-deep), var(--taro-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glow-text-mist { text-shadow: 0 0 24px rgba(143, 177, 201, .3); }

/* --- 10.2 彩色弥散阴影 --- */
.glow-mist { box-shadow: var(--shadow-md), var(--shadow-glow-mist), var(--shadow-inset-hi); }
.glow-taro { box-shadow: var(--shadow-md), var(--shadow-glow-taro), var(--shadow-inset-hi); }

/* --- 10.3 渐变描边 --- */
.border-gradient { position: relative; }
.border-gradient::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; padding: 1px;
  background: var(--border-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

/* --- 10.4 空状态 --- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 1.5rem; text-align: center; gap: .5rem;
}
.empty-state-icon { width: 48px; height: 48px; color: var(--mist-soft); margin-bottom: .5rem; opacity: .8; }
.empty-state-title { font-family: var(--font-ui); font-size: .9375rem; font-weight: 500; color: var(--text-secondary); }
.empty-state-desc { font-size: .8125rem; color: var(--text-muted); max-width: 320px; line-height: 1.6; }

/* --- 10.5 骨架表格行 --- */
.skeleton-row td { padding: .625rem .875rem; }
.skeleton-cell { height: 12px; border-radius: var(--radius-xs); }

/* ============================================================
   11. Admin Components — Web 后台管理
   ============================================================ */

/* --- 11.0 Admin Semantic Colors --- */
:root {
  --success: #7BA88C;
  --success-soft: rgba(123, 168, 140, .12);
  --warning: #C4A86A;
  --warning-soft: rgba(196, 168, 106, .12);
  --danger: #C08888;
  --danger-deep: #A06666;
  --danger-soft: rgba(192, 136, 136, .12);
}

/* --- 11.1 Admin Sidebar --- */
.admin-sidebar {
  width: 240px; height: 100vh;
  position: fixed; left: 0; top: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-faint);
  display: flex; flex-direction: column;
  z-index: 50;
}
.admin-sidebar-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-faint);
  display: flex; align-items: center; gap: .625rem;
}
.admin-sidebar-logo {
  font-family: var(--font-serif);
  font-size: 1.125rem; font-weight: 500;
  color: var(--text-primary);
}
.admin-sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem .625rem; }
.admin-sidebar-section {
  font-family: var(--font-mono);
  font-size: .625rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-muted);
  padding: 1rem .625rem .375rem;
}
.admin-sidebar-item {
  display: flex; align-items: center; gap: .625rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: .8125rem; font-weight: 500;
  transition: all var(--dur-fast) var(--ease-soft);
  position: relative; cursor: pointer;
}
.admin-sidebar-item:hover { background: rgba(143, 177, 201, .08); color: var(--mist-deep); }
.admin-sidebar-item.active { background: rgba(143, 177, 201, .12); color: var(--mist-deep); }
.admin-sidebar-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  border-radius: var(--radius-pill);
  background: var(--mist-deep);
}
.admin-sidebar-footer {
  padding: .875rem 1rem;
  border-top: 1px solid var(--border-faint);
  font-size: .75rem; color: var(--text-muted);
}

/* --- 11.2 Data Table --- */
.data-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.data-table thead th {
  text-align: left; padding: .625rem .875rem;
  font-family: var(--font-mono);
  font-size: .6875rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap; cursor: pointer; user-select: none;
}
.data-table thead th:hover { color: var(--mist-deep); }
.data-table tbody td {
  padding: .625rem .875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-faint);
  white-space: nowrap;
}
.data-table tbody tr { transition: background var(--dur-fast) var(--ease-soft); }
.data-table tbody tr:nth-child(even) { background: rgba(143, 177, 201, .03); }
.data-table tbody tr:hover { background: rgba(143, 177, 201, .07); }
.data-table .col-actions { text-align: right; white-space: nowrap; }
.data-table .col-num { font-family: var(--font-mono); text-align: right; }

/* --- 11.3 Stat Card (KPI) --- */
.stat-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border-faint);
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-base) var(--ease-soft);
}
.stat-card:hover { box-shadow: var(--shadow-md); border-color: var(--border); }
.stat-card-label {
  font-family: var(--font-mono);
  font-size: .6875rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: .5rem;
}
.stat-card-value {
  font-family: var(--font-serif);
  font-size: 2rem; font-weight: 500;
  line-height: 1.1; color: var(--text-primary);
}
.stat-card-trend {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .75rem; font-weight: 500; margin-top: .5rem;
}
.stat-card-trend.up { color: var(--success); }
.stat-card-trend.down { color: var(--danger-deep); }
.stat-card-spark { height: 32px; margin-top: .75rem; opacity: .7; }

/* --- 11.4 Chart Container --- */
.chart-container {
  position: relative; height: 240px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-faint);
  padding: 1rem; box-shadow: var(--shadow-sm);
}
.chart-container svg { width: 100%; height: 100%; }

/* --- 11.5 Filter Bar --- */
.filter-bar {
  display: flex; align-items: center; gap: .75rem;
  flex-wrap: wrap; padding: .875rem 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-faint);
  box-shadow: var(--shadow-sm);
}
.filter-bar .input-field { max-width: 240px; }
.filter-bar-select {
  padding: .5rem .875rem; font-size: .8125rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, .50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; outline: none;
  transition: all var(--dur-base) var(--ease-soft);
}
.filter-bar-select:focus { border-color: var(--mist); }

/* --- 11.6 Pagination --- */
.pagination {
  display: flex; align-items: center; gap: .25rem;
  justify-content: flex-end; padding: .75rem 0;
}
.pagination-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 2rem; padding: 0 .5rem;
  font-size: .8125rem; font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  transition: all var(--dur-fast) var(--ease-soft);
  cursor: pointer;
}
.pagination-btn:hover { background: rgba(143, 177, 201, .10); color: var(--mist-deep); }
.pagination-btn.active { background: var(--mist-deep); color: var(--text-on-mist); }
.pagination-btn:disabled { opacity: .4; cursor: not-allowed; }
.pagination-info {
  font-size: .75rem; color: var(--text-muted);
  margin-right: .75rem; font-family: var(--font-mono);
}

/* --- 11.7 Modal --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(46, 51, 64, .20);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.modal-dialog {
  width: 90%; max-width: 480px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  padding: 1.75rem; position: relative;
  animation: fade-in-up var(--dur-base) var(--ease-soft) both;
}
.modal-dialog-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-dialog-title {
  font-family: var(--font-serif);
  font-size: 1.25rem; font-weight: 500;
  color: var(--text-primary);
}
.modal-dialog-close {
  width: 2rem; height: 2rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs);
  color: var(--text-muted); cursor: pointer;
  transition: all var(--dur-fast) var(--ease-soft);
}
.modal-dialog-close:hover { background: var(--bg-sunken); color: var(--text-primary); }
.modal-dialog-footer {
  display: flex; justify-content: flex-end; gap: .625rem;
  margin-top: 1.5rem;
}

/* --- 11.8 Tab Bar --- */
.tab-bar {
  display: flex; gap: .25rem;
  border-bottom: 1px solid var(--border);
  padding: 0 .25rem; margin-bottom: 1.25rem;
}
.tab-item {
  padding: .625rem 1rem;
  font-size: .8125rem; font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease-soft), border-bottom-color var(--dur-base) var(--ease-soft);
  cursor: pointer; position: relative; bottom: -1px;
}
.tab-item:hover { color: var(--text-secondary); }
.tab-item.active { color: var(--mist-deep); border-bottom-color: var(--mist-deep); }

/* --- 11.9 Status Badge --- */
.status-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .6875rem; font-weight: 600;
  padding: .2rem .5rem;
  border-radius: var(--radius-pill);
  letter-spacing: .03em;
}
.status-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; }
.status-badge.active { background: var(--success-soft); color: var(--success); }
.status-badge.active::before { background: var(--success); }
.status-badge.pending { background: var(--warning-soft); color: var(--warning); }
.status-badge.pending::before { background: var(--warning); }
.status-badge.rejected { background: var(--danger-soft); color: var(--danger-deep); }
.status-badge.rejected::before { background: var(--danger-deep); }
.status-badge.disabled { background: var(--bg-sunken); color: var(--text-muted); }
.status-badge.disabled::before { background: var(--text-muted); }

/* --- 11.10 Form Grid --- */
.form-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem 1.25rem; align-items: center;
}
.form-grid label {
  font-size: .8125rem; font-weight: 500;
  color: var(--text-secondary); text-align: right;
}
.form-grid .form-grid-full { grid-column: 1 / -1; }

/* --- 11.11 Admin Top Bar --- */
.admin-topbar {
  height: 56px;
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-faint);
  position: sticky; top: 0; z-index: 40;
}
.admin-topbar-search { flex: 1; max-width: 400px; }
.admin-topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* --- 11.12 Admin Content Wrapper --- */
.admin-content {
  margin-left: 240px; padding: 1.5rem;
  min-height: calc(100vh - 56px);
}
.admin-content-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.admin-content-title {
  font-family: var(--font-serif);
  font-size: 1.5rem; font-weight: 500;
  color: var(--text-primary);
}
.admin-content-subtitle {
  font-size: .8125rem; color: var(--text-muted);
  margin-top: .25rem;
}

/* ============================================================
   12. Chat Bubble System（角色对话 · 生成交互）
   ============================================================ */
.chat-container {
  display: flex; flex-direction: column; gap: 1rem;
  padding: 1.25rem; overflow-y: auto; flex: 1;
}
.chat-bubble {
  max-width: 70%; padding: .875rem 1rem;
  font-size: .9375rem; line-height: 1.7;
  border-radius: var(--radius-md); position: relative;
}
.chat-bubble-left {
  align-self: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border-faint);
  border-top-left-radius: var(--radius-xs);
}
.chat-bubble-right {
  align-self: flex-end;
  background: rgba(143, 177, 201, .12);
  border: 1px solid var(--border);
  border-top-right-radius: var(--radius-xs);
}
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 600; flex-shrink: 0;
  background: linear-gradient(135deg, var(--mist), var(--taro));
  color: var(--text-on-mist);
  box-shadow: var(--shadow-sm);
}
.chat-meta {
  display: flex; align-items: center; gap: .5rem;
  font-size: .75rem; color: var(--text-muted);
  margin-bottom: .375rem;
}
.chat-context-bar {
  display: flex; align-items: center; gap: .625rem;
  padding: .75rem 1rem; margin: 0 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  font-size: .8125rem; color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.chat-suggestions {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border-faint);
}
.chat-input-bar {
  display: flex; align-items: center; gap: .625rem;
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--border-faint);
  background: var(--bg-elevated);
}

/* ============================================================
   13. Mind Map System（脑暴室）
   ============================================================ */
.mindmap-canvas {
  position: relative; flex: 1; overflow: hidden;
  min-height: 500px;
  background:
    radial-gradient(circle at 50% 50%, rgba(143,177,201,.04) 0%, transparent 70%),
    var(--bg-page);
}
.mindmap-node {
  position: absolute; padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem; line-height: 1.5;
  cursor: grab; user-select: none;
  transition: box-shadow var(--dur-fast) var(--ease-soft);
}
.mindmap-node:hover { box-shadow: var(--shadow-md); }
.mindmap-node-root {
  background: linear-gradient(135deg, rgba(143,177,201,.18), rgba(183,168,201,.14));
  border: 1.5px solid var(--mist);
  color: var(--text-primary); font-weight: 500;
  box-shadow: var(--shadow-glow-mist);
  padding: 1rem 1.5rem; font-size: 1rem;
  z-index: 2;
}
.mindmap-node-branch {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}
.mindmap-node-leaf {
  background: rgba(143, 177, 201, .08);
  border: 1px solid var(--border-faint);
  font-size: .8125rem; padding: .5rem .75rem;
}
.mindmap-connector {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
}
.mindmap-merge-zone {
  position: absolute; right: 1.5rem; top: 50%;
  transform: translateY(-50%);
  width: 200px; min-height: 180px;
  border: 2px dashed var(--taro-soft);
  border-radius: var(--radius-md);
  background: rgba(183, 168, 201, .06);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .5rem; padding: 1rem;
  font-size: .8125rem; color: var(--text-muted);
}
.mindmap-toolbar {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .875rem;
  background: var(--bg-glass-deep);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  z-index: 30;
}

/* ============================================================
   14. Diff Viewer System（版本对比）
   ============================================================ */
.diff-container {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: var(--border-faint);
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border-faint);
}
.diff-panel {
  background: var(--bg-elevated);
  padding: 1rem; overflow-x: auto;
}
.diff-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: .75rem; margin-bottom: .75rem;
  border-bottom: 1px solid var(--border-faint);
  font-size: .8125rem; font-weight: 500; color: var(--text-secondary);
}
.diff-line {
  font-family: var(--font-mono); font-size: .8125rem;
  line-height: 1.7; padding: .125rem .625rem;
  border-left: 3px solid transparent;
  white-space: pre-wrap; word-break: break-all;
}
.diff-line-add {
  background: var(--diff-add-bg);
  border-left-color: var(--success);
  color: var(--text-primary);
}
.diff-line-remove {
  background: var(--diff-remove-bg);
  border-left-color: var(--danger);
  color: var(--text-secondary);
  text-decoration: line-through;
}
.diff-line-modify {
  background: var(--diff-modify-bg);
  border-left-color: var(--warning);
}
.diff-highlight {
  background: rgba(143, 177, 201, .25);
  padding: .0625rem .1875rem;
  border-radius: 2px; font-weight: 500;
}
.diff-stats {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 0; font-size: .8125rem;
}
.diff-timeline {
  display: flex; align-items: center; gap: .25rem;
  padding: 1rem 0; overflow-x: auto;
}
.diff-timeline-node {
  display: flex; flex-direction: column; align-items: center;
  gap: .375rem; padding: .5rem .75rem;
  font-size: .75rem; color: var(--text-muted);
  cursor: pointer; border-radius: var(--radius-xs);
  transition: all var(--dur-fast) var(--ease-soft);
}
.diff-timeline-node:hover { background: rgba(143,177,201,.08); }
.diff-timeline-node.selected {
  color: var(--mist-deep); font-weight: 500;
  background: rgba(143,177,201,.12);
}
.diff-timeline-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg-sunken); border: 2px solid var(--border);
}
.diff-timeline-node.selected .diff-timeline-dot {
  background: var(--mist-deep); border-color: var(--mist-deep);
  box-shadow: 0 0 8px var(--mist-glow);
}

/* ============================================================
   15. Heatmap Calendar System（创作足迹）
   ============================================================ */
.heatmap-grid {
  display: grid; grid-template-columns: repeat(52, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
}
.heatmap-cell {
  aspect-ratio: 1; border-radius: 2px;
  background: var(--bg-sunken);
  transition: background var(--dur-fast) var(--ease-soft);
}
.heatmap-cell:hover { outline: 1.5px solid var(--mist-deep); outline-offset: 1px; }
.heatmap-cell-1 { background: var(--heatmap-1); }
.heatmap-cell-2 { background: var(--heatmap-2); }
.heatmap-cell-3 { background: var(--heatmap-3); }
.heatmap-cell-4 { background: var(--mist-deep); }
.heatmap-legend {
  display: flex; align-items: center; gap: .375rem;
  font-size: .6875rem; color: var(--text-muted);
  margin-top: .75rem;
}
.heatmap-legend-cell {
  width: 12px; height: 12px; border-radius: 2px;
}
.heatmap-month-label {
  font-size: .6875rem; color: var(--text-muted);
  font-family: var(--font-mono);
}
.footprint-stat-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.25rem 1rem; text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-base) var(--ease-soft);
}
.footprint-stat-card:hover { box-shadow: var(--shadow-md); }
.footprint-stat-value {
  font-family: var(--font-serif);
  font-size: 1.75rem; font-weight: 500;
  color: var(--text-primary); line-height: 1.2;
}
.footprint-stat-label {
  font-size: .75rem; color: var(--text-muted);
  margin-top: .375rem;
}

/* ============================================================
   16. Streaming Text System（生成交互）
   ============================================================ */
.stream-container {
  font-family: var(--font-serif);
  font-size: 1.0625rem; line-height: 1.85;
  color: var(--text-primary);
  padding: 1.5rem; max-width: 680px;
  margin: 0 auto;
}
.stream-cursor {
  display: inline-block; width: 2px; height: 1.1em;
  background: var(--mist-deep);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: stream-blink 1s step-end infinite;
}
@keyframes stream-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.stream-thinking {
  margin: 1rem 1.5rem; padding: 1rem;
  background: var(--bg-sunken);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-faint);
  font-size: .8125rem; line-height: 1.6;
  color: var(--text-muted);
}
.stream-controls {
  display: flex; align-items: center; gap: .625rem;
  padding: .75rem 1.5rem;
}
.stream-progress {
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1.5rem .75rem;
  font-size: .8125rem; color: var(--text-secondary);
}

/* ============================================================
   17. Achievement System（成就 · 段位）
   ============================================================ */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}
.achievement-card {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 1.25rem .875rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-base) var(--ease-soft);
}
.achievement-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.achievement-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .625rem;
  background: linear-gradient(135deg, var(--mist), var(--taro));
  box-shadow: var(--shadow-sm);
}
.achievement-icon.locked {
  filter: grayscale(1); opacity: .4;
}
.achievement-name {
  font-size: .8125rem; font-weight: 500;
  color: var(--text-primary); margin-bottom: .375rem;
}
.achievement-progress {
  width: 100%; height: 4px;
  background: var(--bg-sunken);
  border-radius: 2px; overflow: hidden;
}
.achievement-progress-fill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--mist), var(--taro));
  transition: width var(--dur-slow) var(--ease-soft);
}
.tier-banner {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}
.tier-badge {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--mist-deep), var(--taro-deep));
  color: var(--text-on-mist);
  font-size: 1.25rem; font-weight: 600;
  box-shadow: var(--shadow-glow-mist);
  flex-shrink: 0;
}
.tier-info { flex: 1; }
.tier-name {
  font-family: var(--font-serif);
  font-size: 1.125rem; font-weight: 500;
  color: var(--text-primary);
}
.tier-desc {
  font-size: .8125rem; color: var(--text-muted);
  margin-top: .25rem;
}
.challenge-card {
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.challenge-card + .challenge-card { margin-top: .75rem; }

/* ============================================================
   18. Settings Form System（设置面板）
   ============================================================ */
.settings-section { margin-bottom: 2rem; }
.settings-group {
  background: var(--bg-elevated);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.settings-group-title {
  display: flex; align-items: center; gap: .625rem;
  padding: 1rem 1.25rem;
  font-family: var(--font-ui);
  font-size: .9375rem; font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-faint);
  background: rgba(143, 177, 201, .03);
}
.settings-group-title::before {
  content: ''; width: 3px; height: 16px;
  background: var(--mist-deep); border-radius: 2px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border-faint);
  gap: 1rem;
}
.settings-row:last-child { border-bottom: none; }
.settings-label {
  font-size: .875rem; color: var(--text-secondary);
  flex-shrink: 0;
}
.settings-label-hint {
  display: block; font-size: .75rem;
  color: var(--text-muted); margin-top: .125rem;
}
.settings-control {
  display: flex; align-items: center; gap: .625rem;
  flex-shrink: 0;
}
.radio-group {
  display: flex; align-items: center; gap: .125rem;
  background: var(--bg-sunken);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.radio-group-item {
  padding: .375rem .75rem;
  font-size: .8125rem; font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-soft);
}
.radio-group-item:hover { color: var(--text-secondary); }
.radio-group-item.active {
  background: var(--bg-elevated);
  color: var(--mist-deep);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   19. Export & Subscription Cards（导出 · 订阅）
   ============================================================ */
.format-card {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 1.5rem 1rem;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-faint);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-soft);
}
.format-card:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }
.format-card.selected {
  border-color: var(--mist-deep);
  box-shadow: var(--shadow-glow-mist);
  background: rgba(143, 177, 201, .04);
}
.format-card-icon {
  width: 40px; height: 40px; margin-bottom: .625rem;
  color: var(--mist-deep); opacity: .8;
}
.format-card-name {
  font-size: .875rem; font-weight: 500;
  color: var(--text-primary);
}
.format-card-desc {
  font-size: .75rem; color: var(--text-muted);
  margin-top: .25rem;
}
.export-progress {
  display: flex; flex-direction: column; gap: .75rem;
  padding: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-card);
}
.plan-card {
  display: flex; flex-direction: column;
  padding: 1.75rem 1.5rem;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-faint);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-base) var(--ease-soft);
}
.plan-card:hover { box-shadow: var(--shadow-md); }
.plan-card.featured {
  border-color: var(--mist);
  box-shadow: var(--shadow-md), var(--shadow-glow-mist);
  position: relative;
}
.plan-card.featured::after {
  content: '推荐';
  position: absolute; top: -.625rem; left: 50%;
  transform: translateX(-50%);
  padding: .1875rem .75rem;
  font-size: .6875rem; font-weight: 600;
  background: linear-gradient(135deg, var(--mist-deep), var(--taro-deep));
  color: var(--text-on-mist);
  border-radius: var(--radius-pill);
}
.plan-name {
  font-family: var(--font-serif);
  font-size: 1.125rem; font-weight: 500;
  color: var(--text-primary); margin-bottom: .5rem;
}
.plan-price {
  font-family: var(--font-serif);
  font-size: 2rem; font-weight: 500;
  line-height: 1.2; margin-bottom: .25rem;
}
.plan-price-unit {
  font-size: .8125rem; font-weight: 400;
  color: var(--text-muted);
}
.plan-features {
  display: flex; flex-direction: column; gap: .5rem;
  margin: 1.25rem 0; flex: 1;
  font-size: .8125rem; color: var(--text-secondary);
}
.plan-feature-item {
  display: flex; align-items: flex-start; gap: .5rem;
}
.plan-feature-item::before {
  content: ''; width: 16px; height: 16px; flex-shrink: 0;
  margin-top: 1px;
  background: var(--success);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z'/%3E%3C/svg%3E");
}
.plan-action { margin-top: auto; }
.plan-action .btn { width: 100%; justify-content: center; }

/* ============================================================
   20. Auth Layout（登录 · 注册）
   ============================================================ */
.auth-layout {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; position: relative;
  padding: 2rem;
}
.auth-card {
  width: 100%; max-width: 400px;
  padding: 2.5rem;
  background: var(--bg-glass-deep);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}
.auth-logo {
  display: flex; flex-direction: column;
  align-items: center; gap: .625rem;
  margin-bottom: 1.75rem;
}
.auth-logo-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, var(--mist), var(--taro));
  box-shadow: var(--shadow-md);
}
.auth-logo-name {
  font-family: var(--font-serif);
  font-size: 1.5rem; font-weight: 500;
  color: var(--text-primary);
}
.auth-title {
  font-family: var(--font-serif);
  font-size: 1.25rem; font-weight: 500;
  color: var(--text-primary); text-align: center;
  margin-bottom: .375rem;
}
.auth-subtitle {
  font-size: .875rem; color: var(--text-muted);
  text-align: center; margin-bottom: 1.75rem;
}
.auth-form {
  display: flex; flex-direction: column; gap: .875rem;
}
.auth-divider {
  display: flex; align-items: center; gap: .75rem;
  margin: 1.25rem 0;
  font-size: .75rem; color: var(--text-muted);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border-faint);
}
.auth-social {
  display: flex; justify-content: center; gap: .75rem;
}
.auth-social-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  transition: all var(--dur-fast) var(--ease-soft);
}
.auth-social-btn:hover {
  border-color: var(--border-strong);
  background: rgba(143, 177, 201, .06);
  color: var(--mist-deep);
}
