:root {
      --bg: #08070c;
      --rail: #0c0a11;
      --ink: #f5f1f8;
      --soft: #beb5c7;
      --dim: #7d7489;
      --line: #292331;
      --line-soft: #1b1721;
      --panel: #100d16;
      --panel-bright: #15111d;
      --pink: #ff3f8e;
      --cyan: #6ee9f5;
      --gold: #ffc96e;
      --green: #78e7a8;
      --red: #ff7a8f;
      --rail-width: 204px;
    }
    * { box-sizing: border-box; }
    body {
      min-width: 320px; margin: 0; color: var(--ink); background: var(--bg);
      font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    }
    button { font: inherit; cursor: pointer; }
    .shell { min-height: 100vh; display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); }
    .rail {
      position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
      padding: 20px 12px 14px; background: var(--rail); border-right: 1px solid var(--line);
    }
    .mark { padding: 5px 10px 24px; border-bottom: 1px solid var(--line); }
    .mark-top { color: var(--cyan); font-size: 10px; letter-spacing: .18em; }
    .mark-name { margin-top: 7px; font-size: 17px; font-weight: 900; letter-spacing: .05em; }
    .mark-name span { color: var(--pink); }
    .mark-sub { margin-top: 5px; color: var(--dim); font-size: 10px; letter-spacing: .1em; }
    .nav { display: grid; gap: 3px; padding-top: 18px; }
    .nav button {
      width: 100%; min-height: 39px; display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 9px;
      padding: 0 10px; border: 1px solid transparent; border-radius: 6px; color: var(--soft); background: transparent; text-align: left; font-size: 12px;
    }
    .nav button:hover { color: var(--ink); background: #16121d; }
    .nav button.active { color: var(--ink); background: #26101c; border-color: #6c294a; }
    .nav-indicator { width: 7px; height: 7px; border: 1px solid currentColor; transform: rotate(45deg); }
    .nav button.active .nav-indicator { background: var(--pink); border-color: var(--pink); }
    .nav-badge { min-width: 19px; padding: 2px 5px; border: 1px solid #5c4929; border-radius: 99px; color: var(--gold); font-size: 10px; text-align: center; }
    .rail-rule { margin: 20px 10px 10px; color: var(--dim); font-size: 10px; letter-spacing: .12em; }
    .rail-mini { padding: 11px 10px; margin: 0 0 2px; border: 0; border-radius: 6px; color: var(--soft); background: transparent; font-size: 11px; text-align: left; }
    .rail-mini:hover { color: var(--ink); background: #16121d; }
    .operator { margin-top: auto; padding: 12px 10px; border-top: 1px solid var(--line); }
    .operator-row { display: flex; align-items: center; gap: 8px; }
    .operator-chip { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #70542e; border-radius: 5px; color: var(--gold); font-size: 12px; font-weight: 900; }
    .operator b { display: block; font-size: 11px; }
    .operator small { display: block; margin-top: 2px; color: var(--dim); font-size: 10px; }
    main { min-width: 0; padding: 23px 28px 42px; }
    .command-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
    .header-kicker { color: var(--cyan); font-size: 10px; letter-spacing: .19em; }
    h1 { margin: 6px 0 0; font-size: 24px; letter-spacing: .03em; }
    .header-copy { margin-top: 6px; color: var(--dim); font-size: 12px; }
    .header-right { display: flex; align-items: center; gap: 12px; padding-top: 3px; }
    .data-clock { color: var(--dim); font-family: Consolas, monospace; font-size: 10px; white-space: nowrap; }
    .header-button, .small-button, .command-button {
      min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--soft); background: var(--panel); font-size: 11px;
    }
    .header-button:hover, .small-button:hover, .command-button:hover { color: var(--ink); border-color: var(--cyan); }
    .header-button.primary, .command-button.primary { color: #fff; border-color: #9a275c; background: #3e132a; }
    .telemetry { display: grid; grid-template-columns: 1.2fr repeat(3, .8fr); border: 1px solid var(--line); background: var(--panel); }
    .telemetry > div { min-height: 66px; padding: 12px 15px; border-right: 1px solid var(--line); }
    .telemetry > div:last-child { border-right: 0; }
    .telemetry label { display: block; color: var(--dim); font-size: 10px; letter-spacing: .1em; }
    .telemetry strong { display: block; margin-top: 8px; font-size: 18px; }
    .telemetry .operation-state { display: flex; align-items: center; gap: 9px; }
    .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(120,231,168,.1); }
    .telemetry small { color: var(--soft); font-size: 11px; font-weight: 500; }
    .command-grid { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(440px, 1.55fr) minmax(250px, .85fr); gap: 12px; margin-top: 12px; }
    .module { min-width: 0; border: 1px solid var(--line); background: var(--panel); }
    .module-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; padding: 0 13px; border-bottom: 1px solid var(--line); }
    .module-head h2 { margin: 0; font-size: 13px; letter-spacing: .04em; }
    .module-head h2::before { content: ""; display: inline-block; width: 5px; height: 13px; margin-right: 8px; vertical-align: -2px; background: var(--pink); }
    .module-meta { color: var(--dim); font-size: 10px; white-space: nowrap; }
    .priority { grid-row: span 2; }
    .priority-list { padding: 0 12px; }
    .priority-item { padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
    .priority-item:last-child { border-bottom: 0; }
    .priority-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
    .priority-top b { font-size: 12px; line-height: 1.45; }
    .severity { flex: none; padding: 3px 6px; border: 1px solid #7e313f; border-radius: 99px; color: var(--red); font-size: 9px; }
    .severity.gold { border-color: #745832; color: var(--gold); }
    .severity.cyan { border-color: #2d6974; color: var(--cyan); }
    .priority-item p { margin: 7px 0 11px; color: var(--dim); font-size: 11px; line-height: 1.55; }
    .priority-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .priority-foot span { color: var(--soft); font-size: 10px; }
    .text-action { border: 0; padding: 0; color: var(--cyan); background: transparent; font-size: 11px; }
    .text-action:hover { color: #fff; text-decoration: underline; }
    .flow { margin: 12px; padding: 12px; border: 1px solid var(--line); background: #0d0a12; }
    .flow-title { color: var(--soft); font-size: 10px; letter-spacing: .1em; }
    .flow-track { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
    .flow-node { position: relative; display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; color: var(--dim); font-size: 10px; }
    .flow-node.done { border-color: #327058; color: var(--green); }
    .flow-node.warn { border-color: #79592d; color: var(--gold); }
    .flow-line { height: 1px; flex: 1; background: var(--line); }
    .flow-labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; color: var(--dim); font-size: 9px; text-align: center; }
    .stage { position: relative; overflow: hidden; min-height: 386px; background: #0d0b12; }
    .stage::before { content: ""; position: absolute; inset: 50px 0 0; opacity: .15; background: url("./bg-zap-map.webp") center/cover; }
    .stage-content { position: relative; display: grid; min-height: 386px; grid-template-rows: auto 1fr auto; }
    .stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.13); }
    .stage-kicker { color: var(--gold); font-size: 10px; letter-spacing: .14em; }
    .stage-time { color: var(--soft); font-family: Consolas, monospace; font-size: 11px; }
    .match-board { display: grid; grid-template-columns: 1fr 54px 1fr; align-items: center; gap: 13px; max-width: 590px; width: 100%; margin: auto; padding: 26px 24px; }
    .side { min-width: 0; text-align: center; }
    .side-logo { width: 74px; height: 74px; margin: 0 auto 11px; border: 1px solid #5e4164; border-radius: 7px; object-fit: cover; background: #16101e; }
    .side-logo.tbd { display: grid; place-items: center; color: var(--gold); font-size: 29px; font-weight: 800; }
    .side-name { font-size: 16px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .side-detail { margin-top: 5px; color: var(--soft); font-size: 10px; }
    .vs { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid #6e2750; border-radius: 50%; color: var(--pink); background: rgba(40,10,27,.72); font-size: 12px; font-weight: 900; }
    .stage-foot { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.13); background: rgba(8,7,12,.72); }
    .stage-foot span { color: var(--soft); font-size: 11px; line-height: 1.5; }
    .pulse-list { padding: 4px 13px 11px; }
    .pulse-row { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 9px; min-height: 47px; border-bottom: 1px solid var(--line-soft); }
    .pulse-row:last-child { border-bottom: 0; }
    .pulse-led { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
    .pulse-led.gold { background: var(--gold); }
    .pulse-led.pink { background: var(--pink); }
    .pulse-copy b { display: block; font-size: 11px; }
    .pulse-copy small { display: block; margin-top: 3px; color: var(--dim); font-size: 10px; }
    .pulse-value { color: var(--soft); font-family: Consolas, monospace; font-size: 11px; }
    .quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 13px; }
    .quick-grid button { min-height: 48px; padding: 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--soft); background: #0d0a12; font-size: 10px; text-align: left; }
    .quick-grid button:hover { color: var(--ink); border-color: var(--pink); }
    .quick-grid b { display: block; margin-bottom: 4px; color: var(--ink); font-size: 11px; }
    .feed { grid-column: 2 / 4; }
    .day-tabs { display: flex; align-items: stretch; gap: 0; }
    .day-tabs button { min-height: 49px; padding: 0 14px; border: 0; border-left: 1px solid var(--line); color: var(--dim); background: transparent; font-size: 11px; }
    .day-tabs button.active { color: var(--ink); background: #1c1321; box-shadow: inset 0 -2px var(--pink); }
    .feed-list { padding: 0 13px; }
    .feed-row { display: grid; grid-template-columns: 62px minmax(180px, 1fr) minmax(120px, .65fr) auto; gap: 12px; align-items: center; min-height: 60px; border-bottom: 1px solid var(--line-soft); }
    .feed-row:last-child { border-bottom: 0; }
    .feed-time b { display: block; color: var(--gold); font-size: 13px; }
    .feed-time span { display: block; margin-top: 4px; color: var(--dim); font-size: 9px; }
    .feed-match { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 800; }
    .feed-match em { padding: 0 6px; color: var(--dim); font-size: 10px; font-style: normal; }
    .feed-type { color: var(--soft); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .state { display: inline-flex; justify-content: center; min-width: 59px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--dim); font-size: 9px; }
    .state.wait { border-color: #745832; color: var(--gold); }
    .state.ready { border-color: #2e6f7a; color: var(--cyan); }
    .state.lock { border-color: #326c53; color: var(--green); }
    .context-drawer { grid-column: 1 / -1; display: none; border: 1px solid #533044; background: #160d18; }
    .context-drawer[data-open="true"] { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 16px; }
    .drawer-kicker { color: var(--cyan); font-size: 10px; letter-spacing: .14em; }
    .drawer-title { margin-top: 5px; font-size: 14px; font-weight: 900; }
    .drawer-copy { margin-top: 5px; color: var(--soft); font-size: 11px; line-height: 1.55; }
    .toast { position: fixed; right: 22px; bottom: 22px; z-index: 4; max-width: 330px; padding: 11px 13px; border: 1px solid #2f7564; border-radius: 6px; color: var(--ink); background: #0e211b; font-size: 11px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
    .toast.show { opacity: 1; transform: translateY(0); }
    .local-note { margin-top: 15px; color: var(--dim); font-size: 10px; text-align: right; letter-spacing: .06em; }
    @media (max-width: 1220px) {
      :root { --rail-width: 68px; }
      .rail { padding: 18px 8px 12px; }
      .mark { padding: 5px 7px 19px; }
      .mark-top, .mark-name, .mark-sub, .nav button span:not(.nav-indicator):not(.nav-badge), .rail-rule, .rail-mini, .operator div:not(.operator-chip) { display: none; }
      .nav button { grid-template-columns: 1fr auto; justify-items: center; padding: 0; }
      .operator { display: grid; place-items: center; padding: 12px 0; }
      .command-grid { grid-template-columns: minmax(270px, .85fr) minmax(430px, 1.45fr); }
      .pulse { grid-column: 1 / -1; }
      .pulse-wrap { display: grid; grid-template-columns: 1fr 1fr; }
      .feed { grid-column: 1 / -1; }
    }
    @media (max-width: 790px) {
      .shell { display: block; }
      .rail { position: static; height: auto; display: block; padding: 11px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
      .mark, .operator { display: none; }
      .nav { display: flex; overflow-x: auto; padding: 0; }
      .nav button { min-width: 90px; display: flex; justify-content: center; gap: 6px; padding: 0 8px; }
      .nav button span:not(.nav-indicator):not(.nav-badge) { display: block; }
      main { padding: 17px 13px 28px; }
      .command-header { display: block; }
      .header-right { margin-top: 14px; justify-content: space-between; }
      .telemetry { grid-template-columns: 1fr 1fr; }
      .telemetry > div:nth-child(2) { border-right: 0; }
      .telemetry > div:nth-child(n+3) { border-top: 1px solid var(--line); }
      .command-grid { grid-template-columns: 1fr; }
      .priority, .feed { grid-column: auto; grid-row: auto; }
      .pulse { grid-column: auto; }
      .pulse-wrap { display: block; }
      .feed-row { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 8px; }
      .feed-type { display: none; }
      .match-board { padding: 21px 14px; }
      .context-drawer[data-open="true"] { grid-template-columns: 1fr; }
    }
