:root {
    /* 品牌主色 — 茶棕金（沉香色系） */
    --primary-50: #faf6f0;
    --primary-100: #f0e6d8;
    --primary-200: #e4d4bc;
    --primary-300: #d4b896;
    --primary-400: #c4a076;
    --primary-500: #a67c52;
    --primary-600: #8d6a44;
    --primary-700: #7a5a3a;
    --primary-800: #5c4228;
    --primary-900: #3d2c1a;
    --primary-950: #2a1d10;

    --primary: var(--primary-600);
    --primary-light: var(--primary-400);
    --primary-lighter: var(--primary-100);
    --primary-dark: var(--primary-700);
    --primary-darker: var(--primary-800);

    /* 金色系 — 鎏金 */
    --gold-50: #fefce8;
    --gold-100: #fef9c3;
    --gold-200: #fef08a;
    --gold-300: #fde047;
    --gold-400: #facc15;
    --gold-500: #eab308;
    --gold-600: #ca8a04;
    --gold-700: #a16207;
    --gold-800: #854d0e;
    --gold-900: #713f12;

    /* 主渐变 — 鎏金茶棕 */
    --primary-gradient: linear-gradient(135deg, #d4af37 0%, #c9a227 15%, #b8860b 30%, #a67c52 55%, #8b6914 75%, #7a5a3a 100%);
    --primary-gradient-soft: linear-gradient(135deg, #f5e6c8 0%, #e8d5a3 50%, #d4b896 100%);
    --primary-gradient-vertical: linear-gradient(180deg, #faf6f0 0%, #f5efe6 50%, #f0e6d8 100%);
    --gold-gradient: linear-gradient(135deg, #fde047 0%, #eab308 50%, #ca8a04 100%);
    --gold-shine: linear-gradient(105deg, transparent 20%, rgba(255,255,255,0.6) 50%, transparent 80%);

    /* 点缀色 — 中国传统色 */
    --accent-cinnabar: #c23a2b;
    --accent-cinnabar-light: #e87060;
    --accent-jade: #5a8a72;
    --accent-jade-light: #7eb899;
    --accent-indigo: #4a5568;
    --accent-azure: #5b7fa3;
    --accent-vermilion: #d4623a;
    --accent-ink: #2c2418;
    --accent-ochre: #b8860b;
    --accent-plum: #7b4b69;

    /* 背景 — 宣纸质感（多层渐变营造温润感） */
    --bg: #faf6f0;
    --bg-warm: #f7f1e8;
    --bg-cool: #f3eee6;
    --bg-deep: #efe8db;
    --surface: #ffffff;
    --surface-alt: #faf6f0;
    --surface-warm: #fdf8f0;
    --surface-elevated: #ffffff;
    --surface-gold-tint: #fdfaf2;

    /* 纸面纹理叠加色 */
    --paper-texture: rgba(166, 124, 82, 0.03);
    --paper-grain: rgba(92, 66, 40, 0.02);

    /* 文字 */
    --text: #2c2418;
    --text-primary: #3d3225;
    --text-secondary: #6b5d4d;
    --text-muted: #9a8e7e;
    --text-hint: #bab0a0;

    /* 边框与分隔 */
    --border: #e8ddd0;
    --border-light: #f0e8dd;
    --border-dark: #d4c4b0;
    --divider: #ede4d8;

    /* 语义色 */
    --success: #5a8a6a;
    --success-light: #e6f0e9;
    --warning: #c98b2a;
    --warning-light: #faf0dc;
    --danger: #b4544d;
    --danger-light: #f6e4e2;
    --info: #5a7d9a;
    --info-light: #e2ebf2;

    /* 字体 */
    --font-display: "Songti SC", "STSong", "Noto Serif SC", serif;
    --font-title: "Songti SC", "STSong", "Noto Serif SC", serif;
    --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-mono: "Consolas", "Monaco", "JetBrains Mono", monospace;

    /* 字号阶梯 */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* 间距 */
    --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;

    /* 别名兼容 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;

    /* 圆角 */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* 阴影 */
    --shadow-xs: 0 1px 2px rgba(92, 66, 40, 0.04);
    --shadow-sm: 0 2px 8px rgba(92, 66, 40, 0.06);
    --shadow-md: 0 4px 16px rgba(92, 66, 40, 0.08);
    --shadow-lg: 0 8px 32px rgba(92, 66, 40, 0.12);
    --shadow-xl: 0 16px 48px rgba(92, 66, 40, 0.16);
    --shadow-inner: inset 0 1px 2px rgba(92, 66, 40, 0.06);
    --shadow-glow: 0 0 20px rgba(166, 124, 82, 0.2);

    /* 过渡 */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* 布局 */
    --header-height: 64px;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;
    --content-max-width: 1440px;
    --content-padding: 32px;

    /* z-index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-sidebar: 300;
    --z-header: 400;
    --z-modal: 900;
    --z-toast: 950;
    --z-tooltip: 999;
    --z-onboarding: 1000;
}

/* 暗色模式 */
[data-theme="dark"] {
    --primary: #d4b896;
    --primary-light: #e8d5bc;
    --primary-lighter: #5c4228;
    --primary-dark: #a67c52;
    --primary-darker: #7a5a3a;
    --primary-gradient: linear-gradient(135deg, #d4b896 0%, #a67c52 50%, #7a5a3a 100%);

    --bg: #1a1612;
    --bg-warm: #1f1a15;
    --bg-cool: #181410;
    --surface: #26201a;
    --surface-alt: #2d261f;
    --surface-warm: #2a231b;
    --surface-elevated: #332b22;

    --text: #e8dccd;
    --text-primary: #f0e6d8;
    --text-secondary: #c4b8a8;
    --text-muted: #9a8e7e;
    --text-hint: #6b5d4d;

    --border: #3d3530;
    --border-light: #332b26;
    --border-dark: #4d4238;
    --divider: #2a241e;

    --success: #7aaa8a;
    --success-light: #2a3d32;
    --warning: #d9a55a;
    --warning-light: #3d3220;
    --danger: #c97a74;
    --danger-light: #3d2826;
    --info: #7a9ab4;
    --info-light: #283340;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 20px rgba(212, 184, 150, 0.15);
}

/* 宣纸纹理背景（浅色）— 多层叠加营造真实质感 */
body {
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 15% 10%, rgba(212, 175, 55, 0.08) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 90%, rgba(166, 124, 82, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(245, 230, 200, 0.4) 0%, transparent 70%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-size: auto, auto, auto, 200px 200px;
    background-attachment: fixed, fixed, fixed, fixed;
    background-blend-mode: normal, normal, normal, overlay;
    opacity: 1;
}

/* 暗色模式背景 */
[data-theme="dark"] body {
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(166, 124, 82, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(60, 45, 30, 0.5) 0%, transparent 70%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-size: auto, auto, auto, 200px 200px;
    background-blend-mode: normal, normal, normal, overlay;
}

/* 装饰性渐变线 */
.deco-line {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-300) 20%, var(--primary-500) 50%, var(--primary-300) 80%, transparent 100%);
    margin: var(--space-lg) 0;
}

.deco-line-double {
    height: 3px;
    border-top: 1px solid var(--primary-300);
    border-bottom: 1px solid var(--primary-300);
    margin: var(--space-lg) 0;
    position: relative;
}

.deco-line-double::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* 印章效果 */
.seal-stamp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 2px solid var(--accent-cinnabar);
    color: var(--accent-cinnabar);
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    transform: rotate(-3deg);
    opacity: 0.85;
    position: relative;
}

.seal-stamp::before {
    content: '';
    position: absolute;
    inset: -4px;
    border: 1px solid var(--accent-cinnabar);
    opacity: 0.5;
}

/* 云纹装饰 */
.cloud-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='30' viewBox='0 0 60 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 15 Q15 10 20 15 Q25 20 30 15 Q35 10 40 15 Q45 20 50 15' stroke='%23d4b896' stroke-width='1' fill='none' opacity='0.3'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    height: 30px;
}

/* 回纹边框 */
.meander-border {
    border: 2px solid var(--primary-400);
    position: relative;
}

.meander-border::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px solid var(--primary-300);
    pointer-events: none;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.8;
    min-height: 100vh;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    font-size: var(--text-base);
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-kerning: normal;
    font-kerning: normal;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    position: relative;
}

h1 { 
    font-size: var(--text-4xl); 
    font-weight: 700; 
    letter-spacing: 0.05em;
}

h2 { 
    font-size: var(--text-3xl); 
    font-weight: 600; 
    letter-spacing: 0.04em;
    position: relative;
    padding-left: 16px;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--primary-gradient);
    border-radius: 2px;
}

h3 { 
    font-size: var(--text-2xl); 
    font-weight: 600; 
    letter-spacing: 0.03em;
}

h4 { 
    font-size: var(--text-xl); 
    font-weight: 600; 
    letter-spacing: 0.02em;
}

h5 { 
    font-size: var(--text-lg); 
    font-weight: 600; 
}

h6 { 
    font-size: var(--text-base); 
    font-weight: 600; 
}

/* 标题装饰 — 左右花纹 */
.title-ornament {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
}

.title-ornament::before,
.title-ornament::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-300), transparent);
}

.title-ornament.left::before {
    flex: none;
    width: 60px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-300), transparent);
}

.title-ornament.right::after {
    flex: none;
    width: 60px;
    background: linear-gradient(90deg, transparent, var(--primary-300), var(--primary-500));
}

/* 首字下沉 */
.drop-cap::first-letter {
    font-family: var(--font-title);
    font-size: 3em;
    font-weight: 700;
    float: left;
    line-height: 1;
    margin-right: 8px;
    margin-top: 4px;
    color: var(--primary);
    background: var(--primary-gradient-soft);
    padding: 8px 12px;
    border-radius: 8px;
}

/* 竖排文字 */
.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.2em;
}

/* 引用样式 */
blockquote {
    position: relative;
    padding: var(--space-lg) var(--space-xl);
    margin: var(--space-lg) 0;
    background: var(--surface-warm);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-family: var(--font-title);
    font-size: 1.05rem;
    line-height: 2;
    color: var(--text-secondary);
}

blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 12px;
    font-family: var(--font-title);
    font-size: 3rem;
    color: var(--primary-300);
    line-height: 1;
}

/* 文字强调 */
.text-underline-deco {
    text-decoration: none;
    background-image: linear-gradient(120deg, var(--primary-300) 0%, var(--primary-500) 100%);
    background-repeat: no-repeat;
    background-size: 100% 2px;
    background-position: 0 90%;
    padding-bottom: 2px;
}

.text-gradient-gold {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 印章文字 */
.text-seal {
    font-family: var(--font-title);
    color: var(--accent-cinnabar);
    font-weight: 700;
    letter-spacing: 0.1em;
}

::selection {
    background-color: var(--primary-light);
    color: var(--primary-darker);
}

a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
}

a:hover {
    color: var(--primary);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    font-size: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-hint);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

hr {
    border: none;
    border-top: 1px solid var(--divider);
    margin: var(--space-6) 0;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 文字工具类 */
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-primary { color: var(--text-primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.font-mono { font-family: var(--font-mono); }
.font-title { font-family: var(--font-title); }
.font-display { font-family: var(--font-display); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-medium { font-weight: 500; }
.fw-normal { font-weight: 400; }
.fw-light { font-weight: 300; }

.leading-tight { line-height: 1.25; }
.leading-snug { line-height: 1.4; }
.leading-normal { line-height: 1.7; }
.leading-relaxed { line-height: 1.8; }

.tracking-tight { letter-spacing: -0.02em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.05em; }
.tracking-wider { letter-spacing: 0.1em; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 间距工具类 */
.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-6 { margin: var(--space-6); }
.m-8 { margin: var(--space-8); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-4 { margin-left: var(--space-4); }
.ml-sm { margin-left: var(--space-sm); }
.ml-md { margin-left: var(--space-md); }

.mr-1 { margin-right: var(--space-1); }
.mr-2 { margin-right: var(--space-2); }
.mr-4 { margin-right: var(--space-4); }
.mr-sm { margin-right: var(--space-sm); }
.mr-md { margin-right: var(--space-md); }

.mx-auto { margin-left: auto; margin-right: auto; }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }

.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.px-8 { padding-left: var(--space-8); padding-right: var(--space-8); }

.py-1 { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }

.gap-0 { gap: 0; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* 显示工具类 */
.hidden { display: none !important; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.inline-grid { display: inline-grid; }
.block { display: block; }
.inline-block { display: inline-block; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-col-reverse { flex-direction: column-reverse; }
.flex-row-reverse { flex-direction: row-reverse; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.items-baseline { align-items: baseline; }

.justify-center { justify-content: center; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-wrap-reverse { flex-wrap: wrap-reverse; }

.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-none { flex: none; }
.grow { flex-grow: 1; }
.grow-0 { flex-grow: 0; }
.shrink { flex-shrink: 1; }
.shrink-0 { flex-shrink: 0; }

.self-center { align-self: center; }
.self-start { align-self: flex-start; }
.self-end { align-self: flex-end; }

.order-first { order: -1; }
.order-last { order: 999; }
.order-1 { order: 1; }
.order-2 { order: 2; }
.order-3 { order: 3; }

/* 宽度 */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }
.w-max { width: max-content; }
.w-min { width: min-content; }

.min-w-0 { min-width: 0; }
.max-w-full { max-width: 100%; }
.max-w-screen { max-width: var(--content-max-width); }

/* 高度 */
.h-full { height: 100%; }
.h-auto { height: auto; }
.h-screen { height: 100vh; }
.h-dvh { height: 100dvh; }
.min-h-screen { min-height: 100vh; }
.min-h-0 { min-height: 0; }

/* 定位 */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.inset-0 { inset: 0; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }

.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* 其他 */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-text { cursor: text; }
.cursor-move { cursor: move; }

.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

.select-none { user-select: none; }
.select-text { user-select: text; }
.select-all { user-select: all; }

.visibility-hidden { visibility: hidden; }
.visibility-visible { visibility: visible; }

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* 圆角 */
.rounded-none { border-radius: 0; }
.rounded-xs { border-radius: var(--radius-xs); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* 边框 */
.border-0 { border-width: 0; }
.border { border-width: 1px; }
.border-2 { border-width: 2px; }

.border-solid { border-style: solid; }
.border-dashed { border-style: dashed; }
.border-dotted { border-style: dotted; }

.border { border-color: var(--border); }
.border-light { border-color: var(--border-light); }
.border-dark { border-color: var(--border-dark); }
.border-primary { border-color: var(--primary); }
.border-success { border-color: var(--success); }
.border-warning { border-color: var(--warning); }
.border-danger { border-color: var(--danger); }

.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-l { border-left: 1px solid var(--border); }
.border-r { border-right: 1px solid var(--border); }

/* 背景 */
.bg-transparent { background-color: transparent; }
.bg-surface { background-color: var(--surface); }
.bg-surface-alt { background-color: var(--surface-alt); }
.bg-surface-warm { background-color: var(--surface-warm); }
.bg-bg { background-color: var(--bg); }
.bg-bg-warm { background-color: var(--bg-warm); }
.bg-primary { background-color: var(--primary); }
.bg-primary-light { background-color: var(--primary-light); }
.bg-primary-lighter { background-color: var(--primary-lighter); }
.bg-success { background-color: var(--success); }
.bg-success-light { background-color: var(--success-light); }
.bg-warning { background-color: var(--warning); }
.bg-warning-light { background-color: var(--warning-light); }
.bg-danger { background-color: var(--danger); }
.bg-danger-light { background-color: var(--danger-light); }
.bg-info { background-color: var(--info); }
.bg-info-light { background-color: var(--info-light); }

/* 过渡动画 */
.transition-all { transition: all var(--transition-normal); }
.transition-colors { transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast); }
.transition-opacity { transition: opacity var(--transition-fast); }
.transition-transform { transition: transform var(--transition-normal); }
.transition-shadow { transition: box-shadow var(--transition-fast); }

.duration-fast { transition-duration: 150ms; }
.duration-normal { transition-duration: 250ms; }
.duration-slow { transition-duration: 400ms; }

.ease-linear { transition-timing-function: linear; }
.ease-in { transition-timing-function: cubic-bezier(0.4, 0, 1, 1); }
.ease-out { transition-timing-function: cubic-bezier(0, 0, 0.2, 1); }
.ease-in-out { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.ease-bounce { transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }

/* 变换 */
.scale-95 { transform: scale(0.95); }
.scale-100 { transform: scale(1); }
.scale-105 { transform: scale(1.05); }
.scale-110 { transform: scale(1.1); }

.rotate-0 { transform: rotate(0deg); }
.rotate-90 { transform: rotate(90deg); }
.rotate-180 { transform: rotate(180deg); }
.rotate-270 { transform: rotate(270deg); }

.translate-y-0 { transform: translateY(0); }
.translate-y-1 { transform: translateY(var(--space-1)); }
.translate-y--1 { transform: translateY(calc(var(--space-1) * -1)); }
.translate-y-2 { transform: translateY(var(--space-2)); }
.translate-y--2 { transform: translateY(calc(var(--space-2) * -1)); }

/* 网格 */
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.grid-flow-row { grid-auto-flow: row; }
.grid-flow-col { grid-auto-flow: column; }
.grid-flow-dense { grid-auto-flow: dense; }

.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-full { grid-column: 1 / -1; }

.row-span-1 { grid-row: span 1 / span 1; }
.row-span-2 { grid-row: span 2 / span 2; }

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.animate-fade-in { animation: fadeIn var(--transition-normal) ease-out; }
.animate-fade-in-up { animation: fadeInUp var(--transition-normal) ease-out; }
.animate-fade-in-down { animation: fadeInDown var(--transition-normal) ease-out; }
.animate-scale-in { animation: scaleIn var(--transition-normal) ease-out; }
.animate-slide-in-right { animation: slideInRight var(--transition-normal) ease-out; }
.animate-slide-in-left { animation: slideInLeft var(--transition-normal) ease-out; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-float { animation: float 4s ease-in-out infinite; }

/* 精致动效 */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce-in-up {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    60% {
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(166, 124, 82, 0.3),
                    0 0 10px rgba(166, 124, 82, 0.2);
    }
    50% {
        box-shadow: 0 0 15px rgba(166, 124, 82, 0.5),
                    0 0 30px rgba(166, 124, 82, 0.3);
    }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

@keyframes slide-up-fade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-shimmer {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.animate-spin { animation: spin 1s linear infinite; }
.animate-bounce-in { animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55); }
.animate-bounce-in-up { animation: bounce-in-up 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55); }
.animate-glow-pulse { animation: glow-pulse 2s ease-in-out infinite; }
.animate-wiggle { animation: wiggle 0.5s ease-in-out; }
.animate-heartbeat { animation: heartbeat 1.5s ease-in-out infinite; }

/* 延迟动画类 - 用于错落入场 */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* 动画填充模式 */
.animate-fill-both { animation-fill-mode: both; }
.animate-fill-forwards { animation-fill-mode: forwards; }
.animate-fill-backwards { animation-fill-mode: backwards; }

/* 鼠标悬停微动效 */
.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: transform var(--transition-fast);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform var(--transition-normal);
}

.hover-rotate:hover {
    transform: rotate(3deg);
}

/* 卡片式入场动画 - 依次淡入上移 */
.stagger-enter > * {
    opacity: 0;
    transform: translateY(16px);
    animation: slide-up-fade 0.5s ease-out forwards;
}

.stagger-enter > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-enter > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-enter > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-enter > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-enter > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-enter > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-enter > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-enter > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-enter > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-enter > *:nth-child(10) { animation-delay: 0.5s; }

/* 响应式断点辅助类 */
@media (max-width: 1024px) {
    .lg\:hidden { display: none !important; }
    .lg\:flex { display: flex !important; }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr) !important; }
}

@media (max-width: 768px) {
    html { font-size: 15px; }

    .md\:hidden { display: none !important; }
    .md\:flex { display: flex !important; }
    .md\:block { display: block !important; }
    .md\:flex-col { flex-direction: column !important; }
    .md\:grid-cols-1 { grid-template-columns: 1fr !important; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
    .md\:w-full { width: 100% !important; }
    .md\:p-4 { padding: var(--space-4) !important; }
    .md\:p-6 { padding: var(--space-6) !important; }
}

@media (max-width: 480px) {
    html { font-size: 14px; }

    .sm\:hidden { display: none !important; }
    .sm\:flex-col { flex-direction: column !important; }
    .sm\:grid-cols-1 { grid-template-columns: 1fr !important; }
    .sm\:w-full { width: 100% !important; }
}

/**
 * 组件样式
 */

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    white-space: nowrap;
    user-select: none;
    position: relative;
    overflow: hidden;
    font-family: var(--font-body);
    letter-spacing: 0.02em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

/* 主按钮 — 鎏金质感 */
.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(166, 124, 82, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(166, 124, 82, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    box-shadow: 0 1px 4px rgba(166, 124, 82, 0.3),
                inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 描边按钮 — 金边效果 */
.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-300);
    color: var(--primary-700);
    font-weight: 600;
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary-500);
    color: var(--primary-600);
    background-color: var(--primary-50);
    box-shadow: 0 2px 8px rgba(166, 124, 82, 0.15);
}

/* 危险按钮 */
.btn-danger {
    background: linear-gradient(135deg, #d4623a 0%, #c23a2b 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(194, 58, 43, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: none;
}

.btn-danger:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(194, 58, 43, 0.4);
    transform: translateY(-1px);
}

/* 幽灵按钮 */
.btn-ghost {
    background-color: transparent;
    color: var(--text-muted);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--primary);
    background-color: var(--primary-50);
}

/* 成功按钮 */
.btn-success {
    background: linear-gradient(135deg, #7eb899 0%, #5a8a72 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(90, 138, 114, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: none;
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(90, 138, 114, 0.4);
    transform: translateY(-1px);
}

/* 信息按钮 */
.btn-info {
    background: linear-gradient(135deg, #7a9ab4 0%, #5b7fa3 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(91, 127, 163, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: none;
}

.btn-info:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(91, 127, 163, 0.4);
    transform: translateY(-1px);
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
}

.btn-icon {
    padding: var(--space-sm);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
    padding: var(--space-xs);
}

.btn-icon.btn-lg {
    width: 48px;
    height: 48px;
    padding: var(--space-md);
}

/* 按钮组 */
.btn-group {
    display: inline-flex;
    gap: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.btn-group .btn:last-child {
    border-right: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* 印章风格按钮 */
.btn-seal {
    background: var(--accent-cinnabar);
    color: #fff;
    font-family: var(--font-title);
    font-weight: 700;
    letter-spacing: 0.1em;
    border-radius: 4px;
    transform: rotate(-2deg);
    box-shadow: 2px 2px 8px rgba(194, 58, 43, 0.3);
}

.btn-seal:hover:not(:disabled) {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 4px 4px 12px rgba(194, 58, 43, 0.4);
}

/* 文字按钮 */
.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    padding: var(--space-xs) var(--space-sm);
    font-weight: 500;
}

.btn-text:hover:not(:disabled) {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ========== 卡片 ========== */
.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
    transition: all var(--transition-normal);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-300);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-gradient-vertical);
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: var(--space-lg);
    right: var(--space-lg);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-300), transparent);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    font-family: var(--font-title);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.card-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.card-body {
    padding: var(--space-lg);
    position: relative;
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
    background-color: var(--surface-alt);
    position: relative;
}

.card-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: var(--space-lg);
    right: var(--space-lg);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-300), transparent);
}

/* 卡片变体 — 金边卡片 */
.card-gold {
    border: 2px solid transparent;
    background: 
        linear-gradient(var(--surface), var(--surface)) padding-box,
        var(--primary-gradient) border-box;
    box-shadow: 0 4px 20px rgba(166, 124, 82, 0.15);
}

.card-gold::before {
    opacity: 1;
}

/* 卡片变体 — 宣纸卡片 */
.card-paper {
    background: var(--surface-warm);
    border-color: var(--primary-200);
    box-shadow: 
        0 2px 8px rgba(166, 124, 82, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.card-paper .card-header {
    background: var(--primary-gradient-soft);
    border-bottom-color: var(--primary-200);
}

/* 卡片变体 — 悬浮感卡片 */
.card-elevated {
    box-shadow: var(--shadow-lg);
    border: none;
    background: var(--surface);
}

.card-elevated:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

/* 卡片角标装饰 */
.card-corner-ribbon {
    position: absolute;
    top: 12px;
    right: -32px;
    transform: rotate(45deg);
    background: var(--primary-gradient);
    color: white;
    padding: 4px 40px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 统计卡片增强 */
.card-stat {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.card-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
}

.card-stat-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient-soft);
    border-radius: var(--radius-md);
}

.card-stat-content {
    flex: 1;
}

.card-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    font-family: var(--font-title);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.card-highlight {
    border: 2px solid transparent;
    background: 
        linear-gradient(var(--surface), var(--surface)) padding-box,
        var(--primary-gradient) border-box;
    box-shadow: 0 4px 20px rgba(166, 124, 82, 0.2);
}

.card-highlight::before {
    opacity: 1;
}

/* ========== 输入框 ========== */
.input, .select, .textarea {
    width: 100%;
    padding: 10px var(--space-md);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--surface);
    color: var(--text);
    transition: all var(--transition-fast);
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
}

.input:hover, .select:hover, .textarea:hover {
    border-color: var(--primary-300);
}

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-100),
                0 2px 8px rgba(166, 124, 82, 0.1);
    background-color: var(--surface);
}

.input:disabled {
    background-color: var(--surface-alt);
    opacity: 0.6;
    cursor: not-allowed;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--text-hint);
    font-style: normal;
}

/* 输入组 — 带前后缀 */
.input-group {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--surface);
    transition: all var(--transition-fast);
    overflow: hidden;
}

.input-group:focus-within {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-100),
                0 2px 8px rgba(166, 124, 82, 0.1);
}

.input-group:hover {
    border-color: var(--primary-300);
}

.input-group .input {
    border: none;
    border-radius: 0;
    background: transparent;
    flex: 1;
    min-width: 0;
}

.input-group .input:focus {
    box-shadow: none;
}

.input-group .input-prefix,
.input-group .input-suffix {
    display: flex;
    align-items: center;
    padding: 0 var(--space-md);
    background-color: var(--surface-alt);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    border-right: 1px solid var(--border);
    min-height: 42px;
}

.input-group .input-suffix {
    border-right: none;
    border-left: 1px solid var(--border);
}

/* 表单组 */
.form-group {
    margin-bottom: var(--space-md);
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-family: var(--font-title);
    letter-spacing: 0.02em;
}

.form-group label .required {
    color: var(--accent-cinnabar);
    margin-left: 2px;
    font-weight: 700;
}

.form-group .form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

.form-group.has-error .input,
.form-group.has-error .select,
.form-group.has-error .textarea,
.form-group.has-error .input-group {
    border-color: var(--danger);
    background-color: var(--danger-light);
}

.form-group.has-error .input:focus,
.form-group.has-error .select:focus,
.form-group.has-error .textarea:focus,
.form-group.has-error .input-group:focus-within {
    box-shadow: 0 0 0 4px rgba(180, 84, 77, 0.15);
}

.form-group .form-error {
    font-size: 0.78rem;
    color: var(--danger);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-group.has-success .input,
.form-group.has-success .select,
.form-group.has-success .textarea {
    border-color: var(--success);
}

/* 标签页增强 */
.tabs {
    display: flex;
    gap: var(--space-xs);
    border-bottom: 2px solid var(--border);
    margin-bottom: var(--space-lg);
    position: relative;
}

.tabs::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-300), transparent);
    pointer-events: none;
}

.tab {
    padding: var(--space-sm) var(--space-md);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    font-family: var(--font-title);
    letter-spacing: 0.02em;
}

.tab:hover {
    color: var(--text);
    background-color: var(--primary-50);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp var(--transition-normal) ease-out;
}

/* 徽章增强 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.02em;
    font-family: var(--font-body);
}

.badge-primary { 
    background: linear-gradient(135deg, var(--primary-100) 0%, var(--primary-200) 100%);
    color: var(--primary-700);
}

.badge-success { 
    background: linear-gradient(135deg, #e6f0e9 0%, #d4e5da 100%);
    color: var(--success);
}

.badge-warning { 
    background: linear-gradient(135deg, #faf0dc 0%, #f5e4c0 100%);
    color: var(--warning);
}

.badge-danger { 
    background: linear-gradient(135deg, #f6e4e2 0%, #f0d0cd 100%);
    color: var(--danger);
}

.badge-info { 
    background: linear-gradient(135deg, #e2ebf2 0%, #cddbe6 100%);
    color: var(--info);
}

.badge-muted { 
    background-color: var(--surface-alt); 
    color: var(--text-muted); 
}

.badge-gold {
    background: var(--gold-gradient);
    color: var(--gold-900);
    font-weight: 700;
}

/* 表格增强 */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: var(--primary-gradient-vertical);
}

.data-table th {
    padding: 12px var(--space-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--primary-200);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
    font-family: var(--font-title);
    letter-spacing: 0.02em;
}

.data-table td {
    padding: 10px var(--space-md);
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    transition: background-color var(--transition-fast);
}

.data-table tbody tr {
    transition: all var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: var(--primary-50);
}

.data-table tbody tr.selected {
    background-color: var(--primary-100);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 表格斑马纹 */
.data-table.zebra tbody tr:nth-child(even) {
    background-color: var(--surface-alt);
}

.data-table.zebra tbody tr:hover {
    background-color: var(--primary-50);
}

/* ========== 表格 ========== */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background-color: var(--surface-alt);
}

.data-table th {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.data-table tbody tr:hover {
    background-color: var(--surface-alt);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

@media (max-width: 768px) {
    .table-wrap.mobile-table {
        border: none;
        border-radius: 0;
    }

    .table-wrap.mobile-table .data-table thead {
        display: none;
    }

    .table-wrap.mobile-table .data-table,
    .table-wrap.mobile-table .data-table tbody,
    .table-wrap.mobile-table .data-table tr,
    .table-wrap.mobile-table .data-table td {
        display: block;
        width: 100%;
    }

    .table-wrap.mobile-table .data-table tr {
        margin-bottom: var(--space-md);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: var(--space-md);
        background-color: var(--surface);
        box-shadow: var(--shadow-sm);
    }

    .table-wrap.mobile-table .data-table td {
        border-bottom: 1px dashed var(--border);
        padding: var(--space-sm) 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .table-wrap.mobile-table .data-table td:last-child {
        border-bottom: none;
    }

    .table-wrap.mobile-table .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.8rem;
        flex-shrink: 0;
        margin-right: var(--space-md);
        min-width: 80px;
    }

    .table-wrap.mobile-table .data-table td .btn-group,
    .table-wrap.mobile-table .data-table td .flex {
        justify-content: flex-end;
    }

    .table-wrap.mobile-table .data-table .badge {
        margin-left: auto;
    }

    /* 手机端表格：会员价等嵌套内容纵向排列 */
    .table-wrap.mobile-table .data-table td > div > div {
        text-align: right;
    }

    /* 手机端表格：操作按钮区 */
    .table-wrap.mobile-table .data-table td .flex.gap-xs {
        gap: var(--space-xs);
    }

    .table-wrap.mobile-table .data-table td .btn-icon.btn-sm {
        width: 32px;
        height: 32px;
        min-height: 32px;
        font-size: 0.75rem;
    }

    /* 手机端表格：售价列的会员价缩小 */
    .table-wrap.mobile-table .data-table td .text-sm.text-muted {
        font-size: 0.75rem;
    }
}

/* 可编辑单元格 */
.cell-editable {
    cursor: text;
    border-radius: var(--radius-sm);
    padding: 2px var(--space-sm);
    transition: background-color var(--transition-fast);
}

.cell-editable:hover {
    background-color: var(--surface-alt);
}

.cell-editable.editing {
    background-color: var(--bg);
    box-shadow: inset 0 0 0 2px var(--primary);
}

/* ========== 徽章 ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--space-sm);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
}

.badge-primary { background-color: rgba(139, 94, 60, 0.15); color: var(--primary); }
.badge-success { background-color: rgba(74, 124, 89, 0.15); color: var(--success); }
.badge-warning { background-color: rgba(201, 123, 42, 0.15); color: var(--warning); }
.badge-danger  { background-color: rgba(169, 68, 66, 0.15); color: var(--danger); }
.badge-info    { background-color: rgba(58, 107, 138, 0.15); color: var(--info); }
.badge-muted   { background-color: var(--surface-alt); color: var(--text-muted); }

/* ========== 提示框 ========== */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    font-size: 0.9rem;
}

.alert-success { background-color: rgba(74, 124, 89, 0.1); border: 1px solid rgba(74, 124, 89, 0.3); }
.alert-warning { background-color: rgba(201, 123, 42, 0.1); border: 1px solid rgba(201, 123, 42, 0.3); }
.alert-danger  { background-color: rgba(169, 68, 66, 0.1); border: 1px solid rgba(169, 68, 66, 0.3); }
.alert-info    { background-color: rgba(58, 107, 138, 0.1); border: 1px solid rgba(58, 107, 138, 0.3); }

/* ========== Toast 通知 ========== */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    animation: toast-in var(--transition-normal);
}

.toast.removing {
    animation: toast-out var(--transition-normal) forwards;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-danger  { border-left: 4px solid var(--danger); }
.toast-info    { border-left: 4px solid var(--info); }

@keyframes toast-in {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(120%); opacity: 0; }
}

/* ========== 模态框 ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    animation: fade-in var(--transition-fast);
}

.modal {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modal-in var(--transition-normal);
}

.modal-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modal-in {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ========== 骨架屏 ========== */
.skeleton {
    background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 50%, var(--surface-alt) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== 统计卡片 ========== */
.card-stat {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
}

.card-stat-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.card-stat-content {
    flex: 1;
}

.card-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.card-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.card-highlight {
    border: 2px solid var(--primary);
}

/* ========== 表单组 ========== */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

/* ========== 输入组 ========== */
.input-group {
    display: flex;
    gap: 4px;
}

.input-group .input {
    flex: 1;
}

/* ========== 复选框 ========== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ========== 图例 ========== */
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-light, rgba(0,0,0,0.04));
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    background: var(--surface-alt);
    border-radius: 20px;
    transition: background 0.2s;
}

.legend-item:hover {
    background: var(--primary-50, #faf6f0);
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.8);
}

.legend-label {
    color: var(--text-secondary);
    white-space: nowrap;
}

.legend-value {
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* ========== AI 定价建议 ========== */
.ai-score-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--primary-50, #faf6f0) 0%, var(--surface) 100%);
    border-radius: var(--radius-md);
}

@media (max-width: 768px) {
    .ai-score-wrap {
        flex-direction: column;
        text-align: center;
    }
}

.ai-score-ring {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-score-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ai-score-ring .ai-score-svg circle {
    transition: stroke-dashoffset 0.8s ease;
}

.ai-score-healthy { color: #22c55e; }
.ai-score-attention { color: #f59e0b; }
.ai-score-critical { color: #ef4444; }

.ai-score-num {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Songti SC', serif;
    z-index: 1;
}

.ai-score-info {
    flex: 1;
}

.ai-score-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.ai-score-max {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
}

.ai-score-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.ai-badge-healthy { background: rgba(34,197,94,0.12); color: #16a34a; }
.ai-badge-attention { background: rgba(245,158,11,0.12); color: #d97706; }
.ai-badge-critical { background: rgba(239,68,68,0.12); color: #dc2626; }

.ai-score-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-stat-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 2px 0 8px;
}

.ai-dot-healthy { background: #22c55e; }
.ai-dot-attention { background: #f59e0b; }
.ai-dot-critical { background: #ef4444; }

.ai-alert-card {
    margin-bottom: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
}

.ai-alert-healthy { border-left: 3px solid #22c55e; }
.ai-alert-attention { border-left: 3px solid #f59e0b; }
.ai-alert-critical { border-left: 3px solid #ef4444; }

.ai-alert-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xs);
}

.ai-alert-score {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.ai-alert-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.ai-alert-msg {
    color: var(--text-secondary);
}

.ai-alert-tip {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    padding-left: 10px;
    border-left: 2px solid var(--border, #e0d6c8);
}

.ai-recommend {
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, var(--primary-50, #faf6f0) 0%, var(--surface-alt) 100%);
    border-radius: var(--radius-sm);
}

.ai-recommend-title {
    margin-bottom: var(--space-sm);
    font-size: 1rem;
}

.ai-recommend-item {
    font-size: 0.85rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========== 图表响应式 ========== */
.chart-canvas {
    display: block;
    width: 100%;
    height: 260px;
}

@media (max-width: 768px) {
    .chart-canvas {
        height: 220px;
    }
}

/* ========== 表格行选中 ========== */
.data-table tr.selected {
    background-color: rgba(139, 94, 60, 0.08);
}

.data-table tr:hover {
    background-color: var(--surface-alt);
}

/* ========== 表格底栏 ========== */
.table-footer {
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========== 分隔线 ========== */
.divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-lg) 0;
}

/* ========== 工具类补全 ========== */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 700; }
.rounded { border-radius: var(--radius-md); }
.bg-muted { background-color: var(--surface-alt); }

.w-full { width: 100%; }
.gap-xs { gap: 4px; }

.p-xs { padding: 4px; }
.p-sm { padding: var(--space-sm); }
.p-lg { padding: var(--space-lg); }
.mt-xs { margin-top: 4px; }

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.skeleton-line {
    height: 14px;
    margin-bottom: var(--space-sm);
}

.skeleton-line:last-child {
    width: 60%;
}

/* ========== 空状态 ========== */
.empty-state {
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
}

/* ========== 进度条 ========== */
.progress {
    width: 100%;
    height: 8px;
    background-color: var(--surface-alt);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.progress-bar-success { background-color: var(--success); }
.progress-bar-warning { background-color: var(--warning); }
.progress-bar-danger  { background-color: var(--danger); }

/* ========== 开关 ========== */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    inset: 0;
    background-color: var(--border);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
    cursor: pointer;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.switch input:checked + .switch-slider {
    background-color: var(--primary);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(20px);
}

/* ========== 新手引导 ========== */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fade-in var(--transition-fast);
}

.onboarding-overlay.fade-out {
    animation: fade-out var(--transition-fast) forwards;
}

.onboarding-highlight {
    position: fixed;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 4px var(--primary), 0 0 0 9999px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 10001;
    transition: all var(--transition-normal);
}

.onboarding-tooltip {
    position: fixed;
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-lg);
    max-width: 360px;
    width: calc(100vw - 32px);
    z-index: 10002;
    animation: modal-in var(--transition-normal);
}

.onboarding-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.onboarding-step {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.onboarding-skip {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.onboarding-skip:hover {
    color: var(--text);
    background-color: var(--surface-alt);
}

.onboarding-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text);
}

.onboarding-content {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.onboarding-actions {
    display: flex;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.onboarding-actions .btn {
    min-height: 40px;
    padding: var(--space-sm) var(--space-md);
}

.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border);
    transition: background-color var(--transition-fast);
}

.onboarding-dot.active {
    background-color: var(--primary);
    width: 20px;
    border-radius: var(--radius-full);
}

.onboarding-dot.completed {
    background-color: var(--primary-light);
}

@keyframes fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@media (max-width: 768px) {
    .onboarding-tooltip {
        max-width: none;
        width: calc(100vw - 32px);
        left: 16px !important;
        right: 16px;
    }

    .onboarding-highlight {
        border-radius: var(--radius-md);
    }
}

/* ========== 标签页 ========== */
.tabs {
    display: flex;
    gap: var(--space-xs);
    border-bottom: 2px solid var(--border);
    margin-bottom: var(--space-lg);
}

.tab {
    padding: var(--space-sm) var(--space-md);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fade-in var(--transition-normal);
}

/* ========== 折叠面板 ========== */
.collapse {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    overflow: hidden;
}

.collapse-header {
    padding: var(--space-md) var(--space-lg);
    background-color: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 500;
    transition: background-color var(--transition-fast);
}

.collapse-header:hover {
    background-color: var(--bg);
}

.collapse-arrow {
    transition: transform var(--transition-fast);
}

.collapse.expanded .collapse-arrow {
    transform: rotate(90deg);
}

.collapse-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.collapse.expanded .collapse-body {
    max-height: 2000px;
    padding: var(--space-lg);
}

/* ========== 说明书 ========== */
.manual-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--space-lg);
    align-items: start;
}

.manual-toc {
    position: sticky;
    top: var(--space-md);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.manual-toc-title {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-dark);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-sm);
}

.manual-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.manual-toc-list li {
    margin-bottom: 2px;
}

.manual-toc-list a {
    display: block;
    padding: 6px 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-left: 2px solid transparent;
}

.manual-toc-list a:hover {
    background-color: var(--bg);
    color: var(--text);
    border-left-color: var(--primary-light);
}

.manual-content {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    min-width: 0;
}

.manual-section {
    padding: var(--space-lg) 0;
    border-bottom: 1px dashed var(--border);
    scroll-margin-top: 80px;
}

.manual-section:last-of-type {
    border-bottom: none;
}

.manual-h2 {
    font-family: var(--font-title);
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--primary-light);
    display: inline-block;
}

.manual-h3 {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: var(--space-sm);
    margin-top: var(--space-md);
}

.manual-feature {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background-color: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.manual-feature-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.manual-feature strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
}

.manual-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.manual-step {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background-color: var(--surface-alt);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
}

.manual-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.manual-step-body h3 {
    font-family: var(--font-title);
    font-size: 1rem;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.manual-product-card {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.manual-product-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.manual-product-card h3 {
    font-family: var(--font-title);
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.manual-product-card ul {
    text-align: left;
    list-style: none;
    padding: 0;
    margin-top: var(--space-sm);
}

.manual-product-card ul li {
    padding: 4px 0;
    border-bottom: 1px dashed var(--border);
}

.manual-product-card ul li:last-child {
    border-bottom: none;
}

.manual-product-card code {
    font-size: 0.8rem;
    background-color: var(--surface);
    padding: 2px 6px;
    border-radius: 3px;
}

.manual-formula {
    background-color: var(--surface-alt);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.manual-formula h3 {
    font-family: var(--font-title);
    color: var(--primary-dark);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.manual-formula-code {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    overflow-x: auto;
    margin: var(--space-sm) 0;
    line-height: 1.6;
}

.manual-tip {
    padding: var(--space-sm) var(--space-md);
    background-color: var(--bg);
    border-left: 3px solid var(--info);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    font-size: 0.9rem;
}

.manual-tip strong {
    color: var(--primary-dark);
    margin-right: 4px;
}

.manual-faq {
    background-color: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.manual-faq[open] {
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(139, 94, 60, 0.08);
}

.manual-faq summary {
    padding: var(--space-md);
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    background-color: var(--surface);
    list-style: none;
    position: relative;
    padding-right: 40px;
}

.manual-faq summary::-webkit-details-marker {
    display: none;
}

.manual-faq summary::after {
    content: '▸';
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    transition: transform var(--transition-fast);
}

.manual-faq[open] summary::after {
    transform: translateY(-50%) rotate(90deg);
}

.manual-faq p {
    padding: 0 var(--space-md) var(--space-md);
    color: var(--text);
    line-height: 1.7;
}

.manual-faq code {
    font-size: 0.85em;
    background-color: var(--bg);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--primary-dark);
}

.manual-ol, .manual-ul {
    padding-left: var(--space-lg);
    line-height: 1.8;
}

.manual-ol li, .manual-ul li {
    margin-bottom: var(--space-xs);
}

.manual-footer {
    margin-top: var(--space-xl);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
    text-align: center;
}

/* 打印样式 */
@media print {
    .app-header, .manual-toc, .page-header .flex, .btn {
        display: none !important;
    }
    .manual-layout {
        grid-template-columns: 1fr;
    }
    .manual-content {
        border: none;
        padding: 0;
    }
    .manual-section {
        page-break-inside: avoid;
    }
    .manual-h2 {
        color: #000;
        border-bottom-color: #000;
    }
}

/* 移动端：说明书目录改为顶部折叠 */
@media (max-width: 768px) {
    .manual-layout {
        grid-template-columns: 1fr;
    }

    .manual-toc {
        position: static;
        max-height: none;
    }

    .manual-toc-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }

    .manual-toc-list a {
        font-size: 0.8rem;
        padding: 4px 6px;
    }

    .manual-content {
        padding: var(--space-md);
    }

    .manual-h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .manual-toc-list {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   公式参数配置区 — 精细化样式
   ============================================================ */

/* 公式区块 */
.formula-block {
    margin-bottom: var(--space-md);
}

.formula-block summary {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.formula-icon {
    font-size: 1.2em;
    line-height: 1;
}

.formula-block-body {
    padding: var(--space-md);
}

/* 公式说明卡 */
.formula-explain {
    background: var(--surface-alt);
    border-radius: 8px;
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    border-left: 3px solid var(--primary);
}

.formula-explain-row {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: 6px;
    align-items: baseline;
}

.formula-explain-row:last-child {
    margin-bottom: 0;
}

.formula-explain-label {
    flex-shrink: 0;
    min-width: 48px;
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.85rem;
}

.formula-explain-row code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--primary-dark);
    display: inline-block;
}

/* 小节标题 */
.formula-section-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: var(--space-sm);
    margin-top: var(--space-md);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.formula-section-title:first-child {
    margin-top: 0;
}

/* 参数单元格 */
.param-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.param-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.param-input-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface);
    transition: border-color 0.2s;
}

.param-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.param-input-wrap .input {
    border: none;
    border-radius: 0;
    flex: 1;
}

.param-prefix,
.param-suffix {
    padding: 0 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--surface-alt);
    font-weight: 600;
    user-select: none;
    flex-shrink: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
}

.param-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 2px;
}

/* 配置区底部操作栏 */
.formula-config-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 2px dashed var(--border);
}

/* ============================================================
   自定义公式 — 模板选择样式
   ============================================================ */

/* 已有公式列表 */
.custom-formula-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface-alt);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.custom-formula-item:hover {
    border-color: var(--primary-light);
}

.custom-formula-info {
    flex: 1;
}

/* 模板卡片网格 */
.formula-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-md);
}

.formula-template-card {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: var(--space-md);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
    position: relative;
}

.formula-template-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.formula-template-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.formula-template-icon {
    font-size: 2em;
    margin-bottom: 8px;
}

.formula-template-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text);
}

.formula-template-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 8px;
}

.formula-template-example {
    font-size: 0.75rem;
    color: var(--primary-dark);
    background: var(--surface-alt);
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    line-height: 1.3;
}

/* grid-4 */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

@media (max-width: 768px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .formula-template-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 经营阶段预设按钮 ========== */
.btn-preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-title);
    transition: all var(--transition-fast);
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text);
    min-width: 110px;
}

.btn-preset:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-preset .preset-icon {
    font-size: 1.1rem;
}

.btn-preset .preset-name {
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
}

.btn-preset .preset-desc {
    font-size: 0.68rem;
    opacity: 0.7;
}

.btn-preset-startup {
    border-color: #5c9ee7;
    color: #2c5aa0;
}

.btn-preset-startup:hover {
    background-color: #e8f0fe;
    border-color: #2c5aa0;
}

.btn-preset-growth {
    border-color: #f5a623;
    color: #c47d1a;
}

.btn-preset-growth:hover {
    background-color: #fff9e6;
    border-color: #c47d1a;
}

.btn-preset-brand {
    border-color: #8b5e3c;
    color: #5c3d28;
}

.btn-preset-brand:hover {
    background-color: #fdf6ed;
    border-color: #5c3d28;
}

@media (max-width: 768px) {
    .btn-preset {
        min-width: 80px;
        padding: 6px 10px;
    }

    .btn-preset .preset-name {
        font-size: 0.75rem;
    }

    .btn-preset .preset-desc {
        font-size: 0.62rem;
    }
}

/**
 * 布局样式
 */

/* ========== 应用整体布局 ========== */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== 汉堡菜单按钮 - 高对比度可见样式 ========== */
.hamburger-btn {
    display: none;
    width: 44px;
    height: 44px;
    border: 2px solid #3d3225;
    background: var(--surface);
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
    z-index: 110;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: background 0.2s ease, transform 0.2s ease;
}

.hamburger-btn:hover {
    transform: scale(1.05);
    background: var(--surface-hover);
}

.hamburger-btn:active {
    transform: scale(0.96);
}

.hamburger-btn svg {
    display: block;
    width: 24px;
    height: 24px;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========== 侧边栏导航（移动端）========== */
.mobile-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 105;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
}

.mobile-sidebar.open {
    transform: translateX(0);
}

.mobile-sidebar-nav {
    flex: 1;
    padding: var(--space-md) 0;
    overflow-y: auto;
}

.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 104;
    backdrop-filter: blur(4px);
}

.mobile-sidebar-overlay.show {
    display: block;
}

.mobile-sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface-gold-tint) 0%, var(--surface) 100%);
}

.mobile-sidebar-header .app-logo {
    font-size: 1rem;
    justify-content: center;
}

.mobile-sidebar-nav {
    padding: var(--space-md) 0;
}

.mobile-sidebar-nav .nav-item {
    display: block;
    padding: var(--space-md) var(--space-lg);
    font-size: 0.9rem;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.mobile-sidebar-nav .nav-item:hover {
    background: var(--surface-hover);
}

.mobile-sidebar-nav .nav-item.active {
    background: var(--primary-50);
    color: var(--primary);
    border-left: 3px solid var(--primary-500);
}

.mobile-sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-md) 0;
}

.mobile-sidebar-user {
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.mobile-sidebar-user .flex {
    align-items: center;
    gap: var(--space-md);
}

.mobile-sidebar-user .user-avatar {
    width: 44px;
    height: 44px;
}

/* ========== 顶部导航 ========== */
.app-header {
    height: var(--header-height);
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-gold-tint) 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 var(--space-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: var(--space-lg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 4px rgba(166, 124, 82, 0.06);
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-300) 20%, var(--primary-400) 50%, var(--primary-300) 80%, transparent 100%);
    pointer-events: none;
}

.app-logo {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.05em;
}

.app-logo .logo-icon {
    font-size: 1.4rem;
    -webkit-text-fill-color: initial;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex: 1;
    position: relative;
}

.nav-item {
    padding: var(--space-sm) var(--space-md);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    position: relative;
    font-family: var(--font-title);
    letter-spacing: 0.02em;
}

.nav-item:hover {
    color: var(--text);
    background-color: var(--primary-50);
}

.nav-item.active {
    color: var(--primary);
    background-color: var(--primary-100);
    font-weight: 600;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.app-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* 用户头像 */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

/* 在线状态指示器 */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-online { background-color: var(--success); }
.status-offline { background-color: var(--text-muted); }
.status-syncing { background-color: var(--warning); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ========== 主内容区 ========== */
.app-main {
    flex: 1;
    padding: var(--space-lg);
    max-width: var(--content-max-width);
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.app-main.narrow {
    max-width: 800px;
}

/* ========== 页面容器 ========== */
.page {
    animation: page-in var(--transition-normal) ease-out;
}

@keyframes page-in {
    from { 
        opacity: 0; 
        transform: translateY(12px); 
    }
    to   { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.page-header {
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    position: relative;
    padding-bottom: var(--space-md);
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--primary-300) 0%, var(--primary-200) 30%, transparent 70%);
}

.page-title-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-title);
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.page-title::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 28px;
    background: var(--primary-gradient);
    border-radius: 3px;
    flex-shrink: 0;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: var(--space-xs);
    padding-left: calc(5px + var(--space-sm));
}

/* 页面装饰元素 */
.page-decoration {
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(ellipse at top right, var(--primary-100) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.5;
}

/* 内容区块间距 */
.section {
    margin-bottom: var(--space-xl);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    font-family: var(--font-title);
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    letter-spacing: 0.02em;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 20px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-200), transparent);
    margin: var(--space-lg) 0;
}

/* ========== 网格布局 ========== */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* ========== 登录/注册页面布局 ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(166, 124, 82, 0.08) 0%, transparent 50%),
        var(--bg);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-100) 0%, transparent 70%);
    opacity: 0.5;
    pointer-events: none;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: 
        0 8px 32px rgba(166, 124, 82, 0.12),
        0 2px 8px rgba(166, 124, 82, 0.08);
    padding: var(--space-xl);
    position: relative;
    z-index: 1;
    animation: auth-card-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes auth-card-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--space-lg);
    position: relative;
}

.auth-logo-icon {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
    display: block;
    filter: drop-shadow(0 2px 8px rgba(166, 124, 82, 0.2));
}

.auth-logo-text {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.08em;
}

.auth-title {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: var(--space-sm);
    font-family: var(--font-title);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.03em;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-md) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-200), transparent);
}

.auth-divider span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.auth-field label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-family: var(--font-title);
    letter-spacing: 0.02em;
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-lg);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-footer a {
    font-weight: 600;
    color: var(--primary);
}

.auth-footer a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* 记住密码复选框 */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-sm);
}

.auth-options .checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.auth-options .forgot-link {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

/* 登录按钮 */
.auth-btn {
    width: 100%;
    margin-top: var(--space-sm);
    padding: 14px var(--space-lg);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-title);
    letter-spacing: 0.05em;
}

/* ========== 待审核页面 ========== */
.pending-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.pending-card {
    text-align: center;
    max-width: 400px;
}

.pending-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

/* ========== 响应式 ========== */
/* 桌面端：显示表格，隐藏卡片 */
.table-cards {
    display: none;
}

.mobile-table table {
    display: table;
}

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    /* 手机端：隐藏表格，显示卡片 */
    .mobile-table table {
        display: none !important;
    }

    .mobile-table .table-cards {
        display: block !important;
    }

    html {
        font-size: 15px;
    }

    /* 显示汉堡菜单按钮 */
    .hamburger-btn {
        display: flex !important;
        background: var(--surface) !important;
        border: 2px solid #3d3225 !important;
        border-radius: var(--radius-md);
    }

    /* 侧边栏容器在手机端存在（但用 transform 隐藏），遮罩层默认不显示 */
    .mobile-sidebar {
        display: flex;
    }

    .mobile-sidebar-overlay {
        display: none;
    }

    .mobile-sidebar-overlay.show {
        display: block;
    }

    /* 顶部导航：极简模式 */
    .app-header {
        padding: 0 var(--space-sm);
        gap: var(--space-xs);
        height: var(--header-height-sm, 52px);
        flex-wrap: nowrap;
        justify-content: space-between;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
    }

    .app-logo {
        font-size: 0.9rem;
        white-space: nowrap;
        flex-shrink: 0;
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
        /* 手机端 logo 用实色，避免渐变看不清 */
        -webkit-text-fill-color: var(--primary);
        color: var(--primary);
        font-weight: 700;
    }

    /* 隐藏顶部导航的导航项 */
    .app-nav {
        display: none !important;
    }

    /* 头部操作区：隐藏用户名和头像，只保留核心按钮 */
    .app-header-actions .flex.flex-col {
        display: none;
    }

    .app-header-actions {
        gap: 2px;
        flex-shrink: 0;
    }

    .app-header-actions .user-avatar {
        display: none;
    }

    .app-header-actions .btn-icon {
        width: 40px;
        height: 40px;
        min-height: 40px;
        color: var(--text);
        background: var(--surface-alt);
        border: 1px solid var(--border);
        font-size: 1.1rem;
    }

    .app-header-actions .btn-icon:hover {
        background: var(--primary-50);
        color: var(--primary);
    }

    /* 主内容区 */
    .app-main {
        padding: var(--space-xs);
        max-width: 100%;
    }

    /* 网格布局改为单列 */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .grid-auto {
        grid-template-columns: 1fr;
    }

    /* 页面标题区 */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
        margin-bottom: var(--space-md);
    }

    .page-title {
        font-size: 1.1rem;
    }

    .page-header .flex {
        width: 100%;
        flex-wrap: wrap;
        gap: var(--space-xs);
    }

    .page-header .btn {
        flex: 1;
        min-width: 0;
    }

    /* 卡片样式优化 */
    .card {
        border-radius: var(--radius-lg);
        overflow: hidden;
    }

    .card-body {
        padding: var(--space-md);
    }

    .card-header {
        padding: var(--space-sm) var(--space-md);
        flex-wrap: wrap;
    }

    /* 按钮优化 */
    .btn {
        min-height: 44px;
        padding: var(--space-md) var(--space-lg);
        font-size: 0.9rem;
    }

    .btn-sm {
        min-height: 36px;
        padding: var(--space-xs) var(--space-md);
        font-size: 0.85rem;
    }

    .btn-icon {
        width: 44px;
        height: 44px;
    }

    .btn-icon.btn-sm {
        width: 36px;
        height: 36px;
    }

    /* 输入框优化 */
    .input, .select, .textarea {
        padding: var(--space-md);
        font-size: 0.95rem;
    }

    .input-sm, .select.input-sm {
        padding: var(--space-sm);
        font-size: 0.85rem;
    }

    /* 模态框全屏显示 */
    .modal {
        width: 100%;
        max-width: none;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .modal-overlay {
        padding: 0;
        align-items: stretch;
    }

    .modal-body {
        padding: var(--space-md);
    }

    .modal-header, .modal-footer {
        padding: var(--space-sm) var(--space-md);
    }

    .modal-header h3 {
        font-size: 1rem;
    }

    .modal .grid-2 {
        grid-template-columns: 1fr;
    }

    /* Toast 提示 */
    .toast-container {
        top: var(--space-md);
        right: var(--space-sm);
        left: var(--space-sm);
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    .grid {
        gap: var(--space-md);
    }

    /* 统计卡片 */
    .card-stat {
        padding: var(--space-md);
    }

    .card-stat-value {
        font-size: 1.3rem;
    }

    /* Tab 切换 */
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        flex-shrink: 0;
    }

    /* 登录卡片 */
    .auth-card {
        padding: var(--space-lg);
        margin: var(--space-xs);
    }

    /* 工作台：卡片式布局 */
    .workbench-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .workbench-card {
        background: var(--surface);
        border-radius: var(--radius-lg);
        border: 1px solid var(--border);
        padding: var(--space-md);
        transition: all 0.3s ease;
    }

    .workbench-card:active {
        transform: scale(0.98);
    }

    .workbench-card-icon {
        font-size: 1.8rem;
        margin-bottom: var(--space-sm);
    }

    .workbench-card-title {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: var(--space-xs);
        font-family: var(--font-title);
    }

    .workbench-card-desc {
        font-size: 0.8rem;
        color: var(--text-muted);
        line-height: 1.4;
    }

    /* 筛选区 */
    .card-body .flex.flex-wrap {
        gap: var(--space-sm);
    }

    /* 预设按钮区 */
    .card-body .flex.flex-wrap.items-center:has(.btn-preset) {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .card-body .flex.flex-wrap.items-center:has(.btn-preset)::-webkit-scrollbar {
        display: none;
    }

    .btn-preset {
        flex-shrink: 0;
        min-width: 140px;
    }

    /* 表格页脚 */
    .table-footer {
        padding: var(--space-sm) var(--space-md);
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    /* 折叠产品卡片 */
    .product-card-collapse {
        background: var(--surface);
        border-radius: var(--radius-md);
        border: 1px solid var(--border);
        margin-bottom: var(--space-sm);
        overflow: hidden;
        transition: box-shadow 0.2s ease;
    }

    .product-card-collapse:active {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .product-card-header {
        display: flex;
        align-items: center;
        padding: var(--space-md);
        cursor: pointer;
        gap: var(--space-sm);
        user-select: none;
    }

    .product-card-summary {
        flex: 1;
        min-width: 0;
    }

    .product-card-name {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .product-card-meta {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .product-card-meta .badge {
        font-size: 0.7rem;
        padding: 2px 6px;
        flex-shrink: 0;
    }

    .product-card-spec {
        font-size: 0.75rem;
        color: var(--text-muted);
        white-space: nowrap;
    }

    .product-card-price-info {
        text-align: right;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
    }

    .product-card-price {
        font-size: 1rem;
        font-weight: 700;
        color: var(--primary);
    }

    .product-card-cost {
        font-size: 0.7rem;
        color: var(--text-muted);
    }

    .product-card-price-info .badge {
        font-size: 0.7rem;
        padding: 1px 6px;
    }

    .product-card-arrow {
        font-size: 0.7rem;
        color: var(--text-muted);
        flex-shrink: 0;
        transition: transform 0.2s ease;
        margin-left: var(--space-xs);
    }

    /* 详情区默认隐藏 */
    .product-card-details {
        display: none;
        padding: 0 var(--space-md) var(--space-md);
        border-top: 1px solid var(--border-light);
        margin-top: 0;
    }

    .product-card-details.open {
        display: block;
        padding-top: var(--space-sm);
    }

    .product-card-details .table-card-row {
        display: flex;
        justify-content: space-between;
        padding: var(--space-xs) 0;
        border-bottom: 1px dashed var(--border-light);
    }

    .product-card-details .table-card-row:last-of-type {
        border-bottom: none;
    }

    .product-card-details .table-card-label {
        font-size: 0.8rem;
        color: var(--text-muted);
        font-weight: 600;
        min-width: 70px;
        flex-shrink: 0;
    }

    .product-card-details .table-card-value {
        font-size: 0.85rem;
        color: var(--text-primary);
        text-align: right;
        flex: 1;
        margin-left: var(--space-sm);
        word-break: break-all;
    }

    .product-card-details .table-card-actions {
        display: flex;
        gap: var(--space-sm);
        justify-content: center;
        margin-top: var(--space-md);
        padding-top: var(--space-sm);
        border-top: 1px solid var(--border-light);
    }

    .product-card-details .table-card-actions .btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .app-header-actions .btn {
        padding: var(--space-sm);
        min-height: auto;
        font-size: 0.8rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .app-main {
        padding: var(--space-xs);
    }

    .page-header {
        margin-bottom: var(--space-md);
    }

    .btn-group {
        flex-wrap: wrap;
        gap: var(--space-xs);
    }

    .btn-group .btn {
        flex: 1;
        min-width: calc(50% - 4px);
    }

    /* 登录卡片更紧凑 */
    .auth-card {
        padding: var(--space-md);
    }

    .auth-title {
        font-size: 1.3rem;
    }

    /* 统计卡片数字 */
    .card-stat-value {
        font-size: 1.1rem;
    }

    /* 模态框标题 */
    .modal-title {
        font-size: 1rem;
    }

    /* 手机端不隐藏任何导航项（侧边栏需要全部显示） */
}

/* ========== 可折叠区域 ========== */
.collapsible-section {
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: var(--space-md);
    gap: var(--space-sm);
    transition: background 0.2s ease;
}

.collapsible-header:hover {
    background: var(--surface-hover);
}

.collapsible-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.collapsible-section .collapsible-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out, padding 0.35s ease-out;
    padding: 0 var(--space-md);
}

.collapsible-section .collapsible-body.open {
    max-height: 800px;
    padding-bottom: var(--space-md);
}

/* ========== 仪表盘网格（数据概览卡片）========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    opacity: 0;
    animation: dashCardIn 0.5s ease forwards;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.dash-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.2s;
}

@keyframes dashCardIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(166, 124, 82, 0.12);
    border-color: var(--primary-300);
}

.dash-card:hover::before {
    opacity: 1;
}

.dash-card-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(166, 124, 82, 0.15));
}

.dash-card-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.dash-card-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-family: 'Songti SC', 'STSong', serif;
    font-variant-numeric: tabular-nums;
}

.dash-card-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.dash-card-good {
    border-left: 3px solid var(--success);
    background: linear-gradient(135deg, rgba(74, 179, 112, 0.05) 0%, var(--surface-alt) 100%);
}

.dash-card-good .dash-card-value {
    color: var(--success);
}

.dash-card-warn {
    border-left: 3px solid var(--warning);
    background: linear-gradient(135deg, rgba(240, 181, 73, 0.05) 0%, var(--surface-alt) 100%);
}

.dash-card-warn .dash-card-value {
    color: var(--warning);
}

.dash-card-critical {
    border-left: 3px solid var(--danger);
    background: linear-gradient(135deg, rgba(235, 96, 96, 0.05) 0%, var(--surface-alt) 100%);
}

.dash-card-critical .dash-card-value {
    color: var(--danger);
}

/* ========== 定价公式可视化 ========== */
.formula-visualization {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.formula-section {
    flex: 1;
    min-width: 280px;
}

.formula-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.formula-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.formula-item {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--surface-alt);
    color: var(--text);
    font-weight: 500;
}

.formula-op {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 20px;
    text-align: center;
}

.formula-cost {
    background: rgba(235, 96, 96, 0.15);
    color: var(--danger);
}

.formula-success {
    background: rgba(74, 179, 112, 0.15);
    color: var(--success);
}

.formula-danger {
    background: rgba(240, 181, 73, 0.15);
    color: var(--warning);
}

.formula-premium {
    background: rgba(145, 100, 210, 0.15);
    color: var(--primary);
}

.formula-markup {
    background: rgba(70, 130, 180, 0.15);
    color: #4682b4;
}

.formula-rate {
    background: rgba(255, 140, 0, 0.15);
    color: #ff8c00;
}

.formula-primary {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.formula-highlight {
    background: rgba(74, 179, 112, 0.08);
    color: var(--text-primary);
    border: 1px dashed var(--border);
}

.formula-divider {
    width: 1px;
    background: var(--border);
    min-height: 100px;
    flex-shrink: 0;
}

.formula-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* ========== 套装定价计算器 ========== */
.bundle-calculator {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.bundle-left, .bundle-right {
    flex: 1;
    min-width: 280px;
}

.bundle-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.bundle-product-list {
    max-height: 200px;
    overflow-y: auto;
}

.bundle-product-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    margin-bottom: 4px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bundle-product-item:hover {
    background: var(--surface-hover);
}

.bundle-product-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.bundle-product-info {
    flex: 1;
    min-width: 0;
}

.bundle-product-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bundle-product-detail {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.bundle-config {
    margin-bottom: var(--space-md);
}

.bundle-result {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
}

.bundle-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}

.bundle-result-row:last-child {
    border-bottom: none;
}

.bundle-result-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.bundle-result-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.bundle-price {
    font-size: 1.2rem;
    color: var(--primary);
}

/* ========== 成本构成分析 ========== */
.cost-analysis {
    padding: var(--space-sm);
}

.cost-summary {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
    padding: var(--space-sm);
    background: var(--surface);
    border-radius: var(--radius-sm);
}

.cost-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 var(--space-md);
}

.cost-summary-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.cost-summary-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cost-bars {
    margin-bottom: var(--space-md);
}

.cost-bar-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: 8px;
    padding: 6px 0;
}

.cost-bar-label {
    font-size: 0.75rem;
    color: var(--text);
    width: 80px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cost-bar-track {
    flex: 1;
    height: 18px;
    background: var(--border);
    border-radius: 9px;
    overflow: hidden;
}

.cost-bar-fill {
    height: 100%;
    display: flex;
    border-radius: 9px;
    transition: width 0.3s ease;
}

.cost-bar-segment {
    height: 100%;
    flex-shrink: 0;
}

.cost-mat {
    background: linear-gradient(90deg, #e87d7d, #e55a5a);
}

.cost-labor {
    background: linear-gradient(90deg, #7daae8, #5a7de5);
}

.cost-acc {
    background: linear-gradient(90deg, #aee87d, #7de55a);
}

.cost-pack {
    background: linear-gradient(90deg, #e8d77d, #e5c05a);
}

.cost-bar-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    width: 60px;
    text-align: right;
    flex-shrink: 0;
}

.cost-legend {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border);
}

.cost-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cost-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* 响应式：仪表盘 */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xs);
    }

    .dash-card {
        padding: var(--space-sm);
    }

    .dash-card-value {
        font-size: 1.1rem;
    }

    .dash-card-label {
        font-size: 0.7rem;
    }

    .dash-card-sub {
        font-size: 0.65rem;
    }
}

