
/* ============================================================
   基础重置 & 设计变量
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #fbfbfe;
    --text: #131629;
    --text-muted: #6b7280;
    --primary: #4f46e5;
    --primary-2: #7c3aed;
    --primary-hover: #4338ca;
    --accent: #06b6d4;
    --accent-rgb: 6, 182, 212;
    --card-shadow-rgb: 31, 34, 51;
    /* 品牌色别名：暗色下与写死的原值完全一致，斯莱特林下换成绿 */
    --brand-deep: #4f46e5;
    --brand-deep-rgb: 79, 70, 229;
    --brand-2: #7c3aed;
    --brand-2-rgb: 124, 58, 237;
    --brand-soft-text: #cdd2ff;
    --primary-glow: #a5b4fc;
    --brand-mid-rgb: 99, 102, 241;
    --shadow-tint-rgb: 30, 27, 75;
    --surface-deep: #ffffff;
    --panel-deep: #f1f2f8;
    --border: #e8eaf1;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow: 0 8px 30px rgba(20, 24, 60, 0.07);
    --shadow-lg: 0 18px 50px rgba(20, 24, 60, 0.13);
    --ring: rgba(var(--brand-deep-rgb), 0.35);

    /* —— 语义色档位：新写组件请优先用这些，别写死 hex —— */
    --primary-rgb: 79, 70, 229;   /* 主色分量，拼半透明：rgba(var(--primary-rgb), 0.08) */
    --on-primary: #fff;           /* 压在主色上的文字/图标颜色（暗色下主色变亮，得翻成深色） */
    --surface-3: #f1f2f8;         /* 三级背景：输入框、下拉、代码块 */
    --border-soft: #dedafb;       /* 更弱的分隔线，带一点主色调 */
    --border-strong: #d8dbe8;     /* 需要强调的边框 */
    --text-subtle: #8b8fa3;       /* 比 --text-muted 更弱的说明文字 */
    --ok: #0f766e;
    --ok-bg: #e6fbf6;
    --ok-border: #b7ece0;
    --warn: #8a6100;
    --warn-bg: #fff8e6;
    --warn-border: #f3dfa6;
    --danger: #9a2630;
    --danger-bg: #fdf1f1;
    --danger-border: #f0c9cb;

    --nav-h: 68px;
    --video-min: 260px; /* 视频卡片最小宽度：决定一行能放几个 */
    --video-max: 340px; /* 视频卡片最大宽度：单张时的上限，避免被拉满 */
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-h);
}

body {
    font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

img,
video {
    max-width: 100%;
    display: block;
}

::selection {
    background: rgba(var(--brand-2-rgb), 0.18);
}

/* ============================================================
   通用容器 / 按钮
   ============================================================ */

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 clamp(18px, 4vw, 24px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 30px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease,
        background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 10px 24px rgba(var(--brand-deep-rgb), 0.32);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(var(--brand-deep-rgb), 0.38);
}

.btn-ghost {
    color: var(--text);
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--border);
    backdrop-filter: blur(8px);
}

.btn-ghost:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--primary);
}

/* ============================================================
   导航栏
   ============================================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease,
        background 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.88);
    border-bottom-color: var(--border);
    box-shadow: 0 4px 20px rgba(20, 24, 60, 0.05);
}

.nav-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 clamp(18px, 4vw, 24px);
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text);
}

.logo-mark {
    display: block;
    width: 22px;
    height: 24px;
    flex: 0 0 auto;
    /* 图形是竖长的 490:538，用 contain 保证任何尺寸下都不变形 */
    object-fit: contain;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 34px;
    /* 导航容器里还有主题按钮，让链接吃掉剩余空间，保持"链接 + 按钮"一组靠右 */
    margin-left: auto;
}

.nav-links a {
    position: relative;
    font-size: 0.94rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
    padding: 4px 0;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    transition: width 0.25s ease;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    border-radius: 2px;
    background: var(--text);
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   主视觉区
   ============================================================ */

.hero {
    position: relative;
    min-height: 88vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    padding: calc(var(--nav-h) + clamp(64px, 12vh, 120px)) 0 clamp(56px, 8vw, 80px);
    overflow: hidden;
    background: linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* 右侧铺一层极淡的坐标点阵，向外渐隐：既填住空白，又暗示"地图"，
   不抢左侧文字。透明度靠 mask 径向淡出控制，不用整层降 alpha */

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(var(--brand-deep-rgb), 0.5) 1px, transparent 1.2px);
    background-size: 24px 24px;
    -webkit-mask-image: radial-gradient(62% 60% at 74% 40%, #000 0%, transparent 74%);
    mask-image: radial-gradient(62% 60% at 74% 40%, #000 0%, transparent 74%);
    opacity: 0.42;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.5;
    animation: float 16s ease-in-out infinite;
}

.blob-1 {
    width: 380px;
    height: 380px;
    top: -80px;
    left: -60px;
    background: radial-gradient(circle, var(--primary-glow), transparent 70%);
}

.blob-2 {
    width: 460px;
    height: 460px;
    bottom: -140px;
    right: -100px;
    background: radial-gradient(circle, #c4b5fd, transparent 70%);
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    top: 30%;
    right: 12%;
    background: radial-gradient(circle, #67e8f9, transparent 70%);
    opacity: 0.35;
    animation-delay: -9s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(24px, -30px) scale(1.06); }
    66% { transform: translate(-22px, 20px) scale(0.96); }
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 clamp(18px, 4vw, 24px);
}

.hero-horizon {
    position: absolute;
    top: calc(var(--nav-h) + clamp(30px, 7vh, 74px));
    left: 0;
    right: 0;
    height: 2px;
    pointer-events: none;
    background: linear-gradient(90deg,
        rgba(var(--brand-deep-rgb), 0.04) 0%,
        rgba(var(--brand-deep-rgb), 0.3) 16%,
        rgba(var(--brand-deep-rgb), 0.3) 84%,
        rgba(var(--brand-deep-rgb), 0.04) 100%);
}

/* 地平线下方一排短刻度，像地图边缘的经纬标尺 */

.hero-horizon::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 5px;
    background: repeating-linear-gradient(90deg,
        rgba(var(--brand-deep-rgb), 0.2) 0 1px,
        transparent 1px 72px);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 22%, #000 34%, #000 66%, transparent 78%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, transparent 22%, #000 34%, #000 66%, transparent 78%, transparent 100%);
}

@media (max-width: 780px) {
    .hero-horizon {
        top: calc(var(--nav-h) + 26px);
    }
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--primary);
    background: rgba(var(--brand-deep-rgb), 0.08);
    border: 1px solid rgba(var(--brand-deep-rgb), 0.14);
    padding: 6px 16px;
    border-radius: 999px;
    margin-bottom: 26px;
}

.hero-tag::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.hero h1 {
    font-size: clamp(2.8rem, 7.4vw, 4.7rem);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.025em;
    margin-bottom: 24px;
}

.gradient-text {
    background: linear-gradient(120deg, var(--primary), var(--primary-2) 45%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* 中文大字下面压一行英文小字：字距拉开、等宽，给标题加一层节奏 */

.hero-en {
    margin: -10px 0 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--primary);
    opacity: 0.62;
}

.hero-desc {
    font-size: 1.18rem;
    line-height: 1.5;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 0 22px;
}

.hero-url {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    opacity: 0.78;
}

/* 域名前引一道短横线，像地图上的标注引线 */

.hero-url::before {
    content: "";
    width: 30px;
    height: 1px;
    background: currentColor;
    opacity: 0.55;
}

.scroll-hint {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 42px;
    border: 2px solid rgba(226, 234, 230, 0.28);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.scroll-hint span {
    width: 4px;
    height: 8px;
    border-radius: 2px;
    background: var(--primary);
    animation: scrollDot 1.8s ease-in-out infinite;
}

@keyframes scrollDot {
    0% { transform: translateY(0); opacity: 1; }
    70% { transform: translateY(14px); opacity: 0; }
    100% { transform: translateY(0); opacity: 0; }
}

/* ============================================================
   区块通用
   ============================================================ */

.section {
    padding: clamp(56px, 8vw, 92px) 0;
}

.section-alt {
    background: var(--surface);
}

.section-head {
    text-align: center;
    margin-bottom: clamp(32px, 5vw, 48px);
}

.section-title {
    position: relative;
    display: inline-block;
    font-size: clamp(1.45rem, 3.6vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.4px;
    margin-bottom: 10px;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.section-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 14px;
}

/* ============================================================
   关于区
   ============================================================ */

.about {
    text-align: center;
    max-width: 620px;
    margin: 0 auto;
}

.about .section-title {
    margin-bottom: 40px;
}

.about p {
    color: var(--text-muted);
    font-size: 1.02rem;
}

/* ============================================================
   页脚
   ============================================================ */

.footer {
    padding: clamp(28px, 5vw, 40px) clamp(18px, 4vw, 24px);
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.footer-inner {
    text-align: center;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.footer-sub {
    margin-top: 6px;
    font-size: 0.78rem;
    opacity: 0.75;
}

/* 页脚备案号：管局要求公示，字号最小、可点但低调 */

.footer-beian {
    margin-top: 14px;
    font-size: 0.74rem;
    letter-spacing: 0.2px;
    opacity: 0.8;
}

.footer-beian a {
    color: inherit;
    transition: color 0.2s, opacity 0.2s;
}

.footer-beian a:hover {
    color: var(--primary);
    opacity: 1;
}

/* 页脚的管理员入口：低调但仍可点击 */

.footer-admin {
    display: inline-block;
    margin-top: 16px;
    padding: 7px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.6);
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.footer-admin:hover {
    color: var(--primary);
    border-color: rgba(var(--brand-deep-rgb), 0.35);
    transform: translateY(-1px);
}

/* ============================================================
   滚动入场动画
   ============================================================ */

/* 仅在 JS 可用时才隐藏，避免脚本失效导致内容不可见 */

.js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.js .reveal.in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js .reveal { opacity: 1; transform: none; transition: none; }
    .blob, .scroll-hint span { animation: none; }
}

/* ============================================================
   移动端适配
   ============================================================ */

@media (max-width: 720px) {
    /* 区块间距已由 clamp() 连续缩放，这里只管断点式的结构变化 */
    .menu-toggle { display: flex; }

    .nav-links {
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        padding: 8px 24px 18px;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 16px 30px rgba(20, 24, 60, 0.08);
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.28s ease, opacity 0.28s ease;
    }

    .nav-links.open {
        transform: none;
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        padding: 14px 0;
        border-bottom: 1px solid var(--border);
        font-size: 1rem;
    }

    .nav-links a:last-child { border-bottom: none; }

    .nav-links a::after { display: none; }
}

@media (max-width: 420px) {
    .hero-desc { font-size: 1rem; }
    .btn { padding: 12px 24px; }
}

/* ============================================================
   首页 · 快捷入口卡片
   ============================================================ */

.entry-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(16px, 2.4vw, 24px);
    margin: 0 auto;
}

@media (max-width: 980px) {
    .entry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .entry-grid {
        grid-template-columns: 1fr;
    }
}

.entry-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: clamp(20px, 2.6vw, 28px);
    border-radius: var(--radius);
    background: linear-gradient(135deg, #f6f5ff 0%, #eef2ff 55%, #e9f7fd 100%);
    border: 1px solid #dedafb;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.entry-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2), var(--accent));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.entry-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--brand-deep-rgb), 0.3);
}

.entry-card:hover::before {
    opacity: 1;
}

.entry-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    border-radius: 14px;
    margin-bottom: 4px;
    background: linear-gradient(135deg, rgba(var(--brand-deep-rgb), 0.12), rgba(6, 182, 212, 0.14));
}

.entry-card h3 {
    font-size: 1.14rem;
    font-weight: 700;
}

.entry-card p {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.entry-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    transition: gap 0.2s ease;
}

/* 入口卡底部的"事实行"（比描述更具体的一行信息） */

.entry-meta {
    display: block;
    font-size: 0.76rem;
    line-height: 1.5;
    color: var(--text-subtle);
    font-variant-numeric: tabular-nums;
    padding-top: 2px;
    border-top: 1px dashed var(--border-soft);
    margin-top: -2px;
}

.entry-card:hover .entry-more {
    gap: 12px;
}

/* ============================================================
   子页面 · 头部 / 返回 / 通用面板
   ============================================================ */

.subhero {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: calc(var(--nav-h) + clamp(36px, 7vw, 62px)) 0 clamp(36px, 6vw, 58px);
    background: linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
}

.subhero .container {
    position: relative;
    z-index: 1;
}

.subhero h1 {
    font-size: clamp(1.9rem, 5.5vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.8px;
    line-height: 1.2;
    margin-bottom: 14px;
}

.subhero-lead {
    font-size: clamp(1rem, 2.4vw, 1.15rem);
    font-weight: 500;
    color: var(--text);
    margin-bottom: 10px;
}

.subhero p {
    max-width: 640px;
    margin: 0 auto 26px;
    color: var(--text-muted);
}

.eyebrow {
    display: inline-block;
    padding: 5px 14px;
    margin-bottom: 20px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--primary);
    background: rgba(var(--brand-deep-rgb), 0.08);
    border: 1px solid rgba(var(--brand-deep-rgb), 0.14);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
    color: var(--primary);
    transform: translateX(-3px);
}

/* 教程视频 */

.video-wrap {
    display: flex;
    max-width: 820px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: #0b0b12;
    box-shadow: var(--shadow);
}

.video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 宣传片用的加宽版，与下方轮播同宽 */

.video-wrap.wide {
    max-width: 900px;
}

/* 视频文件缺失时的占位，避免出现空播放器 */

.video-wrap.is-missing {
    align-items: center;
    justify-content: center;
    background: #f1f2f8;
}

.video-wrap.is-missing video {
    display: none;
}

.video-wrap.is-missing::after {
    content: attr(data-ph);
    padding: 0 24px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.video-caption {
    max-width: 640px;
    margin: 16px auto 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 下载卡片 */

.dl-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 520px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 38px);
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.dl-file {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}

.dl-file-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
    border-radius: 13px;
    background: rgba(var(--brand-deep-rgb), 0.08);
}

.dl-file strong {
    display: block;
    font-size: 1.06rem;
    font-weight: 700;
}

.dl-file small {
    display: block;
    margin-top: 2px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* 下载按钮组：并排显示，窄屏自动换行 */

.dl-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

/* 蓝奏云备用下载的提取码提示 */

.dl-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 34em;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dl-hint code {
    padding: 3px 10px;
    border-radius: 7px;
    background: rgba(var(--brand-deep-rgb), 0.08);
    color: var(--primary);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

/* 提示条 */

.page-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    color: var(--warn);
    font-size: 0.85rem;
    line-height: 1.55;
    text-align: left;
}

.page-note[hidden] {
    display: none;
}

/* ============================================================
   子页面 · 特性 / CTA / 徽章 / 按钮
   ============================================================ */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 288px), 1fr));
    gap: clamp(16px, 2.5vw, 22px);
}

.feature {
    display: flex;
    gap: 14px;
    padding: clamp(18px, 2.6vw, 24px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(var(--brand-deep-rgb), 0.25);
}

.feature-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    border-radius: 12px;
    background: rgba(var(--brand-deep-rgb), 0.08);
}

.feature h3 {
    margin-bottom: 4px;
    font-size: 1rem;
    font-weight: 700;
}

.feature p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.cta-panel {
    max-width: 800px;
    margin: 0 auto;
    padding: clamp(28px, 5vw, 46px);
    text-align: center;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #f5f4ff 0%, #eff4ff 55%, #eafafd 100%);
    border: 1px solid #e5e3fb;
}

.cta-panel p {
    margin-bottom: 26px;
    font-size: clamp(1rem, 2.4vw, 1.08rem);
    line-height: 1.85;
    color: var(--text);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 15px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ok);
    background: var(--ok-bg);
    border: 1px solid var(--ok-border);
}

.badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    /* 跟着徽章文字色走，斯莱特林下自动变银白 */
    background: currentColor;
    box-shadow: 0 0 0 3px var(--ok-bg);
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1rem;
}

.btn-outline {
    color: var(--primary);
    background: #fff;
    border-color: rgba(var(--brand-deep-rgb), 0.3);
}

.btn-outline:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(var(--brand-deep-rgb), 0.16);
}

/* ============================================================
   子页面 · 服务器信息（复制）
   ============================================================ */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: clamp(14px, 2.5vw, 20px);
    max-width: 720px;
    margin: 0 auto;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px clamp(18px, 2.5vw, 22px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.info-card:hover {
    border-color: rgba(var(--brand-deep-rgb), 0.3);
    box-shadow: 0 8px 24px rgba(var(--brand-deep-rgb), 0.1);
}

.info-body {
    flex: 1;
    min-width: 0;
}

.info-label {
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.info-value {
    font-size: 1.02rem;
    font-weight: 700;
    word-break: break-all;
}

.info-value.mono {
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.copy-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(var(--brand-deep-rgb), 0.28);
    background: rgba(var(--brand-deep-rgb), 0.06);
    color: var(--primary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.copy-btn:hover {
    background: rgba(var(--brand-deep-rgb), 0.12);
    transform: translateY(-1px);
}

.copy-btn.done {
    background: var(--ok-bg);
    border-color: var(--ok-border);
    color: var(--ok);
}

/* ============================================================
   子页面 · 图片轮播
   ============================================================ */

.slider {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    touch-action: pan-y;
}

.slider:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 4px;
}

.slider-track {
    display: flex;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.slide {
    position: relative;
    flex: 0 0 100%;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #f1f2f8;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 图片缺失时的占位，避免出现破图 */

.slide.is-missing img {
    display: none;
}

.slide.is-missing::after {
    content: "图片未找到：" attr(data-ph);
    padding: 0 20px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 18px rgba(20, 24, 60, 0.16);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.slider-arrow:hover {
    background: #fff;
    color: var(--primary);
    transform: translateY(-50%) scale(1.08);
}

.slider-arrow.prev { left: 14px; }
.slider-arrow.next { right: 14px; }

.slider-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.slider-dots button {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: rgba(19, 22, 41, 0.28);
    transition: transform 0.2s ease, background 0.2s ease, width 0.2s ease;
}

.slider-dots button:hover {
    background: rgba(19, 22, 41, 0.5);
}

.slider-dots button.active {
    width: 22px;
    border-radius: 999px;
    background: var(--primary);
}

/* 导航当前页高亮 */

.nav-links a[aria-current="page"] {
    color: var(--primary);
    font-weight: 600;
}

.nav-links a[aria-current="page"]::after {
    width: 100%;
}

/* ============================================================
   子页面 · 移动端
   ============================================================ */

@media (max-width: 720px) {
    .slider-arrow {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .slider-arrow.prev { left: 8px; }
    .slider-arrow.next { right: 8px; }

    .entry-icon {
        width: 46px;
        height: 46px;
        font-size: 1.3rem;
    }

    .info-card {
        flex-direction: column;
        align-items: stretch;
    }

    .copy-btn {
        align-self: stretch;
        padding: 10px;
    }
}

/* 导航分组分隔（内容 / 工具） */

.nav-sep {
    width: 1px;
    height: 15px;
    background: var(--border);
    flex: none;
}

/* 页脚次级链接（信息课等不占主导航的页面） */

.footer-more {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.18s, border-color 0.18s;
}

.footer-more:hover {
    color: var(--primary);
    border-bottom-color: rgba(var(--brand-deep-rgb), 0.4);
}

@media (max-width: 900px) {
    .nav-sep {
        display: none;
    }

    /* 导航从 5 项变成 6 项（加了 App），这一档把间距收一点，
       否则 721–900px 之间 logo 和菜单会贴太近。720px 以下走汉堡菜单，不受影响。 */
    .nav-links {
        gap: 22px;
    }
}

/* ==========================================================================
   暗色主题
   --------------------------------------------------------------------------
   上面的浅色规则一律不改，这里全部是覆盖：切换只靠 <html data-theme="dark">。
   颜色体系沿用同一套语义变量，主色在暗底上提亮一档（indigo-400 一系），
   保证文字对比度，同时按钮仍用原来的深渐变以压住白字。
   ========================================================================== */

html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0d0f16;
    --surface: #161a24;
    --surface-2: #1a1f2b;
    --text: #e7e9f2;
    --text-muted: #99a0b4;
    --primary: #8b93f8;
    --primary-2: #a78bfa;
    --primary-hover: #aab1fb;
    --accent: #22d3ee;
    --accent-rgb: 34, 211, 238;
    --card-shadow-rgb: 31, 34, 51;
    --brand-deep: #4f46e5;
    --brand-deep-rgb: 79, 70, 229;
    --brand-2: #7c3aed;
    --brand-2-rgb: 124, 58, 237;
    --brand-soft-text: #cdd2ff;
    --brand-mid-rgb: 99, 102, 241;
    --shadow-tint-rgb: 30, 27, 75;
    --surface-deep: #1a1f2e;
    --panel-deep: #232838;
    --border: #262b3a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
    --ring: rgba(var(--primary-rgb), 0.45);

    --primary-rgb: 139, 147, 248;
    --on-primary: #12131c;
    --surface-3: #1c2130;
    --border-soft: #2a3046;
    --border-strong: #333a4d;
    --text-subtle: #7f869c;
    --ok: #5eead4;
    --ok-bg: rgba(20, 184, 166, 0.14);
    --ok-border: rgba(20, 184, 166, 0.32);
    --warn: #c9d2cd;
    --warn-bg: rgba(234, 179, 8, 0.1);
    --warn-border: rgba(234, 179, 8, 0.28);
    --danger: #dcc9c7;
    --danger-bg: rgba(220, 201, 199, 0.1);
    --danger-border: rgba(220, 201, 199, 0.3);
}

/* ==========================================================================
   斯莱特林（专属主题，只有白名单账号能切到这一档）
   --------------------------------------------------------------------------
   底色是压到极暗的学院宝石绿，主色用祖母绿，辅助色走银灰。
   组件级覆盖已经在上面和暗色共用，这里只补「底色写死过」的几处，
   以及换掉紫色选区、蓝黑导航。
   ========================================================================== */
html[data-theme="slytherin"] {
    --bg: #08120e;
    --surface: #0f1d17;
    --surface-2: #12241c;
    --surface-3: #162b21;
    --text: #eaf0ed;
    --text-muted: #b8c4bf;
    --text-subtle: #8c9994;

    --primary: #e2eae6;
    --primary-2: #b9c6c0;
    --primary-hover: #f4f8f6;
    --primary-rgb: 226, 234, 230;
    --on-primary: #0b1612;
    --accent: #c9d6cf;
    --accent-rgb: 201, 214, 207;
    --card-shadow-rgb: 6, 18, 13;
    --brand-deep: #aebbb5;
    --brand-deep-rgb: 174, 187, 181;
    --brand-2: #8fa39a;
    --brand-2-rgb: 143, 163, 154;
    --brand-soft-text: #e4ebe7;
    --primary-glow: #e8efeb;
    --brand-mid-rgb: 200, 212, 206;
    --shadow-tint-rgb: 5, 14, 10;
    --surface-deep: #12241c;
    --panel-deep: #17261f;

    --border: rgba(226, 234, 230, 0.2);
    --border-soft: rgba(226, 234, 230, 0.11);
    --border-strong: rgba(226, 234, 230, 0.32);
    --ring: rgba(226, 234, 230, 0.45);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.62);

    --ok: #e9f0ec;
    --ok-bg: rgba(226, 234, 230, 0.1);
    --ok-border: rgba(226, 234, 230, 0.3);
    --warn: #e6c76b;
    --warn-bg: rgba(201, 210, 205, 0.09);
    --warn-border: rgba(201, 210, 205, 0.26);
    --danger: #fca5a5;
    --danger-bg: rgba(185, 28, 28, 0.18);
    --danger-border: rgba(248, 113, 113, 0.35);
}

html[data-theme="slytherin"] ::selection {
    background: rgba(53, 177, 132, 0.32);
}

html[data-theme="slytherin"] .navbar {
    background: rgba(8, 18, 14, 0.74);
}

html[data-theme="slytherin"] .navbar.scrolled {
    background: rgba(8, 18, 14, 0.92);
}

@media (max-width: 720px) {
    html[data-theme="slytherin"] .nav-links {
        background: rgba(14, 28, 22, 0.98);
    }
}

html[data-theme="dark"] ::selection {
    background: rgba(167, 139, 250, 0.3);
}

/* ---------- 导航 ---------- */

html[data-theme="dark"] .navbar,
html[data-theme="slytherin"] .navbar {
    background: rgba(13, 15, 22, 0.72);
}

html[data-theme="dark"] .navbar.scrolled, html[data-theme="slytherin"] .navbar.scrolled {
    background: rgba(13, 15, 22, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

@media (max-width: 720px) {
    html[data-theme="dark"] .nav-links, html[data-theme="slytherin"] .nav-links {
        background: rgba(20, 24, 34, 0.98);
        box-shadow: 0 16px 30px rgba(0, 0, 0, 0.55);
    }
}

/* ---------- 首屏与光斑 ---------- */

html[data-theme="dark"] .hero,
html[data-theme="dark"] .subhero,
html[data-theme="slytherin"] .hero, html[data-theme="slytherin"] .subhero {
    background: linear-gradient(180deg, #121620 0%, var(--bg) 100%);
}

html[data-theme="dark"] .hero-bg::after, html[data-theme="slytherin"] .hero-bg::after {
    background-image: radial-gradient(rgba(var(--primary-rgb), 0.34) 1px, transparent 1.2px);
}

html[data-theme="dark"] .hero-horizon, html[data-theme="slytherin"] .hero-horizon {
    background: linear-gradient(90deg,
        rgba(var(--primary-rgb), 0.03) 0%,
        rgba(var(--primary-rgb), 0.42) 16%,
        rgba(var(--primary-rgb), 0.42) 84%,
        rgba(var(--primary-rgb), 0.03) 100%);
}

html[data-theme="dark"] .hero-horizon::after, html[data-theme="slytherin"] .hero-horizon::after {
    background: repeating-linear-gradient(90deg,
        rgba(var(--primary-rgb), 0.26) 0 1px,
        transparent 1px 72px);
}

html[data-theme="dark"] .blob-1, html[data-theme="slytherin"] .blob-1 {
    background: radial-gradient(circle, rgba(var(--brand-mid-rgb), 0.26), transparent 70%);
}

html[data-theme="dark"] .blob-2, html[data-theme="slytherin"] .blob-2 {
    background: radial-gradient(circle, rgba(var(--brand-2-rgb), 0.22), transparent 70%);
}

html[data-theme="dark"] .blob-3, html[data-theme="slytherin"] .blob-3 {
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.15), transparent 70%);
}

html[data-theme="dark"] .hero-tag,
html[data-theme="dark"] .eyebrow, html[data-theme="slytherin"] .hero-tag, html[data-theme="slytherin"] .eyebrow {
    background: rgba(var(--primary-rgb), 0.12);
    border-color: rgba(var(--primary-rgb), 0.22);
}

html[data-theme="dark"] .scroll-hint, html[data-theme="slytherin"] .scroll-hint {
    border-color: rgba(153, 160, 180, 0.4);
}

/* ---------- 按钮 ---------- */

/* 主按钮保持深渐变 + 白字：--primary 在暗色下被提亮过，直接用会压不住白字 */

html[data-theme="dark"] .btn-primary,
html[data-theme="slytherin"] .btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-deep), var(--brand-2));
    box-shadow: 0 10px 24px rgba(var(--brand-deep-rgb), 0.45);
}

html[data-theme="dark"] .btn-primary:hover, html[data-theme="slytherin"] .btn-primary:hover {
    box-shadow: 0 16px 32px rgba(var(--brand-deep-rgb), 0.55);
}

html[data-theme="dark"] .btn-ghost, html[data-theme="slytherin"] .btn-ghost {
    background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .btn-outline, html[data-theme="slytherin"] .btn-outline {
    background: var(--surface);
}

html[data-theme="dark"] .btn-outline:hover, html[data-theme="slytherin"] .btn-outline:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

/* ---------- 首页入口卡 ---------- */

html[data-theme="dark"] .entry-card,
html[data-theme="slytherin"] .entry-card {
    background: linear-gradient(135deg, var(--surface-deep) 0%, var(--surface-deep) 55%, var(--surface-deep) 100%);
    border-color: var(--border-soft);
}

html[data-theme="dark"] .entry-card:hover, html[data-theme="slytherin"] .entry-card:hover {
    border-color: rgba(var(--primary-rgb), 0.45);
    box-shadow: 0 16px 34px -20px rgba(0, 0, 0, 0.9);
}

html[data-theme="dark"] .entry-icon, html[data-theme="slytherin"] .entry-icon {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.18), rgba(var(--accent-rgb), 0.15));
}

html[data-theme="dark"] .cta-panel, html[data-theme="slytherin"] .cta-panel {
    background: linear-gradient(135deg, var(--surface-deep) 0%, var(--surface-deep) 55%, var(--surface-deep) 100%);
    border-color: var(--border-soft);
}

/* 斯莱特林：首页这几处渐变是写死的蓝调，单独换成墨绿 */
html[data-theme="slytherin"] .entry-card {
    background: linear-gradient(135deg, #12241c 0%, #0f1f19 55%, #0f2a20 100%);
    border-color: #22362c;
}

html[data-theme="slytherin"] .entry-card:hover {
    border-color: rgba(var(--primary-rgb), 0.5);
}

html[data-theme="slytherin"] .cta-panel {
    background: linear-gradient(135deg, #112019 0%, #0f2620 55%, #0e2b21 100%);
    border-color: #22362c;
}

/* ---------- 通用卡片细节 ---------- */

html[data-theme="dark"] .feature:hover,
html[data-theme="dark"] .info-card:hover,
html[data-theme="slytherin"] .feature:hover, html[data-theme="slytherin"] .info-card:hover {
    border-color: rgba(var(--primary-rgb), 0.32);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .feature-icon,
html[data-theme="dark"] .dl-file-icon,
html[data-theme="dark"] .dl-hint code, html[data-theme="slytherin"] .feature-icon, html[data-theme="slytherin"] .dl-file-icon, html[data-theme="slytherin"] .dl-hint code {
    background: rgba(var(--primary-rgb), 0.14);
}

html[data-theme="dark"] .footer-admin, html[data-theme="slytherin"] .footer-admin {
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .footer-admin:hover, html[data-theme="slytherin"] .footer-admin:hover {
    border-color: rgba(var(--primary-rgb), 0.4);
}

html[data-theme="dark"] .footer-more:hover, html[data-theme="slytherin"] .footer-more:hover {
    border-bottom-color: rgba(var(--primary-rgb), 0.45);
}

/* ---------- 状态色：提示条 / 徽章 / 复制按钮 ---------- */

html[data-theme="dark"] .copy-btn,
html[data-theme="slytherin"] .copy-btn {
    background: rgba(var(--primary-rgb), 0.12);
    border-color: rgba(var(--primary-rgb), 0.3);
}

html[data-theme="dark"] .copy-btn:hover, html[data-theme="slytherin"] .copy-btn:hover {
    background: rgba(var(--primary-rgb), 0.2);
}

/* ---------- 图片轮播 ---------- */

html[data-theme="dark"] .slide,
html[data-theme="dark"] .video-wrap.is-missing,
html[data-theme="slytherin"] .slide, html[data-theme="slytherin"] .video-wrap.is-missing {
    background: var(--surface-3);
}

html[data-theme="dark"] .slider-arrow, html[data-theme="slytherin"] .slider-arrow {
    background: rgba(28, 33, 48, 0.9);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .slider-arrow:hover, html[data-theme="slytherin"] .slider-arrow:hover {
    background: #232939;
}

html[data-theme="dark"] .slider-dots button, html[data-theme="slytherin"] .slider-dots button {
    background: rgba(231, 233, 242, 0.3);
}

html[data-theme="dark"] .slider-dots button:hover, html[data-theme="slytherin"] .slider-dots button:hover {
    background: rgba(231, 233, 242, 0.55);
}

/* ---------- 滚到底部的细线（部分浏览器才有） ---------- */

html[data-theme="dark"],
html[data-theme="slytherin"] {
    scrollbar-color: #33394b var(--bg);
}

/* ==========================================================================
   主题切换按钮（由 script.js 注入到导航里，七个页面共用）
   ========================================================================== */

.theme-toggle {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    padding: 0;
    margin-left: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
}

/* 导航右侧的账号入口（由 script.js 注入，登录后显示账号名） */

.nav-login {
    display: inline-flex;
    align-items: center;
    flex: none;
    max-width: 118px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.nav-login:hover {
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.35);
}

.nav-login:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* 账号入口：外面包一层，才能挂下拉菜单 */
.nav-account {
    position: relative;
    display: flex;
    align-items: center;
    flex: none;
    margin-left: 12px;
}

.nav-account-btn {
    cursor: pointer;
}

.nav-caret {
    flex: none;
    margin-left: 4px;
    font-size: 0.6rem;
    line-height: 1;
    opacity: 0.7;
}

.nav-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 130;
    min-width: 132px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

/* 自己设了 display，必须配 [hidden] */
.nav-menu[hidden] {
    display: none;
}

.nav-menu a,
.nav-menu button {
    display: block;
    width: 100%;
    padding: 8px 11px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 0.84rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu button:hover {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
}

.nav-menu button.danger {
    color: var(--danger);
}

.nav-menu button.danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.nav-menu button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nav-login-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 未读私信数：右上角小红点 */

.nav-dot {
    flex: none;
    min-width: 16px;
    margin-left: 6px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 0.66rem;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    letter-spacing: 0;
}

html[data-theme="dark"] .nav-dot, html[data-theme="slytherin"] .nav-dot {
    background: var(--primary);
    color: #12131c;
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: rgba(var(--brand-deep-rgb), 0.3);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.theme-toggle svg {
    width: 17px;
    height: 17px;
    display: block;
}

/* 图标跟的是「用户偏好」(data-theme-pref)，不是实际生效的主题：
   auto 显示半明半暗圆，light 太阳，dark 月亮，专属主题显示学院盾牌 */

.theme-toggle .icon-auto,
.theme-toggle .icon-sun,
.theme-toggle .icon-moon,
.theme-toggle .icon-slytherin {
    display: none;
}

html[data-theme-pref="auto"] .theme-toggle .icon-auto,
html[data-theme-pref="light"] .theme-toggle .icon-sun,
html[data-theme-pref="dark"] .theme-toggle .icon-moon,
html[data-theme-pref="slytherin"] .theme-toggle .icon-slytherin {
    display: block;
}

html[data-theme="dark"] .theme-toggle:hover, html[data-theme="slytherin"] .theme-toggle:hover {
    border-color: rgba(var(--primary-rgb), 0.4);
}

/* 暗色下主色被提亮过（#4f46e5 → #8b93f8），logo 的渐变是写死的，
   不提亮会显得比导航其他元素「沉」一档 */

html[data-theme="dark"] .logo-mark,
html[data-theme="slytherin"] .logo-mark {
    filter: brightness(1.22) saturate(1.06);
}

@media (max-width: 720px) {
    /* 移动端 nav-links 是下拉层、不占位，改由账号入口吃掉剩余空间，主题按钮紧跟其后 */
    .nav-links {
        margin-left: 0;
    }

    .nav-account {
        margin-left: auto;
        margin-right: 8px;
    }

    .nav-account .nav-login {
        margin: 0;
    }

    .theme-toggle {
        margin-left: 0;
    }
}

/* ==========================================================================
   首次访问公告（script.js 第 12 节注入，只弹一次）
   两个出口语义不同：知道了 = 本次关闭，不再提示 = 永久
   ========================================================================== */

.fv-mask {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(19, 22, 41, 0.42);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    overscroll-behavior: contain;
    /* 刻意不加淡入：animation 一旦没执行（后台标签页 / 省电模式 / 无头环境），
       fill-mode: both 会让 opacity 停在 0 —— 弹窗看不见，遮罩却挡住整页点击 */
}

.fv-card {
    position: relative;
    width: min(430px, 100%);
    padding: 26px 26px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: fvRise 0.24s ease both;
}

/* 只位移、不改透明度：动画没跑也照样看得见 */

@keyframes fvRise {
    from { transform: translateY(10px); }
}

.fv-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.16s, color 0.16s;
}

.fv-close:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--text);
}

.fv-tag {
    display: inline-block;
    margin: 0 0 10px;
    padding: 2px 9px;
    border-radius: 6px;
    background: rgba(var(--primary-rgb), 0.09);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.fv-title {
    margin: 0 0 10px;
    font-size: 1.14rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text);
}

.fv-desc {
    margin: 0;
    font-size: 0.89rem;
    line-height: 1.75;
    color: var(--text-muted);
    /* 公告正文是纯文本，保留作者写的换行；太长就在框里滚，别把弹窗撑出屏幕 */
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 46vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.fv-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.fv-btn {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: transform 0.16s, box-shadow 0.16s, background 0.16s, border-color 0.16s, color 0.16s;
}

.fv-btn-primary {
    background: linear-gradient(135deg, var(--brand-deep), var(--brand-2));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 8px 20px -12px rgba(var(--brand-deep-rgb), 0.9);
}

.fv-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px -12px rgba(var(--brand-deep-rgb), 0.95);
}

.fv-btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

.fv-btn-ghost:hover {
    border-color: rgba(var(--primary-rgb), 0.35);
    color: var(--text);
}

.fv-btn:focus-visible,
.fv-close:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}


/* 暗色：遮罩压深一档，卡片靠变量自动适配 */


html[data-theme="dark"] .fv-mask,
html[data-theme="slytherin"] .fv-mask {
    background: rgba(5, 7, 12, 0.64);
}

@media (prefers-reduced-motion: reduce) {
    .fv-card {
        animation: none;
    }
}

@media (max-width: 480px) {
    .fv-card {
        padding: 22px 20px 18px;
    }

    .fv-actions {
        flex-direction: column;
    }

    .fv-btn {
        width: 100%;
    }
}

/* ==========================================================================
   斯莱特林收尾覆盖
   --------------------------------------------------------------------------
   上面那些规则是和暗色共用的，其中有几处颜色写死成了蓝调，分不出主题。
   这段放在文件最后，专门把它们换成墨绿 —— 靠顺序压过前面的同名规则。
   ========================================================================== */
html[data-theme="slytherin"] .navbar {
    background: rgba(8, 18, 14, 0.74);
}

html[data-theme="slytherin"] .navbar.scrolled {
    background: rgba(8, 18, 14, 0.92);
}

html[data-theme="slytherin"] .hero,
html[data-theme="slytherin"] .subhero {
    background: linear-gradient(180deg, #0b1a14 0%, var(--bg) 100%);
}

html[data-theme="slytherin"] .fv-mask {
    background: rgba(5, 14, 10, 0.55);
}

/* logo 是 SVG 图片，颜色写死在文件里，只能用滤镜把紫色转成绿色 */
html[data-theme="slytherin"] .logo-mark {
    filter: grayscale(1) brightness(1.85);
}

/* 主色在斯莱特林下是亮银白，按钮文字要翻成深色；浅色/暗色仍是深紫底白字 */
html[data-theme="slytherin"] .btn-primary {
    color: var(--on-primary);
}

html[data-theme="slytherin"] .fv-btn-primary {
    background: linear-gradient(135deg, var(--brand-deep), var(--brand-2));
    box-shadow: 0 10px 24px rgba(var(--brand-deep-rgb), 0.35);
}

/* 轮播箭头：暗色那份写死的深蓝灰，换墨绿 */
html[data-theme="slytherin"] .slider-arrow {
    background: rgba(23, 38, 31, 0.9);
}

html[data-theme="slytherin"] .slider-arrow:hover {
    background: #1d3329;
}

/* ==========================================================================
   手机 App 下载区（server.html #app）
   ========================================================================== */

.app-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 18px 0 22px;
}

.app-meta .badge {
    padding: 5px 13px;
    font-size: 0.78rem;
}

.app-steps {
    max-width: 540px;
    margin: 24px auto 0;
    padding: 0;
    list-style: none;
    counter-reset: appstep;
    display: flex;
    flex-direction: column;
    gap: 11px;
    text-align: left;
}

.app-steps li {
    position: relative;
    padding-left: 34px;
    counter-increment: appstep;
    font-size: 0.86rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.app-steps li::before {
    content: counter(appstep);
    position: absolute;
    left: 0;
    top: 2px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 600;
}

.app-hash {
    margin: 14px 0 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.74rem;
    letter-spacing: 0.02em;
    color: var(--text-subtle);
    text-align: center;
    word-break: break-all;
}

/* ==========================================================================
   App 页（app.html）：当前版本说明 + 常见问题
   --------------------------------------------------------------------------
   两块都只用变量取色，四套主题自动跟随，不需要额外的覆盖块。
   ========================================================================== */

/* 当前版本的更新说明，由 script.js 从 data/app-version.json 渲染。
   发版时它自动变，所以页面正文不用跟着改。 */
.app-notes {
    max-width: 800px;
    margin: 22px auto 0;
    padding: clamp(20px, 3vw, 28px) clamp(22px, 3.6vw, 34px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: left;
}

.app-notes-title {
    margin: 0 0 4px;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text);
}

.app-notes-sub {
    margin: 0 0 14px;
    font-size: 0.76rem;
    color: var(--text-subtle);
}

.app-notes ul {
    margin: 0;
    padding-left: 1.15em;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.app-notes li {
    font-size: 0.86rem;
    line-height: 1.72;
    color: var(--text-muted);
}

/* ---------- 常见问题 ---------- */

.faq-list {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq-item {
    padding: 0 clamp(16px, 2.4vw, 24px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease;
}

.faq-item[open] {
    border-color: rgba(var(--brand-deep-rgb), 0.22);
}

.faq-q {
    padding: 16px 30px 16px 0;
    position: relative;
    cursor: pointer;
    font-size: 0.93rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text);
    list-style: none;
}

/* 去掉各浏览器默认的那个三角 */
.faq-q::-webkit-details-marker {
    display: none;
}

.faq-q::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1;
    color: var(--text-subtle);
}

.faq-item[open] .faq-q::after {
    content: "−";
}

.faq-a {
    padding: 0 0 18px;
    font-size: 0.87rem;
    line-height: 1.82;
    color: var(--text-muted);
}

.faq-a p {
    margin: 0;
}

.faq-a p + p {
    margin-top: 10px;
}

.faq-a strong {
    color: var(--text);
    font-weight: 600;
}

/* ==========================================================================
   斯莱特林：银色蛇形水印
   --------------------------------------------------------------------------
   只在斯莱特林主题下出现，其他主题完全看不到。
   放在两个「头部区」的装饰层里，而不是 body 背景：body 那层会跑到正文中间、
   和卡片叠在一起，看起来像脏点。每个页面都有 .hero 或 .subhero，够用。
   尺寸按容器高度的百分比算，保证整条蛇完整可见、不被 overflow 裁掉。
   素材是银白色 PNG（带透明通道），这里的 opacity 直接决定它有多淡。
   ========================================================================== */

/* 只限 .hero 里的 .hero-bg：内页的 .subhero 里也套了一个 .hero-bg（点阵用的），
   不加限定会在同一位置画两条蛇，看起来就是重影 */
html[data-theme="slytherin"] .hero .hero-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: url("files/snake-mark.png") no-repeat right 9% center / auto 52%;
    opacity: 0.13;
}

html[data-theme="slytherin"] .subhero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: url("files/snake-mark.png") no-repeat right 9% center / auto 62%;
    opacity: 0.13;
}


/* 模组库没有 .hero/.subhero，头图区是 .mods-head，单独补一条 */
html[data-theme="slytherin"] .mods-head {
    position: relative;
    min-height: 168px;
}

html[data-theme="slytherin"] .mods-head::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: url("files/snake-mark.png") no-repeat right center / auto 100%;
    opacity: 0.13;
}
/* 窄屏：收到角落，别压在正文上 */
@media (max-width: 760px) {
    html[data-theme="slytherin"] .hero .hero-bg::before {
        background-position: right -16% bottom 6%;
        background-size: auto 52%;
    }

    html[data-theme="slytherin"] .subhero::before {
        background-position: right -22% center;
        background-size: auto 76%;
    }
}
