/* ═══════════════════════════════════════════════════════════════════════
   theme.css — 全站视觉层(「纸本」设计)
   ───────────────────────────────────────────────────────────────────────
   必须在 site.css / article.css / wordlist.css 之后加载。
   设计语言:暖色纸张底 + 墨色文字 + 松绿主色 + 赭红点缀;
            衬线标题、细墨线边框、小圆角、无渐变无光晕。
   想换色只改第 1 节变量。
   ═══════════════════════════════════════════════════════════════════════ */

/* ───────────────────────────── 1. 变量 ───────────────────────────── */
:root {
    --primary: #1f5c4b;
    --primary-light: #2f7a65;
    --primary-dark: #14463a;
    --primary-soft: rgba(31, 92, 75, 0.09);
    --primary-glow: rgba(31, 92, 75, 0.32);
    --accent: #c2512b;
    --accent-soft: rgba(194, 81, 43, 0.12);
    --success: #1f5c4b;

    --bg: #f4efe4;
    --bg-alt: #ebe4d3;
    --card-bg: #fffcf5;
    --card-border: rgba(43, 33, 18, 0.16);
    --card-shadow: none;
    --card-hover-shadow: 3px 3px 0 rgba(43, 33, 18, 0.88);
    --glass: rgba(244, 239, 228, 0.94);
    --divider: rgba(43, 33, 18, 0.12);
    --text: #231c11;
    --text-primary: #231c11;
    --text-secondary: #5d5242;
    --text-muted: #8a7e6b;
    --tag-bg: #ebe4d3;
    --tag-text: #5d5242;
    --tag-active-bg: var(--primary);
    --tag-active-text: #fffcf5;
    --input-bg: #fffcf5;
    --input-focus-bg: #fffcf5;
    --input-border: rgba(43, 33, 18, 0.22);
    --input-focus-border: var(--primary);

    --ink: #231c11;
    --ink-line: rgba(43, 33, 18, 0.88);
    --on-primary: #fffcf5;

    --site-nav-h: 56px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;

    --font-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
    --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', Georgia, 'Times New Roman', serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
    --primary: #3d9a7e;
    --primary-light: #5db499;
    --primary-dark: #2f8a6e;
    --primary-soft: rgba(93, 180, 153, 0.13);
    --primary-glow: rgba(93, 180, 153, 0.40);
    --accent: #e0825c;
    --accent-soft: rgba(224, 130, 92, 0.16);

    --bg: #16130d;
    --bg-alt: #1e1a12;
    --card-bg: #221e15;
    --card-border: rgba(240, 228, 205, 0.15);
    --card-hover-shadow: 3px 3px 0 rgba(93, 180, 153, 0.85);
    --glass: rgba(22, 19, 13, 0.94);
    --divider: rgba(240, 228, 205, 0.11);
    --text: #f0e8d8;
    --text-primary: #f0e8d8;
    --text-secondary: #b9ae98;
    --text-muted: #85796a;
    --tag-bg: #2b261b;
    --tag-text: #b9ae98;
    --input-bg: #221e15;
    --input-focus-bg: #28231a;
    --input-border: rgba(240, 228, 205, 0.2);

    --ink: #f0e8d8;
    --ink-line: rgba(93, 180, 153, 0.85);
    --on-primary: #0f1a15;
}

/* ───────────────────────────── 2. 基础 ───────────────────────────── */
body {
    background-color: var(--bg);
    background-image: none;
    font-family: var(--font-sans);
}

h1, h2, h3, h4 {
    letter-spacing: 0;
}

::selection {
    background: var(--accent-soft);
    color: var(--text);
}

a:hover {
    text-decoration: none;
}

:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* 细而安静的滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--card-border) transparent;
}

/* 触控反馈:统一的“按下去”手感 */
button, .btn, a.card, .article-item, .site-nav-link {
    -webkit-tap-highlight-color: transparent;
}

.btn:active,
.page-tab:active,
.level-btn:active,
.cat-btn:active,
.icon-btn:active,
.ai-entry:active,
.filter-trigger:active,
.site-theme-toggle:active,
.btn-round:active {
    transform: scale(0.96) !important;
}

/* ───────────────────────────── 3. 顶部导航 ───────────────────────────── */
.site-nav {
    background: var(--glass);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.site-nav.is-scrolled {
    border-bottom-color: var(--ink-line);
}

.site-nav-brand {
    gap: 10px;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.site-nav-brand:hover {
    color: var(--text);
}

.site-nav-mark {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--ink);
    color: var(--bg);
    font-family: var(--font-serif);
    font-size: 12px;
    letter-spacing: 0;
    transform: rotate(-4deg);
    transition: transform 0.3s var(--ease), background 0.2s ease;
}

.site-nav-brand:hover .site-nav-mark {
    transform: rotate(4deg) scale(1.06);
    background: var(--primary);
    color: var(--on-primary);
}

.site-nav-links {
    align-items: center;
    gap: 4px;
}

.site-nav-link {
    min-height: 0;
    height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.site-nav-link:hover {
    background: transparent;
    border-color: var(--card-border);
    color: var(--text);
}

.site-nav-link[aria-current="page"] {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
    box-shadow: none;
}

.site-theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    font-size: 15px;
}

.site-theme-toggle:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}

/* ───────────────────────────── 4. 按钮 ───────────────────────────── */
.btn {
    min-height: 48px;
    border: 1.5px solid var(--ink);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--ink);
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 3px 3px 0 var(--ink-line);
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s ease, color 0.18s ease;
}

.btn:hover {
    border-color: var(--ink);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--ink-line);
}

.btn:active {
    transform: translate(3px, 3px) !important;
    box-shadow: 0 0 0 var(--ink-line);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--ink);
    color: var(--on-primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--ink);
    box-shadow: 4px 4px 0 var(--ink-line);
}

.btn-quiet {
    background: transparent;
    box-shadow: none;
    border-color: var(--card-border);
}

.btn-quiet:hover {
    background: var(--card-bg);
    border-color: var(--ink);
    color: var(--ink);
    box-shadow: 3px 3px 0 var(--ink-line);
}

.btn[disabled],
.btn[aria-disabled="true"] {
    box-shadow: none;
    transform: none !important;
}

/* ───────────────────────────── 5. 首页 ───────────────────────────── */
.home-main {
    padding-top: clamp(36px, 7vw, 88px);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    grid-template-areas:
        "kicker points"
        "title  points"
        "sub    points"
        "actions points";
    column-gap: clamp(32px, 6vw, 88px);
    align-items: start;
    max-width: none;
}

.hero-kicker { grid-area: kicker; justify-self: start; }
.hero-title  { grid-area: title; }
.hero-sub    { grid-area: sub; }
.hero-actions { grid-area: actions; }
.hero-points { grid-area: points; }

.hero-kicker {
    padding: 0 0 8px;
    border: 0;
    border-bottom: 2px solid var(--ink);
    border-radius: 0;
    background: transparent;
    color: var(--text);
    letter-spacing: 0.18em;
}

.hero-kicker::before {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--accent);
    transform: rotate(45deg);
}

.hero-title {
    margin: 10px 0 22px;
    font-family: var(--font-serif);
    font-size: clamp(46px, 9vw, 92px);
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.hero-title em {
    position: relative;
    z-index: 0;
    color: inherit;
    white-space: nowrap;
}

/* 荧光笔式下划线 */
.hero-title em::after {
    content: '';
    position: absolute;
    z-index: -1;
    left: -0.06em;
    right: -0.06em;
    bottom: 0.06em;
    height: 0.34em;
    background: var(--accent);
    opacity: 0.38;
    transform: scaleX(0);
    transform-origin: left;
    animation: marker 0.8s 0.35s var(--ease) forwards;
}

.hero-sub {
    font-size: clamp(16px, 2vw, 19px);
    line-height: 1.9;
}

.hero-points {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    margin-top: 0;
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: 6px 6px 0 var(--ink-line);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
}

.hero-points li {
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px dashed var(--divider);
    transition: background 0.2s ease, padding-left 0.25s var(--ease);
}

.hero-points li:last-child {
    border-bottom: 0;
}

.hero-points li:hover {
    padding-left: 26px;
    background: var(--primary-soft);
}

.hero-points li::before {
    content: '';
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--accent);
    transform: rotate(45deg);
}

.section-heading {
    align-items: center;
    margin: clamp(56px, 9vw, 96px) 0 22px;
}

.section-heading h2 {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.section-heading::after {
    content: '';
    order: 2;
    flex: 1 1 auto;
    height: 0;
    border-top: 1.5px solid var(--ink);
}

.section-heading span {
    order: 3;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
}

.card-grid {
    gap: 20px;
}

.card {
    gap: 12px;
    min-height: 220px;
    padding: 28px;
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 5px 5px 0 var(--ink-line);
    transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), background 0.2s ease;
}

a.card:hover,
a.card:focus-visible {
    border-color: var(--ink);
    background: var(--card-bg);
    box-shadow: 8px 8px 0 var(--accent);
    transform: translate(-3px, -3px);
}

a.card:active {
    transform: translate(3px, 3px);
    box-shadow: 1px 1px 0 var(--ink-line);
}

.card-icon {
    width: 52px;
    height: 52px;
    border: 1.5px solid var(--ink);
    border-radius: 8px;
    background: var(--bg-alt);
    font-size: 24px;
    transition: transform 0.3s var(--ease), background 0.2s ease;
}

a.card:hover .card-icon {
    background: var(--accent-soft);
    transform: rotate(-8deg) scale(1.08);
}

.card-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 800;
}

.card-desc {
    font-size: 15px;
}

.card-meta {
    padding: 3px 10px;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    background: transparent;
    font-weight: 700;
}

.card-arrow {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    color: var(--ink);
    font-size: 16px;
    transition: transform 0.25s var(--ease), background 0.2s ease, color 0.2s ease;
}

a.card:hover .card-arrow {
    transform: translateX(4px);
    background: var(--ink);
    color: var(--bg);
}

.card-ghost {
    border: 1.5px dashed var(--card-border);
    background: transparent;
    box-shadow: none;
    opacity: 1;
}

.card-ghost .card-icon {
    border-style: dashed;
    border-color: var(--card-border);
    background: transparent;
}

.tip-box {
    position: relative;
    margin-top: clamp(48px, 8vw, 80px);
    padding: 24px 26px 24px 30px;
    border: 0;
    border-left: 5px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--bg-alt);
    font-size: 15.5px;
}

.tip-box strong {
    font-family: var(--font-serif);
}

.site-footer,
.article-footer {
    background: transparent;
    border-top: 1.5px solid var(--ink);
}

.site-footer-inner a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

@keyframes marker {
    to { transform: scaleX(1); }
}

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

/* 进场:内容依次浮现(只在首次加载时) */
.hero > *,
.card-grid > .card,
.tip-box {
    animation: rise 0.7s var(--ease) backwards;
}
.hero > :nth-child(2) { animation-delay: 0.08s; }
.hero > :nth-child(3) { animation-delay: 0.16s; }
.hero > :nth-child(4) { animation-delay: 0.24s; }
.hero > :nth-child(5) { animation-delay: 0.32s; }
.card-grid > .card:nth-child(2) { animation-delay: 0.1s; }
.card-grid > .card:nth-child(3) { animation-delay: 0.2s; }

/* ───────────────────────────── 6. 短文页 ───────────────────────────── */
.page-head {
    border-bottom: 1.5px solid var(--ink);
    background: var(--bg-alt);
}

.page-kicker {
    color: var(--accent);
    letter-spacing: 0.22em;
}

.page-head h1 {
    font-family: var(--font-serif);
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 900;
    letter-spacing: 0.03em;
}

.page-head-stat {
    border: 1.5px solid var(--ink);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text);
    font-weight: 700;
}

.article-side {
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 4px 4px 0 var(--ink-line);
}

.level-filter {
    gap: 4px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--bg-alt);
}

.level-btn {
    border-radius: 5px;
    font-weight: 700;
}

.level-btn:hover {
    color: var(--text);
}

.level-btn[aria-pressed="true"],
[data-theme="dark"] .level-btn[aria-pressed="true"] {
    background: var(--ink);
    color: var(--bg);
    box-shadow: none;
}

.list-group {
    color: var(--accent);
    letter-spacing: 0.18em;
}

.article-item {
    position: relative;
    border-radius: 8px;
    transition: background 0.16s ease, padding-left 0.22s var(--ease);
}

.article-item:hover {
    padding-left: 16px;
    background: var(--primary-soft);
}

.article-item[aria-current="true"] {
    border-color: var(--ink);
    background: var(--card-bg);
    box-shadow: 2px 2px 0 var(--ink-line);
}

.item-title {
    font-family: var(--font-serif);
    font-weight: 700;
}

.level-badge {
    border-radius: 4px;
    font-family: var(--font-sans);
}

.level-badge[data-level="A1"] {
    background: var(--primary);
    color: var(--on-primary);
}

.level-badge[data-level="A2"] {
    background: var(--accent);
    color: #fffcf5;
}

[data-theme="dark"] .level-badge[data-level="A2"] {
    color: #1a120c;
}

.reader-card {
    position: relative;
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 6px 6px 0 var(--ink-line);
    animation: rise 0.5s var(--ease) backwards;
}

.reader-title {
    font-weight: 900;
    letter-spacing: 0.01em;
}

.reader-hint {
    border-bottom: 1px dashed var(--divider);
}

.reader-body {
    font-size: clamp(18px, 1.6vw, 21px);
    line-height: 2;
}

.reader-body .w {
    border-radius: 2px;
    transition: background 0.14s ease, box-shadow 0.14s ease;
}

.reader-body .w:hover,
.reader-body .w:focus-visible {
    background: var(--accent-soft);
    color: inherit;
    box-shadow: 0 2px 0 var(--accent);
}

.reader-body .w:active {
    background: var(--accent);
    color: #fffcf5;
}

.translation-toggle {
    border: 1.5px dashed var(--ink);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    box-shadow: none;
    letter-spacing: 0.08em;
}

.translation-toggle:hover {
    border-style: solid;
    background: var(--primary-soft);
    box-shadow: none;
    transform: none;
}

.translation-toggle[aria-expanded="true"] {
    border-style: solid;
    background: var(--ink);
    color: var(--bg);
}

.translation {
    border: 0;
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    animation: rise 0.4s var(--ease);
}

.translation-title {
    color: var(--primary);
}

.reader-pager {
    border-top: 1px dashed var(--divider);
}

.reader-placeholder,
.reader-error {
    border: 1.5px dashed var(--card-border);
    border-radius: var(--radius);
}

/* 点词释义卡 */
#wordCard.word-card,
.word-card[role="dialog"] {
    border: 1.5px solid var(--ink);
    border-radius: 10px;
    box-shadow: 4px 4px 0 var(--ink-line);
    animation: pop 0.22s var(--ease);
}

@keyframes pop {
    from { opacity: 0; transform: translateY(6px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}

.wc-word {
    font-weight: 900;
}

.wc-speak,
.wc-close {
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: transparent;
}

.wc-speak:hover,
.wc-close:hover {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

/* 阅读进度条(由 ui.js 注入) */
.read-progress {
    position: fixed;
    z-index: 1200;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
}

/* ───────────────────────────── 7. 词汇页 ───────────────────────────── */
header {
    border-bottom: 1px solid var(--card-border);
    background: var(--glass);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: none;
}

.brand-kicker {
    color: var(--accent);
    letter-spacing: 0.2em;
}

.brand-title {
    font-family: var(--font-serif);
    font-weight: 900;
    letter-spacing: 0.03em;
}

.page-switcher {
    border: 1.5px solid var(--ink);
    border-radius: 8px;
    background: var(--bg-alt);
}

.page-tab {
    border-radius: 5px;
    color: var(--text-secondary);
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease;
}

.page-tab:hover {
    color: var(--text);
    background: transparent;
}

.page-tab.active,
[data-theme="dark"] .page-tab.active {
    background: var(--ink);
    color: var(--bg);
    box-shadow: none;
}

.page-tab.active .tab-subtitle {
    color: inherit;
    opacity: 0.7;
}

#searchInput {
    border: 1.5px solid var(--ink);
    border-radius: 8px;
    background: var(--card-bg);
    box-shadow: none;
    transition: box-shadow 0.2s var(--ease), background 0.2s ease;
}

#searchInput:focus {
    border-color: var(--ink);
    background: var(--card-bg);
    box-shadow: 3px 3px 0 var(--accent);
    outline: none;
}

.search-wrap .search-icon {
    color: var(--text);
}

.clear-search {
    border-radius: 4px;
}

.icon-btn,
.ai-entry,
.filter-trigger {
    border: 1.5px solid var(--ink);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--ink);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.ai-entry {
    border-color: var(--ink);
    background: var(--accent);
    color: #fffcf5;
    box-shadow: 3px 3px 0 var(--ink-line);
}

[data-theme="dark"] .ai-entry {
    color: #1a120c;
}

.ai-entry:hover {
    background: var(--accent);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--ink-line);
}

.icon-btn:hover,
.filter-trigger:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--bg);
}

.filter-panel {
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 4px 4px 0 var(--ink-line);
}

.filter-panel-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 800;
}

.cat-btn {
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease, padding-left 0.22s var(--ease);
}

.cat-btn:hover {
    background: var(--primary-soft);
    color: var(--text);
}

.cat-btn.active {
    background: var(--ink);
    color: var(--bg);
}

.cat-btn.active::before {
    background: var(--accent);
    left: 5px;
}

.results-eyebrow {
    color: var(--accent);
    letter-spacing: 0.2em;
}

.results-title {
    font-family: var(--font-serif);
    font-weight: 900;
    letter-spacing: 0.02em;
}

.word-count {
    border: 1.5px solid var(--ink);
    border-radius: 6px;
}

.word-count .count-num {
    font-family: var(--font-serif);
    font-weight: 900;
    color: var(--accent);
}

.word-card {
    border: 1.5px solid var(--card-border);
    border-radius: 8px;
    background: var(--card-bg);
    box-shadow: none;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s ease, background 0.2s ease;
}

.word-card::before {
    top: auto;
    bottom: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease), opacity 0.2s ease;
}

.word-card:hover {
    border-color: var(--ink);
    box-shadow: 3px 3px 0 var(--ink-line);
    transform: translate(-2px, -2px);
}

.word-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

.word-card:active {
    transform: translate(2px, 2px) !important;
    box-shadow: 0 0 0 transparent;
    background: var(--accent-soft);
}

.word-card .main-word {
    font-family: var(--font-serif);
    font-weight: 800;
    letter-spacing: 0.01em;
}

.word-card:hover .main-word {
    color: var(--primary);
}

.word-card .phonetic {
    font-family: 'Segoe UI', 'Lucida Sans Unicode', 'DejaVu Sans', sans-serif;
}

.word-card .chi {
    border-top: 1px dashed var(--divider);
}

.word-card .speak-hint {
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
}

.no-results .no-icon {
    color: var(--text-muted);
}

/* 悬浮按钮 / AI 面板 */
.btn-round {
    border: 1.5px solid var(--ink);
    background: var(--card-bg);
    box-shadow: 3px 3px 0 var(--ink-line);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.btn-round:hover {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
    box-shadow: 4px 4px 0 var(--accent);
    transform: translate(-1px, -1px);
}

.chat-panel {
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: 6px 6px 0 var(--ink-line);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.chat-header {
    background: var(--ink);
    color: var(--bg);
}

.chat-header h3 {
    font-family: var(--font-serif);
    font-weight: 800;
    letter-spacing: 0.04em;
}

.chat-close {
    background: transparent;
    border: 1px solid currentColor;
    color: var(--bg);
}

.chat-close:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.chat-message {
    border-radius: 8px;
}

.chat-message.system {
    background: var(--bg-alt);
    border: 1px dashed var(--card-border);
}

.chat-message.user {
    background: var(--primary);
    color: var(--on-primary);
    border-bottom-right-radius: 2px;
}

.chat-message.ai {
    background: var(--bg-alt);
    border-left: 3px solid var(--accent);
    border-bottom-left-radius: 2px;
}

#chatInput {
    border: 1.5px solid var(--ink);
    border-radius: 8px;
    background: var(--card-bg);
}

#chatInput:focus {
    box-shadow: 2px 2px 0 var(--accent);
}

#sendBtn {
    border: 1.5px solid var(--ink);
    border-radius: 8px;
    background: var(--primary);
    color: var(--on-primary);
}

#sendBtn:hover {
    background: var(--primary-dark);
}

/* ───────────────────────────── 8. 手机适配 ───────────────────────────── */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        grid-template-areas:
            "kicker"
            "title"
            "sub"
            "actions"
            "points";
    }

    .hero-points {
        margin-top: 40px;
    }
}

@media (max-width: 768px) {
    :root {
        --site-nav-h: 52px;
    }

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

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

    .card {
        min-height: 0;
        padding: 22px;
        box-shadow: 4px 4px 0 var(--ink-line);
    }

    .hero-points {
        box-shadow: 4px 4px 0 var(--ink-line);
    }

    .reader-card {
        box-shadow: 4px 4px 0 var(--ink-line);
    }

    /* 抽屉:顶部加一条“拖拽把手” */
    .filter-panel,
    .article-side {
        box-shadow: 0 -6px 0 var(--ink-line);
    }

    .filter-panel::before,
    .article-side::before {
        content: '';
        display: block;
        flex: 0 0 auto;
        width: 40px;
        height: 4px;
        margin: 0 auto 10px;
        border-radius: 2px;
        background: var(--card-border);
    }

    .filter-panel {
        border-radius: 14px 14px 0 0;
        right: 0;
        bottom: 0;
        left: 0;
    }

    .article-side {
        border-radius: 14px 14px 0 0;
    }

    .picker-open {
        border: 1.5px solid var(--ink);
        border-radius: 8px;
        box-shadow: 3px 3px 0 var(--ink-line);
        transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
    }

    .picker-open:active {
        transform: translate(3px, 3px);
        box-shadow: 0 0 0 var(--ink-line);
    }

    .picker-title {
        font-family: var(--font-serif);
        font-weight: 800;
    }

    .picker-more {
        color: var(--accent);
    }

    .filter-close,
    .picker-close {
        border-radius: 50%;
        border: 1px solid var(--card-border);
        background: transparent;
    }

    .word-card {
        box-shadow: none;
    }

    .word-card:hover {
        transform: none;
        box-shadow: none;
        border-color: var(--card-border);
    }

    .reader-pager {
        position: sticky;
        bottom: 0;
        margin-left: -18px;
        margin-right: -18px;
        padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
        background: var(--card-bg);
        border-top: 1.5px solid var(--ink);
        z-index: 5;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(44px, 16vw, 64px);
    }

    .section-heading h2 {
        font-size: 22px;
    }

    .hero-points li {
        padding: 15px 16px;
    }
}

/* 触屏设备不需要悬浮位移 */
@media (hover: none) {
    a.card:hover,
    .btn:hover,
    .btn-quiet:hover {
        transform: none;
    }

    .hero-points li:hover,
    .article-item:hover {
        padding-left: revert;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero > *,
    .card-grid > .card,
    .tip-box,
    .reader-card,
    .translation {
        animation: none !important;
    }

    .hero-title em::after {
        animation: none;
        transform: scaleX(1);
    }
}
