/* ============================================================
   CTF 赛历 · 视觉系统 v2「作战终端」
   近黑底 + 细网格 + 青色霓虹结构色，品红只留给「进行中」。
   签名元素：终端窗外壳的倒计时 Hero，月历里发光的时长缎带。
   ============================================================ */

:root {
    /* 底色层次 */
    --void: #05070a;
    --paper: #05070a;
    --surface: #0b1017;
    --surface-2: #0d131a;
    --surface-3: #111a23;

    /* 文本 */
    --ink: #dbe7f0;
    --ink-soft: #b3c3d2;
    --muted: #7c8da0;
    --faint: #526375;
    --ghost: #3a4756;

    /* 线条 */
    --rule: #212d3a;
    --rule-soft: #1c2734;
    --line-2: #2b3948;

    /* 强调色 */
    --cobalt: #20e3c6;
    --cobalt-weak: rgba(32, 227, 198, 0.10);
    --cobalt-mid: rgba(32, 227, 198, 0.22);
    --cobalt-glow: rgba(32, 227, 198, 0.45);
    --flare: #ff2d78;
    --flare-weak: rgba(255, 45, 120, 0.12);
    --amber: #ffb43d;

    --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "JetBrains Mono",
        "Roboto Mono", Consolas, "Liberation Mono", monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
        "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;

    --shell: 1220px;
    --pad: 28px;
    --radius: 4px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    color-scheme: dark;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background-color: var(--void);
    background-image:
        radial-gradient(1100px 520px at 50% -12%, rgba(32, 227, 198, 0.09), transparent 68%),
        radial-gradient(700px 420px at 88% 8%, rgba(255, 45, 120, 0.05), transparent 70%),
        linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 46px, 46px 100%;
    background-attachment: fixed, fixed, fixed, fixed;
}

/* 顶部扫描线 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    z-index: 120;
    background: linear-gradient(90deg, transparent, var(--cobalt), var(--flare), transparent);
    background-size: 220% 100%;
    opacity: 0.5;
    animation: topslide 9s linear infinite;
    pointer-events: none;
}

@keyframes topslide {
    from { background-position: 0% 0; }
    to { background-position: 220% 0; }
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

input,
select,
textarea {
    font: inherit;
    color: inherit;
}

::selection {
    background: var(--cobalt);
    color: #04110f;
}

:focus-visible {
    outline: 2px solid var(--cobalt);
    outline-offset: 2px;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--void);
}

::-webkit-scrollbar-thumb {
    background: #1d2833;
    border: 2px solid var(--void);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2b3a48;
}

.shell {
    width: 100%;
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 var(--pad);
}

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--faint);
}

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(5, 7, 10, 0.78);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    border-bottom: 1px solid var(--rule);
}

.topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(32, 227, 198, 0.35), transparent);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    height: 58px;
}

.brand,
.tab,
.ghost-link,
.topbar-friend {
    flex-shrink: 0;
}

.tab,
.ghost-link,
.topbar-friend {
    white-space: nowrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-mark {
    width: 22px;
    height: 22px;
    color: var(--cobalt);
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(32, 227, 198, 0.45));
}

.brand-cn {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.07em;
    padding-right: 1px;
    color: #eefaf8;
}

.brand-en {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--muted);
    text-transform: uppercase;
    padding-top: 1px;
    border-left: 1px solid var(--rule);
    padding-left: 10px;
    line-height: 1.35;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-left: 6px;
}

.tab {
    padding: 6px 12px;
    font-size: 13px;
    color: var(--muted);
    border-radius: 3px;
    border: 1px solid transparent;
    transition: color 0.16s, background 0.16s, border-color 0.16s;
}

.tab:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.035);
}

.tab[aria-selected="true"] {
    color: var(--cobalt);
    background: var(--cobalt-weak);
    border-color: rgba(32, 227, 198, 0.35);
    box-shadow: inset 0 0 18px -8px rgba(32, 227, 198, 0.6);
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ghost-link {
    font-size: 13px;
    color: var(--muted);
    padding: 6px 10px;
    border-radius: 3px;
    transition: color 0.16s, background 0.16s;
}

.ghost-link:hover {
    color: var(--cobalt);
    background: var(--cobalt-weak);
}

.ghost-link .mono {
    font-size: 10.5px;
    letter-spacing: 0.1em;
    margin-left: 5px;
    color: var(--ghost);
}

/* ---------------------------------------------------------------- 终端 Hero */
.hero {
    padding: 26px 0 6px;
    position: relative;
}

.term {
    position: relative;
    border: 1px solid var(--line-2);
    border-radius: 6px;
    background:
        radial-gradient(680px 220px at 12% -20%, rgba(32, 227, 198, 0.10), transparent 70%),
        linear-gradient(180deg, #0a1016, #070b10);
    box-shadow:
        0 0 0 1px rgba(32, 227, 198, 0.04),
        0 40px 90px -60px rgba(32, 227, 198, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.term-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--rule);
    background: rgba(255, 255, 255, 0.012);
}

.term-dots {
    display: flex;
    gap: 6px;
}

.term-dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22303c;
    display: block;
}

.term-dots i:first-child {
    background: rgba(255, 45, 120, 0.5);
}

.term-dots i:nth-child(2) {
    background: rgba(255, 180, 61, 0.45);
}

.term-dots i:nth-child(3) {
    background: rgba(32, 227, 198, 0.55);
}

.term-path {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--faint);
}

.term-status {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    color: var(--cobalt);
    text-transform: uppercase;
}

.term-status i {
    width: 15px;
    height: 1px;
    background: var(--cobalt);
    display: block;
    box-shadow: 0 0 6px var(--cobalt-glow);
}

.term-scan {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 46%;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(32, 227, 198, 0.055), transparent);
    animation: scan 7.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes scan {
    0% { transform: translateY(-60%); opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { transform: translateY(260%); opacity: 0; }
}

.term-body {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 36px;
    padding: 26px 26px 24px;
}

.hero-label {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--faint);
    margin-bottom: 12px;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-label .dash {
    width: 22px;
    height: 1px;
    background: linear-gradient(90deg, var(--cobalt), transparent);
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cobalt);
    box-shadow: 0 0 8px var(--cobalt-glow);
    flex-shrink: 0;
}

.hero.is-live .dot {
    background: var(--flare);
    box-shadow: 0 0 10px rgba(255, 45, 120, 0.7);
    animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 45, 120, 0.55); }
    70% { box-shadow: 0 0 0 10px rgba(255, 45, 120, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 45, 120, 0); }
}

.hero-title {
    font-size: clamp(21px, 2.7vw, 30px);
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 12px;
    letter-spacing: 0.01em;
    max-width: 32ch;
    color: #f0faf8;
    text-shadow: 0 0 34px rgba(32, 227, 198, 0.22);
}

.hero-title::after {
    content: "";
    display: inline-block;
    width: 9px;
    height: 1.02em;
    margin-left: 7px;
    vertical-align: -3px;
    background: var(--cobalt);
    box-shadow: 0 0 12px var(--cobalt-glow);
    animation: blink 1.15s step-end infinite;
}

.hero-empty .hero-title::after {
    display: none;
}

@keyframes blink {
    0%, 55% { opacity: 1; }
    56%, 100% { opacity: 0; }
}

.hero-meta {
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.03em;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0 13px;
}

.hero-meta .sep {
    color: var(--ghost);
}

.hero-meta strong {
    color: var(--cobalt);
    font-weight: 500;
    text-shadow: 0 0 16px rgba(32, 227, 198, 0.4);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 18px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--ink);
    border: 1px solid var(--line-2);
    background: rgba(255, 255, 255, 0.02);
    padding: 7px 13px;
    border-radius: 3px;
    transition: border-color 0.18s, color 0.18s, background 0.18s, gap 0.18s;
}

.hero-cta:hover {
    color: var(--cobalt);
    border-color: rgba(32, 227, 198, 0.5);
    background: var(--cobalt-weak);
    gap: 12px;
}

.countdown {
    display: flex;
    align-items: flex-end;
    gap: 13px;
    padding-bottom: 3px;
}

.cd-unit {
    text-align: left;
}

.cd-num {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: clamp(32px, 4.6vw, 50px);
    line-height: 0.92;
    font-weight: 500;
    letter-spacing: -0.03em;
    display: block;
    color: #edfdfa;
    text-shadow: 0 0 40px rgba(32, 227, 198, 0.35);
}

.hero.is-live .cd-num {
    color: #ffe9f1;
    text-shadow: 0 0 40px rgba(255, 45, 120, 0.45);
}

.cd-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--faint);
    margin-top: 8px;
    text-transform: uppercase;
}

.cd-note {
    text-align: right;
    padding-bottom: 6px;
}

.cd-note-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--faint);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.cd-note-value {
    font-family: var(--font-mono);
    font-size: clamp(24px, 3.4vw, 38px);
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--ink);
    text-shadow: 0 0 30px rgba(32, 227, 198, 0.3);
}

.cd-colon {
    font-family: var(--font-mono);
    font-size: clamp(16px, 2vw, 22px);
    color: rgba(32, 227, 198, 0.4);
    line-height: 1;
    padding-bottom: 20px;
}

.hero-empty .hero-title {
    color: var(--muted);
    font-weight: 400;
    text-shadow: none;
}

.hero-empty .term {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 40px 90px -60px rgba(0, 0, 0, 0.8);
}

/* ---------------------------------------------------------------- 主体布局 */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 296px;
    gap: 32px;
    padding: 22px 0 56px;
    align-items: start;
}

/* ---------------------------------------------------------------- 工具栏 */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.month-label {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0 6px 0 4px;
    min-width: 138px;
    color: #eaf6f4;
}

.month-label::before {
    content: "//";
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--cobalt);
    margin-right: 8px;
    letter-spacing: -0.04em;
    opacity: 0.8;
}

.month-label .yr {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--faint);
    font-weight: 400;
    letter-spacing: 0.08em;
    margin-right: 6px;
    vertical-align: 2px;
}

.icon-btn {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 3px;
    color: var(--muted);
    border: 1px solid transparent;
    transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.icon-btn:hover {
    background: var(--cobalt-weak);
    color: var(--cobalt);
    border-color: rgba(32, 227, 198, 0.3);
}

.pill-btn {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.08em;
    padding: 5px 11px;
    border: 1px solid var(--rule);
    border-radius: 40px;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.015);
    transition: border-color 0.16s, color 0.16s, background 0.16s;
}

.pill-btn:hover {
    border-color: rgba(32, 227, 198, 0.45);
    color: var(--cobalt);
    background: var(--cobalt-weak);
}

.toolbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search {
    position: relative;
    width: 208px;
}

.search input {
    width: 100%;
    height: 30px;
    padding: 0 10px 0 28px;
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--ink);
    font-size: 13px;
    transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.search input::placeholder {
    color: var(--ghost);
}

.search input:focus {
    outline: none;
    border-color: rgba(32, 227, 198, 0.55);
    background: rgba(32, 227, 198, 0.04);
    box-shadow: 0 0 0 3px rgba(32, 227, 198, 0.12);
}

.search svg {
    position: absolute;
    left: 9px;
    top: 9px;
    color: var(--faint);
    pointer-events: none;
}

.seg {
    display: flex;
    border: 1px solid var(--rule);
    border-radius: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.seg button {
    padding: 5px 10px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.06em;
    color: var(--muted);
    border-left: 1px solid var(--rule);
    transition: background 0.16s, color 0.16s;
    white-space: nowrap;
}

.seg button:first-child {
    border-left: 0;
}

.seg button:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
}

.seg button[aria-pressed="true"] {
    background: var(--cobalt);
    color: #04110f;
    font-weight: 500;
    box-shadow: 0 0 18px -4px rgba(32, 227, 198, 0.6);
}

/* ---------------------------------------------------------------- 日历 */
.calendar {
    position: relative;
    border: 1px solid var(--line-2);
    border-radius: 5px;
    background: linear-gradient(180deg, #0d131a, #080c12);
    overflow: hidden;
    box-shadow: 0 30px 80px -60px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

/* HUD 四角 */
.calendar::before,
.calendar::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-color: rgba(32, 227, 198, 0.5);
    border-style: solid;
    pointer-events: none;
    z-index: 4;
}

.calendar::before {
    left: 0;
    top: 0;
    border-width: 1px 0 0 1px;
}

.calendar::after {
    right: 0;
    bottom: 0;
    border-width: 0 1px 1px 0;
}

.cal-head {
    display: grid;
    grid-template-columns: 32px repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid var(--line-2);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012));
}

.cal-head .wk-label {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.12em;
    color: var(--faint);
    padding: 8px 0 8px 8px;
}

.cal-head .wd {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    color: var(--muted);
    padding: 8px 0 8px 8px;
    border-left: 1px solid var(--rule-soft);
}

.cal-head .wd.weekend {
    color: var(--faint);
    background: rgba(255, 255, 255, 0.012);
}

.week {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    border-bottom: 1px solid var(--rule-soft);
}

.week:last-child {
    border-bottom: 0;
}

.week-gutter {
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: var(--ghost);
    letter-spacing: 0;
    padding: 9px 0 0 5px;
    border-right: 1px solid var(--rule-soft);
    user-select: none;
    line-height: 1;
}

.week-body {
    position: relative;
    height: calc(80px + var(--lanes, 0) * 21px);
}

.week-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    height: 100%;
}

.day {
    position: relative;
    border-left: 1px solid var(--rule-soft);
    padding: 7px 6px 0;
    transition: background 0.18s;
}

.day:hover {
    background: rgba(32, 227, 198, 0.035);
}

.day:first-child {
    border-left: 0;
}

.day.is-out {
    background: rgba(0, 0, 0, 0.22);
}

.day.is-weekend {
    background: rgba(255, 255, 255, 0.013);
}

.day.is-out.is-weekend {
    background: rgba(0, 0, 0, 0.28);
}

.day-num {
    display: inline-grid;
    place-items: center;
    min-width: 19px;
    height: 17px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
}

.day.is-out .day-num {
    color: #33414f;
}

.day.is-today .day-num {
    background: var(--cobalt);
    color: #04110f;
    border-radius: 2px;
    font-weight: 600;
    box-shadow: 0 0 14px rgba(32, 227, 198, 0.55);
}

/* 今日取景框 */
.day.is-today::before,
.day.is-today::after {
    content: "";
    position: absolute;
    width: 9px;
    height: 9px;
    border-color: var(--cobalt);
    border-style: solid;
    opacity: 0.75;
    pointer-events: none;
}

.day.is-today::before {
    left: 3px;
    top: 3px;
    border-width: 1px 0 0 1px;
}

.day.is-today::after {
    right: 3px;
    bottom: 3px;
    border-width: 0 1px 1px 0;
}

.day-marker {
    display: none;
}

/* 缎带层 */
.week-ribbons {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ribbon {
    position: absolute;
    height: 18px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 6px 0 6px;
    background: linear-gradient(90deg, rgba(32, 227, 198, 0.20), rgba(32, 227, 198, 0.07));
    border-left: 2px solid var(--cobalt);
    border-radius: 2px;
    font-size: 12px;
    line-height: 1;
    color: #c8f5ee;
    white-space: nowrap;
    overflow: hidden;
    pointer-events: auto;
    cursor: pointer;
    transition: background 0.16s, box-shadow 0.16s, transform 0.16s, color 0.16s;
}

.ribbon:hover {
    background: linear-gradient(90deg, rgba(32, 227, 198, 0.34), rgba(32, 227, 198, 0.16));
    box-shadow: 0 0 0 1px rgba(32, 227, 198, 0.5), 0 0 22px -6px rgba(32, 227, 198, 0.7);
    color: #eafffb;
    z-index: 3;
}

.ribbon .r-title {
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.ribbon .r-dur {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    color: var(--cobalt);
    opacity: 0.85;
    flex-shrink: 0;
    padding-left: 4px;
}

.ribbon.cut-l {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left-width: 0;
    padding-left: 9px;
}

.ribbon.cut-r {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.ribbon.cut-l::before,
.ribbon.cut-r::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    border-top: 1px dashed rgba(32, 227, 198, 0.45);
    border-bottom: 1px dashed rgba(32, 227, 198, 0.45);
}

.ribbon.cut-l::before {
    left: 0;
    border-left: 1px dashed rgba(32, 227, 198, 0.45);
}

.ribbon.cut-r::after {
    right: 0;
    border-right: 1px dashed rgba(32, 227, 198, 0.45);
}

.ribbon.is-past {
    background: rgba(255, 255, 255, 0.028);
    border-left-color: #2a3744;
    color: #5b6b7b;
}

.ribbon.is-past .r-dur {
    color: #4a5866;
}

.ribbon.is-live {
    background: linear-gradient(90deg, rgba(255, 45, 120, 0.85), rgba(255, 45, 120, 0.5));
    border-left-color: #ff6b9d;
    color: #fff;
    box-shadow: 0 0 20px -6px rgba(255, 45, 120, 0.9);
}

.ribbon.is-live .r-dur {
    color: rgba(255, 255, 255, 0.85);
}

.ribbon.is-live:hover {
    background: linear-gradient(90deg, rgba(255, 45, 120, 1), rgba(255, 45, 120, 0.7));
    box-shadow: 0 0 0 1px rgba(255, 45, 120, 0.7), 0 0 26px -6px rgba(255, 45, 120, 1);
}

.ribbon.is-onsite {
    border-left-style: double;
    border-left-width: 4px;
    border-left-color: var(--amber);
}

.ribbon.is-onsite.is-live {
    border-left-color: #ffd08a;
}

.more-btn {
    position: absolute;
    left: 6px;
    height: 18px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--rule);
    border-radius: 2px;
    padding: 0 7px;
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    transition: color 0.16s, border-color 0.16s, background 0.16s;
}

.more-btn:hover {
    color: var(--cobalt);
    border-color: rgba(32, 227, 198, 0.5);
    background: var(--cobalt-weak);
}

.cal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 12px;
    border-top: 1px solid var(--line-2);
    background: rgba(255, 255, 255, 0.012);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--faint);
}

.cal-foot .legend {
    display: flex;
    align-items: center;
    gap: 14px;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend i {
    width: 9px;
    height: 9px;
    border-radius: 1px;
    display: inline-block;
}

.legend .k-up {
    background: rgba(32, 227, 198, 0.22);
    border-left: 2px solid var(--cobalt);
}

.legend .k-live {
    background: var(--flare);
    box-shadow: 0 0 8px rgba(255, 45, 120, 0.6);
}

.legend .k-past {
    background: rgba(255, 255, 255, 0.08);
}

/* ---------------------------------------------------------------- 列表视图 */
.list {
    border: 1px solid var(--line-2);
    border-radius: 5px;
    background: var(--surface);
    overflow: hidden;
    overflow: clip;
    box-shadow: 0 24px 70px -60px rgba(0, 0, 0, 0.9);
}

.list-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line-2);
    background: rgba(255, 255, 255, 0.028);
    position: sticky;
    top: 58px;
    z-index: 3;
    backdrop-filter: blur(8px);
}

.list-month {
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.12em;
    color: var(--cobalt);
}

.list-count {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--faint);
    letter-spacing: 0.06em;
}

.row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--rule-soft);
    cursor: pointer;
    transition: background 0.14s;
}

.row:last-child {
    border-bottom: 0;
}

.row:hover {
    background: rgba(32, 227, 198, 0.045);
}

.row-date {
    text-align: left;
    border-left: 2px solid var(--rule);
    padding-left: 10px;
}

.row.is-live .row-date {
    border-left-color: var(--flare);
    box-shadow: -1px 0 12px -4px rgba(255, 45, 120, 0.9);
}

.row.is-past .row-date {
    border-left-color: #2a3744;
}

.row-day {
    display: block;
    font-family: var(--font-mono);
    font-size: 19px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.row-wd {
    display: block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.1em;
    color: var(--faint);
    margin-top: 2px;
}

.row-main {
    min-width: 0;
}

.row-title {
    font-size: 14px;
    font-weight: 500;
    color: #dfeef7;
    margin: 0 0 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.14s;
}

.row:hover .row-title {
    color: var(--cobalt);
}

.row.is-past .row-title {
    color: var(--muted);
}

.row-sub {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--muted);
    letter-spacing: 0.02em;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.row-sub .sep {
    color: var(--ghost);
}

.row-side {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chip {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid var(--rule);
    color: var(--muted);
    white-space: nowrap;
}

.chip.solid {
    background: var(--cobalt);
    border-color: var(--cobalt);
    color: #04110f;
}

.chip.live {
    background: var(--flare-weak);
    border-color: rgba(255, 45, 120, 0.5);
    color: #ff6b9d;
    box-shadow: 0 0 14px -6px rgba(255, 45, 120, 0.9);
}

.arrow {
    color: var(--ghost);
    transition: transform 0.16s, color 0.16s;
}

.row:hover .arrow {
    color: var(--cobalt);
    transform: translateX(2px);
}

/* ---------------------------------------------------------------- 右侧栏 */
.rail {
    position: sticky;
    top: 74px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rail-card {
    position: relative;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.008));
    padding: 14px;
}

.rail-card::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 14px;
    width: 2px;
    height: 16px;
    background: var(--cobalt);
    box-shadow: 0 0 10px var(--cobalt-glow);
}

.rail-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 11px;
}

.rail-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--ink);
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
    border-radius: 3px;
    overflow: hidden;
}

.stat {
    background: #080c11;
    padding: 9px 10px;
}

.stat b {
    display: block;
    font-family: var(--font-mono);
    font-size: 21px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--cobalt);
    text-shadow: 0 0 22px rgba(32, 227, 198, 0.35);
}

.stat span {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    color: var(--faint);
    text-transform: uppercase;
}

.mini {
    display: flex;
    gap: 9px;
    padding: 8px 0;
    border-top: 1px solid var(--rule-soft);
    cursor: pointer;
}

.mini:first-of-type {
    border-top: 0;
    padding-top: 2px;
}

.mini:hover .mini-title {
    color: var(--cobalt);
}

.mini-when {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.04em;
    color: var(--faint);
    flex-shrink: 0;
    width: 38px;
    padding-top: 2px;
}

.mini-title {
    font-size: 13px;
    line-height: 1.45;
    color: var(--ink-soft);
    transition: color 0.14s;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.rail-note {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.75;
    margin: 0;
}

.rail-note a {
    color: var(--cobalt);
    border-bottom: 1px solid var(--cobalt-mid);
}

.rail-note .mono {
    font-size: 11px;
    color: var(--faint);
}

/* ---------------------------------------------------------------- 详情抽屉 */
.scrim {
    position: fixed;
    inset: 0;
    background: rgba(2, 4, 6, 0.62);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s;
    z-index: 60;
}

.scrim.on {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(430px, 100vw);
    background: #080c11;
    border-left: 1px solid var(--line-2);
    z-index: 61;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.22, 0.9, 0.28, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -30px 0 80px -40px rgba(0, 0, 0, 0.9);
}

.drawer::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(32, 227, 198, 0.6), rgba(32, 227, 198, 0.05) 40%, transparent);
}

.drawer.on {
    transform: translateX(0);
}

.drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--rule);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.02);
}

.drawer-top .eyebrow {
    color: var(--faint);
}

.drawer-body {
    padding: 20px 20px 30px;
    overflow-y: auto;
    flex: 1;
}

.drawer-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 2px;
    background: var(--cobalt-weak);
    border: 1px solid rgba(32, 227, 198, 0.3);
    color: var(--cobalt);
    margin-bottom: 12px;
}

.drawer-status.live {
    background: var(--flare-weak);
    border-color: rgba(255, 45, 120, 0.45);
    color: #ff6b9d;
    box-shadow: 0 0 18px -8px rgba(255, 45, 120, 0.8);
}

.drawer-title {
    font-size: 21px;
    line-height: 1.4;
    font-weight: 600;
    margin: 0 0 18px;
    letter-spacing: 0.01em;
    color: #eef9f7;
}

.spec {
    border-top: 1px solid var(--rule-soft);
    margin-bottom: 18px;
}

.spec-row {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--rule-soft);
}

.spec-row dt {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ghost);
    padding-top: 3px;
}

.spec-row dd {
    margin: 0;
    font-size: 13px;
    line-height: 1.65;
    color: var(--ink-soft);
}

.spec-row dd.mono {
    font-size: 12.5px;
    letter-spacing: 0.01em;
    color: var(--ink);
}

.desc {
    font-size: 13px;
    line-height: 1.8;
    color: var(--muted);
    white-space: pre-line;
    border-left: 1px solid var(--rule);
    padding-left: 12px;
    margin: 0 0 8px;
}

.desc.clamped {
    max-height: 196px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}

.desc-toggle {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.06em;
    color: var(--cobalt);
    padding: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--cobalt-mid);
}

.desc-toggle:hover {
    border-color: var(--cobalt);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 22px;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 16px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background 0.16s, border-color 0.16s, color 0.16s, box-shadow 0.16s;
}

.btn-primary {
    background: var(--cobalt);
    color: #04110f;
    box-shadow: 0 0 24px -8px rgba(32, 227, 198, 0.9);
}

.btn-primary:hover {
    background: #4bf0d8;
    box-shadow: 0 0 30px -6px rgba(32, 227, 198, 1);
}

.btn-line {
    border-color: var(--line-2);
    background: rgba(255, 255, 255, 0.02);
    color: var(--ink-soft);
}

.btn-line:hover {
    border-color: rgba(32, 227, 198, 0.45);
    color: var(--cobalt);
    background: rgba(32, 227, 198, 0.06);
}

/* ---------------------------------------------------------------- 空状态 */
.empty {
    padding: 52px 20px;
    text-align: center;
}

.empty-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 6px;
    color: var(--ink);
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}

.empty-hint {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 16px;
}

.empty-hint .mono {
    font-size: 12px;
}

/* ---------------------------------------------------------------- 页脚 */
.footer {
    border-top: 1px solid var(--rule);
    padding: 18px 0 30px;
}

.footer-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--ghost);
}

.footer-inner a {
    color: var(--muted);
    border-bottom: 1px solid var(--rule);
    padding-bottom: 1px;
    transition: color 0.16s, border-color 0.16s;
}

.footer-inner a:hover {
    color: var(--cobalt);
    border-color: rgba(32, 227, 198, 0.5);
}

.footer-inner .push {
    margin-left: auto;
}

.topbar-friend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 4px;
    padding: 4px 9px 4px 8px;
    border: 1px solid var(--rule);
    border-radius: 40px;
    font-size: 12px;
    color: var(--muted);
    transition: color 0.16s, border-color 0.16s, background 0.16s;
}

.topbar-friend:hover {
    color: var(--cobalt);
    border-color: rgba(32, 227, 198, 0.45);
    background: var(--cobalt-weak);
}

.ff-tag {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    color: var(--faint);
    transition: color 0.16s;
}

.topbar-friend:hover .ff-tag {
    color: rgba(32, 227, 198, 0.75);
}

.ff-name {
    white-space: nowrap;
}

.ff-arrow {
    font-size: 11px;
    line-height: 1;
    opacity: 0.6;
}

.foot-views {
    color: var(--faint);
    letter-spacing: 0.04em;
}

.foot-views::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--cobalt);
    margin-right: 6px;
    vertical-align: 1px;
    box-shadow: 0 0 8px var(--cobalt-glow);
}

/* ---------------------------------------------------------------- 动效 */
.reveal {
    animation: rise 0.45s cubic-bezier(0.22, 0.9, 0.28, 1) both;
}

.week {
    animation: rise 0.4s cubic-bezier(0.22, 0.9, 0.28, 1) both;
}

.week:nth-child(2) { animation-delay: 0.03s; }
.week:nth-child(3) { animation-delay: 0.06s; }
.week:nth-child(4) { animation-delay: 0.09s; }
.week:nth-child(5) { animation-delay: 0.12s; }
.week:nth-child(6) { animation-delay: 0.15s; }
.week:nth-child(7) { animation-delay: 0.18s; }

/* 首次加载：标题做一次轻微信号错位 */
.booting .hero-title {
    animation: glitch 0.72s cubic-bezier(0.2, 0.9, 0.3, 1) 1 both;
}

@keyframes glitch {
    0% {
        text-shadow: 2px 0 rgba(255, 45, 120, 0.75), -2px 0 rgba(32, 227, 198, 0.75);
        transform: translateX(1px);
    }

    18% {
        text-shadow: -3px 0 rgba(255, 45, 120, 0.7), 3px 0 rgba(32, 227, 198, 0.7);
        transform: translateX(-2px);
    }

    36% {
        text-shadow: 2px 0 rgba(255, 45, 120, 0.55), -2px 0 rgba(32, 227, 198, 0.55);
        transform: translateX(1px);
    }

    54% {
        text-shadow: -1px 0 rgba(255, 45, 120, 0.4), 1px 0 rgba(32, 227, 198, 0.4);
        transform: none;
    }

    100% {
        text-shadow: 0 0 34px rgba(32, 227, 198, 0.22);
        transform: none;
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .term-scan {
        display: none;
    }
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1080px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }

    .rail {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .rail-card {
        flex: 1 1 260px;
    }
}

@media (max-width: 780px) {
    :root {
        --pad: 16px;
    }

    .topbar-inner {
        height: 52px;
        gap: 8px;
    }

    .tab {
        padding: 5px 9px;
        font-size: 12.5px;
    }

    .ghost-link {
        padding: 6px 7px;
        font-size: 12px;
    }

    .tabs {
        gap: 2px;
        margin-left: 2px;
    }

    .brand-en {
        display: none;
    }

    .tabs {
        margin-left: 0;
    }

    .topbar-right .hide-sm {
        display: none;
    }

    .topbar-friend {
        padding: 4px 8px;
        gap: 4px;
    }

    .topbar-friend .ff-name {
        display: none;
    }

    .hero {
        padding-top: 16px;
    }

    .term-body {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding: 20px 16px 18px;
    }

    .term-path {
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .countdown {
        gap: 9px;
    }

    .cd-num {
        font-size: 32px;
    }

    .cd-colon {
        padding-bottom: 16px;
    }

    .week-gutter {
        display: none;
    }

    .cal-head {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .cal-head .wk-label {
        display: none;
    }

    .week {
        grid-template-columns: minmax(0, 1fr);
    }

    .cal-head .wd {
        padding-left: 4px;
        font-size: 10px;
        letter-spacing: 0.1em;
    }

    .week-body {
        height: calc(64px + var(--lanes, 0) * 19px);
    }

    .ribbon {
        height: 16px;
        font-size: 11px;
        padding-left: 4px;
    }

    .ribbon .r-dur {
        display: none;
    }

    .more-btn {
        height: 16px;
    }

    .row {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 12px;
    }

    .row-side {
        display: none;
    }

    .row-sub .sep {
        display: none;
    }

    .row-sub {
        gap: 4px 10px;
    }

    .toolbar-right {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
        gap: 8px;
    }

    .search {
        flex: 1 1 100%;
    }

    .seg {
        flex: 0 0 auto;
    }

    .footer-inner .push {
        margin-left: 0;
    }
}

@media (max-width: 340px) {
    .topbar-friend {
        display: none;
    }
}
