:root {
    /* --- 默认深色模式 (Dark Mode) - 紫禁书房 --- */
    --bg-color: #1a1a1a;        /* 玄色 */
    --surface-color: #232323;   /* 墨色 */
    --text-color: #e0e0e0;      /* 宣纸白 */
    --text-dim: #8a8a8a;        /* 墨灰 */

    /* 进度条底色 */
    --track-color: #333333;

    /* 强调色 */
    --gold: #c6a87c;            /* 沉金 */
    --gold-dim: #4a3f2f;        /* 暗金 */
    --vermilion: #b5493f;       /* 朱砂 */
    --green: #10B981;           /* 玉绿 */

    --border-color: #333333;

    /* 字体 */
    --font-serif: "Noto Serif SC", "Songti SC", "SimSun", "Times New Roman", serif;
    --font-mono: "JetBrains Mono", "Courier New", monospace;
}

/* --- 浅色模式 (Light Mode) - 松烟宣纸 --- */
@media (prefers-color-scheme: light) {
    :root {
        --bg-color: #f7f5f0;        /* 宣纸米白 */
        --surface-color: #eae6db;   /* 浅米灰 (模拟纸张堆叠) */
        --text-color: #2b2b2b;      /* 焦墨 (深灰黑) */
        --text-dim: #666666;        /* 淡墨 */

        --track-color: #dcd6cb;     /* 浅灰底槽 */

        /* 浅色下，金色需要加深一点，否则看不清 */
        --gold: #9d8458;            /* 泥金 (深古铜) */
        --gold-dim: #dcd0bc;        /* 浅金装饰 */
        --vermilion: #c93a3a;       /* 鲜朱砂 */
        --green: #059669;           /* 深翠绿 */

        --border-color: #dcd6cb;
    }

    /* 浅色模式下，纹理稍微加深一点 */
    .texture-overlay {
        opacity: 0.6;
        filter: invert(1); /* 反转噪点颜色 */
    }
}

/* 全局重置 */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-serif);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: fixed;
    width: 100%;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* --- 特效类 --- */

.texture-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
    opacity: 0.4;
    transition: opacity 0.5s ease;
}

.glow-breathing {
    animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe {
    0%, 100% { opacity: 0.85; text-shadow: 0 0 15px rgba(198, 168, 124, 0.2); }
    50% { opacity: 1; text-shadow: 0 0 25px rgba(198, 168, 124, 0.5); }
}

.ink-dot {
    width: 10px;
    height: 10px;
    background-color: var(--vermilion);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 8px rgba(181, 73, 63, 0.4);
}
.ink-dot.active {
    transform: scale(1);
}
@media (min-width: 768px) {
    .ink-dot { width: 14px; height: 14px; }
}

.shake-light {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-2px, 0, 0); }
    40%, 60% { transform: translate3d(2px, 0, 0); }
}

/* 实用类 */
.text-gold { color: var(--gold); }
.text-dim { color: var(--text-dim); }
.font-serif { font-family: var(--font-serif); }
.font-mono { font-family: var(--font-mono); }