:root {
    --night-bg: #0c0a0d;
    --night-panel: #171116;
    --night-panel-raised: #21161d;
    --night-line: rgba(255, 234, 238, .12);
    --night-line-strong: rgba(252, 89, 110, .42);
    --night-text: #f8f1f2;
    --night-muted: #aa969b;
    --night-dim: #75646a;
    --night-red: #ec3f5b;
    --night-red-light: #ff6378;
    --night-gold: #e7b76f;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--night-bg); }

body.night-page {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse 70% 38% at 8% -3%, rgba(157, 28, 54, .25), transparent 68%),
        radial-gradient(ellipse 44% 25% at 95% 8%, rgba(127, 21, 45, .18), transparent 72%),
        linear-gradient(180deg, #151014 0, #0c0a0d 39%, #0a090b 100%);
    color: var(--night-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.night-page::before {
    position: fixed;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,.07) .7px, transparent .7px);
    background-size: 5px 5px;
    opacity: .13;
    content: "";
}

.night-shell {
    position: relative;
    z-index: 1;
    width: min(1220px, calc(100% - 40px));
    margin: 0 auto;
    padding: 22px 0 42px;
}

.night-header,
.night-header-actions,
.night-brand,
.night-intro,
.night-section-heading,
.night-search,
.night-pagination,
.night-page-jump,
.night-footer,
.night-crumb,
.night-meta,
.night-line-list,
.night-episode-list { display: flex; }

.night-header {
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.night-brand {
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
}

.night-brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 150, 162, .68);
    border-radius: 13px;
    background: linear-gradient(145deg, #fb5d72, #941d37);
    box-shadow: 0 7px 21px rgba(0, 0, 0, .32), inset 0 1px rgba(255,255,255,.31);
    color: #fff;
    font: 800 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.night-brand strong { display: block; font-size: 17px; letter-spacing: .05em; }
.night-brand small { display: block; margin-top: 2px; color: #af969c; font: 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; }

.night-header-actions { align-items: center; gap: 10px; }

.night-forum-link,
.night-age-badge {
    border: 1px solid var(--night-line);
    border-radius: 9px;
    padding: 8px 11px;
    color: #e5d8da;
    font-size: 12px;
    text-decoration: none;
}

.night-forum-link { transition: border-color .18s ease, background-color .18s ease, color .18s ease; }
.night-forum-link:hover { border-color: var(--night-line-strong); background: rgba(236, 63, 91, .09); color: #fff; }
.night-age-badge { border-color: rgba(231, 183, 111, .32); background: rgba(231, 183, 111, .08); color: #f3c879; font-weight: 700; }

.night-intro {
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 176px;
    margin-top: 23px;
    overflow: hidden;
    border: 1px solid var(--night-line);
    border-radius: 22px;
    background: linear-gradient(115deg, rgba(45, 20, 28, .96), rgba(27, 17, 22, .95) 50%, rgba(69, 20, 35, .9));
    box-shadow: 0 20px 48px rgba(0, 0, 0, .2), inset 0 1px rgba(255,255,255,.035);
    padding: 32px 42px;
}

.night-intro > div { position: relative; z-index: 1; }
.night-intro::after {
    width: 284px;
    height: 284px;
    flex: 0 0 auto;
    margin: -129px -77px -129px 0;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    box-shadow: 0 0 0 37px rgba(255,255,255,.025), 0 0 0 78px rgba(255,255,255,.018);
    content: "";
}

.night-eyebrow,
.night-section-heading p {
    margin: 0;
    color: var(--night-gold);
    font: 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .16em;
}

.night-intro h1 { margin: 8px 0 7px; font-size: 38px; line-height: 1.08; letter-spacing: .08em; }
.night-intro p:not(.night-eyebrow) { margin: 0; color: #cdbcc0; font-size: 14px; }

.night-search {
    position: relative;
    z-index: 1;
    width: min(100%, 387px);
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(255, 237, 239, .15);
    border-radius: 12px;
    background: rgba(10, 7, 9, .54);
    box-shadow: inset 0 1px rgba(255,255,255,.04);
    padding: 4px 5px 4px 14px;
}

.night-search svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: #ae8e95; stroke-width: 1.8; }
.night-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font: 14px inherit; }
.night-search input::placeholder { color: #816e74; }
.night-search button,
.night-page-jump button {
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #dd3652, #a4223b);
    box-shadow: 0 5px 13px rgba(121, 19, 43, .27);
    padding: 9px 18px;
    color: #fff;
    font: 700 13px inherit;
    cursor: pointer;
    transition: transform .18s ease, filter .18s ease;
}

.night-search button:hover,
.night-page-jump button:hover { filter: brightness(1.1); transform: translateY(-1px); }

.night-results { margin-top: 29px; }
.night-section-heading { align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 15px; }
.night-section-heading h2 { margin: 4px 0 0; font-size: 22px; }
.night-section-heading > span { color: var(--night-muted); font-size: 12px; white-space: nowrap; }

.night-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 19px 18px;
}

.night-card { min-width: 0; color: inherit; text-decoration: none; }
.night-cover {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border: 1px solid rgba(255,255,255,.115);
    border-radius: 13px;
    background: #21131a;
    box-shadow: 0 11px 23px rgba(0,0,0,.25);
}

.night-cover::after {
    position: absolute;
    inset: auto 0 0;
    height: 38%;
    background: linear-gradient(transparent, rgba(6,4,5,.48));
    pointer-events: none;
    content: "";
}

.night-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.night-cover--empty { background: linear-gradient(153deg, #5d2636, #22121a 55%, #35151f); }
.night-cover--empty > span { position: absolute; top: 12%; right: 11%; width: 41%; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; box-shadow: 0 0 0 15px rgba(255,255,255,.035); }
.night-cover--empty::before { position: absolute; inset: 0; background: linear-gradient(145deg, transparent 0 43%, rgba(255,255,255,.09) 43% 45%, transparent 45%); content: ""; }

.night-play {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.52);
    border-radius: 50%;
    background: rgba(21, 10, 13, .58);
    opacity: 0;
    transform: translate(-50%, -42%) scale(.88);
    transition: opacity .2s ease, transform .2s ease;
}

.night-play svg { width: 20px; height: 20px; margin-left: 2px; fill: #fff; }
.night-card:hover .night-cover img { transform: scale(1.045); }
.night-card:hover .night-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.night-card-copy { display: block; padding: 9px 2px 0; }
.night-card-copy > strong {
    display: -webkit-box;
    overflow: hidden;
    color: #f8f2f3;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.night-meta { flex-wrap: wrap; gap: 4px 6px; margin-top: 5px; color: var(--night-muted); font-size: 11px; line-height: 1.45; }
.night-meta em { color: #e8a5ae; font-style: normal; }
.night-meta b { font-weight: 400; }
.night-meta b + b::before { margin-right: 6px; color: #735d63; content: "·"; }

.night-state {
    display: grid;
    min-height: 221px;
    place-content: center;
    border: 1px dashed rgba(255,255,255,.17);
    border-radius: 15px;
    background: rgba(255,255,255,.018);
    padding: 28px;
    text-align: center;
}

.night-state strong { font-size: 16px; }
.night-state span { margin-top: 7px; color: var(--night-muted); font-size: 13px; }
.night-action-link { justify-self: center; margin-top: 16px; border: 1px solid var(--night-line-strong); border-radius: 8px; padding: 8px 12px; color: #ffdce1; font-size: 12px; text-decoration: none; }

.night-pagination { flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; margin: 31px 0 0; }
.night-pagination > a { min-width: 35px; border: 1px solid var(--night-line); border-radius: 8px; padding: 8px 11px; color: #dfd1d4; font-size: 12px; text-align: center; text-decoration: none; transition: border-color .18s ease, background-color .18s ease; }
.night-pagination > a:hover { border-color: var(--night-line-strong); background: rgba(236,63,91,.09); }
.night-pagination > a.is-current { border-color: #d83853; background: #be2d47; color: #fff; font-weight: 700; }
.night-page-gap { padding: 0 3px; color: var(--night-dim); }
.night-page-jump { align-items: center; gap: 6px; margin: 0 0 0 3px; }
.night-page-jump label { display: flex; align-items: center; gap: 6px; color: #bba8ad; font-size: 12px; white-space: nowrap; }
.night-page-jump input { width: 67px; border: 1px solid var(--night-line); border-radius: 8px; outline: 0; background: #1b1217; padding: 8px; color: #fff; font: inherit; }
.night-page-jump button { padding: 8px 11px; box-shadow: none; font-size: 12px; }

.night-footer { justify-content: space-between; margin-top: 37px; border-top: 1px solid var(--night-line); padding-top: 17px; color: #816d73; font-size: 11px; }
.night-footer a { color: #e3a1aa; text-decoration: none; }

.night-crumb { align-items: center; gap: 8px; overflow: hidden; margin: 25px 0 16px; color: var(--night-muted); font-size: 12px; white-space: nowrap; }
.night-crumb a { color: #e9a8b1; text-decoration: none; }
.night-crumb span:last-child { overflow: hidden; text-overflow: ellipsis; }

.night-watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 24px; align-items: start; }
.night-player { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid var(--night-line); border-radius: 18px; background: #050506; box-shadow: 0 18px 39px rgba(0,0,0,.32); }
.night-player video { display: block; width: 100%; height: 100%; background: #000; }
.night-player-status { position: absolute; right: 14px; bottom: 12px; left: 14px; z-index: 2; overflow: hidden; margin: 0; color: #ffd0d5; font-size: 12px; text-align: center; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; white-space: nowrap; pointer-events: none; }
.night-player-status[data-state="ready"] { display: none; }

.night-detail { margin-top: 19px; }
.night-category { display: inline-block; border: 1px solid rgba(255, 163, 176, .28); border-radius: 999px; padding: 5px 8px; color: #f3b6bf; font-size: 11px; }
.night-detail h1 { margin: 10px 0 5px; font-size: 25px; line-height: 1.36; }
.night-detail-meta { margin: 0; color: var(--night-muted); font-size: 13px; }

.night-source-panel { border: 1px solid var(--night-line); border-radius: 15px; background: rgba(28,17,22,.7); box-shadow: inset 0 1px rgba(255,255,255,.035); padding: 17px; }
.night-source-panel h2 { margin: 0 0 11px; color: #eedce0; font-size: 14px; }
.night-episode-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--night-line); }
.night-line-list,
.night-episode-list { flex-wrap: wrap; gap: 7px; }
.night-line-list a,
.night-episode-list a { overflow: hidden; max-width: 100%; border: 1px solid var(--night-line); border-radius: 7px; padding: 8px 9px; color: #cbbcc0; font-size: 12px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; transition: border-color .18s ease, background-color .18s ease; }
.night-line-list a:hover,
.night-episode-list a:hover { border-color: var(--night-line-strong); }
.night-line-list a.is-selected,
.night-episode-list a.is-selected { border-color: #d63751; background: rgba(210,45,70,.17); color: #fff; }
.night-episode-list a { min-width: 48px; text-align: center; }
.night-watch-state { margin-top: 30px; }

.night-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 900px) {
    .night-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .night-watch-layout { grid-template-columns: 1fr; }
    .night-source-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    .night-episode-section { margin: 0; border: 0; padding: 0; }
}

@media (max-width: 640px) {
    .night-shell { width: min(100% - 24px, 1220px); padding-top: 14px; }
    .night-header { gap: 10px; }
    .night-brand-mark { width: 37px; height: 37px; border-radius: 11px; font-size: 16px; }
    .night-brand strong { font-size: 15px; }
    .night-brand small { font-size: 8px; }
    .night-forum-link { padding: 7px 8px; font-size: 11px; }
    .night-age-badge { display: none; }
    .night-intro { display: block; min-height: 0; margin-top: 17px; border-radius: 17px; padding: 23px 21px 20px; }
    .night-intro::after { display: none; }
    .night-intro h1 { font-size: 30px; }
    .night-intro p:not(.night-eyebrow) { font-size: 12px; }
    .night-search { width: 100%; margin-top: 19px; }
    .night-search button { padding: 8px 14px; }
    .night-results { margin-top: 22px; }
    .night-section-heading h2 { font-size: 19px; }
    .night-section-heading > span { font-size: 11px; }
    .night-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
    .night-card-copy { padding-top: 7px; }
    .night-card-copy > strong { font-size: 13px; }
    .night-meta { font-size: 10px; }
    .night-pagination { justify-content: flex-start; margin-top: 24px; }
    .night-page-jump { width: 100%; margin: 3px 0 0; }
    .night-footer { margin-top: 27px; }
    .night-crumb { margin-top: 19px; }
    .night-watch-layout { gap: 16px; }
    .night-player { border-radius: 13px; }
    .night-detail h1 { font-size: 21px; }
    .night-source-panel { grid-template-columns: 1fr; gap: 0; padding: 15px; }
    .night-episode-section { margin-top: 17px; border-top: 1px solid var(--night-line); padding-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
