:root {
      --bg: #060708;
      --surface: rgba(16, 18, 21, 0.85);
      --surface-deep: rgba(10, 11, 13, 0.92);
      --surface-hover: rgba(25, 28, 33, 0.92);
      --hairline: rgba(255, 255, 255, 0.06);
      --text: #dddad2;
      --text-dim: #928e85;
      --text-faint: #59554e;
      --gold: #cbb07a;
      --crimson: #9b3333;
      --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
      --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Inter", sans-serif;
      --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    }

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

    html, body {
      background: radial-gradient(ellipse at 50% 0%, #141518 0%, #060708 74%);
      color: var(--text);
      font-family: var(--font-sans);
      font-size: 16px;
      min-height: 100vh;
      overflow-x: hidden;
      -webkit-font-smoothing: antialiased;
      line-height: 1.85;
    }

    .vignette {
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 88;
      background:
        repeating-linear-gradient(
          to bottom,
          rgba(255, 255, 255, 0.012) 0px,
          rgba(255, 255, 255, 0.012) 1px,
          transparent 1px,
          transparent 4px
        ),
        radial-gradient(circle at 50% 45%, transparent 46%, rgba(0, 0, 0, 0.78) 100%);
    }

    #noise-canvas {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 87;
      opacity: 0.055;
      transition: opacity 0.2s;
    }

    body.glitch-flash #noise-canvas { opacity: 0.22; }
    body.glitch-flash { animation: vhs-jitter 0.3s steps(2, end); }
    body.knock-shake { animation: knock-thump 0.26s ease; }

    @keyframes vhs-jitter {
      0% { transform: translate(0, 0); }
      35% { transform: translate(-3px, 1px); filter: contrast(1.18); }
      70% { transform: translate(3px, -1px); }
      100% { transform: translate(0, 0); filter: none; }
    }

    @keyframes knock-thump {
      0% { transform: scale(1); }
      35% { transform: scale(1.012) translateY(2px); }
      100% { transform: scale(1); }
    }

    #stream-canvas {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 2;
      opacity: 0;
      transition: opacity 1.1s ease;
    }

    body.ending-b-active #stream-canvas { opacity: 0.34; }

    .aberration {
      text-shadow: -1px 0 rgba(155, 51, 51, 0.38), 1px 0 rgba(110, 155, 148, 0.24);
    }

    /* Top strip */
    .topbar {
      position: fixed;
      top: 0; left: 0; right: 0;
      height: 58px;
      padding: 0 28px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: linear-gradient(to bottom, rgba(6, 7, 8, 0.95), rgba(6, 7, 8, 0));
      z-index: 60;
    }

    .deck-left { display: flex; align-items: center; gap: 18px; }

    .brand-mark {
      display: flex;
      align-items: center;
      gap: 10px;
      color: var(--text);
      font-family: var(--font-serif);
      cursor: pointer;
      background: none;
      border: none;
      font-size: 16px;
      letter-spacing: 0.24em;
    }

    .rec-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--crimson);
      box-shadow: 0 0 10px rgba(155, 51, 51, 0.85);
      animation: blink-rec 1.9s infinite;
    }

    @keyframes blink-rec {
      0%, 60% { opacity: 1; }
      72%, 100% { opacity: 0.2; }
    }

    .timecode {
      font-family: var(--font-mono);
      font-size: 13px;
      color: var(--text-faint);
      letter-spacing: 0.06em;
      transition: color 0.6s;
    }

    .timecode.leaked { color: #d66868; }

    .top-actions { display: flex; align-items: center; gap: 18px; }

    .nav-link {
      background: none;
      border: none;
      color: var(--text-dim);
      font-size: 14px;
      font-family: var(--font-sans);
      letter-spacing: 0.08em;
      cursor: pointer;
      padding: 4px 2px;
      transition: color 0.2s;
      white-space: nowrap;
    }

    .nav-link:hover:not(:disabled) { color: var(--text); }
    .nav-link.active { color: var(--gold); }
    .nav-link.beckon {
      color: #dc7e7e;
      animation: soft-pulse 2.2s ease-in-out infinite;
    }
    .nav-link:disabled { opacity: 0.24; cursor: not-allowed; }

    @keyframes soft-pulse {
      0%, 100% { opacity: 0.65; }
      50% { opacity: 1; }
    }

    main {
      position: relative;
      z-index: 10;
      min-height: 100vh;
      padding: 84px 24px 76px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }

    .view {
      display: none;
      width: 100%;
      max-width: 920px;
      margin: 0 auto;
      animation: fadeIn 0.55s ease;
    }

    .view.active { display: block; }

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

    /* Controls */
    .input-row { width: 100%; display: flex; gap: 12px; align-items: center; }

    .text-input {
      flex: 1;
      background: transparent;
      border: none;
      border-bottom: 1px solid rgba(255, 255, 255, 0.16);
      color: var(--text);
      padding: 12px 4px;
      font-size: 16px;
      outline: none;
      font-family: var(--font-serif);
      letter-spacing: 0.1em;
      transition: border-color 0.25s;
    }

    .text-input::placeholder { color: var(--text-faint); font-size: 14.5px; }
    .text-input:focus { border-bottom-color: var(--gold); }

    .btn {
      background: rgba(255, 255, 255, 0.05);
      border: none;
      color: var(--text-dim);
      padding: 10px 18px;
      font-size: 14px;
      letter-spacing: 0.12em;
      border-radius: 2px;
      cursor: pointer;
      transition: background 0.22s, color 0.22s, box-shadow 0.22s;
      white-space: nowrap;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
    }

    .btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: var(--text); }

    .btn-primary {
      background: rgba(203, 176, 122, 0.13);
      color: var(--gold);
      box-shadow: inset 0 0 0 1px rgba(203, 176, 122, 0.3);
    }

    .btn-primary:hover:not(:disabled) { background: rgba(203, 176, 122, 0.22); color: #e6ce96; }

    .btn-crimson {
      background: rgba(155, 51, 51, 0.18);
      color: #e29090;
      box-shadow: inset 0 0 0 1px rgba(155, 51, 51, 0.36);
    }

    .btn-crimson:hover:not(:disabled) { background: rgba(155, 51, 51, 0.28); color: #ffbbbb; }

    .btn.toggled {
      background: rgba(203, 176, 122, 0.22);
      color: var(--gold);
      box-shadow: inset 0 0 0 1px rgba(203, 176, 122, 0.5);
    }

    .btn:disabled { opacity: 0.28; cursor: not-allowed; }

    .feedback-line {
      min-height: 24px;
      font-size: 14.5px;
      letter-spacing: 0.08em;
      color: var(--text-dim);
      font-family: var(--font-serif);
      margin-top: 10px;
    }
    .feedback-line.error { color: #cf7272; }
    .feedback-line.success { color: var(--gold); }

    /* Quiet film-note caption */
    .film-note {
      display: none;
      margin-top: 22px;
      padding: 16px 6px 4px;
      border-top: 1px solid var(--hairline);
      font-family: var(--font-sans);
      font-size: 15.5px;
      color: #d6cfc2;
      line-height: 1.95;
      letter-spacing: 0.04em;
      animation: fadeIn 0.5s ease;
    }

    .film-note.visible { display: block; }

    .film-note-lead {
      display: block;
      font-size: 12.5px;
      letter-spacing: 0.18em;
      color: var(--gold);
      margin-bottom: 6px;
    }

    /* ACT 1: HOME */
    .home-layout {
      display: grid;
      grid-template-columns: 1.08fr 0.92fr;
      gap: 48px;
      align-items: center;
    }

    .photo-plate {
      position: relative;
      width: 100%;
      aspect-ratio: 1 / 1;
      background: #040506;
      overflow: hidden;
      border-radius: 2px;
      box-shadow: 0 34px 95px rgba(0, 0, 0, 0.9), inset 0 0 42px rgba(0, 0, 0, 0.55);
    }

    .photo-plate img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      filter: contrast(1.06) brightness(0.86);
      animation: dream-breathe 16s ease-in-out infinite alternate;
      transition: filter 0.6s ease;
    }

    .photo-plate.cloth-loose img {
      animation: cloth-tremble 4.5s ease-in-out infinite;
    }

    @keyframes dream-breathe {
      0% { transform: scale(1.01); }
      100% { transform: scale(1.055) translateY(-3px); }
    }

    @keyframes cloth-tremble {
      0%, 100% { transform: scale(1.02) translate(0, 0); filter: contrast(1.1) brightness(0.88); }
      50% { transform: scale(1.045) translate(0, -2px); filter: contrast(1.16) brightness(0.94); }
    }

    .photo-plate.negative-flash img { filter: invert(1) contrast(1.45); }

    .eye-hotspot {
      position: absolute;
      top: 28%;
      left: 36%;
      width: 48%;
      height: 18%;
      background: transparent;
      border: none;
      cursor: default;
      z-index: 6;
      outline: none;
    }

    .eye-hotspot.ready { cursor: pointer; }

    .home-copy-col { display: flex; flex-direction: column; align-items: center; text-align: center; }

    .vertical-poetry {
      writing-mode: vertical-rl;
      text-orientation: upright;
      font-family: var(--font-serif);
      font-size: 19px;
      letter-spacing: 0.3em;
      line-height: 2.35;
      color: var(--text);
      margin: 0 auto 36px;
      min-height: 255px;
      text-align: left;
    }

    .vertical-poetry .poetry-gap { margin-right: 22px; }
    .home-input-box { width: 100%; max-width: 360px; }

    /* HUB */
    .hub-head { margin-bottom: 28px; }
    .eyebrow { font-size: 12.5px; letter-spacing: 0.2em; color: var(--text-faint); margin-bottom: 6px; }
    .page-title { font-family: var(--font-serif); font-size: 28px; font-weight: 400; letter-spacing: 0.2em; color: var(--text); }

    .search-strip {
      background: var(--surface);
      padding: 22px 26px;
      border-radius: 2px;
      margin-bottom: 28px;
      box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    }

    .archive-list {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 18px;
      margin-bottom: 28px;
    }

    .archive-card {
      background: var(--surface);
      border: none;
      border-radius: 2px;
      padding: 24px 24px 20px;
      text-align: left;
      cursor: pointer;
      transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      min-height: 146px;
      color: var(--text-dim);
      box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.04);
      animation: fadeIn 0.45s ease;
    }

    .archive-card:hover {
      background: var(--surface-hover);
      color: var(--text);
      transform: translateY(-2px);
      box-shadow: 0 20px 44px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(203, 176, 122, 0.26);
    }

    .archive-card.crimson-card {
      background: linear-gradient(160deg, rgba(155, 51, 51, 0.16), rgba(16, 18, 21, 0.88));
      box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(155, 51, 51, 0.36);
    }

    .card-meta { font-size: 12.5px; letter-spacing: 0.14em; color: var(--text-faint); margin-bottom: 10px; display: flex; justify-content: space-between; }
    .card-title { font-family: var(--font-serif); font-size: 20px; letter-spacing: 0.12em; color: var(--text); margin-bottom: 6px; }
    .card-sub { font-size: 14px; color: var(--text-dim); }

    .cave-strip {
      margin-top: 12px;
      padding: 16px 22px;
      background: rgba(9, 10, 12, 0.68);
      border-radius: 2px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
      font-size: 13px;
      color: var(--text-faint);
      letter-spacing: 0.08em;
    }

    /* DETAIL PANEL */
    .detail-panel {
      background: var(--surface);
      border-radius: 2px;
      padding: 30px 34px;
      box-shadow: 0 26px 80px rgba(0, 0, 0, 0.72);
    }

    .back-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 24px;
      padding-bottom: 16px;
      border-bottom: 1px solid var(--hairline);
      gap: 12px;
    }

    .prose-lead { font-family: var(--font-serif); color: var(--text-dim); font-size: 16px; margin-bottom: 24px; line-height: 2; }

    .footage-frame {
      position: relative;
      width: 100%;
      aspect-ratio: 16 / 9;
      background: #030405;
      border-radius: 2px;
      overflow: hidden;
      margin-bottom: 18px;
      box-shadow: 0 20px 55px rgba(0, 0, 0, 0.78);
    }

    .footage-stage {
      position: relative;
      width: 100%;
      height: 100%;
      transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
    }

    .footage-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .footage-frame.flipped .footage-stage { transform: rotate(180deg); }
    .footage-frame.inverted .footage-stage { filter: invert(1) contrast(1.28); }

    /* Placed in puddle area; pre-rotated 180deg; crisp high-contrast ink when BOTH flipped & inverted */
    .puddle-secret {
      position: absolute;
      bottom: 10%;
      left: 50%;
      transform: translateX(-50%) rotate(180deg);
      font-family: "Kaiti SC", "STKaiti", "KaiTi", "FangSong", var(--font-serif);
      font-size: 24px;
      font-weight: 700;
      letter-spacing: 0.28em;
      color: transparent;
      padding: 6px 18px;
      border-radius: 4px;
      pointer-events: none;
      transition: color 0.5s ease, text-shadow 0.5s ease, background 0.5s ease;
      user-select: none;
      white-space: nowrap;
      z-index: 4;
    }

    /* Remember .footage-stage has filter: invert(1), so dark #0a0806 inverts to bright ivory #f5f7f9,
       and light background #f2ede2 inverts to dark #0d121d — crystal clear readability! */
    .footage-frame.flipped.inverted .puddle-secret {
      color: #0b0a08;
      background: rgba(240, 234, 220, 0.72);
      text-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    }

    .bell-hotspot {
      position: absolute;
      top: 13%;
      left: 6%;
      width: 30%;
      height: 56%;
      background: transparent;
      border: none;
      cursor: crosshair;
      z-index: 5;
      outline: none;
    }

    .controls-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
    .section-block { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--hairline); }

    .slider-row {
      display: flex;
      align-items: center;
      gap: 16px;
      font-size: 14px;
      color: var(--text-dim);
      margin-bottom: 14px;
    }

    .slider-row input[type="range"] { flex: 1; accent-color: var(--gold); cursor: pointer; }

    /* CCTV overlays */
    .cctv-diegetic {
      position: absolute;
      inset: 0;
      padding: 20px;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      pointer-events: none;
      transition: opacity 0.18s ease, filter 0.18s ease;
    }

    .cctv-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 14px; align-items: end; }

    .cctv-note-sheet {
      background: transparent;
      padding: 6px 4px;
      font-family: "Kaiti SC", "STKaiti", "KaiTi", "FangSong", "STFangsong", cursive, serif;
      font-size: 18px;
      color: #f3ead8;
      line-height: 1.85;
      letter-spacing: 0.08em;
      transform: rotate(-1.4deg);
      text-shadow:
        0 2px 6px rgba(0, 0, 0, 0.98),
        0 0 14px rgba(0, 0, 0, 0.96),
        0 0 3px rgba(0, 0, 0, 1);
    }

    .cctv-tag-corner {
      background: transparent;
      padding: 6px 4px;
      font-family: "Kaiti SC", "STKaiti", "KaiTi", "FangSong", cursive, serif;
      font-size: 15.5px;
      color: #e6dfd0;
      text-align: right;
      letter-spacing: 0.08em;
      transform: rotate(1deg);
      text-shadow:
        0 2px 6px rgba(0, 0, 0, 0.98),
        0 0 14px rgba(0, 0, 0, 0.96),
        0 0 3px rgba(0, 0, 0, 1);
    }

    /* Reel Deck */
    .reel-deck { background: var(--surface-deep); padding: 20px 22px; border-radius: 2px; margin-bottom: 18px; }
    .wave-canvas { width: 100%; height: 48px; display: block; margin: 14px 0; background: rgba(0, 0, 0, 0.35); border-radius: 2px; }

    .weigh-slip {
      background: rgba(18, 20, 24, 0.9);
      padding: 18px 22px;
      font-family: var(--font-serif);
      font-size: 15px;
      color: var(--text-dim);
      line-height: 2.05;
      margin-bottom: 16px;
    }

    /* Gold Leaf Scratch */
    .scratch-wrap {
      position: relative;
      width: 100%;
      height: 235px;
      border-radius: 2px;
      overflow: hidden;
      background: #141518;
      user-select: none;
      margin-bottom: 18px;
      box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.85);
    }

    .clay-underlayer {
      position: absolute;
      inset: 0;
      padding: 26px 28px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      background: radial-gradient(circle at 30% 40%, #242529 0%, #141518 70%);
      font-family: var(--font-serif);
      color: #d6d0c3;
    }

    .clay-scratch-text { font-size: 16px; line-height: 2.05; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9); }

    #scratch-canvas, #flake-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
    #scratch-canvas { cursor: crosshair; touch-action: none; z-index: 3; }
    #flake-canvas { pointer-events: none; z-index: 4; }

    /* Ledger table (Tape 03: realistic 5-item manifest requiring real addition!) */
    .ledger-sheet {
      background: var(--surface-deep);
      padding: 20px 24px;
      border-radius: 2px;
      margin-bottom: 16px;
      font-family: var(--font-serif);
    }

    .ledger-row {
      display: flex;
      justify-content: space-between;
      padding: 8px 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.04);
      font-size: 15px;
      color: var(--text-dim);
    }

    .ledger-total {
      display: flex;
      justify-content: space-between;
      padding-top: 14px;
      margin-top: 6px;
      font-size: 15.5px;
      color: var(--text);
    }

    /* Contradiction Board (7 cards incl. red herrings, 3 real contradictions) */
    /* Temple Amulet / Wooden Offering Tablet (佛牌 / 牌位) Grid */
    .evidence-pool {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 18px;
      margin: 22px 0;
    }

    .ev-card {
      position: relative;
      background:
        radial-gradient(ellipse at 50% 0%, rgba(203, 176, 122, 0.1) 0%, transparent 60%),
        linear-gradient(180deg, #1b1713 0%, #110e0c 100%);
      border: none;
      border-radius: 30px 30px 4px 4px;
      padding: 26px 22px 20px;
      text-align: center;
      cursor: pointer;
      transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
      color: #b7ae9e;
      box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.72),
        inset 0 0 0 1px rgba(203, 176, 122, 0.22),
        inset 0 0 0 6px #12100d,
        inset 0 0 0 7px rgba(203, 176, 122, 0.1);
    }

    .ev-card::before {
      content: "❖";
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 11px;
      color: rgba(203, 176, 122, 0.48);
    }

    .ev-card:hover {
      transform: translateY(-2px);
      color: #ede6d8;
      box-shadow:
        0 18px 38px rgba(0, 0, 0, 0.85),
        inset 0 0 0 1px rgba(203, 176, 122, 0.45),
        inset 0 0 0 6px #15120e,
        inset 0 0 0 7px rgba(203, 176, 122, 0.22);
    }

    .ev-card.selected {
      background:
        radial-gradient(ellipse at 50% 0%, rgba(203, 176, 122, 0.22) 0%, transparent 65%),
        linear-gradient(180deg, #282017 0%, #16120d 100%);
      color: #f4ebd8;
      box-shadow:
        0 0 24px rgba(203, 176, 122, 0.22),
        inset 0 0 0 1.5px rgba(203, 176, 122, 0.78),
        inset 0 0 0 6px #1a150f,
        inset 0 0 0 7px rgba(203, 176, 122, 0.35);
    }

    .ev-card.matched {
      background:
        radial-gradient(ellipse at 50% 0%, rgba(155, 51, 51, 0.26) 0%, transparent 65%),
        linear-gradient(180deg, #211212 0%, #120b0b 100%);
      color: #e2bebe;
      opacity: 0.68;
      box-shadow:
        inset 0 0 0 1px rgba(155, 51, 51, 0.52),
        inset 0 0 0 6px #140c0c,
        inset 0 0 0 7px rgba(155, 51, 51, 0.2);
    }

    .ev-tag {
      font-family: var(--font-serif);
      font-size: 13px;
      color: var(--gold);
      margin-bottom: 8px;
      letter-spacing: 0.16em;
    }

    .ev-text {
      font-family: var(--font-serif);
      font-size: 15px;
      line-height: 1.8;
    }

    /* Dramatic Finale Overlay & Vintage Cameraman Press Badge for Ending B */
    .eye-open-curtain {
      position: fixed;
      inset: 0;
      background: #040506;
      z-index: 150;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 24px;
    }

    .eye-open-curtain.active {
      display: flex;
      animation: fadeIn 0.35s ease;
    }

    .curtain-line {
      font-family: var(--font-serif);
      font-size: 30px;
      letter-spacing: 0.42em;
      color: #e6cfa0;
      text-shadow: 0 0 28px rgba(203, 176, 122, 0.55);
      margin-bottom: 14px;
    }

    .curtain-sub {
      font-family: var(--font-serif);
      font-size: 15px;
      letter-spacing: 0.24em;
      color: #a65555;
    }

    .press-badge {
      max-width: 440px;
      margin: 0 auto 24px;
      padding: 18px 22px;
      background: linear-gradient(165deg, #201c17 0%, #13110e 100%);
      border-radius: 2px;
      text-align: left;
      font-family: var(--font-serif);
      box-shadow: 0 18px 50px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(203, 176, 122, 0.32);
      position: relative;
    }

    .press-stamp {
      position: absolute;
      top: 14px;
      right: 16px;
      border: 1.5px solid rgba(176, 58, 58, 0.78);
      color: rgba(204, 78, 78, 0.88);
      font-size: 12px;
      letter-spacing: 0.16em;
      padding: 3px 8px;
      transform: rotate(-8deg);
    }

    /* Old 1996 Newspaper */
    .newspaper-sheet {
      background:
        radial-gradient(ellipse at 25% 20%, rgba(255, 248, 232, 0.08), transparent 65%),
        linear-gradient(170deg, #cfc5b0 0%, #bfb49c 55%, #b1a58c 100%);
      color: #1c1a17;
      padding: 30px 32px 24px;
      border-radius: 2px;
      box-shadow: 0 28px 75px rgba(0, 0, 0, 0.82), inset 0 0 48px rgba(58, 46, 28, 0.28);
      font-family: var(--font-serif);
      position: relative;
      overflow: hidden;
    }

    .np-masthead { border-bottom: 3px double #26211b; padding-bottom: 12px; margin-bottom: 18px; text-align: center; }
    .np-title { font-size: 38px; font-weight: 700; letter-spacing: 0.34em; color: #6b1d1d; line-height: 1.2; margin-bottom: 8px; }
    .np-meta { display: flex; justify-content: space-between; font-size: 13px; color: #3d362c; letter-spacing: 0.08em; border-top: 1px solid #3d362c; padding-top: 6px; flex-wrap: wrap; gap: 8px; }
    .np-columns { display: grid; grid-template-columns: 1.45fr 1fr; gap: 24px; }
    .np-col-main { border-right: 1px solid rgba(38, 33, 27, 0.35); padding-right: 22px; }
    .np-headline { font-size: 23px; font-weight: 700; line-height: 1.4; color: #161411; margin-bottom: 8px; }
    .np-subhead { font-size: 13.5px; color: #463d32; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px dotted rgba(38, 33, 27, 0.4); }
    .np-body { font-size: 15px; line-height: 1.9; text-indent: 2em; color: #24201b; margin-bottom: 14px; text-align: justify; }
    .np-box { border: 1px solid rgba(38, 33, 27, 0.48); padding: 13px 15px; margin-bottom: 14px; background: rgba(38, 33, 27, 0.04); }
    .np-box-title { font-size: 15.5px; font-weight: 700; margin-bottom: 6px; color: #1d1915; }
    .np-small-body { font-size: 14px; line-height: 1.8; color: #2c2721; }
    .np-classifieds { border-top: 2px solid #26211b; padding-top: 12px; margin-top: 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; font-size: 13px; line-height: 1.75; color: #2f2922; }
    .np-colophon { margin-top: 16px; padding-top: 8px; border-top: 1px solid rgba(38, 33, 27, 0.35); display: flex; justify-content: space-between; font-size: 12px; color: #544a3c; letter-spacing: 0.08em; }

    /* Endings */
    .ending-stage { max-width: 660px; margin: 0 auto; text-align: center; padding: 16px; }
    .ending-photo-frame { width: 230px; height: 230px; margin: 0 auto 26px; border-radius: 2px; overflow: hidden; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85); }
    .ending-photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .ending-prose { font-family: var(--font-serif); font-size: 17px; line-height: 2.35; color: var(--text); margin: 22px 0 28px; white-space: pre-line; }

    .archive-log-box {
      text-align: left;
      background: rgba(8, 9, 11, 0.9);
      padding: 18px 20px;
      border-radius: 2px;
      font-family: var(--font-mono);
      font-size: 12.5px;
      color: #a6afb9;
      margin: 0 auto 26px;
      max-height: 175px;
      overflow-y: auto;
      line-height: 1.85;
    }

    /* Modals */
    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(3, 4, 5, 0.86);
      backdrop-filter: blur(6px);
      z-index: 100;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .modal-backdrop.open { display: flex; animation: fadeIn 0.25s ease; }

    .modal-card {
      width: 100%;
      max-width: 480px;
      background: #101216;
      border-radius: 2px;
      padding: 26px;
      box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
    }

    .modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
    .modal-title { font-family: var(--font-serif); font-size: 18px; letter-spacing: 0.14em; color: var(--gold); }

    .notes-area {
      width: 100%;
      min-height: 190px;
      background: #07080a;
      border: none;
      color: var(--text);
      padding: 14px;
      font-size: 15px;
      line-height: 1.8;
      border-radius: 2px;
      resize: vertical;
      outline: none;
    }

    /* Pure Chinese Cinema Subtitle */
    .toast {
      position: fixed;
      bottom: 36px;
      left: 50%;
      transform: translateX(-50%) translateY(6px);
      max-width: 84vw;
      text-align: center;
      background: transparent;
      color: #f3ede0;
      font-family: var(--font-sans);
      font-size: 18px;
      font-weight: 400;
      letter-spacing: 0.18em;
      line-height: 1.7;
      padding: 6px 20px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.65s ease, transform 0.65s ease;
      z-index: 120;
      text-shadow: 0 2px 6px rgba(0, 0, 0, 0.98), 0 0 18px rgba(0, 0, 0, 0.95), 0 0 2px rgba(0, 0, 0, 1);
    }

    .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }


    /* Cave Hatch Unlockable Button */
    .cave-strip.unlocked {
      cursor: pointer;
      background: linear-gradient(90deg, rgba(155, 51, 51, 0.14), rgba(16, 18, 21, 0.88));
      color: var(--gold);
      box-shadow: inset 0 0 0 1px rgba(203, 176, 122, 0.28);
      transition: background 0.25s, transform 0.2s;
    }
    .cave-strip.unlocked:hover {
      background: linear-gradient(90deg, rgba(155, 51, 51, 0.24), rgba(24, 27, 32, 0.94));
      transform: translateY(-1px);
    }

    /* Tape 04: 1996 vs 1998 Head Overlay Frame */
    .overlay-compare {
      position: relative;
      width: 100%;
      max-width: 520px;
      aspect-ratio: 1 / 1;
      margin: 0 auto 18px;
      background: #040506;
      border-radius: 2px;
      overflow: hidden;
      box-shadow: 0 24px 65px rgba(0, 0, 0, 0.85);
    }
    .overlay-compare img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .overlay-year-tag {
      position: absolute;
      bottom: 12px;
      left: 14px;
      font-family: var(--font-mono);
      font-size: 12px;
      color: rgba(240, 234, 222, 0.85);
      text-shadow: 0 2px 6px #000;
      z-index: 4;
      pointer-events: none;
    }

    /* Tape 04: Side-light Stone Inscription Rubbing */
    .stone-rubbing {
      position: relative;
      padding: 28px 26px;
      background: #0d0e10;
      border-radius: 2px;
      overflow: hidden;
      cursor: crosshair;
      user-select: none;
      margin-bottom: 16px;
      box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.92);
    }
    .stone-text {
      font-family: var(--font-serif);
      font-size: 16px;
      line-height: 2.15;
      letter-spacing: 0.14em;
      color: #c8bfa8;
      opacity: 0.08;
      transition: opacity 0.25s;
    }
    .stone-rubbing.lit .stone-text {
      opacity: 0.92;
    }
    .stone-light {
      position: absolute;
      inset: 0;
      pointer-events: none;
      background: radial-gradient(circle 130px at var(--mx, 50%) var(--my, 50%), rgba(203, 176, 122, 0.22), rgba(5, 6, 7, 0.94) 75%);
    }

    /* Tape 05: Three Eternal Lamps (三炷长明灯) */
    .lamps-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      background: var(--surface-deep);
      border-radius: 2px;
      margin-bottom: 18px;
    }
    .lamps-group {
      display: flex;
      gap: 18px;
      align-items: center;
    }
    .lamp-item {
      display: flex;
      align-items: center;
      gap: 6px;
      font-family: var(--font-serif);
      font-size: 13.5px;
      color: var(--gold);
      transition: opacity 0.4s;
    }
    .lamp-flame {
      width: 8px;
      height: 12px;
      border-radius: 50% 50% 40% 40%;
      background: radial-gradient(circle at 50% 60%, #fff2c6, #d98e3a 65%, transparent 100%);
      box-shadow: 0 0 12px rgba(217, 142, 58, 0.85);
      animation: flame-flicker 1.4s ease-in-out infinite alternate;
    }
    .lamp-item.out { opacity: 0.24; color: var(--text-faint); }
    .lamp-item.out .lamp-flame { background: #333; box-shadow: none; animation: none; }
    @keyframes flame-flicker {
      0% { transform: scale(0.92); opacity: 0.85; }
      100% { transform: scale(1.1); opacity: 1; }
    }

    /* Tape 05: 24-Tile Qianfokan (千佛龛寻异) */
    .qianfo-grid {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      gap: 10px;
      margin: 18px 0;
    }
    .niche-tile {
      background: linear-gradient(180deg, #1a1815 0%, #100f0d 100%);
      border: none;
      border-radius: 22px 22px 3px 3px;
      padding: 14px 6px;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      color: #6b665d;
      font-family: var(--font-serif);
      font-size: 12px;
      transition: transform 0.2s, box-shadow 0.2s, color 0.2s;
      box-shadow: inset 0 0 0 1px rgba(203, 176, 122, 0.14);
    }
    .niche-tile:hover {
      transform: translateY(-2px);
      color: #cfc6b4;
      box-shadow: inset 0 0 0 1px rgba(203, 176, 122, 0.42);
    }
    .niche-tile.wrong { opacity: 0.25; cursor: not-allowed; }
    .niche-tile.found {
      background: linear-gradient(180deg, #2b1515 0%, #140b0b 100%);
      color: #f0cfcf;
      box-shadow: 0 0 22px rgba(155, 51, 51, 0.45), inset 0 0 0 1px rgba(203, 176, 122, 0.65);
    }
    .niche-face {
      width: 34px;
      height: 34px;
    }
    @media (max-width: 640px) {
      .qianfo-grid { grid-template-columns: repeat(4, 1fr); }
    }

    @media (max-width: 780px) {
      .home-layout, .archive-list, .evidence-pool, .cctv-grid, .np-columns, .np-classifieds { grid-template-columns: 1fr; }
      .np-col-main { border-right: none; padding-right: 0; border-bottom: 1px solid rgba(38,33,27,0.35); padding-bottom: 14px; }
      .timecode { display: none; }
      .detail-panel, .newspaper-sheet { padding: 20px; }
      .topbar { padding: 0 14px; }
      .top-actions { gap: 10px; }
      .nav-link { font-size: 13px; }
    }
