/* ========================================
   墨韵幽境 — 排版系统
   ======================================== */

/* ── 排版变量 ── */
:root {
    --font-display: 'Noto Serif SC', 'STSong', 'SimSun', serif;
    --font-body: 'LXGW WenKai', 'Ma Shan Zheng', 'STKaiti', 'KaiTi', serif;
    --font-ui: 'LXGW WenKai', 'Noto Serif SC', serif;

    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;
    --font-size-4xl: 36px;

    --line-height-tight: 1.3;
    --line-height-normal: 1.6;
    --line-height-relaxed: 1.8;
    --line-height-loose: 2.0;

    --letter-spacing-tight: -0.01em;
    --letter-spacing-normal: 0.02em;
    --letter-spacing-wide: 0.06em;
    --letter-spacing-wider: 0.12em;
}

/* ── 基础排版 ── */

body {
    font-family: var(--font-body);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-wider);
    color: var(--text-primary);
    margin-bottom: 0.5em;
}

h2 {
    font-size: var(--font-size-3xl);
    text-align: center;
    margin-bottom: 1.5rem;
}

.title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    text-align: center;
    letter-spacing: var(--letter-spacing-wider);
    margin-bottom: 2rem;
}

/* ── 旁白文本（游戏内叙事） ── */

.scene-text,
#scene-text,
p#scene-text,
.scene-text *,
#scene-text * {
    font-family: var(--font-body) !important;
    font-size: 20px !important;
    line-height: 2.0 !important;
    letter-spacing: 0.03em !important;
    color: var(--parchment) !important;
    -webkit-text-fill-color: var(--parchment) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    background: none !important;
    background-image: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    display: block !important;
    margin: 0 0 0.8em 0 !important;
    user-select: none !important;
    outline: none !important;
    animation: none !important;
}

.scene-text:last-child,
#scene-text:last-child {
    margin-bottom: 0 !important;
}

/* ── 选项文字 ── */

.option-text {
    font-family: var(--font-body);
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: 0.02em;
}

/* ── 高亮 ── */

.highlight {
    background: rgba(200, 149, 108, 0.18);
    border-radius: 3px;
    padding: 1px 6px;
    font-weight: 500;
}

.narrative-highlight {
    color: var(--amber-light) !important;
    -webkit-text-fill-color: var(--amber-light) !important;
    font-weight: 500;
    text-shadow: 0 0 8px rgba(200, 149, 108, 0.2) !important;
}

/* ── 段落排版 ── */

p {
    margin-bottom: 1em;
    line-height: var(--line-height-relaxed);
}

p:last-child {
    margin-bottom: 0;
}

blockquote {
    border-left: 2px solid var(--amber);
    padding-left: 1em;
    margin: 1em 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* ── 响应式排版 ── */

@media (min-width: 1200px) {
    .scene-text, #scene-text {
        font-size: 22px !important;
        line-height: 2.1 !important;
    }
    .option-text { font-size: 17px; }
    h2 { font-size: var(--font-size-4xl); }
}

@media (max-width: 768px) {
    .scene-text, #scene-text {
        font-size: 17px !important;
        line-height: 1.9 !important;
    }
    .option-text { font-size: 15px; }
    h2 { font-size: 26px !important; }
    .title { font-size: 1.2rem !important; }
}

@media (max-width: 480px) {
    .scene-text, #scene-text {
        font-size: 16px !important;
        line-height: 1.85 !important;
    }
    h2 { font-size: 22px !important; }
}

/* ── 辅助类 ── */

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }

.leading-tight { line-height: var(--line-height-tight); }
.leading-normal { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }
.leading-loose { line-height: var(--line-height-loose); }

.tracking-tight { letter-spacing: var(--letter-spacing-tight); }
.tracking-normal { letter-spacing: var(--letter-spacing-normal); }
.tracking-wide { letter-spacing: var(--letter-spacing-wide); }
.tracking-wider { letter-spacing: var(--letter-spacing-wider); }
