@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=Orbitron:wght@500;700&display=swap');

:root {
    --bg-color: #0b0e14;
    --text-color: #e2e8f0;
    --glass-bg: rgba(20, 25, 35, 0.75);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --faction-virtual: #a855f7;
    --faction-clone: #ef4444;
    --faction-mech: #3b82f6;
    --prometheus-color: #059669; /* Unified matrix deep green */
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden; 
    background-image: radial-gradient(circle at 75% 50%, #1a202c 0%, #000000 100%);
}

.layout-grid {
    display: flex;
    width: 100vw;
    height: 100vh;
}

.sidebar-panel {
    width: 270px;
    flex-shrink: 0;
    height: 100vh;
    background: rgba(10, 15, 25, 0.95);
    border-right: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    box-shadow: 5px 0 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-panel.right-panel {
    border-right: none;
    border-left: 1px solid var(--glass-border);
    box-shadow: -5px 0 20px rgba(0,0,0,0.5);
}

.doom-track-vertical-container {
    position: absolute;
    right: 0;
    top: 0;
    width: 8px;
    height: 100%;
    background: #111;
}

.doom-track-vertical-bar {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, #ef4444, #f59e0b);
    transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px #ef4444;
}

.sidebar-content {
    padding: 20px 15px;
    flex-grow: 1;
    overflow-y: auto;
}

.main-theater {
    flex-grow: 1;
    height: 100vh;
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    padding: 0 30px;
    position: relative;
}

.container {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    width: 100%;
    
    max-height: 85vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* 玻璃面板内部滚动条 */
.glass-panel::-webkit-scrollbar { width: 6px; }
.glass-panel::-webkit-scrollbar-track { background: transparent; }
.glass-panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

#screen-narrative {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #f8fafc;
    margin-bottom: 30px;
}

.narrative-paragraph {
    margin-bottom: 20px;
    padding-bottom: 5px;
    opacity: 0.9;
    transition: opacity 0.5s;
}

.type-cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    background: var(--prometheus-color);
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    box-shadow: 0 0 8px var(--prometheus-color);
}

@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0% { opacity: 0.5; } 100% { opacity: 1; } }

.hidden { display: none !important; }

/* 选项按钮 */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    padding: 16px 20px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: #64748b;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.option-btn:disabled,
.option-btn.locked {
    cursor: not-allowed;
    opacity: 0.48;
    border-style: dashed;
    background: rgba(255, 255, 255, 0.025);
    transform: none;
}

.option-btn:disabled:hover,
.option-btn.locked:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--glass-border);
}

.locked-req {
    display: block;
    margin-top: 8px;
    color: #f59e0b;
    font-size: 0.78rem;
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.5px;
}

.continue-btn {
    border-color: rgba(5, 150, 105, 0.45);
    background: rgba(5, 150, 105, 0.08);
}

/* 意识流吐槽区块 */
.commentary-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
}
.commentary-list::-webkit-scrollbar { width: 4px; }
.commentary-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

.ai-voice-active {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--prometheus-color);
    border-left: 2px solid var(--prometheus-color);
    padding: 8px 12px;
    background: rgba(5, 150, 105, 0.05); /* very dark green tint */
    border-radius: 0 4px 4px 0;
    line-height: 1.5;
}

.voice-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.66rem;
    letter-spacing: 1px;
    margin-bottom: 5px;
    opacity: 0.85;
}

.voice-body {
    color: #cbd5e1;
}

.voice-logic { border-color: #38bdf8; background: rgba(56, 189, 248, 0.05); }
.voice-shame { border-color: #f97316; background: rgba(249, 115, 22, 0.06); }
.voice-survival { border-color: #ef4444; background: rgba(239, 68, 68, 0.06); }
.voice-system { border-color: #94a3b8; background: rgba(148, 163, 184, 0.05); }

.prometheus-header h2 {
    color: var(--prometheus-color);
}

.prometheus-status-ring {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px auto;
    border-radius: 50%;
    border: 2px solid #334155;
    background: radial-gradient(circle, #1e293b 0%, #0f172a 100%);
    position: relative;
}
.prometheus-status-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: #64748b;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s;
    box-shadow: 0 0 10px rgba(100, 116, 139, 0.5);
}

/* 警报形态 */
.prometheus-status-ring.warning::after {
    background: #ef4444;
    box-shadow: 0 0 20px #ef4444, 0 0 40px #ef4444;
    animation: statusPulse 1s infinite alternate;
}
@keyframes statusPulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

/* Alignment Matrix */
.alignment-container {
    width: 100%;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.alignment-grid {
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    border-radius: 4px;
    margin: 20px 0;
}

.grid-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
}
.grid-line.horizontal { width: 100%; height: 1px; top: 50%; left: 0; background: rgba(255, 255, 255, 0.15); }
.grid-line.vertical { height: 100%; width: 1px; left: 50%; top: 0; background: rgba(255, 255, 255, 0.15); }

.grid-label {
    position: absolute;
    color: #64748b;
    font-size: 0.7rem;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.grid-label.top { top: -25px; left: 50%; transform: translateX(-50%); }
.grid-label.bottom { bottom: -25px; left: 50%; transform: translateX(-50%); }
.grid-label.left { left: -35px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.grid-label.right { right: -35px; top: 50%; transform: translateY(-50%) rotate(90deg); }

.alignment-pointer {
    position: absolute;
    width: 12px;
    height: 12px;
    left: 50%;
    top: 50%;
    border: 2px solid var(--prometheus-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--prometheus-color);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 5;
    background: rgba(0,0,0,0.5);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Glitch Overlay */
.glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 0, 0, 0.1);
    mix-blend-mode: color-burn;
    pointer-events: none;
    z-index: 9999;
}

.option-btn.ai-proposed {
    border: 1px solid var(--prometheus-color);
    background: rgba(5, 150, 105, 0.05);
    box-shadow: 0 0 10px rgba(5, 150, 105, 0.2) inset;
}
.option-btn.ai-proposed::before {
    content: '[ 普氏提案 ] ';
    font-family: 'Orbitron', monospace;
    color: var(--prometheus-color);
    font-size: 0.8em;
    display: block;
    margin-bottom: 5px;
    letter-spacing: 1px;
}
.option-btn.ai-proposed:hover {
    background: rgba(5, 150, 105, 0.15);
    border-color: var(--prometheus-color);
    box-shadow: 0 5px 15px rgba(5, 150, 105, 0.4);
}

/* 中央面板 - 继续提示 */
.narrative-continue-hint {
    text-align: center;
    color: var(--prometheus-color);
    font-size: 0.9rem;
    font-family: 'Orbitron', monospace;
    margin-top: 16px;
    padding: 10px 0;
    letter-spacing: 1px;
    animation: hintPulse 2s ease-in-out infinite;
    text-shadow: 0 0 8px rgba(5, 150, 105, 0.5);
    cursor: pointer;
    border-top: 1px solid rgba(5, 150, 105, 0.15);
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(2px); }
}

/* 左侧面板 - 紧凑对齐矩阵 */
.sidebar-matrix-title {
    text-align: center;
    color: #64748b;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 16px 0 4px 0;
}

.sidebar-section-kicker,
.sidebar-section-title {
    color: #64748b;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-size: 0.62rem;
    margin: 16px 0 8px;
}

.sidebar-section-kicker {
    margin-top: 0;
}

.sidebar-main-card,
.delta-panel,
.flags-panel,
.evolution-legend,
.outcome-panel {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    border-radius: 10px;
}

.sidebar-main-card {
    padding: 12px;
}

.sidebar-main-title {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    color: #e2e8f0;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.78rem;
    margin-bottom: 10px;
}

.sidebar-main-title span {
    color: #ef4444;
    font-size: 0.66rem;
}

.sidebar-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.sidebar-stat-grid div {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
}

.sidebar-stat-grid b {
    display: block;
    font-family: 'Orbitron', sans-serif;
    color: #f8fafc;
    font-size: 0.9rem;
}

.sidebar-stat-grid span {
    display: block;
    color: #94a3b8;
    font-size: 0.62rem;
    margin-top: 4px;
}

.evolution-legend {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.evolution-legend div {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    gap: 8px;
    align-items: center;
    color: #cbd5e1;
    font-size: 0.76rem;
}

.evolution-legend span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    box-shadow: 0 0 8px currentColor;
}

.evolution-legend b {
    color: #94a3b8;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
}

.delta-panel,
.flags-panel {
    padding: 10px;
}

.delta-badge,
.flag-chip {
    display: inline-flex;
    align-items: center;
    margin: 3px;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-family: 'Orbitron', monospace;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.delta-badge.positive {
    color: #34d399;
    background: rgba(52, 211, 153, 0.08);
}

.delta-badge.negative {
    color: #fb7185;
    background: rgba(251, 113, 133, 0.08);
}

.flag-chip {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
}

.flag-gain {
    color: #94a3b8;
    font-size: 0.72rem;
    margin-top: 8px;
}

.flag-gain code {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    padding: 2px 5px;
    border-radius: 4px;
}

.muted {
    color: #64748b;
    font-size: 0.78rem;
}

.outcome-panel {
    padding: 18px;
    border-color: rgba(5, 150, 105, 0.25);
    box-shadow: 0 0 24px rgba(5, 150, 105, 0.08) inset;
}

.outcome-title {
    color: var(--prometheus-color);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.outcome-choice {
    color: #e2e8f0;
    font-weight: 600;
    margin-bottom: 12px;
}

.outcome-deltas,
.outcome-flags {
    margin-bottom: 10px;
}

.outcome-commentary {
    color: #cbd5e1;
    line-height: 1.65;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
}
