/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

: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;
    --pressure-green: #4a8c5c;
    --pressure-yellow: #c9a84c;
    --pressure-red: #8b2020;
    --font-main: "Noto Serif SC", "Source Han Serif SC", "SimSun", "STSong", serif;
    --font-ui: "Microsoft YaHei", "PingFang SC", sans-serif;
}

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

/* ===== 游戏容器（竖屏 9:16） ===== */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 500px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--dark-bg);
}

/* ===== 场景背景 ===== */
#scene-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: background-image 0.8s ease, filter 0.6s ease;
}

/* ===== 氛围叠加层 ===== */
#atmosphere-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: background 0.8s ease;
    z-index: 1;
}

.atmosphere-interrogation {
    background: linear-gradient(
        to bottom,
        rgba(60, 10, 10, 0.3) 0%,
        rgba(20, 5, 5, 0.1) 40%,
        rgba(20, 5, 5, 0.4) 100%
    ) !important;
}

.atmosphere-tense {
    background: linear-gradient(
        to bottom,
        rgba(80, 10, 10, 0.45) 0%,
        rgba(30, 5, 5, 0.2) 40%,
        rgba(40, 5, 5, 0.55) 100%
    ) !important;
}

.atmosphere-breakthrough {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* ===== 角色立绘 ===== */
#character-layer {
    position: absolute;
    bottom: 38%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 55%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2;
    transition: transform 0.3s ease, filter 0.3s ease;
}

#character-sprite {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom center;
    transition: background-image 0.15s ease, transform 0.2s ease, filter 0.3s ease;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5));
}

/* 角色动画效果 */
.char-shake {
    animation: charShake 0.4s ease-in-out;
}

.char-tremble {
    animation: charTremble 0.8s ease-in-out infinite;
}

.char-flinch {
    animation: charFlinch 0.3s ease-out;
}

@keyframes charShake {
    0%, 100% { transform: translateX(-50%); }
    20% { transform: translateX(calc(-50% + 8px)); }
    40% { transform: translateX(calc(-50% - 8px)); }
    60% { transform: translateX(calc(-50% + 5px)); }
    80% { transform: translateX(calc(-50% - 3px)); }
}

@keyframes charTremble {
    0%, 100% { transform: translateX(-50%); }
    25% { transform: translateX(calc(-50% + 2px)); }
    75% { transform: translateX(calc(-50% - 2px)); }
}

@keyframes charFlinch {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(0.97); }
    100% { transform: translateX(-50%) scale(1); }
}

/* ===== 角色名牌 ===== */
#name-plate {
    position: absolute;
    top: -16px;
    left: 0;
    z-index: 11;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    padding: 4px 18px;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    pointer-events: none;
}

#character-name {
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 700;
    color: var(--dark-bg);
    letter-spacing: 4px;
}

/* ===== 对话框 ===== */
#dialog-box {
    position: absolute;
    bottom: 18%;
    left: 4%;
    right: 4%;
    z-index: 10;
    background: var(--dialog-bg);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 20px 18px 16px;
    min-height: 120px;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

#dialog-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
    letter-spacing: 1px;
    min-height: 60px;
}

#dialog-text .highlight {
    color: var(--gold);
    font-weight: 700;
}

#click-indicator {
    position: absolute;
    bottom: 8px;
    right: 14px;
    color: var(--gold);
    font-size: 12px;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* ===== 内心独白 ===== */
#inner-thought {
    position: absolute;
    top: 8%;
    left: 6%;
    right: 6%;
    z-index: 12;
    background: rgba(244, 232, 193, 0.95);
    border: 1px solid var(--gold-dim);
    border-radius: 6px;
    padding: 14px 16px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: thoughtSlideIn 0.4s ease-out;
}

@keyframes thoughtSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#thought-icon {
    font-size: 13px;
    flex-shrink: 0;
    background: var(--gold);
    color: var(--dark-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    letter-spacing: 2px;
    font-style: normal;
}

#thought-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink);
    font-style: normal;
}

/* ===== 选项面板 ===== */
#choices-panel {
    position: absolute;
    bottom: 18%;
    left: 4%;
    right: 4%;
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.choice-btn {
    background: var(--dialog-bg);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 14px 18px;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 15px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    backdrop-filter: blur(4px);
}

.choice-btn:hover {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--gold);
    transform: translateX(4px);
}

.choice-btn:active {
    transform: translateX(4px) scale(0.98);
}

/* ===== 审讯输入面板 ===== */
#interrogation-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 15;
    background: linear-gradient(to top, rgba(10, 6, 3, 0.98) 70%, rgba(10, 6, 3, 0.8));
    padding: 10px 12px 16px;
    border-top: 1px solid var(--gold-dim);
}

#evidence-hint {
    margin-bottom: 8px;
    padding: 6px 12px;
    background: rgba(201, 168, 76, 0.1);
    border-left: 3px solid var(--gold);
    border-radius: 2px;
    font-size: 12px;
    color: var(--gold);
    animation: hintFade 0.3s ease-out;
}

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

#input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

#player-input {
    flex: 1;
    background: rgba(244, 232, 193, 0.08);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 10px 14px;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

#player-input:focus {
    border-color: var(--gold);
}

#player-input::placeholder {
    color: var(--text-dim);
}

#send-btn {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    border: none;
    border-radius: 4px;
    padding: 10px 18px;
    color: var(--dark-bg);
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

#send-btn:hover { opacity: 0.9; }
#send-btn:active { transform: scale(0.95); }
#send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

#voice-btn {
    background: rgba(244, 232, 193, 0.08);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

#voice-btn:hover {
    background: rgba(201, 168, 76, 0.15);
    border-color: var(--gold);
}

#voice-btn.recording {
    background: rgba(139, 32, 32, 0.4);
    border-color: var(--accent-red-bright);
    animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(197, 48, 48, 0); }
    50% { box-shadow: 0 0 12px 3px rgba(197, 48, 48, 0.4); }
}

#interrogation-tools {
    display: flex;
    gap: 8px;
}

.tool-btn {
    flex: 1;
    background: rgba(244, 232, 193, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 4px;
    padding: 8px;
    color: var(--text-dim);
    font-family: var(--font-ui);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: rgba(201, 168, 76, 0.12);
    color: var(--gold);
    border-color: var(--gold-dim);
}

/* ===== 线索面板 ===== */
#evidence-panel {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

#evidence-panel-inner {
    width: 88%;
    max-height: 75vh;
    background: var(--dialog-bg);
    border: 1px solid var(--gold-dim);
    border-radius: 6px;
    padding: 24px 18px;
    overflow-y: auto;
}

#evidence-panel-inner h3 {
    color: var(--gold);
    font-size: 18px;
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gold-dim);
}

.evidence-item {
    background: rgba(244, 232, 193, 0.05);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.evidence-item:hover {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--gold-dim);
}

.evidence-item .ev-title {
    color: var(--gold);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.evidence-item .ev-desc {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.6;
}

.evidence-item.ev-new {
    border-color: var(--gold);
    animation: evPulse 1s ease-in-out 2;
}

@keyframes evPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0); }
    50% { box-shadow: 0 0 12px 2px rgba(201, 168, 76, 0.3); }
}

#close-evidence {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    font-size: 14px;
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--gold-dim);
    color: var(--gold);
}

/* ===== 压力指示器 ===== */
#pressure-meter {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 12;
    text-align: right;
}

#pressure-label {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 4px;
    letter-spacing: 2px;
}

#pressure-bar-bg {
    width: 120px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

#pressure-bar-fill {
    height: 100%;
    width: 100%;
    background: var(--pressure-green);
    border-radius: 3px;
    transition: width 0.6s ease, background-color 0.6s ease;
}

/* ===== 击穿演出 ===== */
#breakthrough-overlay {
    position: absolute;
    inset: 0;
    z-index: 25;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: breakthroughFlash 0.5s ease-out;
}

@keyframes breakthroughFlash {
    0% { background: rgba(201, 168, 76, 0.6); }
    100% { background: rgba(0, 0, 0, 0.9); }
}

#breakthrough-text {
    color: var(--gold);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 8px;
    text-align: center;
    animation: btTextReveal 0.8s ease-out 0.3s both;
}

@keyframes btTextReveal {
    from { transform: scale(1.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ===== 转场遮罩 ===== */
#transition-mask {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: #000;
    transition: opacity 0.6s ease;
}

.mask-fade-in { opacity: 1 !important; }
.mask-fade-out { opacity: 0 !important; }

/* ===== 开始画面 ===== */
#title-screen {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: radial-gradient(ellipse at 30% 40%, #1e1812 0%, #0a0805 60%, #000 100%);
    overflow: hidden;
}

/* --- 案卷卷轴 --- */
#scroll-wrap {
    position: absolute;
    inset: 0;
    z-index: 52;
    pointer-events: none;
}

#scroll-left, #scroll-right {
    position: absolute;
    top: 0;
    width: 52%;
    height: 100%;
    background: linear-gradient(to bottom, #2a2018, #1e1812 20%, #1e1812 80%, #2a2018);
    z-index: 52;
}

#scroll-left {
    left: 0;
    border-right: 3px solid var(--gold-dim);
    animation: scrollOpenLeft 1.8s ease-in-out 1s forwards;
}

#scroll-right {
    right: 0;
    border-left: 3px solid var(--gold-dim);
    animation: scrollOpenRight 1.8s ease-in-out 1s forwards;
}

/* 卷轴纹理线 */
#scroll-left::before, #scroll-right::before {
    content: '';
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 40px,
        rgba(201, 168, 76, 0.04) 40px,
        rgba(201, 168, 76, 0.04) 41px
    );
}

@keyframes scrollOpenLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-105%); }
}

@keyframes scrollOpenRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(105%); }
}

/* --- 印泥分开动画 --- */
#seal-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 53;
    display: flex;
    opacity: 0;
    animation: sealAppear 0.6s ease-out 0.1s forwards, sealFade 0.5s ease-in 2.4s forwards;
}

#seal-left, #seal-right {
    transition: transform 1s ease-in-out;
}

#seal-left {
    animation: sealSplitLeft 1.2s ease-in-out 0.7s forwards;
}

#seal-right {
    animation: sealSplitRight 1.2s ease-in-out 0.7s forwards;
}

@keyframes sealAppear {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1.5); }
}

@keyframes sealSplitLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-30px); }
}

@keyframes sealSplitRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(30px); }
}

@keyframes sealFade {
    to { opacity: 0; }
}

/* --- 狄仁杰剪影 --- */
#di-silhouette {
    position: absolute;
    bottom: 0;
    left: -8%;
    width: 65%;
    height: 80%;
    z-index: 51;
    opacity: 0;
    filter: drop-shadow(2px 0 40px rgba(201, 168, 76, 0.12));
    animation: silhouetteReveal 1.5s ease-out 2.5s forwards;
}

#di-silhouette svg {
    width: 100%;
    height: 100%;
}

@keyframes silhouetteReveal {
    0% { opacity: 0; transform: translateX(-40px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* --- 标题文字 --- */
#title-content {
    position: absolute;
    top: 14%;
    right: 6%;
    z-index: 51;
    text-align: right;
    opacity: 0;
    animation: titleContentReveal 1.2s ease-out 3.2s forwards;
}

@keyframes titleContentReveal {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

#game-title {
    font-size: 48px;
    color: var(--gold);
    letter-spacing: 14px;
    text-shadow: 0 2px 30px rgba(201, 168, 76, 0.4), 0 0 60px rgba(201, 168, 76, 0.15);
    writing-mode: vertical-rl;
    display: inline-block;
    margin-bottom: 0;
}

#title-divider {
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom, transparent, var(--gold-dim), transparent);
    margin: 12px 0 12px auto;
    animation: dividerGrow 0.8s ease-out 3.8s forwards;
}

@keyframes dividerGrow {
    to { height: 50px; }
}

#case-title {
    font-size: 15px;
    color: var(--text-dim);
    letter-spacing: 4px;
    font-weight: 400;
    writing-mode: vertical-rl;
    display: inline-block;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 4.2s forwards;
}

/* --- 底部输入和按钮 --- */
#title-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 51;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 30px;
    opacity: 0;
    animation: fadeIn 1s ease-out 4.5s forwards;
}

#api-key-area {
    margin-bottom: 16px;
    width: 75%;
    max-width: 300px;
}

#api-key-input {
    width: 100%;
    background: rgba(244, 232, 193, 0.06);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 10px 14px;
    color: var(--text-color);
    font-family: var(--font-ui);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

#api-key-input:focus {
    border-color: var(--gold);
}

#api-key-input::placeholder {
    color: var(--text-dim);
}

#api-status {
    margin-top: 6px;
    font-size: 12px;
    font-family: var(--font-ui);
    min-height: 18px;
}

.api-ok { color: #4a8c5c; }
.api-err { color: var(--accent-red-bright); }

#start-btn {
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: 4px;
    padding: 14px 48px;
    color: var(--gold);
    font-family: var(--font-main);
    font-size: 18px;
    letter-spacing: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#start-btn:hover {
    background: rgba(201, 168, 76, 0.1);
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.2);
}

#subtitle {
    margin-top: 14px;
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: 2px;
    font-family: var(--font-ui);
    opacity: 0.5;
}

/* ===== 重新开始按钮 ===== */
#restart-btn {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: 4px;
    padding: 8px 24px;
    color: var(--gold);
    font-family: var(--font-main);
    font-size: 14px;
    letter-spacing: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

#restart-btn.show {
    animation: fadeIn 0.8s ease-out 1s forwards;
}

#restart-btn:hover {
    background: rgba(201, 168, 76, 0.1);
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.2);
}

/* ===== 指认凶手面板 ===== */
#guess-panel {
    position: absolute;
    bottom: 18%;
    left: 4%;
    right: 4%;
    z-index: 15;
    background: var(--dialog-bg);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 20px 18px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.4s ease-out;
}

#guess-prompt {
    font-size: 15px;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 14px;
    text-align: center;
}

#guess-input-wrapper {
    display: flex;
    gap: 8px;
}

#guess-input {
    flex: 1;
    background: rgba(244, 232, 193, 0.08);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 10px 14px;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

#guess-input:focus {
    border-color: var(--gold);
}

#guess-input::placeholder {
    color: var(--text-dim);
}

#guess-submit {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    color: var(--dark-bg);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 2px;
    transition: transform 0.1s, opacity 0.2s;
}

#guess-submit:hover { opacity: 0.9; }
#guess-submit:active { transform: scale(0.95); }

/* ===== 定场诗 ===== */
#poem-screen {
    position: absolute;
    inset: 0;
    z-index: 55;
    background: linear-gradient(
        to bottom,
        #050302 0%,
        #1a1410 20%,
        #1a1410 80%,
        #050302 100%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    cursor: pointer;
}

#poem-allusion {
    text-align: center;
    opacity: 0;
    animation: poemFadeIn 1.5s ease-out 0.5s forwards;
}

#allusion-source {
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: 3px;
    margin-bottom: 12px;
}

#allusion-text {
    font-size: 14px;
    color: var(--gold-dim);
    letter-spacing: 2px;
    line-height: 2;
    max-width: 80%;
    margin: 0 auto;
    font-style: italic;
}

#poem-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 0;
}

.poem-line {
    font-size: 20px;
    color: var(--gold);
    letter-spacing: 4px;
    line-height: 2;
    opacity: 0;
    transform: translateY(12px);
    text-shadow: 0 1px 10px rgba(201, 168, 76, 0.2);
}

.poem-line.poem-line-show {
    animation: poemLineReveal 0.8s ease-out forwards;
}

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

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

#poem-skip {
    position: absolute;
    bottom: 40px;
    color: var(--text-dim);
    font-size: 13px;
    letter-spacing: 4px;
    font-family: var(--font-ui);
    opacity: 0;
    animation: poemFadeIn 1s ease-out 8s forwards;
}

/* ===== 屏幕震动 ===== */
.screen-shake {
    animation: screenShake 0.5s ease-in-out;
}

@keyframes screenShake {
    0%, 100% { transform: translate(0); }
    10% { transform: translate(-6px, 3px); }
    20% { transform: translate(6px, -3px); }
    30% { transform: translate(-4px, 2px); }
    40% { transform: translate(4px, -2px); }
    50% { transform: translate(-2px, 1px); }
}

/* ===== 通用 ===== */
.hidden { display: none !important; }

.fade-in { animation: fadeIn 0.4s ease-out; }
.fade-out { animation: fadeOut 0.4s ease-out forwards; }

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

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

/* ===== 对话框内审讯模式下的狄仁杰发言 ===== */
.di-line {
    color: var(--gold);
    font-weight: 700;
}

/* ===== 加载指示器 ===== */
.typing-indicator {
    display: inline-block;
}

.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--text-dim);
    border-radius: 50%;
    margin: 0 2px;
    animation: typingDot 1s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-4px); }
}

/* ===== 新线索获得提示 ===== */
#new-evidence-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 22;
    background: rgba(10, 6, 3, 0.95);
    border: 2px solid var(--gold);
    border-radius: 6px;
    padding: 20px 30px;
    text-align: center;
    animation: toastIn 0.5s ease-out;
    box-shadow: 0 0 30px rgba(201, 168, 76, 0.3);
}

#new-evidence-toast .toast-title {
    color: var(--gold);
    font-size: 14px;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

#new-evidence-toast .toast-content {
    color: var(--text-color);
    font-size: 16px;
    letter-spacing: 2px;
}

@keyframes toastIn {
    from { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
    border-radius: 2px;
}

/* ===== 深查面板 ===== */
#investigate-panel {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

#investigate-panel-inner {
    width: 88%;
    max-height: 75vh;
    background: var(--dialog-bg);
    border: 1px solid var(--gold-dim);
    border-radius: 6px;
    padding: 24px 18px;
    overflow-y: auto;
}

#investigate-panel-inner h3 {
    color: var(--gold);
    font-size: 18px;
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gold-dim);
}

#investigate-hint {
    color: #c9a84c;
    font-size: 13px;
    text-align: center;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: rgba(201, 168, 76, 0.08);
    border-radius: 4px;
    border: 1px dashed rgba(201, 168, 76, 0.3);
}

.contradiction-item {
    background: rgba(244, 232, 193, 0.05);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.contradiction-item:hover {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--gold-dim);
}

.contradiction-item.investigated {
    opacity: 0.6;
    cursor: default;
}

.contradiction-item.investigated:hover {
    background: rgba(244, 232, 193, 0.05);
    border-color: rgba(201, 168, 76, 0.2);
}

.contradiction-title {
    color: var(--gold);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.contradiction-summary {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.4;
}

.contradiction-status {
    color: var(--text-dim);
    font-size: 11px;
    margin-top: 6px;
    text-align: right;
}

.contradiction-status.clickable {
    color: var(--gold);
    cursor: pointer;
}

/* ===== 防线进度条状态 ===== */
.defense-stalled {
    animation: defenseBlink 1.2s ease-in-out infinite;
}

@keyframes defenseBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.defense-truth {
    box-shadow: 0 0 8px rgba(139, 32, 32, 0.6), 0 0 16px rgba(139, 32, 32, 0.3);
    animation: defenseGlow 2s ease-in-out infinite;
}

@keyframes defenseGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(139, 32, 32, 0.6); }
    50% { box-shadow: 0 0 16px rgba(201, 64, 64, 0.8), 0 0 24px rgba(201, 64, 64, 0.4); }
}
