: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;
    --surface-hover: var(--surface-warm);

    /* 纸面纹理叠加色 */
    --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);
    --shadow: var(--shadow-md);

    /* 过渡 */
    --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;
}
