/* ================= 麦克斯韦妖 · 云室仪器 ================= */
:root {
    --ink-0: #0b141d;
    --ink-1: #0e1620;
    --ink-2: #14202d;
    --chamber: #08111a;
    --amber: #ff9f43;
    --hot: #ff6b4a;
    --cyan: #59d6e8;
    --brass: #c9a227;
    --txt: #e8eef4;
    --muted: #7c93a8;
    --line: rgba(89, 214, 232, 0.14);
    --serif: "Noto Serif SC", "Songti SC", serif;
    --sans: "Noto Sans SC", "PingFang SC", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
}

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

body {
    background:
        radial-gradient(70% 45% at 50% -5%, rgba(255, 159, 67, 0.06), transparent 65%),
        radial-gradient(55% 40% at 90% 105%, rgba(89, 214, 232, 0.06), transparent 70%),
        linear-gradient(172deg, var(--ink-1), var(--ink-0) 70%);
    color: var(--txt);
    font-family: var(--sans);
    min-height: 100vh;
    padding: clamp(18px, 4vw, 48px) 16px 60px;
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255, 159, 67, 0.35); }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }

.mono-label {
    font-family: var(--mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--muted);
}

.page { max-width: 1180px; margin: 0 auto; }

/* ---- 页眉 ---- */
.masthead { text-align: center; margin-bottom: clamp(28px, 5vh, 48px); }
.eyebrow { margin-bottom: 16px; }
.eyebrow .mono {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--brass);
}
.masthead h1 {
    font-family: var(--serif);
    font-weight: 900;
    font-size: clamp(2.6rem, 6vw, 4rem);
    letter-spacing: 0.08em;
    background: linear-gradient(150deg, #ffd9a8, var(--amber) 55%, #c25e1e);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 18px rgba(255, 159, 67, 0.25));
}
.subtitle {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.9;
}

/* ---- 仪器区 ---- */
.instrument {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: 20px;
    margin-bottom: clamp(36px, 6vh, 64px);
}
@media (max-width: 900px) { .instrument { grid-template-columns: 1fr; } }

/* 云室面板 */
.chamber-panel {
    background: linear-gradient(165deg, var(--ink-2), #0d1826);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px 16px 14px;
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(232, 238, 244, 0.05);
}

.chamber-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.chamber-leds { display: flex; gap: 8px; }
.led {
    width: 9px; height: 9px; border-radius: 50%;
    background: #2a3a48;
    transition: all 0.4s;
}
.led.hot { background: var(--hot); box-shadow: 0 0 8px var(--hot); }
.led.cold { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

.chamber-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(89, 214, 232, 0.1);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6), 0 0 50px -20px rgba(89, 214, 232, 0.3);
}

#simulation {
    display: block;
    width: 100%;
    height: auto;
    background: var(--chamber);
}

/* 温度仪表 */
.gauges {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}
@media (max-width: 520px) { .gauges { grid-template-columns: 1fr; } }

.gauge {
    background: rgba(8, 17, 26, 0.7);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gauge-label {
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    color: var(--muted);
}

.gauge-value {
    font-family: var(--mono);
    font-size: 1.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    transition: color 0.5s;
}
.gauge-value small { font-size: 0.85rem; margin-left: 2px; opacity: 0.7; }
.gauge-hot .gauge-value { color: var(--amber); text-shadow: 0 0 14px rgba(255, 159, 67, 0.5); }
.gauge-cold .gauge-value { color: var(--cyan); text-shadow: 0 0 14px rgba(89, 214, 232, 0.5); }
.gauge-delta .gauge-value { color: var(--txt); }

.gauge-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(232, 238, 244, 0.08);
    overflow: hidden;
}
.gauge-bar i {
    display: block;
    height: 100%;
    width: 30%;
    border-radius: 2px;
    transition: width 0.4s;
}
.gauge-hot .gauge-bar i { background: linear-gradient(90deg, var(--amber), var(--hot)); box-shadow: 0 0 8px rgba(255, 107, 74, 0.7); }
.gauge-cold .gauge-bar i { background: linear-gradient(90deg, #2e8c9e, var(--cyan)); box-shadow: 0 0 8px rgba(89, 214, 232, 0.7); }

.gauge-note {
    font-size: 0.68rem;
    color: var(--muted);
    letter-spacing: 0.08em;
}

/* ---- 控制台 ---- */
.console-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.console-block {
    background: linear-gradient(165deg, var(--ink-2), #0d1826);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px 18px;
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.8);
}

.control-group { margin-bottom: 18px; }
.control-group label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--txt);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}
.mono-val {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--amber);
    font-weight: 700;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--amber);
    cursor: pointer;
}

.btn-row { display: flex; gap: 10px; }

.btn {
    flex: 1;
    padding: 12px 10px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    border: none;
    color: #2a1602;
    background: linear-gradient(135deg, #ffc06a, var(--amber) 60%, #e07f1f);
    box-shadow: 0 8px 20px -8px rgba(255, 159, 67, 0.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -8px rgba(255, 159, 67, 0.8); }
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid rgba(232, 238, 244, 0.16);
}
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }

/* 妖之开关 */
.demon-switch {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    color: var(--txt);
    background: linear-gradient(165deg, #1c1420, #140f18);
    border: 1px solid rgba(255, 107, 74, 0.25);
    box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.8);
    transition: all 0.3s;
}
.demon-switch:hover { border-color: rgba(255, 107, 74, 0.55); }
.demon-switch[aria-pressed="true"] {
    background: linear-gradient(165deg, #2a1410, #1c0e0a);
    border-color: var(--hot);
    box-shadow: 0 0 34px -8px rgba(255, 107, 74, 0.55);
}

.ds-eyes { display: flex; gap: 5px; }
.ds-eyes i {
    width: 10px; height: 10px; border-radius: 50%;
    background: #3a3040;
    transition: all 0.3s;
}
.demon-switch[aria-pressed="true"] .ds-eyes i {
    background: var(--hot);
    box-shadow: 0 0 10px var(--hot), 0 0 22px rgba(255, 107, 74, 0.6);
    animation: demonBlink 3.4s infinite;
}
.demon-switch[aria-pressed="true"] .ds-eyes i:last-child { animation-delay: 0.08s; }
@keyframes demonBlink {
    0%, 46%, 54%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.15); }
}

.ds-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ds-text strong { font-size: 1rem; letter-spacing: 0.08em; }
.ds-text small { color: var(--muted); font-size: 0.72rem; letter-spacing: 0.05em; }
.demon-switch[aria-pressed="true"] .ds-text small { color: #d98a76; }

.ds-toggle {
    width: 44px; height: 24px;
    border-radius: 999px;
    background: rgba(232, 238, 244, 0.1);
    border: 1px solid rgba(232, 238, 244, 0.15);
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s;
}
.ds-toggle::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--muted);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.demon-switch[aria-pressed="true"] .ds-toggle {
    background: rgba(255, 107, 74, 0.25);
    border-color: var(--hot);
}
.demon-switch[aria-pressed="true"] .ds-toggle::after {
    left: 22px;
    background: var(--hot);
    box-shadow: 0 0 10px rgba(255, 107, 74, 0.8);
}

/* 计数 */
.counters { display: flex; gap: 14px; }
.counter {
    flex: 1;
    background: rgba(8, 17, 26, 0.7);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}
.counter-label {
    display: block;
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    color: var(--muted);
    margin-bottom: 4px;
}
.counter-value {
    font-family: var(--mono);
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--txt);
}

/* ---- 实验档案 ---- */
.archive { margin-bottom: 40px; }
.archive-head {
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
    margin-bottom: 22px;
}
.archive-head h2 {
    font-family: var(--serif);
    font-weight: 900;
    font-size: 1.7rem;
    letter-spacing: 0.06em;
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
}

.file-card {
    background: rgba(20, 32, 45, 0.55);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px 18px;
    transition: all 0.25s;
}
.file-card:hover {
    transform: translateY(-3px);
    border-color: rgba(201, 162, 39, 0.4);
    box-shadow: 0 16px 34px -18px rgba(0, 0, 0, 0.8);
}
.fc-eyebrow { color: var(--brass) !important; margin-bottom: 10px; }
.file-card h3 {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 900;
    margin-bottom: 10px;
    letter-spacing: 0.03em;
}
.file-card p {
    font-size: 0.86rem;
    line-height: 1.9;
    color: var(--muted);
}
.file-card p strong { color: var(--txt); font-weight: 700; }

.file-card.verdict {
    border-color: rgba(255, 159, 67, 0.3);
    background: rgba(255, 159, 67, 0.05);
}
.file-card.verdict .fc-eyebrow { color: var(--amber) !important; }

/* ---- 页脚 ---- */
.page-foot {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
    * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
