/* 狄公案 · 主菜单 launcher 样式 */

@font-face {
    font-family: 'YanZhenQing';
    src: url('../fonts/YanZhenQingFaShu-subset.woff2?v=3') format('woff2');
    font-display: swap;
    font-weight: normal;
    font-style: normal;
}

:root {
    --gold: #c9a84c;
    --gold-dim: #8a6d2b;
    --dark-bg: #1a1410;
    --dialog-bg: rgba(15, 10, 5, 0.92);
    --text-color: #e8dcc8;
    --text-dim: #9a8b76;
    --accent-red: #8b2020;
    --accent-red-bright: #c53030;
    --paper: #f4e8c1;
    --ink: #2a1a0a;
    --font-main: "Noto Serif SC", "Source Han Serif SC", "SimSun", "STSong", serif;
    --font-title: 'YanZhenQing', "Noto Serif SC", "Source Han Serif SC", "SimSun", "STSong", serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: var(--font-main);
}

body {
    background: #000;
    color: var(--text-color);
}

/* ===== Splash 封面页（首屏，全屏欣赏封面）===== */
#splash {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    background: #1a1410;
    cursor: pointer;
    overflow: hidden;
    opacity: 1;
    transition: opacity 1.2s ease, visibility 0s 1.2s;
}
#splash.splash-fade {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-bg {
    position: absolute;
    inset: 0;
    background: url('../img/launcher-bg.webp') center center / contain no-repeat #f6efde;
    z-index: 0;
    /* 进场轻微缩放呼吸 */
    animation: splashBreath 12s ease-in-out infinite alternate;
}
@keyframes splashBreath {
    0%   { transform: scale(1); }
    100% { transform: scale(1.04); }
}
@media (max-width: 600px) {
    .splash-bg { background-size: cover; }
}

.splash-vignette {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center, transparent 35%, rgba(20, 14, 8, 0.35) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, transparent 25%, transparent 70%, rgba(0, 0, 0, 0.30) 100%);
}

.splash-content {
    position: relative;
    z-index: 2;
    width: 100%;
    text-align: center;
    padding: 60px 16px 0 16px;
    max-width: 500px;
}
.splash-title {
    font-size: 56px;
    color: var(--ink);
    letter-spacing: 26px;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.6), 0 0 1px rgba(0, 0, 0, 0.4);
    font-weight: 700;
    margin: 0 0 0 26px; /* 抵消最右一个 letter-spacing */
    line-height: 1;
    font-family: var(--font-title);
}
.splash-divider {
    width: 36%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(42, 26, 10, 0.55) 50%, transparent 100%);
    margin: 16px auto 10px auto;
}
.splash-subtitle {
    font-size: 12px;
    color: rgba(42, 26, 10, 0.72);
    letter-spacing: 8px;
    margin-left: 8px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    font-family: var(--font-title);
}

.splash-tap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    color: rgba(42, 26, 10, 0.88);
    font-size: 14px;
    letter-spacing: 2px;
    text-shadow:
        0 0 6px rgba(255, 255, 255, 0.95),
        0 0 14px rgba(255, 255, 255, 0.7),
        0 1px 2px rgba(255, 255, 255, 0.5);
    font-family: var(--font-title);
    white-space: nowrap;
}

@media (max-height: 700px) {
    .splash-title { font-size: 44px; letter-spacing: 18px; margin-left: 18px; }
    .splash-content { padding-top: 40px; }
    .splash-tap { padding-bottom: 24px; }
}

/* ===== 主菜单背景：进入后用沉色（与游戏内 dark-bg 一致），不再借底图 ===== */
#launcher.launcher-hidden {
    opacity: 0;
    pointer-events: none;
}

#launcher {
    position: relative;
    z-index: 1;
    width: 100vw;
    height: 100vh;
    max-width: 500px;
    margin: 0 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 14px 14px 14px;
    display: flex;
    flex-direction: column;
    /* 沿用 splash 同款水墨底图，叠深褐 overlay 让 UI 仍清晰 */
    background:
        linear-gradient(180deg, rgba(20, 14, 8, 0.72) 0%, rgba(20, 14, 8, 0.88) 60%, rgba(20, 14, 8, 0.95) 100%),
        url('../img/launcher-bg.webp') center center / cover no-repeat,
        var(--dark-bg);
    transition: opacity 0.6s ease;
}

/* ===== 标题 ===== */
.launcher-title {
    text-align: center;
    padding: 20px 0 10px 0;
    flex-shrink: 0;
}

.title-chars {
    font-size: 44px;
    color: var(--gold);
    letter-spacing: 20px;
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.45), 0 2px 6px rgba(0, 0, 0, 0.7);
    font-weight: 600;
    margin: 0 0 0 20px; /* 抵消最右一个 letter-spacing */
    line-height: 1;
    font-family: var(--font-title);
}

.title-divider {
    width: 48%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--gold-dim) 50%, transparent 100%);
    margin: 14px auto 8px auto;
}

.launcher-subtitle {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 6px;
    margin-left: 6px;
    font-family: var(--font-title);
}

/* ===== 卷宗陈列 ===== */
.case-shelf {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    padding: 14px 0;
    align-items: stretch;
}

.case-volume {
    flex: 1;
    max-width: 32.5%;
    display: flex;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(180deg, #3a2818 0%, #1f1208 100%);
    border: 2px solid var(--gold-dim);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), inset 0 0 16px rgba(201, 168, 76, 0.08);
    transition: transform 0.25s cubic-bezier(.2, .8, .2, 1), box-shadow 0.25s;
    border-radius: 3px;
    overflow: hidden;
    min-height: 210px;
    cursor: pointer;
}

.case-volume:not(.disabled):active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
}

.case-volume:not(.disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.8), inset 0 0 18px rgba(201, 168, 76, 0.18);
    border-color: var(--gold);
}

.volume-spine {
    width: 28px;
    background: linear-gradient(90deg, var(--accent-red) 0%, #6a1818 100%);
    color: var(--gold);
    writing-mode: vertical-rl;
    -webkit-writing-mode: vertical-rl;
    text-orientation: upright;
    -webkit-text-orientation: upright;
    text-align: center;
    padding: 16px 0;
    font-size: 15px;
    letter-spacing: 8px;
    border-right: 1px solid rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7);
    line-height: 1.1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
}

.volume-cover {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.volume-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 65%; /* 重点显示封面中下部的远山+建筑 */
    opacity: 0.7;
    z-index: 0;
}

.volume-label {
    position: relative;
    z-index: 2;
    font-size: 13px;
    color: var(--gold);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.6);
    padding: 6px 4px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 70%, transparent 100%);
    text-align: center;
    letter-spacing: 1px;
    font-family: var(--font-title);
}

.volume-stamp {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-red);
    color: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border: 2px solid var(--gold);
    box-shadow: 0 0 10px rgba(139, 32, 32, 0.7), 0 2px 4px rgba(0, 0, 0, 0.4);
    font-weight: 700;
    transform: rotate(-10deg);
    font-family: var(--font-title);
}

.volume-stamp.coming {
    background: rgba(50, 40, 32, 0.92);
    color: var(--text-dim);
    border-color: var(--gold-dim);
    box-shadow: none;
    font-size: 10px;
    letter-spacing: 1px;
    transform: rotate(-6deg);
}

.case-volume.disabled {
    pointer-events: none;
    filter: grayscale(0.85) opacity(0.6);
    background: linear-gradient(180deg, #2a2018 0%, #18120c 100%);
}

.case-volume.disabled .volume-spine {
    background: linear-gradient(90deg, #5a4838 0%, #2a201a 100%);
    color: var(--text-dim);
}

.volume-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    color: rgba(201, 168, 76, 0.18);
    font-weight: 200;
    z-index: 0;
}

/* ===== 已解锁结局列表 ===== */
.ending-archive {
    flex: 1;
    margin-top: 14px;
    background: rgba(244, 232, 193, 0.05);
    border-top: 1px solid var(--gold-dim);
    border-bottom: 1px solid var(--gold-dim);
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    min-height: 110px;
    max-height: 38vh;
}

.archive-title {
    color: var(--gold);
    font-size: 12px;
    letter-spacing: 8px;
    text-align: center;
    margin: 0 0 8px 8px;
    flex-shrink: 0;
    font-family: var(--font-title);
}

.ending-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 4px 4px 4px;
}

.ending-list .ending-section-divider {
    color: var(--gold-dim);
    font-size: 10px;
    letter-spacing: 4px;
    border-top: 1px dashed rgba(138, 109, 43, 0.35);
    margin-top: 6px;
    padding-top: 5px;
    text-align: center;
    font-family: var(--font-title);
}
.ending-list .ending-section-divider:first-child {
    border-top: none;
    margin-top: 0;
}

.ending-list .ending-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 8px;
    margin: 4px 0 6px 0;
}

.ending-list .ending-item {
    padding: 1px 0;
    font-size: 11px;
    line-height: 1.7;
    color: rgba(244, 232, 193, 0.42);
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-family: var(--font-title);
}

.ending-list .ending-item.unlocked {
    color: var(--gold);
}

.ending-list .ending-item:before {
    content: "○";
    margin-right: 4px;
    font-size: 9px;
    color: var(--gold-dim);
    flex-shrink: 0;
}

.ending-list .ending-item.unlocked:before {
    content: "●";
    color: var(--accent-red);
}

/* ===== 底部 ===== */
.launcher-foot {
    text-align: center;
    padding: 10px 0 6px 0;
    flex-shrink: 0;
}

.ghost-btn {
    background: transparent;
    border: 1px solid var(--gold-dim);
    color: var(--text-dim);
    padding: 7px 16px;
    font-family: var(--font-title);
    font-size: 11px;
    letter-spacing: 4px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s;
}

.ghost-btn:hover {
    background: rgba(201, 168, 76, 0.06);
    color: var(--gold);
    border-color: var(--gold);
}
.ghost-btn:active {
    transform: translateY(1px);
}

/* 适配小屏 */
@media (max-height: 700px) {
    .title-chars { font-size: 36px; letter-spacing: 14px; margin-left: 14px; }
    .title-divider { margin: 10px auto 6px auto; }
    .launcher-title { padding: 14px 0 6px 0; }
    .case-volume { min-height: 170px; }
    .volume-spine { font-size: 13px; padding: 10px 0; letter-spacing: 4px; }
    .volume-stamp { width: 32px; height: 32px; font-size: 10px; }
    .ending-list .ending-item { font-size: 10px; }
}
@media (max-height: 600px) {
    .case-volume { min-height: 140px; }
    .ending-archive { max-height: 30vh; }
}
