/* ============================================================
   成语词典 - 蓝白简约主题 v2.5（响应式 + 暗黑模式）
   主题约定：
   - <html data-theme="light|dark"> 由 theme.js 预置脚本写入（localStorage 记忆）
   - 未写入时跟随系统（下方 prefers-color-scheme 块）
   - 全部颜色经语义变量取值，组件样式不写死色值
   ============================================================ */
:root {
    /* 品牌蓝 */
    --blue: #2563eb;
    --blue-dark: #1e40af;
    --blue-mid: #1d4ed8;
    --blue-light: #dbeafe;
    --blue-bg: #f4f8ff;
    --blue-soft: #eff6ff;
    --blue-pale: #bfdbfe;
    --blue-sky: #93c5fd;
    /* 文字 */
    --text: #1e293b;
    --text-2: #64748b;
    --text-3: #94a3b8;
    --ink: #0f172a;
    /* 表面与描边 */
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --on-accent: #ffffff;
    --head-glass: rgba(255, 255, 255, .86);
    --scroll-thumb: #c7d5ef;
    /* 状态色 */
    --ok: #15803d;          --ok-bg: #dcfce7;   --ok-border: #86efac;
    --danger: #dc2626;      --danger-bg: #fee2e2; --danger-border: #fecaca;
    --danger-strong: #b91c1c;
    --warn: #b45309;        --warn-bg: #fef3c7; --warn-border: #fde68a;
    --warn-accent: #f59e0b;
    --teal: #0d9488;        --teal-bg: #ccfbf1;
    --purple: #7e22ce;      --purple-strong: #a855f7;  --purple-bg: #f3e8ff;
    --info: #0891b2;
    /* 兼容旧引用（--white 已由 --surface 取代，保留避免漏网） */
    --white: #ffffff;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(30, 64, 175, .05), 0 6px 20px rgba(30, 64, 175, .07);
    --shadow-hover: 0 2px 6px rgba(37, 99, 235, .10), 0 14px 34px rgba(37, 99, 235, .16);
    --ease: cubic-bezier(.22, .8, .32, 1);
    color-scheme: light;
}

/* ---------- 暗黑色板（手动切换） ---------- */
html[data-theme="dark"] {
    --blue: #3b82f6;
    --blue-dark: #93c5fd;      /* 深色下用作标题亮蓝 */
    --blue-mid: #60a5fa;
    --blue-light: rgba(59, 130, 246, .16);
    --blue-bg: #0b1526;
    --blue-soft: rgba(59, 130, 246, .12);
    --blue-pale: #1e3a8a;
    --blue-sky: #7cb0fb;
    --text: #e2e8f0;
    --text-2: #94a3b8;
    --text-3: #64748b;
    --ink: #060d18;
    --surface: #111f35;
    --surface-2: #16263f;
    --surface-3: #1c2f4d;
    --border: #2b3e5e;
    --border-strong: #47586f;
    --on-accent: #ffffff;
    --head-glass: rgba(8, 15, 28, .85);
    --scroll-thumb: #2b3e5e;
    --ok: #4ade80;             --ok-bg: rgba(34, 197, 94, .14);   --ok-border: rgba(74, 222, 128, .38);
    --danger: #f87171;         --danger-bg: rgba(239, 68, 68, .14); --danger-border: rgba(248, 113, 113, .38);
    --danger-strong: #fca5a5;
    --warn: #fbbf24;           --warn-bg: rgba(245, 158, 11, .14); --warn-border: rgba(251, 191, 36, .38);
    --warn-accent: #fbbf24;
    --teal: #2dd4bf;        --teal-bg: rgba(20, 184, 166, .15);
    --purple: #d8b4fe;      --purple-strong: #c084fc;  --purple-bg: rgba(168, 85, 247, .15);
    --info: #22d3ee;
    --white: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
    --shadow-hover: 0 2px 6px rgba(0, 0, 0, .45), 0 14px 34px rgba(0, 0, 0, .5);
    color-scheme: dark;
}

/* ---------- 暗黑色板（跟随系统，未手动选择时生效） ---------- */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --blue: #3b82f6;
        --blue-dark: #93c5fd;
        --blue-mid: #60a5fa;
        --blue-light: rgba(59, 130, 246, .16);
        --blue-bg: #0b1526;
        --blue-soft: rgba(59, 130, 246, .12);
        --blue-pale: #1e3a8a;
        --blue-sky: #7cb0fb;
        --text: #e2e8f0;
        --text-2: #94a3b8;
        --text-3: #64748b;
        --ink: #060d18;
        --surface: #111f35;
        --surface-2: #16263f;
        --surface-3: #1c2f4d;
        --border: #2b3e5e;
        --border-strong: #47586f;
        --on-accent: #ffffff;
        --head-glass: rgba(8, 15, 28, .85);
        --scroll-thumb: #2b3e5e;
        --ok: #4ade80;             --ok-bg: rgba(34, 197, 94, .14);   --ok-border: rgba(74, 222, 128, .38);
        --danger: #f87171;         --danger-bg: rgba(239, 68, 68, .14); --danger-border: rgba(248, 113, 113, .38);
        --danger-strong: #fca5a5;
        --warn: #fbbf24;           --warn-bg: rgba(245, 158, 11, .14); --warn-border: rgba(251, 191, 36, .38);
        --warn-accent: #fbbf24;
        --teal: #2dd4bf;        --teal-bg: rgba(20, 184, 166, .15);
        --purple: #d8b4fe;      --purple-strong: #c084fc;  --purple-bg: rgba(168, 85, 247, .15);
        --info: #22d3ee;
        --white: #ffffff;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
        --shadow-hover: 0 2px 6px rgba(0, 0, 0, .45), 0 14px 34px rgba(0, 0, 0, .5);
        color-scheme: dark;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC", "Segoe UI", system-ui, sans-serif;
    background: var(--blue-bg);
    background-image: radial-gradient(ellipse 900px 420px at 85% -80px, rgba(37, 99, 235, .06), transparent),
                      radial-gradient(ellipse 700px 380px at 0% 30%, rgba(37, 99, 235, .045), transparent);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color .25s var(--ease), color .25s var(--ease);
}

/* 暗黑下的页面氛围光与选区 */
html[data-theme="dark"] body {
    background-image: radial-gradient(ellipse 900px 420px at 85% -80px, rgba(59, 130, 246, .10), transparent),
                      radial-gradient(ellipse 700px 380px at 0% 30%, rgba(59, 130, 246, .07), transparent);
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) body {
        background-image: radial-gradient(ellipse 900px 420px at 85% -80px, rgba(59, 130, 246, .10), transparent),
                          radial-gradient(ellipse 700px 380px at 0% 30%, rgba(59, 130, 246, .07), transparent);
    }
}

::selection { background: rgba(37, 99, 235, .18); }
html[data-theme="dark"] ::selection { background: rgba(59, 130, 246, .35); }

/* 暗黑下 hero 用深海军蓝，避免大片亮蓝刺眼 */
html[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #17307a 55%, #0f1d4d 100%);
    box-shadow: 0 10px 36px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .hero {
        background: linear-gradient(135deg, #1e3a8a 0%, #17307a 55%, #0f1d4d 100%);
        box-shadow: 0 10px 36px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);
    }
}

/* 细滚动条（Webkit） */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 99px; border: 2px solid var(--blue-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.main { padding-bottom: 56px; }

/* ---------- 头部（毛玻璃吸顶） ---------- */
.site-header {
    background: var(--head-glass);
    -webkit-backdrop-filter: saturate(1.6) blur(12px);
    backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 62px;
}
.header-right { display: flex; align-items: center; gap: 8px; }

/* ---------- 主题切换按钮 ---------- */
.theme-toggle {
    width: 36px; height: 36px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 50%;
    background: var(--surface); cursor: pointer; font-size: 15px; line-height: 1;
    transition: all .18s var(--ease);
    -webkit-user-select: none; user-select: none;
}
.theme-toggle:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: rotate(12deg); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle .tt-sun { display: none; }
html[data-theme="dark"] .theme-toggle .tt-moon { display: none; }
html[data-theme="dark"] .theme-toggle .tt-sun { display: inline; }

.logo {
    font-size: 20px; font-weight: 800; color: var(--blue-dark);
    text-decoration: none; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 8px;
    transition: transform .2s var(--ease);
}
.logo:hover { transform: scale(1.02); }
.logo-en { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 2px; letter-spacing: .5px; }
.nav { display: flex; gap: 6px; align-items: center; }
.nav-link {
    color: var(--text-2); text-decoration: none; padding: 8px 14px;
    border-radius: 9px; font-size: 15px; font-weight: 500;
    transition: all .18s var(--ease);
    position: relative;
}
.nav-link:hover { color: var(--blue); background: var(--blue-light); }
.nav-cta {
    background: var(--blue); color: var(--on-accent) !important;
    border-radius: 999px; padding: 7px 18px;
    box-shadow: 0 3px 10px rgba(37, 99, 235, .28);
}
.nav-cta:hover { background: var(--blue-mid); box-shadow: 0 5px 16px rgba(37, 99, 235, .38); }
.member-entry { color: var(--blue) !important; font-weight: 600; }

/* ---------- Hero 搜索区（渐变 + 光斑装饰） ---------- */
.hero {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 55%, #1e3a8a 100%);
    position: relative;
    overflow: hidden;
    padding: 56px 0 48px;
    text-align: center;
    color: var(--on-accent);
}
/* 装饰光斑 */
.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.hero::before {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(255,255,255,.14) 0%, transparent 68%);
    top: -180px; left: -120px;
}
.hero::after {
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(255,255,255,.10) 0%, transparent 66%);
    bottom: -280px; right: -140px;
}
.hero > * { position: relative; z-index: 1; }
.hero-title {
    font-size: 32px; letter-spacing: 3px; font-weight: 800;
    text-shadow: 0 2px 14px rgba(0,0,0,.16);
}
.hero-sub { margin: 10px 0 26px; opacity: .92; font-size: 15px; letter-spacing: .5px; }
.search-box {
    display: flex; max-width: 660px; margin: 0 auto;
    background: var(--surface); border-radius: 999px; padding: 6px 6px 6px 8px;
    box-shadow: 0 10px 36px rgba(9, 20, 60, .30), 0 2px 8px rgba(9, 20, 60, .12);
    transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.search-box:focus-within {
    box-shadow: 0 10px 40px rgba(9, 20, 60, .34), 0 0 0 4px rgba(255,255,255,.22);
    transform: translateY(-1px);
}
.search-box input {
    flex: 1; border: 0; outline: 0; padding: 10px 14px 10px 18px;
    font-size: 16px; border-radius: 999px; min-width: 0;
    background: transparent;
}
.search-box button {
    border: 0; background: var(--blue); color: var(--on-accent);
    padding: 10px 32px; border-radius: 999px; font-size: 16px; cursor: pointer;
    font-weight: 600;
    transition: background .2s, transform .15s;
}
.search-box button:hover { background: var(--blue-mid); }
.search-box button:active { transform: scale(.97); }
.hero-tags { margin-top: 20px; }
.tag {
    display: inline-block; margin: 4px; padding: 5px 15px;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .30);
    border-radius: 999px; color: var(--on-accent); text-decoration: none; font-size: 13px;
    transition: background .2s, transform .2s var(--ease);
}
.tag:hover { background: rgba(255, 255, 255, .28); transform: translateY(-1px); }

/* ---------- 概览条 ---------- */
.stats-bar {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
    margin: 26px 0 6px;
}
.stats-bar span {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; padding: 6px 18px; font-size: 14px; color: var(--text-2);
    box-shadow: var(--shadow);
    transition: transform .2s var(--ease);
}
.stats-bar span:hover { transform: translateY(-2px); }
.stats-bar b { color: var(--blue); font-size: 15px; }

/* ---------- 通用 section ---------- */
.section { margin-top: 40px; }
.section-title {
    font-size: 20px; color: var(--text); margin-bottom: 18px; font-weight: 700;
    display: flex; align-items: center; gap: 10px;
}
/* 标题左侧渐变竖条 */
.section-title::before {
    content: "";
    width: 4px; height: 20px; border-radius: 4px;
    background: linear-gradient(180deg, var(--blue), #60a5fa);
}

/* ---------- 分类卡片 ---------- */
.cat-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
}
.cat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 10px; text-align: center; text-decoration: none;
    transition: all .22s var(--ease); box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}
/* 顶部渐变装饰条 */
.cat-card::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--blue), #60a5fa);
    opacity: 0; transition: opacity .22s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--blue-pale); }
.cat-card:hover::before { opacity: 1; }
.cat-name { display: block; font-weight: 600; color: var(--text); font-size: 16px; }
.cat-card:hover .cat-name { color: var(--blue); }
.cat-en { display: block; font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ---------- 成语卡片 ---------- */
.idiom-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.idiom-card {
    display: block; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 16px; text-decoration: none;
    transition: all .22s var(--ease); box-shadow: var(--shadow); overflow: hidden;
    position: relative;
}
.idiom-card::after {
    content: "→";
    position: absolute; right: 14px; bottom: 12px;
    color: var(--blue); opacity: 0; font-size: 15px;
    transition: all .22s var(--ease);
    transform: translateX(-6px);
}
.idiom-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--blue-pale); }
.idiom-card:hover::after { opacity: 1; transform: translateX(0); }
.idiom-word { font-size: 20px; font-weight: 700; color: var(--text); transition: color .2s; }
.idiom-card:hover .idiom-word { color: var(--blue); }
.idiom-pinyin { color: var(--blue); font-size: 13px; margin: 2px 0 8px; }
.idiom-mean { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.idiom-en {
    font-size: 12px; color: var(--text-3); margin-top: 6px; font-style: italic;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- 最新列表 ---------- */
.latest-list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; }
.latest-item {
    display: flex; align-items: baseline; gap: 12px; padding: 13px 18px;
    border-bottom: 1px solid var(--surface-3); text-decoration: none; flex-wrap: wrap;
    transition: background .15s;
}
.latest-item:last-child { border-bottom: 0; }
.latest-item:hover { background: var(--blue-bg); }
.lw { font-weight: 600; color: var(--text); font-size: 15px; min-width: 96px; transition: color .15s; }
.latest-item:hover .lw { color: var(--blue); }
.lp { color: var(--blue); font-size: 12px; min-width: 130px; }
.lm { color: var(--text-2); font-size: 13px; flex: 1; }

/* ---------- 面包屑 / 页标题 ---------- */
.breadcrumb { font-size: 13px; color: var(--text-3); margin: 20px 0 10px; }
.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.page-title { font-size: 22px; color: var(--text); margin: 6px 0 16px; font-weight: 700; }
.page-title small { font-size: 13px; color: var(--text-2); font-weight: 400; margin-left: 8px; }

/* ---------- 筛选条 ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter-item {
    padding: 6px 16px; border-radius: 999px; background: var(--surface);
    border: 1px solid var(--border); color: var(--text-2); text-decoration: none; font-size: 14px;
    transition: all .18s var(--ease);
}
.filter-item:hover { color: var(--blue); border-color: var(--blue); }
.filter-item.active {
    background: var(--blue); border-color: var(--blue); color: var(--on-accent);
    box-shadow: 0 3px 10px rgba(37, 99, 235, .28);
}

/* ---------- 搜索结果 ---------- */
.result-list { display: flex; flex-direction: column; gap: 12px; }
.result-item {
    display: block; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px; text-decoration: none;
    transition: all .2s var(--ease); box-shadow: var(--shadow);
}
.result-item:hover { border-color: var(--blue-pale); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.r-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.r-word { font-size: 19px; font-weight: 700; color: var(--text); transition: color .15s; }
.result-item:hover .r-word { color: var(--blue); }
.r-pinyin { color: var(--blue); font-size: 13px; }
.r-views { margin-left: auto; font-size: 12px; color: var(--text-3); }
.r-cn { font-size: 14px; color: var(--text); margin-top: 6px; }
.r-en { font-size: 13px; color: var(--text-3); font-style: italic; margin-top: 2px; }
.empty { text-align: center; color: var(--text-2); padding: 56px 0; }

/* ---------- 分页 ---------- */
.pager { margin-top: 26px; text-align: center; }
.pager ul { display: inline-flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.pager li a, .pager li span {
    display: inline-block; padding: 6px 13px; border-radius: 9px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-2); text-decoration: none; font-size: 14px;
    transition: all .18s;
}
.pager li.active span {
    background: var(--blue); border-color: var(--blue); color: var(--on-accent);
    box-shadow: 0 3px 10px rgba(37, 99, 235, .28);
}
.pager li a:hover { color: var(--blue); border-color: var(--blue); }

/* ---------- 详情页 ---------- */
.idiom-detail {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 32px; margin-top: 10px;
}
.detail-head {
    padding-bottom: 20px; margin-bottom: 22px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--blue-bg), transparent);
    margin-left: -32px; margin-right: -32px; padding-left: 32px; padding-right: 32px;
    border-radius: var(--radius) var(--radius) 0 0;
}
.detail-word { font-size: 36px; color: var(--blue-dark); letter-spacing: 5px; font-weight: 800; }
.detail-word-row { display: flex; align-items: center; }
.detail-word-row .detail-word { margin: 0; }
.detail-pinyin { color: var(--blue); font-size: 16px; margin: 10px 0 12px; letter-spacing: .5px; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
    background: var(--blue-light); color: var(--blue-dark);
    border-radius: 999px; padding: 3px 14px; font-size: 13px; font-weight: 500;
}
.badge.light { background: var(--surface-3); color: var(--text-2); font-weight: 400; }

.detail-section { margin: 24px 0; }
.detail-section h2 {
    font-size: 16px; color: var(--text); margin-bottom: 10px; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}
.detail-section h2::before {
    content: "";
    width: 4px; height: 16px; border-radius: 4px;
    background: linear-gradient(180deg, var(--blue), #60a5fa);
}
.detail-section p { font-size: 15px; line-height: 1.85; }
.detail-section.en p {
    color: var(--text);
    background: var(--blue-bg);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--blue-light);
}
.origin { color: var(--text-2); font-size: 14px !important; }

.example-block {
    border-left: 4px solid var(--blue);
    background: linear-gradient(90deg, var(--blue-bg), transparent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 14px 20px;
}
.ex-cn { font-size: 15px; font-weight: 500; }
.ex-en { font-size: 13px; color: var(--text-2); font-style: italic; margin-top: 6px; }

.words-map { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.wm-list { display: flex; flex-wrap: wrap; gap: 8px; }
.wm-item {
    padding: 5px 16px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; color: var(--blue); text-decoration: none; font-size: 14px;
    transition: all .18s var(--ease);
}
.wm-item:hover {
    background: var(--blue); color: var(--on-accent); border-color: var(--blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .30);
}

.detail-nav { display: flex; justify-content: space-between; margin-top: 28px; gap: 12px; }
.dnav {
    padding: 11px 18px; background: var(--blue-bg); border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--blue-dark); text-decoration: none; font-size: 14px; max-width: 48%;
    transition: all .18s var(--ease);
}
.dnav:hover {
    background: var(--blue-light);
    border-color: var(--blue-pale);
    transform: translateY(-1px);
}

/* ---------- 页脚（深蓝收尾） ---------- */
.site-footer {
    background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
    margin-top: 56px; padding: 30px 0; text-align: center;
    color: #cbd5e1; font-size: 13px;   /* 页脚固定深色底，文字不随主题切换 */
}
.site-footer p { margin: 5px 0; }
.site-footer .footer-links a { color: #93c5fd; text-decoration: none; }
.site-footer .footer-links a:hover { color: var(--on-accent); text-decoration: underline; }

/* ---------- 学龄段标签 ---------- */
.grade-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.7;
}
.grade-tag.gl-preschool,
.badge.grade.gl-preschool { background: var(--warn-bg); color: var(--warn); }
.grade-tag.gl-primary,
.badge.grade.gl-primary   { background: var(--blue-light); color: var(--blue-mid); }
.grade-tag.gl-junior,
.badge.grade.gl-junior    { background: var(--ok-bg); color: var(--ok); }
.grade-tag.gl-senior,
.badge.grade.gl-senior    { background: var(--purple-bg); color: var(--purple); }
.badge.grade { border: 0; font-weight: 600; transition: transform .18s var(--ease); }
.badge.grade:hover { transform: translateY(-1px); }

/* 搜索 / 分类页学龄段筛选条 */
.grade-bar { margin-top: -8px; }
.filter-item.grade { display: inline-flex; align-items: center; gap: 6px; }
.filter-item.grade em {
    font-style: normal; font-size: 11.5px; color: var(--text-3);
    background: var(--surface-3); border-radius: 999px; padding: 0 6px; min-width: 18px; text-align: center;
}
.filter-item.grade.active em { background: rgba(255,255,255,.26); color: var(--on-accent); }
.filter-item.grade.gl-primary.active  { background: var(--blue-mid); border-color: var(--blue-mid); }
.filter-item.grade.gl-junior.active   { background: var(--ok); border-color: var(--ok); }
.filter-item.grade.gl-preschool.active{ background: var(--warn); border-color: var(--warn); }
.filter-item.grade.gl-senior.active   { background: var(--purple); border-color: var(--purple); }

/* 详情页学龄段标签行 */
.r-head .grade-tag { align-self: center; }
.usage-grade { margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ug-label { font-size: 13px; color: var(--text-3); }

/* 首页学龄段区块标题 */
.section-title .st-link { color: inherit; text-decoration: none; transition: color .18s; }
.section-title .st-link:hover { color: var(--blue); }
.section-title .st-sub { font-size: 12.5px; color: var(--text-3); font-weight: 400; margin-left: 4px; }

/* ---------- 首页游戏入口 ---------- */
.game-entry {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    flex-wrap: wrap;
    background: linear-gradient(120deg, var(--blue-dark) 0%, var(--blue) 52%, #3b82f6 100%);
    border-radius: var(--radius);
    padding: 24px 28px;
    color: var(--on-accent);
    box-shadow: 0 8px 28px rgba(30, 64, 175, .26);
    position: relative;
    overflow: hidden;
}
.game-entry::after {
    content: "";
    position: absolute; width: 320px; height: 320px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.14) 0%, transparent 68%);
    right: -110px; top: -140px; pointer-events: none;
}
.ge-left, .ge-right { position: relative; z-index: 1; }
.ge-title { font-size: 21px; font-weight: 700; letter-spacing: 1px; }
.ge-sub { font-size: 13.5px; opacity: .92; margin-top: 6px; }
.ge-right { display: flex; gap: 10px; flex-wrap: wrap; }
.ge-btn {
    display: inline-block; padding: 9px 22px; border-radius: 999px;
    font-size: 14px; font-weight: 600; text-decoration: none;
    transition: all .18s var(--ease);
}
.ge-btn.primary { background: var(--surface); color: var(--blue-dark); box-shadow: 0 4px 14px rgba(9,20,60,.22); }
.ge-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(9,20,60,.3); }
.ge-btn.ghost { background: rgba(255,255,255,.16); color: var(--on-accent); border: 1px solid rgba(255,255,255,.34); }
.ge-btn.ghost:hover { background: rgba(255,255,255,.28); transform: translateY(-2px); }

/* ---------- 详情页用法区块 ---------- */
.usage-block { display: flex; flex-direction: column; gap: 12px; }
.usage-item {
    display: flex; gap: 12px; align-items: flex-start;
    background: var(--surface-2); border: 1px solid var(--border);
    border-left: 4px solid var(--blue);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 14px 18px;
}
.usage-item p { font-size: 14.5px; line-height: 1.85; margin: 0; }
.usage-item.en { border-left-color: #60a5fa; background: var(--surface-2); }
.usage-item.en p { color: var(--text-2); font-size: 13.5px; }
.usage-lang {
    flex: 0 0 auto; font-size: 11.5px; font-weight: 600;
    color: var(--blue-dark); background: var(--blue-light);
    border-radius: 6px; padding: 2px 8px; margin-top: 3px;
}
.usage-item.en .usage-lang { background: var(--blue-light); color: var(--blue); }

/* ---------- 详情页词条补充（正音 / 变形 / 辨析） ---------- */
.extra-list { display: flex; flex-direction: column; gap: 12px; }
.extra-item {
    display: flex; gap: 12px; align-items: flex-start;
    background: var(--surface-2); border: 1px solid var(--border);
    border-left: 4px solid var(--text-3);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 14px 18px;
}
.extra-item p { font-size: 14.5px; line-height: 1.85; margin: 0; color: var(--text-2); }
.extra-label {
    flex: 0 0 auto; font-size: 11.5px; font-weight: 600;
    color: var(--text-2); background: var(--surface-3);
    border-radius: 6px; padding: 2px 8px; margin-top: 3px;
}

/* 导航：游戏入口 */
.nav-link.nav-game { color: var(--blue) !important; font-weight: 600; }

/* ---------- 通用按钮 ---------- */
.btn-primary {
    display: inline-block;
    background: var(--blue); color: var(--on-accent);
    border: 0; border-radius: 999px;
    padding: 10px 26px; font-size: 14px; font-weight: 600;
    cursor: pointer; text-decoration: none;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .30);
    transition: all .18s var(--ease);
}
.btn-primary:hover { background: var(--blue-mid); transform: translateY(-1px); box-shadow: 0 7px 18px rgba(37, 99, 235, .36); }
.btn-primary:active { transform: scale(.97); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
    .idiom-grid { grid-template-columns: repeat(2, 1fr); }
    .hero { padding: 44px 0 40px; }
    .hero-title { font-size: 26px; }
}

@media (max-width: 600px) {
    /* 导航：窄屏改为两行排布（grid + display:contents 让 nav 摆脱 .header-right 的宽度束缚） */
    .header-inner { display: grid; grid-template-columns: 1fr auto; align-items: center; row-gap: 4px; height: auto; padding: 9px 0 10px; }
    .header-right { display: contents; }
    .logo { grid-column: 1; }
    .theme-toggle { grid-column: 2; width: 34px; height: 34px; font-size: 14px; }
    .nav { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; gap: 2px; }
    .nav-link { padding: 6px 10px; font-size: 14px; }
    .nav-cta { padding: 5px 14px; }
    .hero { padding: 36px 0 32px; }
    .hero-title { font-size: 22px; letter-spacing: 2px; }
    .hero-sub { font-size: 13.5px; }
    .search-box button { padding: 10px 18px; }
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
    .idiom-grid { grid-template-columns: 1fr; }
    .words-map { grid-template-columns: 1fr; gap: 16px; }
    .idiom-detail { padding: 22px 18px; }
    .detail-head { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
    .detail-word { font-size: 27px; letter-spacing: 3px; }
    .lw { min-width: auto; }
    .lp { min-width: auto; }
    .lm { flex-basis: 100%; }
    .logo-en { display: none; }
    .site-footer { margin-top: 40px; }
    .game-entry { padding: 20px; }
    .ge-right { width: 100%; }
    .ge-btn { flex: 1; text-align: center; }
    .usage-item { flex-direction: column; gap: 6px; }
    .usage-lang { margin-top: 0; }
}

/* ============================================================
   语音朗读（tts.js v1.0.0，Web Speech API，不支持时整组隐藏）
   按钮 DOM 约定（data-tts-* 驱动；皮肤类可复用词条/故事/每日各按钮外观）：
     <button class="tts-btn" data-tts-text="…" 或 data-tts-target="…">
       <span class="tts-ico"><i class="t-on">🔊</i><i class="t-off">⏹</i></span>
       <span class="tts-txt"><i class="t-on">听故事</i><i class="t-off">停止</i></span>
     </button>
   播放中 JS 加 .tts-playing，图标/文字由 CSS 切换，无需改 DOM 文本。
   优先级说明：button[属性] 比皮肤类高一级，稳赢各皮肤的 :hover / .active。
   ============================================================ */
.tts-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
    border-radius: 999px; cursor: pointer; font-size: 13px; line-height: 1;
    padding: 7px 14px; transition: all .18s var(--ease);
    -webkit-user-select: none; user-select: none;
}
.tts-btn:hover { border-color: var(--blue); color: var(--blue); box-shadow: var(--shadow); }
.tts-btn:active { transform: scale(.96); }
.tts-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tts-btn-speak { width: 34px; height: 34px; padding: 0; font-size: 16px; margin-left: 10px; vertical-align: middle; }
.tts-btn-sm { font-size: 12px; padding: 4px 10px; }

/* 图标/文字双态（挂 data-tts-* 的按钮通用，不挑皮肤类） */
[data-tts-text] i, [data-tts-target] i { font-style: normal; }
[data-tts-text] .t-off, [data-tts-target] .t-off { display: none; }
[data-tts-text].tts-playing .t-on, [data-tts-target].tts-playing .t-on { display: none; }
[data-tts-text].tts-playing .t-off, [data-tts-target].tts-playing .t-off { display: inline; }

/* 播放态 */
button[data-tts-text].tts-playing, button[data-tts-target].tts-playing {
    background: var(--blue); border-color: var(--blue); color: var(--on-accent);
    animation: tts-pulse 1.1s ease-in-out infinite;
}
@keyframes tts-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .35); }
    50%      { box-shadow: 0 0 0 7px rgba(37, 99, 235, 0); }
}

/* 不支持语音的浏览器：全部隐藏（tts.js 检测后给 <html> 挂 .no-tts） */
.no-tts [data-tts-text], .no-tts [data-tts-target] { display: none !important; }

@media (max-width: 600px) {
    .tts-btn-speak { width: 30px; height: 30px; font-size: 14px; margin-left: 8px; }
    .tts-btn { padding: 6px 12px; }
}
