/* ============================================================
   王的家乡台 · 地方电视直播聚合站
   响应式样式：暗色玻璃质感 + 分地区强调色
   ============================================================ */

:root {
    --bg: #070b14;
    --surface: #0f1729;
    --surface-2: #131d31;
    --line: rgba(148, 170, 210, 0.14);
    --line-strong: rgba(148, 170, 210, 0.26);
    --text: #eef3fb;
    --muted: #94a3b8;
    --muted-2: #6b7a93;
    --accent: #ff6b4a;
    --accent-2: #3ddad7;
    --accent-soft: rgba(255, 107, 74, 0.14);
    --radius: 20px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --wrap: 1180px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 92px;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    background:
        radial-gradient(1100px 620px at 10% -12%, rgba(255, 107, 74, 0.16), transparent 62%),
        radial-gradient(900px 520px at 94% -6%, rgba(61, 218, 215, 0.11), transparent 58%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

button {
    font-family: inherit;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
    color: #b9c9e2;
}

.wrap {
    width: min(var(--wrap), calc(100% - 40px));
    margin-inline: auto;
}

/* ------------------------------------------------------------
   通用组件
   ------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.18s var(--ease), background 0.18s, border-color 0.18s,
        box-shadow 0.18s, opacity 0.18s;
}

.btn:focus-visible,
.filter:focus-visible,
.search-clear:focus-visible,
.modal-x:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 3px;
}

.btn-primary {
    background: linear-gradient(135deg, #ff7d55, #ff4f3d);
    color: #fff;
    box-shadow: 0 10px 30px rgba(255, 79, 61, 0.28);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 36px rgba(255, 79, 61, 0.36);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
    color: var(--text);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.075);
    border-color: var(--line-strong);
}

.btn-lg {
    padding: 14px 24px;
    font-size: 15px;
}

.btn-block {
    width: 100%;
}

.btn:disabled,
.btn.is-busy {
    cursor: not-allowed;
    opacity: 0.75;
    transform: none;
}

.btn-icon {
    display: inline-block;
    font-size: 16px;
    line-height: 1;
}

.btn-icon.spin {
    animation: spin 0.9s linear infinite;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(61, 218, 215, 0.25);
    border-radius: 999px;
    background: rgba(61, 218, 215, 0.08);
    color: var(--accent-2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 0 4px rgba(61, 218, 215, 0.14);
    animation: pulse 2s infinite;
}

.pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
    flex: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.badge-region[data-region="local"] {
    color: #ffb08d;
    background: rgba(255, 122, 69, 0.13);
    border: 1px solid rgba(255, 122, 69, 0.22);
}

.badge-region[data-region="hmt"] {
    color: #7fe9e6;
    background: rgba(61, 218, 215, 0.12);
    border: 1px solid rgba(61, 218, 215, 0.2);
}

.badge-region[data-region="other"] {
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.13);
    border: 1px solid rgba(167, 139, 250, 0.2);
}

.badge-region[data-region="cctv"] {
    color: #ff9d9d;
    background: rgba(255, 92, 92, 0.13);
    border: 1px solid rgba(255, 92, 92, 0.24);
}

.badge-region[data-region="satellite"] {
    color: #9ec5ff;
    background: rgba(80, 150, 255, 0.13);
    border: 1px solid rgba(80, 150, 255, 0.24);
}

.badge-region[data-region="paid"] {
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.13);
    border: 1px solid rgba(167, 139, 250, 0.2);
}

/* ------------------------------------------------------------
   顶部导航
   ------------------------------------------------------------ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(7, 11, 20, 0.74);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 72px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    display: block;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 24px rgba(255, 77, 61, 0.35);
}

.brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 图片四周有留白，稍微放大让虎头在 42px 图标里更饱满 */
    transform: scale(1.16);
}

.brand-text strong {
    display: block;
    font-size: 17px;
    letter-spacing: 0.02em;
}

.brand-text small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.14em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ------------------------------------------------------------
   首页 Hero
   ------------------------------------------------------------ */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.32fr) minmax(300px, 0.68fr);
    align-items: center;
    gap: 44px;
    padding: 64px 0 34px;
}

.hero-copy h1 {
    margin: 20px 0 18px;
    font-size: clamp(34px, 5vw, 58px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.hero-desc {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: 15.5px;
    line-height: 1.85;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.hero-panel {
    position: relative;
    padding: 24px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.018));
    box-shadow: var(--shadow);
}

.hero-panel::after {
    content: "";
    position: absolute;
    right: -70px;
    bottom: -90px;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 74, 0.26), transparent 68%);
    pointer-events: none;
}

.panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.panel-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.panel-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #86efac;
    font-size: 11px;
    font-weight: 600;
}

.panel-live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.13);
}

.panel-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 20px;
}

.panel-stat strong {
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.panel-stat span {
    color: var(--muted);
    font-size: 13px;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.panel-cell {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
}

.panel-cell span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.panel-cell b {
    display: block;
    margin-top: 2px;
    font-size: 18px;
    font-weight: 700;
}

.panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.panel-foot b {
    color: #cbd5e1;
    font-weight: 500;
}

/* ------------------------------------------------------------
   提示条
   ------------------------------------------------------------ */

.tips {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 183, 77, 0.24);
    border-radius: 16px;
    background: rgba(255, 183, 77, 0.075);
    color: #f0d6a4;
    font-size: 13.5px;
    line-height: 1.75;
}

.tips-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 24px;
    height: 24px;
    margin-top: 1px;
    border-radius: 50%;
    background: rgba(255, 183, 77, 0.18);
    color: #ffce8a;
    font-size: 13px;
    font-weight: 800;
}

.tips p {
    margin: 0;
}

.tips strong {
    color: #ffd08a;
}

/* ------------------------------------------------------------
   搜索与筛选
   ------------------------------------------------------------ */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 42px 0 20px;
}

.search {
    position: relative;
    flex: 1 1 340px;
    max-width: 520px;
}

.search input {
    width: 100%;
    height: 50px;
    padding: 0 46px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.search input::placeholder {
    color: var(--muted-2);
}

.search input:focus {
    border-color: rgba(255, 107, 74, 0.55);
    background: #111a2c;
    box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.1);
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    display: flex;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.search-clear {
    position: absolute;
    top: 50%;
    right: 12px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    color: var(--muted);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.search-clear:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.12);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 9px 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.filter:hover {
    color: #cfd9e8;
    border-color: var(--line-strong);
}

.filter.is-active {
    border-color: rgba(255, 107, 74, 0.45);
    background: var(--accent-soft);
    color: #ffb09b;
}

.filter-count {
    margin-left: 2px;
    font-size: 11px;
    font-weight: 600;
    opacity: 0.72;
}

/* ------------------------------------------------------------
   频道列表
   ------------------------------------------------------------ */

.list-section {
    padding-bottom: 12px;
}

.result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 12.5px;
}

.result-hint {
    color: var(--muted-2);
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
    gap: 14px;
}

.channel-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 158px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(165deg, rgba(20, 30, 49, 0.96), rgba(12, 19, 33, 0.96));
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}

.channel-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 107, 74, 0.42);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
}

.channel-card:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 3px;
}

.channel-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.channel-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* 有真实台标时改为白底图片，保持台标原有比例 */
.channel-mark.has-logo {
    background: #fff;
    overflow: hidden;
    padding: 3px;
}

.channel-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.channel-card__flags {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chip-warn {
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255, 186, 66, 0.42);
    background: rgba(255, 186, 66, 0.14);
    color: #ffc35c;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.channel-views {
    color: var(--muted);
}

.sort-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.sort-btn {
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.sort-btn:hover {
    color: #cfd9e8;
    border-color: var(--line-strong);
}

.sort-btn.is-active {
    color: #fff;
    border-color: rgba(255, 107, 74, 0.6);
    background: rgba(255, 107, 74, 0.16);
}

.chip-hot {
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid rgba(61, 218, 215, 0.45);
    background: rgba(61, 218, 215, 0.14);
    color: #7ce7e4;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* 画质标记：高清为青色高亮，普通为低饱和描边 */
.chip-quality {
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid rgba(148, 170, 210, 0.3);
    background: rgba(148, 170, 210, 0.1);
    color: #a9b8cd;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.chip-quality.is-hd {
    border-color: rgba(61, 218, 215, 0.5);
    background: rgba(61, 218, 215, 0.14);
    color: #7ce7e4;
}

.line-switch {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.line-switch[hidden] {
    display: none;
}

.line-switch__label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.line-switch__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.line-btn {
    padding: 6px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.line-btn:hover {
    color: #cfd9e8;
    border-color: var(--line-strong);
}

.line-btn.is-active {
    color: #fff;
    border-color: rgba(61, 218, 215, 0.6);
    background: rgba(61, 218, 215, 0.16);
}

.line-switch__status {
    margin-left: auto;
    color: var(--muted-2);
    font-size: 11.5px;
    white-space: nowrap;
}

.warn-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 186, 66, 0.32);
    background: rgba(255, 186, 66, 0.1);
    color: #ffcf7a;
    font-size: 12.5px;
    line-height: 1.6;
}

.warn-list {
    display: grid;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.warn-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 186, 66, 0.22);
    background: rgba(255, 186, 66, 0.07);
    font-size: 13px;
}

.warn-name {
    font-weight: 600;
}

.warn-meta {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.channel-mark[data-region="local"] {
    background: linear-gradient(135deg, #ff9a5c, #ff5f3d);
    box-shadow: 0 8px 20px rgba(255, 95, 61, 0.22);
}

.channel-mark[data-region="hmt"] {
    background: linear-gradient(135deg, #46e0d4, #2196c9);
    box-shadow: 0 8px 20px rgba(33, 150, 201, 0.22);
}

.channel-mark[data-region="other"] {
    background: linear-gradient(135deg, #a78bfa, #6366f1);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.22);
}

.channel-mark[data-region="cctv"] {
    background: linear-gradient(135deg, #ff7b7b, #d63b3b);
    box-shadow: 0 8px 20px rgba(214, 59, 59, 0.22);
}

.channel-mark[data-region="satellite"] {
    background: linear-gradient(135deg, #6fa8ff, #2f6fe0);
    box-shadow: 0 8px 20px rgba(47, 111, 224, 0.22);
}

.channel-mark[data-region="paid"] {
    background: linear-gradient(135deg, #b79bfb, #7c5cf0);
    box-shadow: 0 8px 20px rgba(124, 92, 240, 0.22);
}

.channel-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
    overflow: hidden;
    font-size: 15.5px;
    font-weight: 650;
    line-height: 1.45;
    min-height: 2.9em;
}

.channel-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-2);
    font-size: 11.5px;
}

.channel-play {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    color: #ff9a7e;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.78;
    transition: opacity 0.18s;
}

.channel-play span {
    font-size: 10px;
}

.channel-card:hover .channel-play {
    opacity: 1;
}

.empty-state {
    padding: 56px 20px;
    border: 1px dashed var(--line-strong);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.012);
    text-align: center;
}

.empty-icon {
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent);
    font-size: 24px;
}

.empty-state h2,
.empty-state h1 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
}

.empty-state p {
    max-width: 480px;
    margin: 0 auto 18px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.8;
}

/* ------------------------------------------------------------
   页脚
   ------------------------------------------------------------ */

.site-footer {
    margin-top: 64px;
    padding: 26px 0 40px;
    border-top: 1px solid var(--line);
    color: var(--muted-2);
    font-size: 12.5px;
    line-height: 1.85;
}

.site-footer .disclaimer {
    margin: 0;
    max-width: 780px;
}

.footer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 170, 210, 0.08);
}

.footer-meta a {
    color: var(--muted);
    text-decoration: none;
}

.footer-meta a:hover {
    color: var(--text);
}

/* ------------------------------------------------------------
   更新口令弹窗
   ------------------------------------------------------------ */

body.modal-open {
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 6, 12, 0.72);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}

.modal-panel {
    position: relative;
    width: min(440px, 100%);
    padding: 28px;
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background: #0e1728;
    box-shadow: var(--shadow);
    animation: modalIn 0.25s var(--ease);
}

.modal-x {
    position: absolute;
    top: 12px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.modal-x:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

.modal-panel h2 {
    margin: 0 0 10px;
    font-size: 21px;
    font-weight: 700;
}

.modal-desc {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
    transition: color 0.2s;
}

.modal-desc.is-error {
    color: #fda4af;
}

.login-form label,
#update-form label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 12.5px;
    font-weight: 600;
}

#update-token,
.login-form input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

#update-token:focus,
.login-form input:focus {
    border-color: rgba(255, 107, 74, 0.55);
    box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.1);
}

.remember {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0 !important;
    color: var(--muted) !important;
    font-size: 12.5px !important;
    font-weight: 400 !important;
    cursor: pointer;
}

.remember input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

/* ------------------------------------------------------------
   Toast
   ------------------------------------------------------------ */

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(14, 23, 40, 0.94);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    color: #dbe5f3;
    font-size: 13px;
    line-height: 1.5;
    transform: translateX(-50%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    animation: toastIn 0.25s var(--ease);
}

.toast[hidden] {
    display: none;
}

.toast-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-2);
}

.toast--loading .toast-dot {
    background: var(--accent);
    animation: pulse 1.2s infinite;
}

.toast--success .toast-dot {
    background: #4ade80;
}

.toast--error .toast-dot {
    background: #fb7185;
}

/* ------------------------------------------------------------
   播放页
   ------------------------------------------------------------ */

.player-head {
    padding: 38px 0 20px;
}

.player-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.player-logo {
    width: 40px;
    height: 40px;
    padding: 3px;
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
}

.player-head h1 {
    margin: 0;
    font-size: clamp(24px, 3.2vw, 36px);
    font-weight: 750;
    line-height: 1.25;
}

.player-sub {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.player-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(290px, 0.6fr);
    align-items: start;
    gap: 22px;
    padding-bottom: 10px;
}

.player-main {
    min-width: 0;
}

.player-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #000;
    box-shadow: var(--shadow);
}

.player-shell video {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    object-fit: contain;
}

.player-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: 0;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(3, 6, 12, 0.55);
    color: #cbd5e1;
    font-size: 13px;
    pointer-events: none;
}

.player-overlay[hidden] {
    display: none;
}

.spinner {
    width: 26px;
    height: 26px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.player-error {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(5, 9, 17, 0.9);
    text-align: center;
}

.player-error[hidden] {
    display: none;
}

.player-error-inner {
    max-width: 460px;
}

.player-error h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

.player-error p {
    margin: 0 0 8px;
    color: #cbd5e1;
    font-size: 13.5px;
    line-height: 1.75;
}

.error-detail {
    color: var(--muted-2) !important;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px !important;
    word-break: break-all;
}

.player-error-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.mix-warning {
    margin-top: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 183, 77, 0.28);
    border-radius: 12px;
    background: rgba(255, 183, 77, 0.08);
    color: #f0d6a4;
    font-size: 12.5px;
    line-height: 1.7;
}

.player-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.player-info {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
}

.player-info h2,
.admin-card h2 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #dbe5f3;
}

.info-list {
    margin: 0;
}

.info-list div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 170, 210, 0.08);
}

.info-list dt {
    flex: none;
    color: var(--muted);
    font-size: 12px;
}

.info-list dd {
    margin: 0;
    text-align: right;
    font-size: 12.5px;
    word-break: break-all;
}

.url-cell {
    max-width: 62%;
}

.url-cell code {
    display: block;
    max-height: 130px;
    overflow: auto;
    color: #9fb3d1;
    font-size: 10.5px;
    line-height: 1.65;
    text-align: left;
    word-break: break-all;
}

.player-info .btn-block {
    margin-top: 16px;
}

.notice-box {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid rgba(61, 218, 215, 0.16);
    border-radius: 12px;
    background: rgba(61, 218, 215, 0.05);
}

.notice-box strong {
    display: block;
    margin-bottom: 5px;
    color: #8ce9e5;
    font-size: 12px;
}

.notice-box p {
    margin: 0;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.75;
}

.info-foot {
    margin: 16px 0 0;
    color: var(--muted-2);
    font-size: 11px;
    line-height: 1.7;
}

.not-found {
    padding: 70px 0;
}

/* ------------------------------------------------------------
   管理页
   ------------------------------------------------------------ */

.admin-page {
    padding: 44px 0 20px;
}

.login-card {
    max-width: 480px;
    margin: 3vh auto;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(165deg, rgba(20, 30, 49, 0.98), rgba(12, 19, 33, 0.98));
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin: 14px 0 10px;
    font-size: 30px;
    font-weight: 750;
}

.login-desc {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.85;
}

.login-form {
    margin: 0;
}

.login-form .btn {
    margin-top: 14px;
}

.login-foot {
    margin: 18px 0 0;
    color: var(--muted-2);
    font-size: 11.5px;
}

.form-error {
    margin-bottom: 16px;
    padding: 10px 14px;
    border: 1px solid rgba(251, 113, 133, 0.3);
    border-radius: 10px;
    background: rgba(251, 113, 133, 0.09);
    color: #fda4af;
    font-size: 12.5px;
}

.admin-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px 0 0;
}

.admin-hero h1 {
    margin: 14px 0 8px;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 750;
}

.admin-hero p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.8;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 30px 0 18px;
}

.stat-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.stat-card strong {
    display: block;
    margin-top: 6px;
    font-size: 30px;
    font-weight: 750;
    line-height: 1;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
}

.admin-card .info-list div:last-child {
    border-bottom: 0;
}

.admin-note {
    margin: 14px 0 0;
    color: var(--muted-2);
    font-size: 11.5px;
    line-height: 1.75;
}

/* 导入视频源 */
.import-card {
    margin-top: 16px;
}

.import-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
}

.import-form input[type="file"] {
    flex: 1 1 280px;
    min-width: 0;
    padding: 11px 14px;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}

.import-form input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 7px 14px;
    border: 1px solid rgba(61, 218, 215, 0.4);
    border-radius: 999px;
    background: rgba(61, 218, 215, 0.14);
    color: #8ce9e5;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.import-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--muted);
    font-size: 12.5px;
}

.import-options label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.notice {
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.7;
}

.notice.ok {
    border: 1px solid rgba(61, 218, 215, 0.32);
    background: rgba(61, 218, 215, 0.09);
    color: #8ce9e5;
}

.notice.err {
    border: 1px solid rgba(255, 107, 74, 0.35);
    background: rgba(255, 107, 74, 0.1);
    color: #ffab97;
}

.source-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.source-list li {
    padding: 9px 0;
    border-bottom: 1px solid rgba(148, 170, 210, 0.08);
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.6;
    word-break: break-all;
}

.source-list li:last-child {
    border-bottom: 0;
}

.source-list code {
    font-size: 10.5px;
    color: #9fb3d1;
}

.admin-tips {
    margin-top: 16px;
}

.admin-tips ul {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.9;
}

.admin-tips li + li {
    margin-top: 6px;
}

.status-ok {
    color: #86efac;
}

.status-bad {
    color: #fda4af;
}

/* ------------------------------------------------------------
   动画
   ------------------------------------------------------------ */

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.55;
        transform: scale(0.86);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* ------------------------------------------------------------
   响应式
   ------------------------------------------------------------ */

@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-top: 46px;
    }

    .hero-panel {
        max-width: 560px;
    }

    .player-layout {
        grid-template-columns: 1fr;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    html {
        scroll-padding-top: 78px;
    }

    .wrap {
        width: calc(100% - 28px);
    }

    .header-inner {
        height: 64px;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .brand-text strong {
        font-size: 15.5px;
    }

    .brand-text small {
        font-size: 10px;
        letter-spacing: 0.1em;
    }

    .hero {
        padding: 34px 0 24px;
        gap: 24px;
    }

    .hero-copy h1 {
        margin: 16px 0 14px;
        font-size: clamp(30px, 8vw, 40px);
    }

    .hero-desc {
        font-size: 14px;
    }

    .hero-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 22px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .panel-stat strong {
        font-size: 46px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 30px 0 18px;
    }

    .search {
        max-width: none;
        flex-basis: auto;
    }

    .filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 3px;
        scrollbar-width: none;
    }

    .filters::-webkit-scrollbar {
        display: none;
    }

    .filter {
        flex: none;
    }

    .channel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .channel-card {
        gap: 11px;
        min-height: 146px;
        padding: 14px;
        border-radius: 15px;
    }

    .channel-mark {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        font-size: 11px;
    }

    .badge {
        padding: 3px 7px;
        font-size: 10px;
    }

    .channel-name {
        font-size: 14px;
        min-height: 2.9em;
    }

    .channel-meta {
        font-size: 10.5px;
    }

    .result-hint {
        display: none;
    }

    .player-head {
        padding: 26px 0 16px;
    }

    .player-head h1 {
        font-size: 22px;
    }

    .player-layout {
        gap: 16px;
    }

    .player-shell {
        border-radius: 14px;
    }

    .player-actions .btn {
        flex: 1;
    }

    .player-info {
        padding: 18px;
        border-radius: 16px;
    }

    .modal {
        align-items: end;
        padding: 0;
    }

    .modal-panel {
        width: 100%;
        padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
        border-radius: 22px 22px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        animation: sheetIn 0.28s var(--ease);
    }

    .toast {
        bottom: 18px;
        width: calc(100% - 28px);
        justify-content: center;
        border-radius: 14px;
        text-align: center;
    }

    .admin-page {
        padding-top: 30px;
    }

    .login-card {
        padding: 26px 20px;
        border-radius: 20px;
    }

    .login-card h1 {
        font-size: 26px;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 22px;
    }

    .stat-card strong {
        font-size: 26px;
    }

    .admin-hero {
        align-items: stretch;
    }

    .admin-hero .btn {
        width: 100%;
    }

    .footer-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (max-width: 400px) {
    .brand-text small {
        display: none;
    }

    .header-inner .btn {
        padding: 9px 14px;
        font-size: 13px;
    }

    .channel-grid {
        grid-template-columns: 1fr;
    }

    .channel-card {
        min-height: auto;
    }

    .panel-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@keyframes sheetIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
