/* ========== 锦绣家业 · 古代家主模拟器 v3 · 天盛朝 ========== */

/* v100: 持久化弹窗容器 — 不影响布局，子元素 .modal-overlay 自带 position:fixed */
#modal-layer { position: static; }

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600;700;900&family=Ma+Shan+Zheng&family=ZCOOL+XiaoWei&family=LXGW+WenKai+TC:wght@400;700&display=swap');

:root {
    --bg-paper: #f0e6d2;
    --bg-paper-dark: #ddd0b5;
    --bg-silk: #faf5e9;
    --bg-silk-dark: #f0e8d5;
    --color-vermillion: #8b1a1a;
    --color-vermillion-light: #b22222;
    --color-vermillion-glow: #c0392b;
    --color-gold: #b8941e;
    --color-gold-light: #d4af37;
    --color-gold-bright: #f0c850;
    --color-jade: #1a6b54;
    --color-jade-light: #2d8b6e;
    --color-ink: #1a1410;
    --color-ink-light: #3d2f25;
    --color-ink-soft: #5d4a3a;
    --color-cream: #f8f0dc;
    --color-cream-light: #fdf8eb;
    --color-border: #a09080;
    --color-border-light: #c4b496;
    --color-shadow: rgba(26, 20, 16, 0.18);
    --color-shadow-deep: rgba(26, 20, 16, 0.35);
    --color-male: #2c5f7c;
    --color-female: #8b3a5c;
    --color-danger: #6b0000;
    --color-success: #1a6b54;
    --color-warning: #8b6914;
    --color-surface: #fdf8eb;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Noto Serif SC', 'SimSun', serif;
    color: var(--color-ink);
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--bg-paper);
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(184, 148, 30, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(139, 26, 26, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(26, 107, 84, 0.06) 0%, transparent 50%),
        repeating-linear-gradient(135deg, transparent, transparent 3px, rgba(139, 119, 84, 0.015) 3px, rgba(139, 119, 84, 0.015) 6px),
        linear-gradient(180deg, var(--bg-paper) 0%, #e8dcc0 100%);
    background-attachment: scroll;
    overscroll-behavior-y: auto;
    touch-action: pan-y pan-x;
    -webkit-overflow-scrolling: touch;
    -webkit-tap-highlight-color: transparent;
}

#app {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    position: relative;
    overflow: visible;
    touch-action: pan-y pan-x;
}

/* ========== 移动端触摸优化 ==========
   touch-action:manipulation 确保按钮点击无延迟
   overscroll-behavior:contain 防止弹窗内滚动穿透
*/
button, .btn, .event-choice, .choice-btn, .story-choice-btn, .story-choice,
.action-btn, .tab-btn, .audio-toggle-btn, .audio-icon-btn, [onclick], .clickable {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.event-modal, .map-event-modal, .modal, .monthly-report, .modal-body {
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* ========== 装饰元素 ========== */

.corner-deco {
    position: absolute;
    width: 40px;
    height: 40px;
    pointer-events: none;
    opacity: 0.6;
}

.corner-deco.tl { top: 8px; left: 8px; border-top: 2px solid var(--color-gold); border-left: 2px solid var(--color-gold); }
.corner-deco.tr { top: 8px; right: 8px; border-top: 2px solid var(--color-gold); border-right: 2px solid var(--color-gold); }
.corner-deco.bl { bottom: 8px; left: 8px; border-bottom: 2px solid var(--color-gold); border-left: 2px solid var(--color-gold); }
.corner-deco.br { bottom: 8px; right: 8px; border-bottom: 2px solid var(--color-gold); border-right: 2px solid var(--color-gold); }

/* 水墨晕染效果 */
.ink-wash {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

/* ========== 按钮 ========== */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 12px 32px;
    font-family: 'Noto Serif SC', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-cream);
    background: linear-gradient(135deg, var(--color-vermillion) 0%, var(--color-vermillion-light) 50%, var(--color-vermillion) 100%);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    letter-spacing: 3px;
    overflow: hidden;
    box-shadow:
        0 2px 8px var(--color-shadow),
        0 0 0 1px var(--color-gold),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.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.6s;
}

.btn:hover::before { left: 100%; }

.btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 6px 20px var(--color-shadow-deep),
        0 0 0 1px var(--color-gold-bright),
        0 0 24px rgba(192, 57, 43, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn:active { transform: translateY(-1px); }

.btn-secondary {
    background: linear-gradient(135deg, var(--color-ink-light), var(--color-ink));
    box-shadow: 0 2px 8px var(--color-shadow), 0 0 0 1px var(--color-border), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-jade {
    background: linear-gradient(135deg, var(--color-jade), var(--color-jade-light));
    box-shadow: 0 2px 8px var(--color-shadow), 0 0 0 1px var(--color-gold), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-gold {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-bright));
    color: var(--color-ink);
    text-shadow: none;
    box-shadow: 0 2px 8px var(--color-shadow), 0 0 0 1px var(--color-gold), inset 0 1px 0 rgba(255,255,255,0.3);
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn:disabled:hover { transform: none; box-shadow: 0 2px 8px var(--color-shadow); }

/* ========== 标题界面 ========== */

.title-screen {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: visible;
    background-color: #1a1208;
    background-image: url('portraits/bg_title.webp');
    background-size: cover;
    background-position: 25% 30%;
    background-repeat: no-repeat;
    padding: calc(2rem + env(safe-area-inset-top)) 7% calc(2rem + env(safe-area-inset-bottom)) 35%;
    text-align: center;
}

.title-screen > * {
    width: auto;
    max-width: 100%;
    text-align: center;
}

/* 底部暗色蒙版：保证按钮可读 */
.title-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(0,0,0,0.25) 0%,
            rgba(0,0,0,0.15) 35%,
            rgba(0,0,0,0.45) 70%,
            rgba(0,0,0,0.75) 100%),
        linear-gradient(90deg,
            rgba(0,0,0,0.05) 0%,
            rgba(0,0,0,0.35) 55%,
            rgba(0,0,0,0.55) 100%);
    pointer-events: none;
    z-index: 0;
}

/* 飘落花瓣 */
.title-screen::after {
    content: '';
    position: absolute;
    top: -20px; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 220, 200, 0.18) 2px, transparent 3px),
        radial-gradient(circle at 30% 60%, rgba(255, 220, 200, 0.14) 2px, transparent 3px),
        radial-gradient(circle at 70% 30%, rgba(255, 235, 180, 0.16) 2px, transparent 3px),
        radial-gradient(circle at 90% 70%, rgba(255, 220, 200, 0.12) 2px, transparent 3px),
        radial-gradient(circle at 50% 90%, rgba(255, 235, 180, 0.10) 2px, transparent 3px);
    background-size: 200px 200px, 250px 250px, 300px 300px, 220px 220px, 280px 280px;
    pointer-events: none;
    animation: petalsFall 20s linear infinite;
    z-index: 1;
}

@keyframes petalsFall {
    from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
    to { background-position: 0 200px, 0 250px, 0 300px, 0 220px, 0 280px; }
}

.title-main {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 5.5rem;
    color: #fff7e0;
    text-shadow:
        0 0 1px var(--color-gold),
        0 2px 0 rgba(184, 148, 30, 0.9),
        0 4px 0 rgba(120, 80, 20, 0.7),
        0 6px 14px rgba(0, 0, 0, 0.85),
        0 0 40px rgba(255, 220, 150, 0.5);
    margin-bottom: 0.3rem;
    z-index: 2;
    position: relative;
    letter-spacing: 12px;
    animation: titleReveal 1.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.title-main::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}

@keyframes titleReveal {
    0% { opacity: 0; transform: translateY(-30px) scale(0.95); letter-spacing: 30px; }
    100% { opacity: 1; transform: translateY(0) scale(1); letter-spacing: 12px; }
}

.title-sub {
    font-family: 'LXGW WenKai TC', 'Noto Serif SC', serif;
    font-size: 1.3rem;
    color: #f5e6c8;
    margin: 1.5rem 0 0.5rem;
    z-index: 2;
    letter-spacing: 8px;
    opacity: 0.95;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
    animation: fadeInUp 1s 0.5s both;
}

.title-decoration {
    width: 320px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--color-gold) 20%, var(--color-gold-bright) 50%, var(--color-gold) 80%, transparent 100%);
    margin: 1rem 0;
    z-index: 2;
    position: relative;
    animation: lineGrow 1.2s 0.3s both;
    opacity: 0.9;
    filter: drop-shadow(0 0 4px rgba(184, 148, 30, 0.5));
}

.title-decoration::before, .title-decoration::after {
    content: '◆';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-gold);
    font-size: 0.7rem;
}
.title-decoration::before { left: 50%; transform: translate(-50%, -50%); }

@keyframes lineGrow { from { width: 0; } to { width: 320px; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 0.8; transform: translateY(0); } }

.title-poem {
    font-family: 'LXGW WenKai TC', 'Noto Serif SC', serif;
    font-size: 1.05rem;
    color: #f0e3c0;
    text-align: center;
    line-height: 2.2;
    margin-bottom: 2.5rem;
    z-index: 2;
    font-style: italic;
    opacity: 0.9;
    max-width: 400px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
    animation: fadeInUp 1s 0.8s both;
}

.title-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 2;
    animation: fadeInUp 1s 1.2s both;
}

/* 背景水墨晕染 */
.ink-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

.ink-blob-1 { width: 300px; height: 300px; top: 10%; left: 5%; background: rgba(139, 26, 26, 0.08); animation: floatBlob 12s ease-in-out infinite; }
.ink-blob-2 { width: 400px; height: 400px; bottom: 5%; right: 5%; background: rgba(26, 107, 84, 0.06); animation: floatBlob 15s ease-in-out infinite reverse; }
.ink-blob-3 { width: 250px; height: 250px; top: 50%; right: 20%; background: rgba(184, 148, 30, 0.07); animation: floatBlob 10s ease-in-out infinite; }

@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.1); }
    66% { transform: translate(-20px, 30px) scale(0.9); }
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ========== 角色创建 ========== */

.creation-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.creation-panel {
    background: linear-gradient(180deg, var(--color-cream-light), var(--bg-silk));
    border: 1px solid var(--color-gold);
    border-radius: 4px;
    padding: 2.5rem 3rem;
    max-width: 680px;
    width: 100%;
    box-shadow:
        0 12px 48px var(--color-shadow-deep),
        0 0 0 1px var(--color-border-light),
        inset 0 1px 0 rgba(255,255,255,0.5);
    position: relative;
    animation: panelSlideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.creation-panel::before {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    border: 1px solid var(--color-border-light);
    border-radius: 2px;
    pointer-events: none;
    opacity: 0.5;
}

@keyframes panelSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.creation-title {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 2.2rem;
    color: var(--color-vermillion);
    text-align: center;
    margin-bottom: 0.3rem;
    letter-spacing: 6px;
    position: relative;
}

.creation-title::after {
    content: '';
    display: block;
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    margin: 0.5rem auto 0;
}

.creation-subtitle {
    text-align: center;
    color: var(--color-ink-soft);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    letter-spacing: 3px;
    opacity: 0.7;
}

.creation-story {
    background: linear-gradient(135deg, rgba(240, 230, 210, 0.6), rgba(232, 220, 192, 0.4));
    border-left: 3px solid var(--color-vermillion);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    line-height: 2;
    font-size: 0.92rem;
    color: var(--color-ink-soft);
    border-radius: 0 4px 4px 0;
    text-indent: 2em;
    position: relative;
    font-family: 'ZCOOL XiaoWei', serif;
}

.form-group { margin-bottom: 1.2rem; }

.form-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-ink);
    margin-bottom: 0.5rem;
    letter-spacing: 3px;
    position: relative;
    padding-left: 12px;
}

.form-label::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 16px;
    background: var(--color-vermillion);
    border-radius: 2px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Noto Serif SC', serif;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--color-ink);
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-vermillion);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(139, 26, 26, 0.1);
}

.gender-select { display: flex; gap: 1rem; }

.gender-option {
    flex: 1;
    padding: 1.2rem;
    text-align: center;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.35s;
    background: rgba(255, 255, 255, 0.4);
    position: relative;
    outline: 3px solid transparent;
    outline-offset: -3px;
}

.gender-option:hover {
    border-color: var(--color-gold);
    background: rgba(255, 255, 255, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--color-shadow);
}

.gender-option.selected {
    border-color: var(--color-vermillion);
    background:
        linear-gradient(135deg, rgba(255, 247, 224, 0.95), rgba(245, 230, 200, 0.92)),
        linear-gradient(135deg, rgba(139, 26, 26, 0.1), rgba(184, 148, 30, 0.1));
    box-shadow:
        0 0 0 1px var(--color-gold),
        0 0 0 4px rgba(184, 148, 30, 0.35),
        0 6px 20px rgba(139, 26, 26, 0.25),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.gender-option.selected::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px dashed var(--color-vermillion);
    border-radius: 4px;
    pointer-events: none;
    opacity: 0.55;
}

.gender-option.selected::after {
    content: '✓';
    position: absolute;
    top: -10px; right: -10px;
    width: 24px;
    height: 24px;
    line-height: 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--color-vermillion), #8a1414);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    border: 2px solid var(--color-gold);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.gender-icon { font-size: 2rem; margin-bottom: 0.3rem; }
.gender-label { font-size: 1.05rem; font-weight: 700; letter-spacing: 3px; }
.gender-desc { font-size: 0.78rem; color: var(--color-ink-soft); margin-top: 0.2rem; }

/* 立绘选择 */
.portrait-select { display: flex; gap: 1rem; }

.portrait-option {
    flex: 1;
    text-align: center;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.35s;
    background: rgba(255, 255, 255, 0.4);
    padding: 0.8rem;
    position: relative;
}

.portrait-option:hover {
    border-color: var(--color-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--color-shadow);
}

.portrait-option.selected {
    border-color: var(--color-vermillion);
    background:
        linear-gradient(135deg, rgba(255, 247, 224, 0.95), rgba(245, 230, 200, 0.92));
    box-shadow:
        0 0 0 1px var(--color-gold),
        0 0 0 4px rgba(184, 148, 30, 0.35),
        0 6px 20px rgba(139, 26, 26, 0.25),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.portrait-option.selected::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px dashed var(--color-vermillion);
    border-radius: 5px;
    pointer-events: none;
    opacity: 0.55;
}

.portrait-option.selected .portrait-preview {
    border-color: var(--color-vermillion);
    box-shadow:
        0 0 0 2px var(--color-gold),
        0 0 0 4px rgba(255, 247, 224, 0.9),
        0 4px 16px rgba(139, 26, 26, 0.4);
    transform: scale(1.05);
}

.portrait-preview {
    width: 100px;
    height: 100px;
    margin: 0 auto 0.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--color-gold);
    box-shadow: 0 2px 8px var(--color-shadow);
    transition: all 0.35s;
    position: relative;
}

.portrait-preview svg { width: 100%; height: 100%; }
.portrait-preview img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; display: block; }
.portrait-name { font-size: 0.95rem; font-weight: 700; color: var(--color-ink); }
.portrait-desc { font-size: 0.75rem; color: var(--color-ink-soft); margin-top: 0.2rem; }

/* 职业选择 */
.career-select { display: flex; gap: 0.8rem; flex-wrap: wrap; }

.career-option {
    flex: 1;
    min-width: 140px;
    padding: 1rem;
    text-align: center;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.4);
    position: relative;
}

.career-option:hover {
    border-color: var(--color-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--color-shadow);
}

.career-option.selected {
    border-color: var(--color-jade);
    background:
        linear-gradient(135deg, rgba(255, 247, 224, 0.95), rgba(245, 230, 200, 0.92)),
        linear-gradient(135deg, rgba(26, 107, 84, 0.1), rgba(184, 148, 30, 0.1));
    box-shadow:
        0 0 0 1px var(--color-gold),
        0 0 0 4px rgba(26, 107, 84, 0.3),
        0 6px 20px rgba(26, 107, 84, 0.25),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.career-option.selected::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px dashed var(--color-jade);
    border-radius: 4px;
    pointer-events: none;
    opacity: 0.5;
}

.career-icon { font-size: 1.5rem; margin-bottom: 0.3rem; }
.career-name { font-size: 0.95rem; font-weight: 700; }
.career-desc { font-size: 0.72rem; color: var(--color-ink-soft); margin-top: 0.2rem; }

.creation-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* ========== 主游戏界面 ========== */

.game-screen { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }

/* 顶栏 */
.top-bar {
    background:
        linear-gradient(180deg, var(--color-ink) 0%, var(--color-ink-light) 100%);
    color: var(--color-cream);
    padding: calc(0.7rem + env(safe-area-inset-top)) 2rem 0.7rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-gold);
    box-shadow: 0 3px 16px var(--color-shadow-deep);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar::after {
    content: '';
    position: absolute;
    bottom: -3px; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--color-gold) 20%, var(--color-gold-bright) 50%, var(--color-gold) 80%, transparent 100%);
}

.top-bar-left { display: flex; align-items: center; gap: 1.2rem; }

.player-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid var(--color-gold);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(184, 148, 30, 0.3);
}

.player-avatar svg { width: 100%; height: 100%; }
.player-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; display: block; }

/* 真实立绘图片通用适配 */
.player-portrait-img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; display: block; }

.player-name {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 1.4rem;
    color: var(--color-gold-bright);
    letter-spacing: 4px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.player-info {
    font-size: 0.82rem;
    color: var(--color-cream);
    opacity: 0.85;
    letter-spacing: 1px;
}

.career-badge {
    display: inline-block;
    background: rgba(184, 148, 30, 0.2);
    border: 1px solid var(--color-gold);
    color: var(--color-gold-bright);
    padding: 1px 8px;
    border-radius: 2px;
    font-size: 0.72rem;
    margin-left: 0.5rem;
    letter-spacing: 1px;
}

.top-bar-right { display: flex; gap: 0.4rem; align-items: center; }

.icon-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(184, 148, 30, 0.4);
    color: var(--color-cream);
    padding: 6px 14px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: inherit;
    transition: all 0.25s;
    letter-spacing: 2px;
}

.icon-btn:hover {
    background: rgba(184, 148, 30, 0.2);
    border-color: var(--color-gold-bright);
    color: var(--color-gold-bright);
}

/* 属性面板 */
.stats-bar {
    background: linear-gradient(180deg, var(--bg-silk), var(--bg-silk-dark));
    border-bottom: 1px solid var(--color-border-light);
    padding: 0.5rem 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 1px 4px var(--color-shadow);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.stat-label { color: var(--color-ink-soft); font-weight: 600; letter-spacing: 1px; }
.stat-value { color: var(--color-vermillion); font-weight: 700; min-width: 30px; text-align: right; }

.stat-bar {
    width: 70px;
    height: 7px;
    background: rgba(160, 144, 128, 0.2);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--color-border-light);
}

.stat-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.bar-health { background: linear-gradient(90deg, #c0392b, #e74c3c); }
.bar-reputation { background: linear-gradient(90deg, var(--color-gold), var(--color-gold-bright)); }
.bar-power { background: linear-gradient(90deg, var(--color-jade), var(--color-jade-light)); }
.bar-observation { background: linear-gradient(90deg, #2c5f7c, #5dade2); }
.bar-charisma { background: linear-gradient(90deg, #9e2b6e, #d4537e); }

/* 行动力 */
.action-points {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(184, 148, 30, 0.12);
    padding: 4px 10px;
    border-radius: 3px;
    border: 1px solid var(--color-gold);
}

.action-point-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--color-gold-bright);
    box-shadow: 0 0 6px var(--color-gold-bright);
    transition: all 0.3s;
}

.action-point-dot.used {
    background: rgba(160, 144, 128, 0.3);
    box-shadow: none;
}

/* 布告栏 */
.bulletin-bar {
    background: linear-gradient(180deg, rgba(184, 148, 30, 0.06), rgba(184, 148, 30, 0.03));
    border-bottom: 1px solid rgba(184, 148, 30, 0.2);
    padding: 0.35rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    font-size: 0.78rem;
    min-height: 32px;
}
.bulletin-bar-label {
    color: var(--color-gold-dark);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.bulletin-bar-empty {
    color: var(--color-ink-soft);
    opacity: 0.5;
    font-style: italic;
}
.bulletin-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    white-space: nowrap;
    font-size: 0.78rem;
}
.bulletin-tag.good {
    background: rgba(26, 107, 84, 0.1);
    color: var(--color-jade);
}
.bulletin-tag.bad {
    background: rgba(180, 40, 40, 0.08);
    color: var(--color-vermillion);
}
.bulletin-cond {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    white-space: nowrap;
    font-size: 0.72rem;
}
.bulletin-cond.good {
    background: rgba(26, 107, 84, 0.1);
    color: var(--color-jade);
}
.bulletin-cond.bad {
    background: rgba(180, 40, 40, 0.08);
    color: var(--color-vermillion);
}

/* 标签页 */
.tab-bar {
    background: linear-gradient(180deg, var(--bg-silk-dark), var(--bg-silk));
    border-bottom: 2px solid var(--color-gold);
    display: flex;
    padding: 0 1rem;
    overflow-x: auto;
    gap: 0.2rem;
    box-shadow: 0 1px 4px var(--color-shadow);
}

.tab {
    padding: 0.7rem 1.4rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-ink-soft);
    border-bottom: 3px solid transparent;
    transition: all 0.25s;
    letter-spacing: 3px;
    white-space: nowrap;
    position: relative;
}

.tab:hover { color: var(--color-vermillion); background: rgba(139, 26, 26, 0.04); }

.tab.active {
    color: var(--color-vermillion);
    border-bottom-color: var(--color-vermillion);
    background: rgba(139, 26, 26, 0.05);
}

.tab-badge {
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    background: var(--color-vermillion);
    color: var(--color-cream);
    font-size: 0.6rem;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    padding: 0 4px;
    box-shadow: 0 1px 4px rgba(139, 26, 26, 0.4);
}

/* 内容区域 */
.game-content { flex: 1; padding: 1.5rem 2rem; overflow-y: auto; }

/* ========== 后宅界面 ========== */

.harem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
}

.npc-card {
    background: linear-gradient(180deg, var(--color-cream-light), var(--bg-silk));
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px var(--color-shadow);
}

.npc-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-vermillion), var(--color-gold), var(--color-vermillion));
    opacity: 0;
    transition: opacity 0.3s;
}

.npc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 28px var(--color-shadow-deep);
    border-color: var(--color-gold);
}

.npc-card:hover::before { opacity: 1; }

.npc-portrait {
    width: 100%;
    height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(240, 230, 210, 0.3), rgba(232, 220, 192, 0.5));
}

.npc-portrait svg { width: 100%; height: 100%; transition: transform 0.4s; }
.npc-card:hover .npc-portrait svg { transform: scale(1.05); }
.npc-portrait-img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; transition: transform 0.4s; }
/* v195 小厮立绘面部微调 */
.npc-portrait-img[src$="portrait_servant_1.webp"] { object-position: center 22%; }
.npc-portrait-img[src$="portrait_servant_2.webp"] { object-position: center 28%; }
.npc-portrait-img[src$="portrait_servant_3.webp"] { object-position: center 20%; }
.npc-portrait-img[src$="portrait_servant_4.webp"] { object-position: center 22%; }
.npc-portrait-img[src$="portrait_servant_5.webp"] { object-position: center 28%; }
.npc-portrait-img[src$="portrait_servant_6.webp"] { object-position: center 22%; }
/* v204 招募小厮立绘面部微调 */
.npc-portrait-img[src$="portrait_servant_7.webp"] { object-position: center 30%; }
.npc-portrait-img[src$="portrait_servant_8.webp"] { object-position: center 25%; }
.npc-portrait-img[src$="portrait_servant_9.webp"] { object-position: center 28%; }
.npc-portrait-img[src$="portrait_servant_10.webp"] { object-position: center 30%; }
.npc-portrait-img[src$="portrait_servant_11.webp"] { object-position: center 40%; }
.npc-portrait-img[src$="portrait_servant_12.webp"] { object-position: center 30%; }
.npc-portrait-img[src$="portrait_servant_13.webp"] { object-position: center 28%; }
.npc-portrait-img[src$="portrait_servant_14.webp"] { object-position: center 30%; }
.npc-portrait-img[src$="portrait_servant_15.webp"] { object-position: center 26%; }
.npc-portrait-img[src$="portrait_servant_16.webp"] { object-position: center 25%; }
.npc-portrait-img[src$="portrait_servant_17.webp"] { object-position: center 30%; }
.npc-portrait-img[src$="portrait_servant_18.webp"] { object-position: center 28%; }
.npc-portrait-img[src$="portrait_servant_19.webp"] { object-position: center 32%; }
.npc-portrait-img[src$="portrait_servant_20.webp"] { object-position: center 26%; }
.npc-card:hover .npc-portrait-img { transform: scale(1.05); }
/* v307 手选丹青的面部焦点位于画面上方：卡片保持完整眉眼，不再沿用普通立绘的 25% 裁切。 */
.npc-portrait .npc-portrait-img[data-manual-spouse-portrait-v307="true"] {
    object-position: center var(--manual-portrait-card-y, 4%);
}
.npc-card:hover .npc-portrait-img[data-manual-spouse-portrait-v307="true"] { transform: none; }
.npc-portrait-fallback { color: var(--color-text-light); font-size: 0.8rem; padding: 1rem; text-align: center; }

.npc-title-tag {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: linear-gradient(135deg, var(--color-vermillion), var(--color-vermillion-light));
    color: var(--color-cream);
    padding: 3px 12px;
    border-radius: 2px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(139, 26, 26, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.npc-pregnancy-tag {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, var(--color-jade), var(--color-jade-light));
    color: var(--color-cream);
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.68rem;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(26, 107, 84, 0.3);
}

.npc-info { padding: 0.8rem 1rem; }

.npc-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-ink);
    margin-bottom: 0.2rem;
    letter-spacing: 3px;
}

.npc-desc {
    font-size: 0.76rem;
    color: var(--color-ink-soft);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.npc-stats { display: flex; flex-direction: column; gap: 0.25rem; }

.npc-stat-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
}

.npc-favor-bar, .npc-mood-bar {
    width: 100%;
    height: 5px;
    background: rgba(160, 144, 128, 0.2);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--color-border-light);
}

.npc-favor-fill { height: 100%; background: linear-gradient(90deg, var(--color-vermillion), var(--color-vermillion-glow)); transition: width 0.5s; }
.npc-mood-fill { height: 100%; background: linear-gradient(90deg, var(--color-jade), var(--color-jade-light)); transition: width 0.5s; }

.npc-card.danger {
    border-color: var(--color-danger);
    animation: dangerPulse 2s infinite;
}

@keyframes dangerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(107, 0, 0, 0.3); }
    50% { box-shadow: 0 0 16px 4px rgba(107, 0, 0, 0.2); }
}

/* 空后宅 */
.empty-harem {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-ink-soft);
}

.empty-harem-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-harem-text { font-size: 1.1rem; margin-bottom: 0.5rem; letter-spacing: 3px; }
.empty-harem-hint { font-size: 0.82rem; opacity: 0.6; letter-spacing: 1px; }

/* ========== 地图系统 ========== */

.map-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.map-bg {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #e8dcc8 0%, #d4c4a8 30%, #c8b898 60%, #b8a888 100%);
    border-radius: 10px;
    border: 2px solid var(--color-border);
    overflow: hidden;
    /* 默认背景：山脉河流的意境 */
    background-image:
        radial-gradient(ellipse 30% 20% at 30% 40%, rgba(26, 107, 84, 0.12), transparent),
        radial-gradient(ellipse 25% 15% at 70% 60%, rgba(26, 107, 84, 0.10), transparent),
        radial-gradient(ellipse 40% 8% at 50% 50%, rgba(70, 130, 180, 0.08), transparent);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.15);
}

/* 当背景图加载后的遮罩（确保按钮可读） */
.map-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(40, 30, 20, 0.25) 100%);
    pointer-events: none;
    z-index: 1;
}

.map-location {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s;
    z-index: 3;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.map-location.event-loc .map-loc-icon {
    background: rgba(255, 250, 240, 0.92);
    border: 2px solid var(--color-ink-soft);
}

.map-location.npc-loc .map-loc-icon {
    background: rgba(255, 245, 220, 0.95);
    border: 2px solid var(--color-gold);
    box-shadow: 0 2px 10px rgba(184, 148, 30, 0.4);
}

.map-location.completed,
.map-location.in-cooldown {
    opacity: 0.55;
}

.map-location.in-cooldown {
    cursor: not-allowed;
}

.map-location.has-event {
    animation: mapPulse 2s infinite;
}

@keyframes mapPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.08); }
}

/* 上元灯节特殊地点：大图标+金色光晕+烟花动效 */
.map-location.shangyuan-loc {
    z-index: 5;
    animation: shangyuanFloat 3s ease-in-out infinite;
}

.map-location.shangyuan-loc .map-loc-icon {
    width: 68px;
    height: 68px;
    font-size: 2.4rem;
    background: radial-gradient(circle, rgba(255, 230, 130, 0.92), rgba(212, 164, 54, 0.85));
    border: 3px solid #ffd86b;
    box-shadow: 0 0 18px rgba(255, 200, 60, 0.7), 0 0 32px rgba(212, 164, 54, 0.45);
}

.map-location.shangyuan-loc .map-loc-name {
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.92), rgba(212, 164, 54, 0.92));
    color: #fff8e1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    border: 1px solid #fff5b0;
    font-size: 0.78rem;
    padding: 2px 7px;
    margin-top: 4px;
}

.map-location.shangyuan-loc:hover .map-loc-icon {
    transform: scale(1.18);
    box-shadow: 0 0 28px rgba(255, 200, 60, 0.95), 0 0 48px rgba(212, 164, 54, 0.65);
}

@keyframes shangyuanFloat {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50% { transform: translate(-50%, -50%) translateY(-6px); }
}

/* 烟花辐射动效 — 8条辐射线+闪烁粒子 */
.shangyuan-firework {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    width: 68px;
    height: 68px;
    pointer-events: none;
    z-index: -1;
}

.shangyuan-firework .spark {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ffd86b;
    box-shadow: 0 0 6px #ffd86b, 0 0 12px #ff9933;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: shangyuanSpark 2.4s ease-out infinite;
}

.shangyuan-firework .spark.s1 { animation-delay: 0.0s; background: #ffd86b; }
.shangyuan-firework .spark.s2 { animation-delay: 0.15s; background: #ff5b5b; }
.shangyuan-firework .spark.s3 { animation-delay: 0.3s; background: #ff9933; }
.shangyuan-firework .spark.s4 { animation-delay: 0.45s; background: #ff5be0; }
.shangyuan-firework .spark.s5 { animation-delay: 0.6s; background: #5be0ff; }
.shangyuan-firework .spark.s6 { animation-delay: 0.75s; background: #b6ff5b; }
.shangyuan-firework .spark.s7 { animation-delay: 0.9s; background: #ffd86b; }
.shangyuan-firework .spark.s8 { animation-delay: 1.05s; background: #ff5b5b; }

@keyframes shangyuanSpark {
    0% { opacity: 0; transform: translate(-50%, -50%) translate(0, 0) scale(0.3); }
    20% { opacity: 1; transform: translate(-50%, -50%) translate(var(--dx, 0), var(--dy, 0)) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) translate(calc(var(--dx, 0) * 2), calc(var(--dy, 0) * 2)) scale(0.5); }
}

/* 8个粒子向不同方向辐射 */
.shangyuan-firework .spark.s1 { --dx: 32px; --dy: 0px; }
.shangyuan-firework .spark.s2 { --dx: 23px; --dy: 23px; }
.shangyuan-firework .spark.s3 { --dx: 0px; --dy: 32px; }
.shangyuan-firework .spark.s4 { --dx: -23px; --dy: 23px; }
.shangyuan-firework .spark.s5 { --dx: -32px; --dy: 0px; }
.shangyuan-firework .spark.s6 { --dx: -23px; --dy: -23px; }
.shangyuan-firework .spark.s7 { --dx: 0px; --dy: -32px; }
.shangyuan-firework .spark.s8 { --dx: 23px; --dy: -23px; }

/* 列表项特殊样式 */
.map-npc-item.shangyuan-list-item {
    background: linear-gradient(90deg, rgba(255, 230, 130, 0.18), rgba(212, 164, 54, 0.08));
    border-left: 3px solid #d4a436;
    font-weight: 600;
}

/* 上元灯节选侍夫高亮态 */
.shangyuan-spouse-pick.selected > div {
    border-color: #d4a436 !important;
    background: linear-gradient(90deg, rgba(255, 230, 130, 0.5), rgba(212, 164, 54, 0.18)) !important;
    box-shadow: 0 2px 10px rgba(212, 164, 54, 0.4);
    transform: translateX(2px);
}
.shangyuan-spouse-pick {
    cursor: pointer;
}
.shangyuan-spouse-pick:hover > div {
    border-color: #c9a948 !important;
    background: rgba(255, 240, 195, 0.6) !important;
}

/* v207 七夕灯会样式 */
.qixi-loc {
    background: linear-gradient(135deg, rgba(192, 57, 139, 0.18), rgba(142, 68, 173, 0.18)) !important;
    border-color: #c0398b !important;
    color: #fff !important;
}
.qixi-firework {
    position: absolute; top: 50%; left: 50%;
    width: 0; height: 0; pointer-events: none;
}
.qixi-firework .qstar {
    position: absolute;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #c0398b;
    box-shadow: 0 0 8px #c0398b;
    opacity: 0;
    animation: qixi-twinkle 2.5s infinite ease-out;
}
.qixi-firework .qstar.s1 { --dx: 0; --dy: -28px; animation-delay: 0.1s; background: #c0398b; }
.qixi-firework .qstar.s2 { --dx: 26px; --dy: -10px; animation-delay: 0.5s; background: #8e44ad; }
.qixi-firework .qstar.s3 { --dx: 18px; --dy: 22px; animation-delay: 0.9s; background: #5b8cff; }
.qixi-firework .qstar.s4 { --dx: -18px; --dy: 22px; animation-delay: 1.3s; background: #ffd86b; }
.qixi-firework .qstar.s5 { --dx: -26px; --dy: -10px; animation-delay: 1.7s; background: #ff5b5b; }
@keyframes qixi-twinkle {
    0% { transform: translate(0,0) scale(0.4); opacity: 0; }
    25% { opacity: 1; transform: translate(calc(var(--dx) * 0.5), calc(var(--dy) * 0.5)) scale(1); }
    60% { opacity: 0.9; transform: translate(var(--dx), var(--dy)) scale(1.2); }
    100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}
.map-npc-item.qixi-list-item {
    background: linear-gradient(90deg, rgba(192, 57, 139, 0.18), rgba(142, 68, 173, 0.08));
    border-left: 3px solid #c0398b;
    font-weight: 600;
}
.qixi-spouse-pick.selected > div {
    border-color: #c0398b !important;
    background: linear-gradient(90deg, rgba(252, 231, 243, 0.6), rgba(192, 57, 139, 0.18)) !important;
    box-shadow: 0 2px 10px rgba(192, 57, 139, 0.4);
    transform: translateX(2px);
}
.qixi-spouse-pick {
    cursor: pointer;
}
.qixi-spouse-pick:hover > div {
    border-color: #c0398b !important;
    background: rgba(252, 231, 243, 0.7) !important;
}

.map-loc-icon {
    font-size: 1.5rem;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border-radius: 50%;
    border: 2px solid var(--color-ink);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.25s;
}

.map-location:hover .map-loc-icon {
    transform: scale(1.18);
    border-color: var(--color-vermillion);
    box-shadow: 0 4px 14px rgba(192, 57, 43, 0.4);
}

.map-loc-name {
    font-size: 0.7rem;
    color: var(--color-ink);
    font-weight: 700;
    margin-top: 2px;
    padding: 1px 5px;
    background: rgba(255, 250, 240, 0.85);
    border-radius: 3px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.map-loc-status {
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 3px;
    margin-top: 2px;
    white-space: nowrap;
    font-weight: 600;
}

.map-loc-status.new { background: rgba(212, 164, 54, 0.9); color: #fff; }
.map-loc-status.progress { background: rgba(192, 57, 43, 0.9); color: #fff; }
.map-loc-status.done { background: rgba(26, 107, 84, 0.9); color: #fff; }
.map-loc-status.recruited { background: var(--color-vermillion); color: #fff; }
.map-loc-status.cooldown { background: rgba(160, 144, 128, 0.85); color: #fff; }

.map-loc-pulse {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--color-vermillion);
    animation: mapRing 2s infinite;
    pointer-events: none;
}

@keyframes mapRing {
    0% { transform: translateX(-50%) scale(1); opacity: 1; }
    100% { transform: translateX(-50%) scale(2); opacity: 0; }
}

.map-loc-hint {
    font-size: 0.58rem;
    color: #fff;
    background: rgba(192, 57, 43, 0.85);
    margin-top: 1px;
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
}

/* 地图信息面板 */
.map-info-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    padding: 1rem 1.2rem;
}

.map-info-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-ink);
    margin-bottom: 0.3rem;
}

.map-info-desc {
    font-size: 0.78rem;
    color: var(--color-ink-soft);
    line-height: 1.7;
    margin-bottom: 0.8rem;
}

.map-npc-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.map-npc-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    background: var(--color-cream-light);
    border-radius: 6px;
    font-size: 0.8rem;
}

.map-npc-item.done {
    opacity: 0.6;
}

.map-npc-loc {
    color: var(--color-ink);
    font-weight: 700;
    min-width: 90px;
    flex-shrink: 0;
}

.map-npc-stage {
    color: var(--color-ink-soft);
    flex: 1;
    font-size: 0.72rem;
    line-height: 1.4;
}

.map-npc-status {
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(212, 164, 54, 0.18);
    color: var(--color-gold);
    flex-shrink: 0;
}

.map-npc-status.done {
    background: rgba(26, 107, 84, 0.18);
    color: var(--color-jade);
}

/* 地图事件弹窗 */
.map-event-modal {
    background: var(--color-surface);
    border-radius: 10px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.map-event-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--color-border-light);
}

.map-event-loc {
    display: block;
    font-size: 0.85rem;
    color: var(--color-ink-soft);
    margin-bottom: 0.3rem;
}

.map-event-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-vermillion);
    letter-spacing: 2px;
}

.map-event-body {
    line-height: 1.8;
}

.map-event-portrait {
    width: 100%;
    max-width: 240px;
    aspect-ratio: 2 / 2.4;
    margin: 0.8rem auto 0.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border: 2px solid var(--color-gold);
    background: linear-gradient(180deg, #f5ead5, #e8dcc0);
}
.map-event-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    display: block;
}

/* ========== 日常活动 ========== */

.daily-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, rgba(26, 107, 84, 0.06), rgba(184, 148, 30, 0.06));
    border-radius: 8px;
    border: 1px solid var(--color-border-light);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.daily-ap-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.daily-ap-label {
    font-size: 0.85rem;
    color: var(--color-ink-soft);
    letter-spacing: 1px;
}

.daily-ap-dots {
    display: flex;
    gap: 4px;
}

.daily-ap-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(160, 144, 128, 0.25);
    transition: all 0.3s;
}

.daily-ap-dot.active {
    background: var(--color-gold-bright);
    box-shadow: 0 0 6px rgba(212, 164, 54, 0.5);
}

.daily-ap-num {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-gold);
}

.daily-hint {
    font-size: 0.8rem;
    color: var(--color-ink-soft);
    opacity: 0.7;
}

.daily-grid {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.daily-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: all 0.25s;
    background: var(--color-surface);
}

.daily-card:hover:not(.disabled) {
    transform: translateX(4px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.daily-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.daily-card.jade { border-left: 3px solid var(--color-jade); }
.daily-card.vermillion { border-left: 3px solid var(--color-vermillion); }
.daily-card.gold { border-left: 3px solid var(--color-gold); }
.daily-card.ink { border-left: 3px solid var(--color-ink); }
.daily-card.soft { border-left: 3px solid var(--color-ink-soft); }

.daily-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 48px;
    text-align: center;
}

.daily-card-body {
    flex: 1;
}

.daily-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-ink);
    margin-bottom: 0.2rem;
}

.daily-card-cost {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--color-gold);
    background: rgba(212, 164, 54, 0.1);
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 0.5rem;
}

.daily-card-desc {
    font-size: 0.82rem;
    color: var(--color-ink-soft);
    line-height: 1.5;
}

/* ========== 弹窗 ========== */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 20, 16, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 2rem;
    animation: overlayFade 0.3s;
    overflow-y: auto;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: linear-gradient(180deg, var(--color-cream-light), var(--bg-silk));
    border: 1px solid var(--color-gold);
    border-radius: 6px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 16px 64px rgba(0,0,0,0.4), 0 0 0 1px var(--color-border-light);
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.modal::before {
    content: '';
    position: absolute;
    top: 3px; left: 3px; right: 3px; bottom: 3px;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    pointer-events: none;
    opacity: 0.4;
}

@keyframes modalSlideUp {
    from { transform: translateY(40px) scale(0.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
    background: linear-gradient(180deg, var(--color-ink), var(--color-ink-light));
    color: var(--color-cream);
    padding: 1.2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-gold);
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}

.modal-title {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 1.4rem;
    letter-spacing: 4px;
    color: var(--color-gold-bright);
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-cream);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0 0.5rem;
    opacity: 0.6;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover { opacity: 1; transform: rotate(90deg); }

.modal-body { padding: 1.8rem 2rem; }

.npc-detail-portrait {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid var(--color-gold);
    overflow: hidden;
    margin: 0 auto 0.8rem;
    box-shadow: 0 4px 16px var(--color-shadow);
}

.npc-detail-portrait svg { width: 100%; height: 100%; }
.npc-detail-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.npc-detail-portrait .npc-portrait-img[data-manual-spouse-portrait-v307="true"] {
    object-position: center var(--manual-portrait-detail-y, 2%);
}

/* v307 丹青选册与大图审阅 */
.manual-portrait-choice-v307 { cursor: zoom-in; }
.manual-portrait-thumb-v307 {
    position: relative;
    display: block;
    margin-bottom: .45rem;
    overflow: hidden;
    border-radius: 5px;
    background: #211a18;
}
.manual-portrait-thumb-v307 img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center 18%;
    display: block;
    transition: transform .25s ease;
}
.manual-portrait-choice-v307:hover .manual-portrait-thumb-v307 img { transform: scale(1.025); }
.manual-portrait-zoom-hint-v307 {
    position: absolute;
    right: .4rem;
    bottom: .4rem;
    padding: .2rem .45rem;
    border-radius: 999px;
    background: rgba(35, 20, 13, .82);
    color: #fff2cf;
    font-size: .66rem;
    letter-spacing: .08em;
    box-shadow: 0 1px 5px rgba(0,0,0,.32);
}
.manual-portrait-view-action-v307 {
    display: block;
    margin-top: .4rem;
    color: var(--color-vermillion);
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
}
.manual-portrait-preview-overlay-v307 { cursor: default; }
.manual-portrait-preview-modal-v307 { max-width: 760px; }
.manual-portrait-preview-modal-v307 .map-event-header { position: relative; padding-right: 3rem; }
.manual-portrait-preview-close-v307 {
    position: absolute;
    top: 50%;
    right: .85rem;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(201,168,76,.5);
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: #f6e7ba;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}
.manual-portrait-preview-body-v307 { overflow-y: auto; }
.manual-portrait-large-frame-v307 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 520px);
    height: min(66dvh, 720px);
    min-height: 320px;
    margin: 0 auto .9rem;
    padding: .4rem;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid var(--color-gold);
    border-radius: 8px;
    background: #201916;
    box-shadow: 0 8px 28px rgba(31,18,11,.28);
}
.manual-portrait-large-frame-v307 img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}
.manual-portrait-preview-copy-v307 { text-align: center; }
.manual-portrait-preview-actions-v307 .story-choice-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    filter: grayscale(.35);
}

@media (max-width: 600px) {
    .manual-portrait-preview-modal-v307 { width: min(94vw, 760px); }
    .manual-portrait-large-frame-v307 { height: min(58dvh, 620px); min-height: 280px; }
    .manual-portrait-preview-actions-v307 { display: grid; grid-template-columns: 1fr; }
}

.npc-detail-name {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-ink);
    letter-spacing: 4px;
    margin-bottom: 0.2rem;
}

.npc-detail-title {
    text-align: center;
    color: var(--color-vermillion);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.npc-detail-section { margin-bottom: 1.2rem; }

.npc-detail-section-title {
    font-weight: 700;
    color: var(--color-ink);
    margin-bottom: 0.4rem;
    padding-left: 0.6rem;
    border-left: 3px solid var(--color-vermillion);
    font-size: 0.92rem;
    letter-spacing: 2px;
}

.collapse-indicator {
    transition: opacity 0.2s;
}

.npc-detail-section-title:hover .collapse-indicator {
    opacity: 0.7;
}

.npc-detail-text {
    font-size: 0.88rem;
    color: var(--color-ink-soft);
    line-height: 1.9;
    padding-left: 0.8rem;
}

.npc-detail-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
    padding-left: 0.8rem;
}

.npc-detail-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    padding: 0.15rem 0;
    border-bottom: 1px dashed rgba(160, 144, 128, 0.2);
}

.npc-detail-stat-label { color: var(--color-ink-soft); }
.npc-detail-stat-value { font-weight: 700; color: var(--color-ink); }

.npc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.action-btn {
    padding: 8px 20px;
    font-size: 0.88rem;
    border: 1px solid var(--color-border);
    background: linear-gradient(180deg, var(--color-cream-light), var(--bg-silk));
    color: var(--color-ink);
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s;
    letter-spacing: 2px;
}

.action-btn:hover {
    border-color: var(--color-vermillion);
    color: var(--color-vermillion);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px var(--color-shadow);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--color-vermillion), var(--color-vermillion-light));
    color: var(--color-cream);
    border-color: var(--color-gold);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-btn.danger { border-color: var(--color-danger); color: var(--color-danger); }
.action-btn.jade { border-color: var(--color-jade); color: var(--color-jade); }
.action-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

/* ========== 产业界面 ========== */

.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}

.business-card {
    background: linear-gradient(180deg, var(--color-cream-light), var(--bg-silk));
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px var(--color-shadow);
    position: relative;
    overflow: hidden;
}

.business-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-jade), var(--color-gold));
}

.business-card:hover {
    border-color: var(--color-gold);
    box-shadow: 0 6px 20px var(--color-shadow-deep);
    transform: translateY(-3px);
}

.business-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.business-name { font-size: 1.15rem; font-weight: 700; color: var(--color-ink); letter-spacing: 3px; }

.business-level {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-bright));
    color: var(--color-ink);
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(184, 148, 30, 0.3);
}

.business-info {
    font-size: 0.82rem;
    color: var(--color-ink-soft);
    line-height: 1.6;
    margin-bottom: 0.6rem;
}

.business-income { color: var(--color-jade); font-weight: 700; font-size: 0.95rem; }

.business-actions { display: flex; gap: 0.4rem; margin-top: 0.7rem; }

.business-available {
    background: rgba(240, 230, 210, 0.4);
    border: 2px dashed var(--color-border);
    border-radius: 6px;
    padding: 1.1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.business-available:hover {
    border-color: var(--color-gold);
    background: rgba(240, 230, 210, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--color-shadow);
}

.business-available-name { font-size: 1.05rem; font-weight: 700; color: var(--color-ink); margin-bottom: 0.2rem; }
.business-available-cost { color: var(--color-vermillion); font-size: 0.82rem; }

/* ========== 剧情界面 ========== */

.story-chapter {
    background: linear-gradient(180deg, var(--color-cream-light), var(--bg-silk));
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 1.8rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 2px 8px var(--color-shadow);
    position: relative;
    overflow: hidden;
}

.story-chapter::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--color-vermillion), var(--color-gold));
}

.story-chapter-title {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 1.6rem;
    color: var(--color-vermillion);
    margin-bottom: 0.3rem;
    letter-spacing: 5px;
}

.story-chapter-status {
    font-size: 0.78rem;
    color: var(--color-ink-soft);
    margin-bottom: 0.8rem;
    letter-spacing: 1px;
}

.story-chapter-status.locked { color: var(--color-border); }
.story-chapter-status.active { color: var(--color-vermillion); font-weight: 700; }
.story-chapter-status.completed { color: var(--color-jade); }

.story-chapter-desc {
    font-size: 0.92rem;
    color: var(--color-ink-soft);
    line-height: 1.9;
    margin-bottom: 0.8rem;
}

.story-chapter-req {
    font-size: 0.8rem;
    color: var(--color-warning);
    background: rgba(139, 105, 20, 0.08);
    padding: 0.4rem 0.8rem;
    border-radius: 3px;
    border-left: 3px solid var(--color-warning);
}

/* 剧情对话 */
.story-dialogue {
    background: linear-gradient(180deg, var(--color-cream-light), var(--bg-silk));
    border: 1px solid var(--color-gold);
    border-radius: 6px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 16px 64px rgba(0,0,0,0.4), 0 0 0 1px var(--color-border-light);
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.story-dialogue-header {
    background: linear-gradient(180deg, var(--color-vermillion), var(--color-vermillion-light));
    color: var(--color-cream);
    padding: 1.1rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--color-gold);
    position: relative;
}

.story-dialogue-header::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold-bright), transparent);
}

.story-dialogue-title {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 1.4rem;
    letter-spacing: 5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.story-dialogue-body { padding: 1.8rem 2rem; }

.story-narration {
    font-family: 'LXGW WenKai TC', 'Noto Serif SC', serif;
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--color-ink);
    line-height: 2.2;
    margin-bottom: 1.2rem;
    text-indent: 2em;
}

.story-cg-wrap {
    position: relative;
    margin: 0 auto 1.4rem;
    max-width: 92%;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25), 0 0 0 1px var(--color-gold);
}

.story-cg-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 50vh;
    object-fit: cover;
    background: linear-gradient(180deg, #1a1410, #2c1810);
}

.story-cg-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0.8rem 1.4rem 0.9rem;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.7));
    color: #f5e6c0;
    font-family: 'Ma Shan Zheng', serif;
    font-size: 1.15rem;
    letter-spacing: 4px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* v268：主线人物去留抉择立绘 */
.story-character-card {
    width: min(230px, 72vw);
    margin: 0 auto 1rem;
    border: 1px solid var(--color-gold);
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(180deg, #f4ead2, #e3d0aa);
    box-shadow: 0 5px 18px rgba(45, 31, 20, 0.24);
}

.story-character-img {
    display: block;
    width: 100%;
    height: min(310px, 42vh);
    object-fit: cover;
    object-position: center 18%;
}

.story-character-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.65rem 0.8rem 0.75rem;
    text-align: center;
    color: var(--color-ink);
    background: linear-gradient(180deg, rgba(255,255,255,0.75), rgba(240,226,195,0.9));
}

.story-character-meta b {
    color: var(--color-vermillion);
    font-size: 1.08rem;
    letter-spacing: 3px;
}

.story-character-meta span {
    font-size: 0.76rem;
    color: var(--color-ink-soft);
}

.orphan-form-block {
    margin: 0.8rem 0;
    padding: 0.8rem;
    border: 1px solid rgba(184, 148, 30, 0.32);
    border-radius: 6px;
    background: rgba(255, 250, 235, 0.62);
}

.orphan-form-block > label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-vermillion);
    font-weight: 700;
    letter-spacing: 2px;
}

.orphan-form-block > small {
    display: block;
    margin-top: 0.4rem;
    color: var(--color-ink-soft);
    font-size: 0.74rem;
}

.orphan-name-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.orphan-name-row > span {
    flex: 0 0 auto;
    padding: 0.65rem 0.8rem;
    border-radius: 5px;
    background: var(--color-vermillion);
    color: #fff9e9;
    font-weight: 700;
}

.orphan-name-row > input {
    min-width: 0;
    flex: 1;
    box-sizing: border-box;
    padding: 0.65rem 0.8rem;
    border: 1px solid rgba(139, 26, 26, 0.35);
    border-radius: 5px;
    background: rgba(255,255,255,0.82);
    color: var(--color-ink);
    font: inherit;
    outline: none;
}

.orphan-name-row > input:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 2px rgba(184, 148, 30, 0.14);
}

.orphan-father-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.orphan-father-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    background: rgba(255,255,255,0.55);
    cursor: pointer;
}

.orphan-father-option:has(input:checked) {
    border-color: var(--color-jade);
    background: rgba(60, 122, 86, 0.09);
}

.orphan-father-option input { accent-color: var(--color-jade); }
.orphan-father-option span { min-width: 0; }
.orphan-father-option b, .orphan-father-option small { display: block; }
.orphan-father-option small { margin-top: 0.15rem; color: var(--color-ink-soft); font-size: 0.72rem; }

.story-speaker {
    font-family: 'LXGW WenKai TC', 'Noto Serif SC', serif;
    font-weight: 700;
    color: var(--color-vermillion);
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
    letter-spacing: 2px;
}

.story-dialogue-text {
    font-family: 'LXGW WenKai TC', 'Noto Serif SC', serif;
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--color-ink);
    line-height: 2.2;
    margin-bottom: 1.2rem;
    padding-left: 1rem;
    border-left: 3px solid var(--color-gold);
}

.story-choices { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.2rem; }

.story-choice-btn {
    padding: 0.9rem 1.4rem;
    background: linear-gradient(135deg, rgba(240, 230, 210, 0.8), rgba(232, 220, 192, 0.6));
    border: 1px solid var(--color-gold);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s;
    font-size: 1rem;
    color: var(--color-ink);
    line-height: 1.6;
    font-family: 'LXGW WenKai TC', 'Noto Serif SC', serif;
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-choice-btn:hover {
    border-color: var(--color-vermillion);
    background: linear-gradient(135deg, rgba(139, 26, 26, 0.08), rgba(184, 148, 30, 0.08));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--color-shadow);
}

.story-choice-btn:active {
    transform: translateY(0);
}

.story-choice {
    padding: 0.9rem 1.4rem;
    background: linear-gradient(135deg, rgba(240, 230, 210, 0.6), rgba(232, 220, 192, 0.4));
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s;
    font-size: 0.92rem;
    color: var(--color-ink);
    line-height: 1.6;
    font-family: inherit;
}

.story-choice:hover {
    border-color: var(--color-vermillion);
    background: linear-gradient(135deg, rgba(139, 26, 26, 0.06), rgba(184, 148, 30, 0.06));
    transform: translateX(6px);
    box-shadow: 0 3px 8px var(--color-shadow);
}

/* ========== 新手引导 ========== */
.tutorial-modal {
    background: linear-gradient(180deg, var(--color-cream-light), var(--bg-silk));
    border: 1px solid var(--color-gold);
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    box-shadow: 0 16px 64px rgba(0,0,0,0.4), 0 0 0 1px var(--color-border-light);
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: auto;
    touch-action: pan-y;
}

.tutorial-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tutorial-title {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 1.5rem;
    color: var(--color-vermillion);
    margin-bottom: 1rem;
    letter-spacing: 3px;
}

.tutorial-text {
    font-family: 'LXGW WenKai TC', 'Noto Serif SC', serif;
    font-size: 1.02rem;
    color: var(--color-ink);
    line-height: 2.2;
    margin-bottom: 1.5rem;
    text-align: left;
    text-indent: 2em;
}

.tutorial-progress {
    color: var(--color-gold);
    font-size: 0.8rem;
    letter-spacing: 4px;
    margin-bottom: 1.2rem;
}

.tutorial-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ========== 存档前提示 ========== */
.story-save-hint {
    text-align: center;
    margin-top: 0.8rem;
    margin-bottom: 0.8rem;
    padding: 0.6rem 1rem;
    background: rgba(184, 148, 30, 0.08);
    border: 1px dashed var(--color-gold);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--color-gold-dark, #8a6d10);
}

.story-save-btn {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--color-gold);
    color: var(--color-cream);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.82rem;
    margin-left: 0.5rem;
    transition: all 0.2s;
}

.story-save-btn:hover { background: var(--color-gold-bright); }

/* ========== 事件弹窗 ========== */

.event-modal {
    background: linear-gradient(180deg, var(--color-cream-light), var(--bg-silk));
    border: 1px solid var(--color-gold);
    border-radius: 6px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 16px 64px rgba(0,0,0,0.4), 0 0 0 1px var(--color-border-light);
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.event-header {
    padding: 1.1rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--color-gold);
    position: relative;
}

.event-header.urgent { background: linear-gradient(180deg, var(--color-danger), #8b2020); }
.event-header.normal { background: linear-gradient(180deg, var(--color-ink), var(--color-ink-light)); }
.event-header.good { background: linear-gradient(180deg, var(--color-jade), var(--color-jade-light)); }

.event-header.urgent .event-title,
.event-header.normal .event-title { color: var(--color-gold-bright); }
.event-header.good .event-title { color: var(--color-cream); }

.event-title {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 1.4rem;
    letter-spacing: 5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.event-body { padding: 1.8rem 2rem; }

.event-text {
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 0.95rem;
    color: var(--color-ink);
    line-height: 2.2;
    margin-bottom: 1.2rem;
    text-indent: 2em;
}

.event-choices { display: flex; flex-direction: column; gap: 0.6rem; }

.event-choice {
    padding: 0.9rem 1.4rem;
    background: linear-gradient(135deg, rgba(240, 230, 210, 0.6), rgba(232, 220, 192, 0.4));
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s;
    font-size: 0.92rem;
    color: var(--color-ink);
    line-height: 1.6;
    font-family: inherit;
    text-align: left;
}

.event-choice:hover {
    border-color: var(--color-vermillion);
    background: linear-gradient(135deg, rgba(139, 26, 26, 0.06), rgba(184, 148, 30, 0.06));
    transform: translateX(4px);
}

.event-result {
    background: rgba(240, 230, 210, 0.5);
    border-left: 3px solid var(--color-gold);
    padding: 0.8rem 1.2rem;
    margin-top: 0.8rem;
    font-size: 0.9rem;
    color: var(--color-ink-soft);
    line-height: 1.9;
    border-radius: 0 4px 4px 0;
}

.event-result.positive { border-left-color: var(--color-jade); }
.event-result.negative { border-left-color: var(--color-danger); }

/* ========== 存档界面 ========== */

.save-screen { padding: 2rem; max-width: 800px; margin: 0 auto; }

.save-title {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 2rem;
    color: var(--color-vermillion);
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 6px;
    position: relative;
}

.save-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    margin: 0.5rem auto 0;
}

.save-storage-warning,
.activation-storage-warning {
    border: 1px solid rgba(185, 74, 54, 0.55);
    border-left: 4px solid var(--color-danger);
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(185, 74, 54, 0.1), rgba(184, 148, 30, 0.08));
    color: var(--color-ink-soft);
    line-height: 1.75;
}

.save-storage-warning {
    padding: 0.9rem 1rem;
    margin: -0.6rem 0 1.2rem;
    font-size: 0.82rem;
}

.save-storage-warning-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.save-storage-warning-body { margin-top: 0.5rem; }
.save-storage-warning-body > div + div { margin-top: 0.35rem; }
.save-storage-warning-body[hidden],
.save-storage-warning-summary[hidden] { display: none !important; }

.save-storage-warning-summary {
    margin-top: 0.38rem;
    color: var(--color-ink-soft);
    font-size: 0.76rem;
    opacity: 0.86;
}

.save-storage-warning-toggle {
    appearance: none;
    flex: 0 0 auto;
    min-width: 4.2rem;
    padding: 0.28rem 0.52rem;
    border: 1px solid rgba(185, 74, 54, 0.55);
    border-radius: 999px;
    background: rgba(255, 250, 238, 0.72);
    color: var(--color-danger);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    touch-action: manipulation;
}

.save-storage-warning-toggle:active { transform: translateY(1px); }
.save-storage-warning-toggle:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

.save-storage-warning-toggle-arrow {
    display: inline-block;
    margin-left: 0.22rem;
    transition: transform 0.2s ease;
}

.save-storage-warning.is-collapsed .save-storage-warning-toggle-arrow { transform: rotate(180deg); }

.save-storage-warning-title {
    color: var(--color-danger);
    font-weight: 700;
    font-size: 0.94rem;
    letter-spacing: 1px;
}

@media (max-width: 420px) {
    .save-storage-warning { padding: 0.75rem 0.78rem; }
    .save-storage-warning-header { align-items: flex-start; }
    .save-storage-warning-title { font-size: 0.88rem; letter-spacing: 0.5px; }
}

.activation-storage-warning {
    margin-top: 0.8rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.72rem;
    text-align: left;
}

.activation-storage-warning b { color: var(--color-gold); }

.save-slot {
    background: linear-gradient(180deg, var(--color-cream-light), var(--bg-silk));
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 1.3rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
    box-shadow: 0 2px 6px var(--color-shadow);
}

.save-slot:hover { border-color: var(--color-gold); box-shadow: 0 4px 16px var(--color-shadow); }

.save-section-label {
    margin: 0.95rem 0 0.55rem;
    color: var(--color-ink-soft);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.quick-save-section-label { color: var(--color-gold-dark, #8d6b18); }

.quick-save-slot-v300 {
    border-color: rgba(184, 148, 30, 0.72);
    background: linear-gradient(135deg, rgba(255, 248, 218, 0.96), rgba(248, 231, 190, 0.9));
    box-shadow: 0 3px 12px rgba(116, 82, 22, 0.16);
}

.quick-save-auto-label {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.12rem 0.38rem;
    border: 1px solid rgba(184, 148, 30, 0.6);
    border-radius: 999px;
    color: var(--color-gold-dark, #8d6b18);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0;
    vertical-align: middle;
}

.quick-save-help {
    margin-top: 0.35rem;
    color: var(--color-ink-soft);
    font-size: 0.7rem;
    line-height: 1.45;
    opacity: 0.82;
}

.save-slot-info { flex: 1; }
.save-slot-name { font-size: 1.05rem; font-weight: 700; color: var(--color-ink); margin-bottom: 0.2rem; letter-spacing: 2px; }
.save-slot-detail { font-size: 0.8rem; color: var(--color-ink-soft); }
.save-slot-empty { color: var(--color-border); font-style: italic; }
.save-slot-actions { display: flex; gap: 0.4rem; }

/* ========== Toast ========== */

.toast-container {
    position: fixed;
    top: calc(80px + env(safe-area-inset-top));
    right: 20px;
    z-index: 10010;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    pointer-events: none;
}

.toast {
    background: linear-gradient(135deg, var(--color-ink), var(--color-ink-light));
    color: var(--color-cream);
    padding: 0.7rem 1.3rem;
    border-radius: 3px;
    border-left: 3px solid var(--color-gold);
    font-size: 0.88rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    animation: toastIn 0.3s, toastOut 0.4s 7.6s forwards;
    max-width: 320px;
    line-height: 1.6;
    pointer-events: auto;
}

.toast.success { border-left-color: var(--color-jade); }
.toast.danger { border-left-color: var(--color-danger); }
.toast.warning { border-left-color: var(--color-warning); }

@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

/* ========== 月报 ========== */

.monthly-report {
    background: linear-gradient(180deg, var(--color-cream-light), var(--bg-silk));
    border: 1px solid var(--color-gold);
    border-radius: 6px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 16px 64px rgba(0,0,0,0.4), 0 0 0 1px var(--color-border-light);
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.report-header {
    background: linear-gradient(180deg, var(--color-ink), var(--color-ink-light));
    color: var(--color-gold-bright);
    padding: 1.3rem;
    text-align: center;
    border-bottom: 1px solid var(--color-gold);
}

.report-title {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 1.4rem;
    letter-spacing: 5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.report-body { padding: 1.3rem 2rem; }

.report-section { margin-bottom: 1.2rem; }

.report-section-title {
    font-weight: 700;
    color: var(--color-vermillion);
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
    letter-spacing: 3px;
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: 0.3rem;
}

.report-item {
    font-size: 0.85rem;
    color: var(--color-ink-soft);
    line-height: 1.9;
    padding-left: 1rem;
    position: relative;
}

.report-item::before { content: '·'; position: absolute; left: 0; color: var(--color-gold); font-weight: 700; }
.report-item.positive { color: var(--color-jade); }
.report-item.negative { color: var(--color-danger); }

/* ========== 子嗣界面 ========== */

.child-card {
    background: linear-gradient(180deg, var(--color-cream-light), var(--bg-silk));
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--color-shadow);
    transition: all 0.3s;
}

.child-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px var(--color-shadow-deep); }

.child-portrait {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
}

.child-portrait.male-bg { background: linear-gradient(135deg, #d6eaf8, #aed6f1); }
.child-portrait.female-bg { background: linear-gradient(135deg, #fadbd8, #f5b7b1); }

/* ========== 职业面板 ========== */

.career-panel {
    background: linear-gradient(180deg, var(--color-cream-light), var(--bg-silk));
    border: 1px solid var(--color-gold);
    border-radius: 6px;
    padding: 1.8rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 2px 12px var(--color-shadow);
    position: relative;
    overflow: hidden;
}

.career-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-jade), var(--color-gold), var(--color-vermillion));
}

.career-panel-title {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 1.5rem;
    color: var(--color-vermillion);
    margin-bottom: 0.3rem;
    letter-spacing: 4px;
}

.career-rank-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.career-rank-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-jade);
    letter-spacing: 3px;
}

.career-progress {
    flex: 1;
    height: 10px;
    background: rgba(160, 144, 128, 0.2);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--color-border-light);
}

.career-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-jade), var(--color-jade-light));
    transition: width 0.5s;
}

.career-info {
    font-size: 0.85rem;
    color: var(--color-ink-soft);
    line-height: 1.8;
}

/* ========== v3 三线并行仕途 ========== */

.career-parallel-info {
    background: linear-gradient(135deg, var(--color-cream-light), var(--bg-silk));
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
    text-align: center;
}

.career-parallel-info > div {
    font-size: 0.88rem;
    color: var(--color-ink-soft);
    line-height: 1.7;
}

.merchant-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.merchant-actions-grid .action-btn {
    text-align: left;
    font-size: 0.78rem;
    padding: 0.5rem 0.6rem;
}

.merchant-actions-grid .action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.career-panel .npc-detail-stats {
    margin: 0.5rem 0;
}

.career-panel .npc-detail-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-right: 1rem;
}

.career-panel .npc-detail-stat-label {
    font-size: 0.78rem;
    color: var(--color-ink-soft);
}

.career-panel .npc-detail-stat-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-vermillion);
}

/* ========== 滚动条 ========== */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(160, 144, 128, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-gold); }

/* ========== 响应式 ========== */

/* ========== 移动端适配 ========== */

/* 中等屏幕（平板/大手机） */
@media (max-width: 768px) {
    .orphan-father-list { grid-template-columns: 1fr; }
    .story-character-img { height: min(260px, 38vh); }

    /* —— 标题界面 —— */
    .title-screen {
        padding: calc(1.5rem + env(safe-area-inset-top)) 1rem calc(1.5rem + env(safe-area-inset-bottom));
        align-items: center;
        justify-content: flex-start;
        min-height: 100vh;
        min-height: 100dvh;
        height: auto;
        overflow-x: hidden;
        overflow-y: visible;
        touch-action: pan-y;
        /* 竖屏 9:16 裁切左右各约17%，把锚点再左移保证人物背影可见 */
        background-position: 22% 30%;
    }

    /* 安卓 Chrome 的动态地址栏会压缩可视高度。弹窗从顶部参与滚动，
       内容较长时由弹窗自身滚动，避免固定居中把上下两端裁掉。 */
    .modal-overlay {
        align-items: flex-start;
        padding: max(.5rem, env(safe-area-inset-top)) .5rem max(.5rem, env(safe-area-inset-bottom));
        overflow-y: auto;
        touch-action: pan-y;
    }

    .event-modal, .map-event-modal, .modal, .monthly-report {
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
        overflow-y: auto;
        margin: auto;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }
    .title-main { font-size: 3rem; letter-spacing: 6px; }
    .title-sub { font-size: 1.1rem; letter-spacing: 4px; }
    .title-decoration { width: 80%; max-width: 280px; }
    .title-poem { font-size: 0.95rem; max-width: 100%; }
    .title-buttons .btn { padding: 10px 28px; font-size: 0.95rem; letter-spacing: 2px; }

    /* —— 顶栏 —— */
    .top-bar { padding: calc(0.5rem + env(safe-area-inset-top)) 0.8rem 0.5rem 0.8rem; }
    .player-avatar { width: 30px; height: 30px; }
    .player-name { font-size: 1.05rem; letter-spacing: 2px; }
    .player-info { font-size: 0.72rem; }
    .career-badge { font-size: 0.62rem; padding: 1px 5px; margin-left: 0.3rem; }
    .icon-btn { padding: 5px 10px; font-size: 0.72rem; letter-spacing: 1px; }
    .top-bar-right { gap: 0.25rem; }

    /* —— 属性栏 —— */
    .stats-bar {
        padding: 0.4rem 0.8rem;
        gap: 0.6rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .stat-item { font-size: 0.76rem; flex-shrink: 0; }
    .stat-bar { width: 50px; }
    .action-points { padding: 3px 6px; }
    .action-point-dot { width: 7px; height: 7px; }

    /* —— 布告栏 —— */
    .bulletin-bar { font-size: 0.7rem; padding: 0.25rem 0.5rem; }
    .bulletin-bar-label { font-size: 0.68rem; }
    .bulletin-tag, .bulletin-cond { font-size: 0.65rem; padding: 0.1rem 0.3rem; }

    /* —— 标签栏 —— */
    .tab-bar { padding: 0 0.3rem; gap: 0.1rem; }
    .tab { padding: 0.5rem 0.7rem; font-size: 0.82rem; letter-spacing: 1px; }

    /* —— 内容区 —— */
    .game-content { padding: 0.8rem 0.6rem; }

    /* —— 后宅/产业 —— */
    .harem-grid { grid-template-columns: 1fr; gap: 0.8rem; }
    .business-grid { grid-template-columns: 1fr; gap: 0.8rem; }
    .strategic-grid { grid-template-columns: 1fr; }
    .npc-portrait { height: 180px; }

    /* —— 创建角色 —— */
    .creation-screen { padding: 1rem; }
    .creation-panel { padding: 1.2rem 1rem; max-width: 100%; }
    .creation-title { font-size: 1.6rem; letter-spacing: 4px; }
    .creation-story { font-size: 0.85rem; padding: 0.8rem 1rem; line-height: 1.8; }
    .gender-select, .portrait-select, .career-select { flex-direction: column; gap: 0.6rem; }
    .creation-actions { flex-direction: column; gap: 0.6rem; }
    .creation-actions .btn { width: 100%; }

    /* —— 弹窗系统 —— */
    .modal-overlay { padding: 0.5rem; }
    .modal { max-width: 100% !important; max-height: 90vh; border-radius: 4px; }
    .modal-header { padding: 0.8rem 1rem; }
    .modal-title { font-size: 1.1rem; letter-spacing: 2px; }
    .modal-body { padding: 1rem 0.8rem; }
    .modal-close { font-size: 1.4rem; }

    /* 覆盖内联样式的max-width */
    .map-event-modal { max-width: 100% !important; padding: 1rem !important; }
    .tutorial-modal { max-width: 100% !important; width: 100% !important; padding: 1.2rem 1rem !important; }
    .story-dialogue { max-width: 100% !important; }
    .story-dialogue-header { padding: 0.8rem 1rem; }
    .story-dialogue-title { font-size: 1.1rem; letter-spacing: 3px; }
    .story-dialogue-body { padding: 1rem 0.8rem; }
    .story-narration { font-size: 0.95rem; line-height: 2; }
    .story-dialogue-text { font-size: 0.95rem; line-height: 2; }
    .story-choice-btn, .story-choice { font-size: 0.88rem; padding: 0.7rem 1rem; }

    /* —— NPC详情 —— */
    .npc-detail-portrait { width: 100px; height: 100px; }
    .npc-detail-name { font-size: 1.15rem; }
    .npc-detail-text { font-size: 0.82rem; line-height: 1.7; }
    .npc-detail-stats { grid-template-columns: 1fr; }
    .npc-actions { gap: 0.4rem; }
    .action-btn { padding: 6px 14px; font-size: 0.82rem; letter-spacing: 1px; }

    /* —— 按钮 —— */
    .btn { padding: 9px 24px; font-size: 0.9rem; letter-spacing: 2px; }

    /* —— 剧情 —— */
    .story-chapter { padding: 1rem 0.8rem; }
    .story-chapter-title { font-size: 1.2rem; letter-spacing: 3px; }
    .story-chapter-desc { font-size: 0.85rem; line-height: 1.8; }

    /* —— 月报 —— */
    .report-item b { font-size: 0.95rem; }

    /* —— 地图 —— */
    .map-event-portrait { max-width: 180px; }
    .map-loc-icon { width: 32px; height: 32px; font-size: 1.2rem; }
    .map-loc-name { font-size: 0.62rem; }

    /* —— 成就 —— */
    .achievement-container { max-width: 100%; padding: 0.3rem; }
    .achievement-title { font-size: 1.2rem; }

    /* —— 存档 —— */
    .save-screen { padding: 1rem; max-width: 100%; }

    /* —— 日常 —— */
    .daily-header { padding: 0.6rem 0.8rem; gap: 0.6rem; }
    .daily-card { padding: 0.7rem 0.8rem; gap: 0.6rem; }
    .daily-card-icon { font-size: 1.5rem; width: 36px; }
    .daily-card-name { font-size: 0.9rem; }
    .daily-card-desc { font-size: 0.76rem; }

    /* —— 工具栏 —— */
    .toolbar { gap: 0.3rem; margin-bottom: 0.8rem; }
    .toolbar-section { padding: 0.3rem 0.5rem; gap: 0.3rem; }
    .toolbar-label { font-size: 0.72rem; }

    /* —— 区块标题 —— */
    .section-title { font-size: 1.1rem; letter-spacing: 2px; margin: 1rem 0 0.6rem; }

    /* —— 专精路线 —— */
    .spec-choice-card { padding: 0.8rem; }
    .spec-choice-name { font-size: 1rem; }
    .spec-choice-desc { font-size: 0.82rem; }

    /* —— 内联弹窗覆盖 —— */
    [data-interaction-modal] > div {
        max-width: 100% !important;
        padding: 1rem !important;
        border-radius: 6px !important;
    }
    [data-interaction-modal] > div > div > div[style*="white-space:pre-line"] {
        font-size: 0.9rem !important;
        line-height: 1.9 !important;
    }
}

/* 小屏幕（手机） */
@media (max-width: 480px) {
    /* —— 全局防溢出 —— */
    html, body { overflow-x: hidden; max-width: 100vw; }
    #app { max-width: 100vw; overflow-x: hidden; }
    * { max-width: 100%; }

    /* —— 标题界面 —— */
    .title-screen { padding: calc(1rem + env(safe-area-inset-top)) 0.8rem calc(1rem + env(safe-area-inset-bottom)); background-position: 20% 32%; }
    .title-main { font-size: 2.2rem; letter-spacing: 4px; }
    .title-sub { font-size: 0.92rem; letter-spacing: 3px; margin-top: 0.8rem; }
    .title-decoration { width: 70%; max-width: 220px; margin: 0.5rem 0; }
    .title-poem { font-size: 0.82rem; line-height: 1.8; margin-bottom: 1.5rem; }
    .title-buttons { gap: 0.6rem; }
    .title-buttons .btn { padding: 8px 20px; font-size: 0.85rem; letter-spacing: 2px; }

    /* —— 顶栏 —— */
    .top-bar { padding: calc(0.4rem + env(safe-area-inset-top)) 0.6rem 0.4rem 0.6rem; }
    .top-bar-left { gap: 0.5rem; }
    .player-avatar { width: 26px; height: 26px; border-width: 1px; }
    .player-name { font-size: 0.92rem; letter-spacing: 1px; }
    .player-info { font-size: 0.65rem; }
    .career-badge { font-size: 0.55rem; padding: 0px 4px; }
    .icon-btn { padding: 4px 8px; font-size: 0.68rem; letter-spacing: 1px; }
    .top-bar-right { gap: 0.2rem; }

    /* —— 属性栏 —— */
    .stats-bar {
        padding: 0.3rem 0.6rem;
        gap: 0.4rem;
    }
    .stat-item { font-size: 0.68rem; gap: 0.2rem; }
    .stat-label { font-size: 0.68rem; }
    .stat-value { min-width: 22px; font-size: 0.72rem; }
    .stat-bar { width: 38px; height: 5px; }
    .action-points { padding: 2px 5px; gap: 0.15rem; }
    .action-point-dot { width: 6px; height: 6px; }

    /* —— 布告栏 —— */
    .bulletin-bar { padding: 0.2rem 0.4rem; min-height: 26px; }
    .bulletin-bar-label { font-size: 0.62rem; }
    .bulletin-tag, .bulletin-cond { font-size: 0.6rem; padding: 0.05rem 0.25rem; }

    /* —— 标签栏 —— */
    .tab-bar { padding: 0 0.2rem; gap: 0.05rem; }
    .tab { padding: 0.4rem 0.55rem; font-size: 0.72rem; letter-spacing: 1px; }
    .tab-badge { font-size: 0.52rem; min-width: 14px; height: 14px; }

    /* —— 内容区 —— */
    .game-content { padding: 0.6rem 0.4rem; }

    /* —— 创建角色 —— */
    .creation-screen { padding: 0.5rem; }
    .creation-panel { padding: 1rem 0.8rem; }
    .creation-title { font-size: 1.3rem; letter-spacing: 3px; }
    .creation-subtitle { font-size: 0.78rem; }
    .creation-story { font-size: 0.8rem; padding: 0.6rem 0.8rem; line-height: 1.7; }
    .form-label { font-size: 0.88rem; letter-spacing: 2px; }
    .form-input { padding: 8px 12px; font-size: 0.9rem; }
    .gender-option { padding: 0.8rem; }
    .gender-icon { font-size: 1.5rem; }
    .gender-label { font-size: 0.92rem; letter-spacing: 2px; }
    .gender-desc { font-size: 0.7rem; }
    .portrait-preview { width: 80px; height: 80px; }
    .portrait-name { font-size: 0.85rem; }
    .portrait-desc { font-size: 0.68rem; }
    .career-option { min-width: 100%; padding: 0.7rem; }
    .career-icon { font-size: 1.2rem; }
    .career-name { font-size: 0.85rem; }
    .career-desc { font-size: 0.66rem; }

    /* —— 弹窗系统 —— */
    .modal-overlay { padding: 0.3rem; }
    .modal { max-width: 100% !important; max-height: 92vh; border-radius: 4px; }
    .modal-header { padding: 0.6rem 0.8rem; }
    .modal-title { font-size: 0.98rem; letter-spacing: 2px; }
    .modal-body { padding: 0.7rem 0.6rem; }
    .modal-close { font-size: 1.2rem; padding: 0 0.3rem; }

    /* 覆盖所有内联max-width */
    .map-event-modal,
    .tutorial-modal,
    .story-dialogue,
    .modal[style*="max-width"] {
        max-width: 100% !important;
    }
    .map-event-modal { padding: 0.8rem !important; }
    .tutorial-modal {
        max-width: 100% !important;
        width: 100% !important;
        padding: 1rem 0.7rem !important;
    }
    .tutorial-icon { font-size: 2.2rem; margin-bottom: 0.5rem; }
    .tutorial-title { font-size: 1.15rem; margin-bottom: 0.6rem; letter-spacing: 2px; }
    .tutorial-text { font-size: 0.88rem; line-height: 1.9; margin-bottom: 1rem; }
    .tutorial-buttons { gap: 0.5rem; }
    .tutorial-buttons .btn { padding: 7px 16px; font-size: 0.82rem; }

    .story-dialogue-header { padding: 0.6rem 0.8rem; }
    .story-dialogue-title { font-size: 1rem; letter-spacing: 2px; }
    .story-dialogue-body { padding: 0.7rem 0.6rem; }
    .story-narration { font-size: 0.88rem; line-height: 1.9; margin-bottom: 0.8rem; }
    .story-dialogue-text { font-size: 0.88rem; line-height: 1.9; margin-bottom: 0.8rem; padding-left: 0.6rem; }
    .story-speaker { font-size: 0.92rem; }
    .story-choices { gap: 0.4rem; margin-top: 0.8rem; }
    .story-choice-btn { font-size: 0.82rem; padding: 0.6rem 0.8rem; line-height: 1.5; }
    .story-choice { font-size: 0.82rem; padding: 0.6rem 0.8rem; }
    .story-cg-wrap { max-width: 100%; }
    .story-cg-img { max-height: 35vh; }

    /* —— NPC详情 —— */
    .npc-detail-portrait { width: 80px; height: 80px; border-width: 2px; }
    .npc-detail-name { font-size: 1rem; letter-spacing: 2px; }
    .npc-detail-title { font-size: 0.8rem; margin-bottom: 0.6rem; }
    .npc-detail-section { margin-bottom: 0.8rem; }
    .npc-detail-section-title { font-size: 0.82rem; letter-spacing: 1px; }
    .npc-detail-text { font-size: 0.78rem; line-height: 1.6; padding-left: 0.5rem; }
    .npc-detail-stats { grid-template-columns: 1fr; gap: 0.2rem; padding-left: 0.5rem; }
    .npc-detail-stat { font-size: 0.72rem; }
    .npc-actions { gap: 0.3rem; margin-top: 1rem; }
    .action-btn { padding: 5px 12px; font-size: 0.76rem; letter-spacing: 1px; }

    /* —— 按钮 —— */
    .btn { padding: 7px 18px; font-size: 0.82rem; letter-spacing: 2px; border-radius: 2px; }
    .btn:active { transform: none; }

    /* —— 后宅卡片 —— */
    .npc-portrait { height: 160px; }
    .npc-info { padding: 0.5rem 0.6rem; }
    .npc-name { font-size: 0.95rem; letter-spacing: 2px; }
    .npc-desc { font-size: 0.68rem; }
    .npc-stat-row { font-size: 0.66rem; gap: 0.2rem; }
    .npc-title-tag { font-size: 0.62rem; padding: 2px 8px; }
    .npc-pregnancy-tag { font-size: 0.58rem; padding: 1px 6px; }
    .npc-card .wife-bg-tag { font-size: 0.55rem; padding: 1px 4px; }

    /* —— 产业卡片 —— */
    .business-card { padding: 0.7rem; }
    .business-name { font-size: 0.98rem; letter-spacing: 2px; }
    .business-info { font-size: 0.72rem; line-height: 1.5; }
    .business-income { font-size: 0.82rem; }
    .business-actions { gap: 0.3rem; }
    .business-actions .action-btn { font-size: 0.72rem; padding: 4px 10px; }
    .business-available { padding: 0.7rem; }
    .business-available-name { font-size: 0.88rem; }
    .business-available-cost { font-size: 0.72rem; }

    /* —— 剧情 —— */
    .story-chapter { padding: 0.7rem 0.6rem; margin-bottom: 0.8rem; }
    .story-chapter-title { font-size: 1rem; letter-spacing: 2px; }
    .story-chapter-status { font-size: 0.68rem; }
    .story-chapter-desc { font-size: 0.78rem; line-height: 1.7; }
    .story-chapter-req { font-size: 0.72rem; padding: 0.3rem 0.6rem; }

    /* —— 月报 —— */
    .report-item { font-size: 0.82rem; }
    .report-item b { font-size: 0.88rem; }
    .income-summary { padding: 0.6rem; }

    /* —— 地图 —— */
    .map-bg { aspect-ratio: 3 / 4; }
    .map-loc-icon { width: 28px; height: 28px; font-size: 1rem; }
    .map-loc-name { font-size: 0.56rem; padding: 0px 3px; }
    .map-loc-status { font-size: 0.52rem; }
    .map-loc-pulse { width: 28px; height: 28px; }
    .map-loc-hint { font-size: 0.5rem; }
    .map-info-panel { padding: 0.6rem 0.7rem; }
    .map-info-title { font-size: 0.88rem; }
    .map-info-desc { font-size: 0.72rem; line-height: 1.5; }
    .map-npc-item { padding: 0.4rem 0.5rem; font-size: 0.72rem; gap: 0.3rem; }
    .map-npc-loc { min-width: 60px; font-size: 0.72rem; }
    .map-npc-stage { font-size: 0.65rem; }
    .map-npc-status { font-size: 0.62rem; padding: 1px 4px; }
    .map-event-portrait { max-width: 140px; }

    /* —— 日常 —— */
    .daily-header { padding: 0.4rem 0.6rem; gap: 0.4rem; }
    .daily-ap-label { font-size: 0.76rem; }
    .daily-ap-dot { width: 10px; height: 10px; }
    .daily-ap-num { font-size: 0.82rem; }
    .daily-hint { font-size: 0.72rem; }
    .daily-card { padding: 0.5rem 0.6rem; gap: 0.5rem; }
    .daily-card-icon { font-size: 1.3rem; width: 30px; }
    .daily-card-name { font-size: 0.82rem; }
    .daily-card-cost { font-size: 0.62rem; padding: 1px 4px; }
    .daily-card-desc { font-size: 0.7rem; line-height: 1.4; }

    /* —— 长远决策 —— */
    .strategic-card { padding: 0.6rem; }
    .strategic-name { font-size: 0.92rem; }
    .strategic-desc { font-size: 0.72rem; }
    .strategic-active-card { padding: 0.5rem 0.6rem; }
    .strategic-active-name { font-size: 0.82rem; }
    .strategic-active-info { font-size: 0.7rem; }

    /* —— 工具栏 —— */
    .toolbar { gap: 0.2rem; margin-bottom: 0.5rem; flex-direction: column; align-items: stretch; }
    .toolbar-section { padding: 0.3rem 0.5rem; }

    /* —— 区块标题 —— */
    .section-title { font-size: 0.98rem; letter-spacing: 2px; margin: 0.8rem 0 0.5rem; }

    /* —— 成就 —— */
    .achievement-container { padding: 0.2rem; }
    .achievement-title { font-size: 1rem; letter-spacing: 2px; }
    .achievement-header { padding: 0.6rem; margin-bottom: 0.8rem; }
    .achievement-progress { font-size: 0.82rem; }
    .achievement-bar { width: 90%; height: 6px; }
    .achievement-tier-title { font-size: 0.92rem; letter-spacing: 1px; }
    .achievement-card { padding: 0.4rem 0.5rem; gap: 0.4rem; }
    .ach-icon { font-size: 1.2rem; width: 1.8rem; }
    .ach-name { font-size: 0.8rem; }
    .ach-desc { font-size: 0.68rem; }
    .ach-reward { font-size: 0.62rem; }

    /* —— 专精路线 —— */
    .spec-choice-card { padding: 0.6rem; }
    .spec-choice-icon { font-size: 1.5rem; }
    .spec-choice-name { font-size: 0.92rem; }
    .spec-choice-desc { font-size: 0.78rem; }
    .spec-choice-hint { font-size: 0.72rem; padding: 0.4rem; line-height: 1.5; }

    /* —— 存档 —— */
    .save-screen { padding: 0.5rem; }
    .save-slot { padding: 0.6rem; }
    .quick-save-slot-v300 { align-items: flex-start; gap: 0.55rem; }
    .quick-save-slot-v300 .save-slot-actions { flex-wrap: wrap; justify-content: flex-end; }

    /* —— 心境显示 —— */
    .npc-detail-section .xinJing-display { padding: 4px 6px; gap: 4px; }
    .npc-detail-section .xinJing-display .xj-icon { font-size: 1.1rem; }
    .npc-detail-section .xinJing-display .xj-name { font-size: 0.82rem; }
    .npc-detail-section .xinJing-display .xj-desc { font-size: 0.7rem; }

    /* —— 内联弹窗覆盖 —— */
    [data-interaction-modal] { padding: 0.3rem !important; }
    [data-interaction-modal] > div {
        max-width: 100% !important;
        padding: 0.8rem !important;
        border-radius: 6px !important;
        max-height: 90vh !important;
    }
    [data-interaction-modal] > div > div:first-child { margin-bottom: 0.5rem !important; padding-bottom: 0.4rem !important; }
    [data-interaction-modal] > div > div:first-child > span:first-child { font-size: 0.72rem !important; }
    [data-interaction-modal] > div > div:first-child > span:last-child { font-size: 0.98rem !important; }
    [data-interaction-modal] > div > div[style*="line-height:2.2"] > div:first-child {
        font-size: 0.82rem !important;
        line-height: 1.8 !important;
    }
    [data-interaction-modal] > div > div[style*="line-height:2.2"] > div[style*="border-top"] {
        font-size: 0.78rem !important;
        line-height: 1.7 !important;
    }
    [data-interaction-modal] button {
        padding: 6px 1.5rem !important;
        font-size: 0.82rem !important;
    }

    /* —— 事件弹窗 —— */
    .modal .event-text { font-size: 0.82rem; padding: 0.5rem; line-height: 1.6; margin-bottom: 0.8rem; }
    .modal .choice-btn { font-size: 0.8rem; padding: 0.5rem 0.7rem; line-height: 1.5; }
    .modal .event-choices { gap: 0.4rem; }

    /* —— 空后宅 —— */
    .empty-harem { padding: 2rem 1rem; }
    .empty-harem-icon { font-size: 2.5rem; }
    .empty-harem-text { font-size: 0.92rem; letter-spacing: 2px; }
    .empty-harem-hint { font-size: 0.72rem; }

    /* —— 世界观开场 —— */
    #openingWorldview { max-width: 100% !important; padding: 1rem !important; }

    /* —— 防止pre内容溢出 —— */
    pre, code { white-space: pre-wrap; word-wrap: break-word; }
}

/* ========== 工具栏 ========== */

.toolbar {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    align-items: center;
}

.toolbar-section {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    background: rgba(240, 230, 210, 0.4);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--color-border-light);
}

.toolbar-label {
    font-size: 0.78rem;
    color: var(--color-ink-soft);
    letter-spacing: 1px;
}

.section-title {
    font-family: 'Ma Shan Zheng', serif;
    font-size: 1.3rem;
    color: var(--color-vermillion);
    margin: 1.5rem 0 1rem;
    letter-spacing: 4px;
    position: relative;
    padding-left: 14px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 20px;
    background: linear-gradient(180deg, var(--color-vermillion), var(--color-gold));
    border-radius: 2px;
}

.income-summary {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(26, 107, 84, 0.06), rgba(184, 148, 30, 0.06));
    border-radius: 6px;
    border: 1px solid var(--color-border-light);
}

/* ===== 长远决策系统 ===== */
.strategic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.strategic-card {
    background: var(--bg-silk);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s;
}
.strategic-card:hover:not(.disabled) {
    border-color: var(--color-jade);
    box-shadow: 0 2px 12px rgba(26, 107, 84, 0.12);
}
.strategic-card.disabled {
    opacity: 0.5;
    pointer-events: none;
}
.strategic-name {
    font-family: 'Ma Shan Zheng', 'LXGW WenKai TC', serif;
    font-size: 1.1rem;
    color: var(--color-ink);
    margin-bottom: 0.4rem;
}
.strategic-desc {
    font-size: 0.82rem;
    color: var(--color-ink-soft);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}
.strategic-active-list {
    margin-bottom: 1rem;
}
.strategic-active-card {
    background: linear-gradient(135deg, rgba(26, 107, 84, 0.06), rgba(184, 148, 30, 0.04));
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 0.7rem 1rem;
    margin-bottom: 0.5rem;
}
.strategic-active-name {
    font-size: 0.95rem;
    color: var(--color-ink);
    margin-bottom: 0.4rem;
}
.strategic-progress-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}
.strategic-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-jade), var(--color-gold));
    border-radius: 3px;
    transition: width 0.3s;
}
.strategic-active-info {
    font-size: 0.8rem;
    color: var(--color-ink-soft);
}

/* ===== 月报布告样式 ===== */
.report-item.positive {
    color: var(--color-jade);
}
.report-item.negative {
    color: var(--color-vermillion);
}
.report-item b {
    font-size: 1.05rem;
}

/* ===== v12 心境系统样式 ===== */
.npc-name .xinJing-icon {
    font-size: 0.9rem;
    margin-left: 2px;
    opacity: 0.85;
}

.npc-detail-section .xinJing-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-silk);
    border-radius: 6px;
    border-left: 3px solid var(--color-gold);
}

.npc-detail-section .xinJing-display .xj-icon {
    font-size: 1.4rem;
}

.npc-detail-section .xinJing-display .xj-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.npc-detail-section .xinJing-display .xj-desc {
    color: var(--color-ink-soft);
    font-size: 0.82rem;
    flex: 1;
}

/* 后宅剧情事件弹窗 */
.modal .event-text {
    line-height: 1.8;
    font-size: 0.92rem;
    color: var(--color-ink-light);
    margin-bottom: 1.2rem;
    padding: 0.8rem;
    background: var(--bg-silk);
    border-radius: 8px;
    border-left: 3px solid var(--color-gold-light);
}

.modal .event-choices {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.modal .choice-btn {
    padding: 0.7rem 1rem;
    background: var(--bg-paper);
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'LXGW WenKai TC', 'Noto Serif SC', serif;
    font-size: 0.9rem;
    color: var(--color-ink);
    transition: all 0.2s;
    text-align: left;
}

.modal .choice-btn:hover {
    background: var(--color-gold-light);
    color: #fff;
    border-color: var(--color-gold);
    transform: translateX(4px);
}

/* 后宅行为事件文本增强 */
.report-item[data-behavior] {
    padding-left: 12px;
    border-left: 3px solid var(--color-vermillion-light);
}

/* 正妻背景标识 */
.npc-card .wife-bg-tag {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-bright));
    color: #fff;
    font-size: 0.62rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ===== 成就系统 ===== */
.achievement-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0.5rem;
}

.achievement-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(184,148,30,0.08), rgba(212,175,55,0.05));
    border-radius: 8px;
    border: 1px solid rgba(184,148,30,0.2);
}

.achievement-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-gold);
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
}

.achievement-progress {
    font-size: 0.95rem;
    color: var(--color-ink-soft);
    margin-bottom: 0.5rem;
}

.achievement-bar {
    width: 80%;
    height: 8px;
    background: var(--bg-paper-dark);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.achievement-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-gold), var(--color-gold-bright));
    transition: width 0.5s ease;
    border-radius: 4px;
}

.achievement-tier-section {
    margin-bottom: 1.5rem;
}

.achievement-tier-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(160,144,128,0.3);
    letter-spacing: 2px;
}

.achievement-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 500px) {
    .achievement-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.achievement-card {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border: 1px solid;
    transition: transform 0.2s, box-shadow 0.2s;
}

.achievement-card.unlocked {
    background: linear-gradient(135deg, rgba(184,148,30,0.06), rgba(248,240,220,0.5));
    border-color: rgba(184,148,30,0.3);
    box-shadow: 0 1px 4px rgba(184,148,30,0.1);
}

.achievement-card.unlocked:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(184,148,30,0.2);
}

.achievement-card.locked {
    background: var(--bg-paper);
    border-color: var(--color-border-light);
    opacity: 0.65;
}

.ach-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    width: 2.2rem;
    text-align: center;
}

.ach-info {
    flex: 1;
    min-width: 0;
}

.ach-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    color: var(--color-ink);
}

.achievement-card.locked .ach-name {
    color: var(--color-ink-soft);
}

.ach-desc {
    font-size: 0.75rem;
    color: var(--color-ink-soft);
    line-height: 1.4;
}

.ach-reward {
    font-size: 0.7rem;
    color: var(--color-gold);
    margin-top: 0.2rem;
    font-weight: 600;
}

.ach-check {
    font-size: 1.1rem;
    flex-shrink: 0;
    align-self: center;
}

/* ===== 专精路线选择 ===== */
.spec-choices {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.2rem;
}
.spec-choice-card {
    background: linear-gradient(135deg, var(--color-cream-light), var(--bg-silk));
    border: 2px solid var(--color-border-light);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}
.spec-choice-card:hover {
    border-color: var(--color-gold);
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.2);
    transform: translateY(-2px);
}
.spec-choice-icon {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}
.spec-choice-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-vermillion);
    margin-bottom: 0.3rem;
}
.spec-choice-desc {
    font-size: 0.9rem;
    color: var(--color-ink);
    margin-bottom: 0.5rem;
}
.spec-choice-hint {
    font-size: 0.82rem;
    color: var(--color-ink-soft);
    line-height: 1.7;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(0,0,0,0.03);
    border-radius: 5px;
}
.spec-choice-hidden {
    font-size: 0.8rem;
    color: var(--color-gold);
    font-weight: 600;
    padding: 0.3rem 0.5rem;
    background: rgba(201, 168, 76, 0.1);
    border-radius: 4px;
}

/* ========== 音频控制面板 ========== */

.audio-control {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 12px;
    z-index: 10000;
    font-family: 'Noto Serif SC', serif;
}

.audio-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-vermillion) 0%, var(--color-vermillion-light) 100%);
    border: 2px solid var(--color-gold);
    color: var(--color-cream);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(139, 26, 26, 0.4);
    transition: all 0.3s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.audio-toggle-btn:active {
    transform: scale(0.92);
}

.audio-toggle-btn.active {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
    border-color: var(--color-vermillion);
}

.audio-panel {
    position: absolute;
    bottom: 48px;
    right: 0;
    width: 240px;
    background: linear-gradient(180deg, var(--bg-silk) 0%, var(--bg-paper) 100%);
    border: 2px solid var(--color-gold);
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(26, 20, 16, 0.25);
    padding: 12px;
    flex-direction: column;
    gap: 10px;
    animation: audioPanelSlide 0.25s ease;
}

@keyframes audioPanelSlide {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.audio-panel-title {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-vermillion);
    letter-spacing: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 4px;
}

.audio-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--color-gold);
    background: var(--bg-silk-dark);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.audio-icon-btn:active {
    transform: scale(0.9);
    background: var(--color-gold-light);
}

.audio-label {
    font-size: 0.78rem;
    color: var(--color-ink-light);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    width: 56px;
}

.audio-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-paper-dark);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.audio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold));
    border: 1.5px solid var(--color-vermillion);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(139, 26, 26, 0.3);
}

.audio-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold));
    border: 1.5px solid var(--color-vermillion);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(139, 26, 26, 0.3);
}

/* 移动端适配 */
@media (max-width: 480px) {
    .audio-panel {
        width: 210px;
    }
    .audio-label {
        width: 48px;
        font-size: 0.72rem;
    }
}

/* ========== 工作台浮动入口 ========== */
.workbench-link {
    position: fixed;
    bottom: calc(12px + env(safe-area-inset-bottom));
    right: 12px;
    z-index: 500;
    background: linear-gradient(135deg, #7aa2f7, #bb9af7);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(122, 162, 247, 0.4);
    cursor: pointer;
    font-family: sans-serif;
    letter-spacing: 1px;
}

/* ========== v276 更新公告中心 ========== */
.update-center-entry { position: relative; }
.update-first-hint {
    position: relative;
    z-index: 3;
    width: min(100%, 360px);
    max-width: 360px;
    margin: .3rem auto .85rem;
    padding: .68rem .9rem .72rem;
    border: 1px solid rgba(246, 211, 116, .92);
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(34, 22, 17, .94), rgba(91, 31, 32, .92));
    box-shadow: 0 4px 16px rgba(0, 0, 0, .48), inset 0 0 0 1px rgba(255, 244, 205, .12);
    text-align: center;
    cursor: pointer;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.update-first-hint:hover {
    transform: translateY(-1px);
    border-color: #ffe49a;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .58), 0 0 0 2px rgba(240, 200, 80, .12), inset 0 0 0 1px rgba(255, 244, 205, .16);
}
.update-first-hint b,.update-first-hint span { display:block; }
.update-first-hint b {
    color: #ffe7a3;
    font-size: .88rem;
    font-weight: 800;
    letter-spacing: .08rem;
    line-height: 1.45;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .95);
}
.update-first-hint span {
    margin-top: .2rem;
    color: #fff8e8;
    font-size: .74rem;
    font-weight: 600;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .95);
}
.update-unread-dot {
    display: inline-block; margin-left: 8px; padding: 1px 6px; border-radius: 10px;
    background: var(--color-vermillion); color: #fff; font-size: 0.65rem; vertical-align: 1px;
}
.update-center-modal { max-width: 620px; }
.update-center-modal .map-event-body { max-height: 72vh; overflow-y: auto; }
.update-center-summary { display:flex; justify-content:space-between; gap:1rem; color:var(--color-ink-soft); font-size:.76rem; margin-bottom:.7rem; }
.update-record { padding:.8rem .9rem; margin-bottom:.7rem; border:1px solid rgba(201,168,76,.3); border-radius:9px; background:rgba(201,168,76,.05); }
.update-record-head { display:flex; justify-content:space-between; gap:1rem; align-items:baseline; }
.update-record-head b { color:var(--color-gold-bright); }
.update-record-head span { color:var(--color-ink-soft); font-size:.7rem; white-space:nowrap; }
.update-record ul { margin:.5rem 0 0; padding-left:1.2rem; font-size:.8rem; line-height:1.75; }
.update-center-pager { display:grid; grid-template-columns:1fr 1fr; gap:.55rem; margin-top:.9rem; }
.update-center-pager button:disabled { opacity:.35; cursor:default; }

/* ========== v287-v288 手机网页更新推送 / 首页醒目提醒 ========== */
.push-title-alert {
    position:relative;
    z-index:3;
    width:min(100%, 390px);
    max-width:390px;
    min-height:68px;
    margin:.05rem auto .78rem;
    padding:.62rem .72rem;
    border:2px solid #ffcf7a;
    border-radius:12px;
    display:flex;
    align-items:center;
    gap:.68rem;
    color:#fff;
    font:inherit;
    cursor:pointer;
    text-align:left !important;
    appearance:none;
    -webkit-appearance:none;
    box-shadow:0 5px 20px rgba(72,0,8,.58),0 0 0 3px rgba(255,105,105,.2),inset 0 1px 0 rgba(255,255,255,.2);
    transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;
}
.push-title-alert-important {
    background:linear-gradient(135deg,rgba(148,16,27,.98),rgba(211,47,56,.96));
    animation:pushTitleAlertPulse 1.9s ease-in-out infinite;
}
.push-title-alert:hover {
    transform:translateY(-2px);
    border-color:#fff0bd;
    box-shadow:0 8px 25px rgba(72,0,8,.68),0 0 0 4px rgba(255,114,114,.24),inset 0 1px 0 rgba(255,255,255,.25);
}
.push-title-alert-icon {
    width:43px;
    height:43px;
    flex:0 0 43px;
    border-radius:50%;
    display:grid;
    place-items:center;
    background:rgba(255,248,224,.96);
    color:#8f151f;
    font-size:1.55rem;
    line-height:1;
    box-shadow:0 2px 9px rgba(65,0,5,.36);
}
.push-title-alert-copy { min-width:0; flex:1; display:block; }
.push-title-alert-copy b {
    display:block;
    color:#fff8dc;
    font-size:.9rem;
    font-weight:900;
    line-height:1.35;
    letter-spacing:.035rem;
    text-shadow:0 1px 3px rgba(55,0,4,.9);
}
.push-title-alert-copy small {
    display:block;
    margin-top:.18rem;
    color:#fff;
    font-size:.71rem;
    font-weight:650;
    line-height:1.45;
    text-shadow:0 1px 2px rgba(55,0,4,.85);
}
.push-title-alert em {
    flex:0 0 auto;
    padding:.28rem .48rem;
    border:1px solid rgba(255,246,208,.82);
    border-radius:999px;
    color:#671018;
    background:#fff1bf;
    font-size:.67rem;
    font-weight:900;
    font-style:normal;
    white-space:nowrap;
    box-shadow:0 2px 7px rgba(62,0,4,.28);
}
.push-title-alert-enabled {
    border-color:rgba(171,239,200,.94);
    background:linear-gradient(135deg,rgba(20,92,66,.97),rgba(50,137,96,.95));
    box-shadow:0 5px 18px rgba(0,44,28,.45),0 0 0 2px rgba(142,231,184,.15),inset 0 1px 0 rgba(255,255,255,.2);
}
.push-title-alert-enabled .push-title-alert-icon { color:#176447; }
.push-title-alert-enabled em { color:#155e43; background:#e9fff2; border-color:#bcf2d2; }
@keyframes pushTitleAlertPulse {
    0%,100% { box-shadow:0 5px 20px rgba(72,0,8,.58),0 0 0 3px rgba(255,105,105,.18),inset 0 1px 0 rgba(255,255,255,.2); }
    50% { box-shadow:0 7px 26px rgba(72,0,8,.72),0 0 0 7px rgba(255,105,105,.11),inset 0 1px 0 rgba(255,255,255,.24); }
}
.push-prompt-overlay-v288 { cursor:default; }
.push-prompt-modal-v288 {
    position:relative;
    max-width:500px;
    overflow:visible;
    border:2px solid rgba(219,70,78,.86);
    box-shadow:0 18px 55px rgba(55,0,5,.55),0 0 0 4px rgba(219,70,78,.13);
}
.push-prompt-ribbon-v288 {
    position:absolute;
    top:-13px;
    left:50%;
    transform:translateX(-50%);
    padding:.28rem 1rem;
    border:1px solid #ffd98e;
    border-radius:999px;
    color:#fff8db;
    background:linear-gradient(135deg,#8e111d,#ce303b);
    box-shadow:0 4px 12px rgba(73,0,6,.38);
    font-size:.72rem;
    font-weight:900;
    letter-spacing:.12rem;
    white-space:nowrap;
}
.push-prompt-hero-v288 {
    margin:.15rem 0 .85rem;
    padding:.72rem .8rem;
    border:1px solid rgba(197,43,53,.35);
    border-radius:9px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:.55rem;
    color:#991d27;
    background:linear-gradient(135deg,rgba(255,226,218,.72),rgba(255,244,213,.78));
    text-align:center;
}
.push-prompt-hero-v288 span { font-size:1.55rem; }
.push-prompt-hero-v288 b { font-size:1rem; font-weight:900; letter-spacing:.06rem; }
.push-prompt-primary-v288 {
    font-size:.92rem !important;
    font-weight:900 !important;
    box-shadow:0 4px 16px rgba(26,107,84,.28) !important;
}
.update-push-modal { max-width:540px; }
.update-push-modal .map-event-body { max-height:76vh; overflow-y:auto; }
.push-status-pill {
    width:max-content;
    max-width:100%;
    margin:0 auto .85rem;
    padding:.3rem .85rem;
    border:1px solid rgba(201,168,76,.5);
    border-radius:999px;
    color:var(--color-gold-bright);
    background:rgba(201,168,76,.08);
    font-size:.76rem;
    font-weight:700;
    letter-spacing:.06rem;
}
.push-guide-card {
    padding:.95rem 1rem;
    border-left:3px solid var(--color-gold);
    border-radius:7px;
    background:linear-gradient(135deg,rgba(201,168,76,.075),rgba(139,26,26,.045));
    color:var(--color-ink);
    font-size:.84rem;
    line-height:1.85;
}
.push-guide-card b { color:var(--color-gold); }
.push-ios-steps { margin:.55rem 0 .1rem; padding-left:1.35rem; }
.push-ios-steps li { margin:.24rem 0; }
.push-privacy-note {
    margin-top:.7rem;
    padding:.55rem .65rem;
    border-radius:6px;
    color:var(--color-ink-soft);
    background:rgba(26,107,84,.075);
    font-size:.74rem;
    line-height:1.65;
}
.push-enable-choice {
    border-color:rgba(62,146,108,.72) !important;
    color:#fff !important;
    background:linear-gradient(135deg,#276b50,#3a8c69) !important;
}

/* ========== v276 府内来报 / 后期家业 ========== */
.household-inbox-btn { position:relative; min-width:56px; display:inline-flex; align-items:center; justify-content:center; gap:4px; padding-left:.65rem; padding-right:.65rem; }
.household-inbox-btn.has-pending { border-color:var(--color-vermillion); color:#fff; background:linear-gradient(135deg,rgba(146,42,53,.92),rgba(194,90,106,.82)); box-shadow:0 0 0 2px rgba(194,90,106,.18),0 3px 12px rgba(93,30,40,.28); animation:householdInboxPulse 2.4s ease-in-out infinite; }
.household-inbox-icon { font-size:.95rem; }
.household-inbox-label { font-size:.72rem; font-weight:700; letter-spacing:.05rem; }
.household-inbox-count { position:absolute; right:-7px; top:-9px; min-width:19px; height:19px; line-height:19px; padding:0 3px; border-radius:11px; background:#f5d47b; color:#70232c; border:1px solid rgba(112,35,44,.7); font-size:.66rem; font-weight:800; box-shadow:0 2px 6px rgba(0,0,0,.28); }
.household-attention-banner { width:calc(100% - 1.4rem); margin:.55rem .7rem 0; padding:.58rem .85rem; border:1px solid rgba(194,90,106,.52); border-radius:9px; color:var(--color-ink); background:linear-gradient(90deg,rgba(194,90,106,.13),rgba(201,168,76,.1)); display:flex; align-items:center; justify-content:space-between; gap:.8rem; cursor:pointer; text-align:left; }
.household-attention-banner span { font-size:.82rem; }
.household-attention-banner b { color:var(--color-vermillion); margin:0 .12rem; }
.household-attention-banner small { color:var(--color-ink-soft); font-size:.68rem; }
@keyframes householdInboxPulse { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-1px); box-shadow:0 0 0 4px rgba(194,90,106,.13),0 4px 14px rgba(93,30,40,.34); } }
@media (max-width:640px) {
    .household-inbox-btn { min-width:51px; padding-left:.48rem; padding-right:.48rem; }
    .household-attention-banner { align-items:flex-start; flex-direction:column; gap:.18rem; }
}
@media (prefers-reduced-motion:reduce) { .household-inbox-btn.has-pending { animation:none; } }
.household-inbox-modal,.late-game-modal { max-width:620px; }
.household-inbox-modal .map-event-body,.late-game-modal .map-event-body { max-height:72vh; overflow-y:auto; }
.household-section-title { margin:.4rem 0 .55rem; font-size:.86rem; font-weight:700; color:var(--color-gold); letter-spacing:.08rem; }
.household-matter { display:flex; gap:.7rem; justify-content:space-between; align-items:center; padding:.75rem; margin-bottom:.55rem; border-left:3px solid var(--color-vermillion); background:rgba(194,90,106,.06); border-radius:7px; }
.household-matter > div > div { color:var(--color-ink-soft); font-size:.76rem; line-height:1.6; margin-top:.2rem; }
.household-matter button,.late-heir-row button,.grand-project-card button { flex-shrink:0; border:1px solid var(--color-gold); color:var(--color-gold); background:transparent; border-radius:6px; padding:.35rem .55rem; cursor:pointer; }
.household-brief { padding:.65rem .75rem; margin-bottom:.5rem; background:rgba(201,168,76,.045); border-radius:7px; }
.household-brief-date { color:var(--color-gold); font-size:.72rem; font-weight:700; }
.household-brief ul { margin:.35rem 0 0; padding-left:1.15rem; font-size:.77rem; line-height:1.65; }
.household-empty { padding:1rem; text-align:center; color:var(--color-ink-soft); font-size:.78rem; }
.late-game-card { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin:0 0 .9rem; padding:.8rem .95rem; border:1px solid rgba(201,168,76,.38); border-radius:10px; background:linear-gradient(135deg,rgba(120,70,55,.08),rgba(201,168,76,.09)); cursor:pointer; }
.late-game-card.unchosen { border-style:dashed; }
.late-game-card b { color:var(--color-gold-bright); }
.late-game-card div div { margin-top:.2rem; color:var(--color-ink-soft); font-size:.75rem; }
.late-game-card > span { color:var(--color-gold); font-size:.74rem; white-space:nowrap; }
.householder-path-option span { display:block; margin-top:.25rem; font-size:.74rem; opacity:.76; line-height:1.6; }
.late-path-summary { padding:.8rem; border-left:3px solid var(--color-gold); background:rgba(201,168,76,.06); border-radius:7px; }
.late-path-summary p { margin:.45rem 0 0; color:var(--color-ink-soft); font-size:.78rem; line-height:1.65; }
.late-progress { height:7px; margin-top:.5rem; border-radius:5px; background:rgba(201,168,76,.15); overflow:hidden; }
.late-progress span { display:block; height:100%; background:linear-gradient(90deg,var(--color-vermillion),var(--color-gold)); }
.late-heir-row { display:flex; justify-content:space-between; align-items:center; gap:.6rem; padding:.55rem .25rem; border-bottom:1px dashed rgba(201,168,76,.25); }
.late-heir-row span { display:block; color:var(--color-ink-soft); font-size:.71rem; margin-top:.15rem; }
.late-actions { display:grid; grid-template-columns:repeat(3,1fr); gap:.5rem; }
.late-action-btn { border:1px solid rgba(201,168,76,.35); border-radius:8px; background:rgba(201,168,76,.05); color:var(--color-ink); padding:.65rem .4rem; cursor:pointer; }
.late-action-btn:disabled,.grand-project-card button:disabled { opacity:.42; cursor:default; }
.late-action-btn small { display:block; margin-top:.25rem; color:var(--color-ink-soft); font-size:.66rem; }
.grand-project-card { display:flex; justify-content:space-between; gap:.7rem; align-items:center; padding:.7rem; margin-bottom:.5rem; border:1px solid rgba(201,168,76,.28); border-radius:8px; }
.grand-project-card > div span,.grand-project-card > div small { display:block; color:var(--color-ink-soft); font-size:.71rem; line-height:1.55; margin-top:.18rem; }
.grand-project-card > div small { color:var(--color-gold); }
.grand-project-card em { color:var(--color-jade); font-size:.72rem; white-space:nowrap; }

@media (max-width: 560px) {
    .update-first-hint { width:min(94vw,350px); padding:.62rem .78rem .66rem; margin-bottom:.72rem; }
    .update-first-hint b { font-size:.84rem; }
    .update-first-hint span { font-size:.72rem; }
    .update-center-summary,.update-record-head { align-items:flex-start; }
    .late-actions { grid-template-columns:1fr; }
    .grand-project-card { align-items:flex-start; }
    .household-matter { align-items:flex-start; }
    .update-push-modal { width:100%; }
    .push-guide-card { padding:.78rem .82rem; font-size:.8rem; line-height:1.75; }
    .push-title-alert { width:min(94vw,360px); min-height:62px; padding:.55rem .62rem; gap:.54rem; margin-bottom:.62rem; }
    .push-title-alert-icon { width:38px; height:38px; flex-basis:38px; font-size:1.35rem; }
    .push-title-alert-copy b { font-size:.82rem; }
    .push-title-alert-copy small { font-size:.66rem; }
    .push-title-alert em { padding:.25rem .4rem; font-size:.62rem; }
    .push-prompt-modal-v288 { width:calc(100% - 1rem); }
    .push-prompt-hero-v288 { padding:.62rem .55rem; }
    .push-prompt-hero-v288 span { font-size:1.35rem; }
    .push-prompt-hero-v288 b { font-size:.9rem; }
}
@media (prefers-reduced-motion:reduce) { .push-title-alert-important { animation:none; } }

/* ========== v289 安卓 Chrome 纵向滚动保护 ========== */
/* 创建家主页面比普通首页更高。安卓 Chrome 地址栏收起/展开时会改变
   实际视口高度，不能再把长面板固定在视口中央。 */
.creation-screen,
.save-screen {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    touch-action: pan-y;
}

.game-screen {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    touch-action: pan-y pan-x;
}

.game-content {
    touch-action: pan-y pan-x;
    -webkit-overflow-scrolling: touch;
}

.creation-panel,
.portrait-select,
.portrait-option {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.push-prompt-overlay-v288 {
    overflow-y: auto;
    touch-action: pan-y;
}

.push-prompt-modal-v288 {
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .creation-screen {
        align-items: center;
        justify-content: flex-start;
        overflow-x: hidden;
        overflow-y: visible;
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .creation-panel {
        flex: 0 0 auto;
        max-height: none;
        overflow: visible;
    }

    .game-screen {
        overflow-x: hidden;
        overflow-y: visible;
    }

    .game-content {
        min-height: 0;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .push-prompt-overlay-v288 {
        align-items: flex-start;
    }

    .push-prompt-modal-v288 {
        margin: auto;
    }
}
