/* Generated by scripts/build_styles.py. Edit the source CSS files. */

/* Source: style.css */
/* ===== Design Tokens ===== */
:root {
    --primary: #a41c1c;
    --primary-light: #bf3535;
    --primary-dark: #831919;
    --mag-color: var(--mag-color-base, #8b0000);
    --mag-color-dark: var(--mag-color-dark-base, #8b0000);
    --accent: #c7422c;
    --bg: #fbf6f3;
    --bg-2: #f7efe9;
    --card: #fefcfb;
    --text: #3d3433;
    --text-2: #7a706e;
    --text-3: #9a8f8d;
    --border: #e7e1dd;
    --border-2: #dad1cc;
    --highlight: #fbe89c;
    --highlight-text: #5f1313;
    --fav: #e69529;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(3,2,2,0.05);
    --shadow-md: 0 4px 12px rgba(3,2,2,0.08);
    --shadow-lg: 0 12px 40px rgba(3,2,2,0.14);
    --maxw: 920px;
    --header-h: 56px;
    --search-h: 96px;
    --bottom-h: 56px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-serif: "Songti SC", "STSong", "SimSun", serif;
    /* 阅读排版偏好（可由阅读设置面板调整，存 localStorage） */
    --article-fs: 20px;        /* 字号 */
    --article-lh: 2.05;        /* 行距 */
    --article-w-base: 760px;   /* 正文栏基准宽度（≥768px 断点为 860px） */
    --article-w-delta: 0px;    /* 页宽偏移：窄 -80px / 标准 0 / 宽 +120px */
    --article-gutter: 18px;    /* 正文左右留白（页边距），随页宽档位变化 */
    --article-indent: 2em;     /* 首行缩进，0 = 不缩进 */
}

/* Modern editorial reading system */
:root {
    --primary: #9e2922;
    --primary-light: #bd5146;
    --primary-dark: #71231f;
    --bg: #f6f3ed;
    --bg-2: #eeebe4;
    --card: #fffefa;
    --text: #282521;
    --text-2: #686158;
    --text-3: #8d867d;
    --border: #e5dfd5;
    --border-2: #d6cfc4;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-md: 0 8px 28px rgba(49, 37, 23, .07);
    --shadow-lg: 0 18px 48px rgba(49, 37, 23, .13);
}
html[data-theme="dark"] {
    --bg: #201f1d;
    --bg-2: #292724;
    --card: #302e2a;
    --text: #eee9df;
    --text-2: #c3bbae;
    --text-3: #9d958a;
    --border: #45413b;
    --border-2: #575148;
}

/* ===== Dark Mode ===== */
html[data-theme="dark"] {
    --mag-color: #d05050;
    --mag-color-dark: #b03838;
    --primary: #c64545;
    --primary-light: #d26262;
    --primary-dark: #a83838;
    --bg: #262321;
    --bg-2: #201d1c;
    --card: #322e2c;
    --text: #ebe7e6;
    --text-2: #b3aca9;
    --text-3: #8d8481;
    --border: #45403e;
    --border-2: #4f4946;
    --highlight: #7a6824;
    --highlight-text: #e6b3b3;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
}
@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] {
        --mag-color: #d05050;
        --mag-color-dark: #b03838;
        --primary: #c64545;
        --primary-light: #d26262;
        --primary-dark: #a83838;
        --bg: #262321;
        --bg-2: #201d1c;
        --card: #322e2c;
        --text: #ebe7e6;
        --text-2: #b3aca9;
        --text-3: #8d8481;
        --border: #45403e;
        --border-2: #4f4946;
        --highlight: #7a6824;
        --highlight-text: #e6b3b3;
        --shadow: 0 1px 3px rgba(0,0,0,0.3);
        --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
        --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
    }
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    font-size: 15px;
    padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
svg { display: inline-block; vertical-align: middle; }
.icon { width: 1em; height: 1em; flex-shrink: 0; }
button { font-family: inherit; }
input { font-family: inherit; }

.desktop-only { display: none; }
.mobile-only { display: block; }

/* ===== Page Visibility (body class system) ===== */
#homePage { display: block; }
#app { display: none; }
#sectionPage { display: none; }
#articlePage { display: none; }
#aboutPage { display: none; }

body.mag-active #homePage { display: none; }
body.mag-active #app { display: block; }

/* Sidebar & Main wrappers (mobile: plain block; desktop: flex row) */
.app-sidebar { display: block; }
.app-main { display: block; }

body.section-active #homePage,
body.section-active #app { display: none; }
body.section-active #sectionPage { display: block; }
body.section-active { padding-bottom: 0; }

body.article-active #homePage,
body.article-active #app,
body.article-active #sectionPage { display: none; }
body.article-active #articlePage { display: block; }
body.article-active { padding-bottom: 0; }

body.about-active #homePage,
body.about-active #app,
body.about-active #sectionPage,
body.about-active #articlePage { display: none; }
body.about-active #aboutPage { display: block; }
body.about-active { padding-bottom: 0; }

/* ===== Home Page ===== */
.home-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}
.home-header {
    padding: calc(24px + env(safe-area-inset-top, 0px)) 20px 16px;
    text-align: center;
    position: relative;
}
.home-header-inner {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}
.home-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--primary-dark);
    margin-bottom: 4px;
}
.home-subtitle {
    font-size: 12px;
    color: var(--text-3);
    letter-spacing: 4px;
    font-weight: 500;
}
.home-search-btn {
    position: absolute;
    top: 4px;
    right: 42px;
    background: rgba(255,255,255,0.6);
    border: 1px solid var(--border);
    color: var(--text-2);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.home-search-btn .icon { width: 17px; height: 17px; }
.home-search-btn:hover {
    background: var(--card);
    border-color: var(--primary-light);
    color: var(--primary);
}
.home-search { width: calc(100% - 32px); max-width: 680px; margin: 4px auto 10px; }
.home-search-copy { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.home-search-copy strong { color: var(--text); font-size: 15px; }
.home-search-copy span { color: var(--text-3); font-size: 11px; }
.home-search-form { display: flex; align-items: center; min-height: 50px; padding: 5px 6px 5px 15px; background: var(--card); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.home-search-form > .icon { color: var(--text-3); width: 18px; height: 18px; }
.home-search-form input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 14px; }
.home-search-form input::placeholder { color: var(--text-3); }
.home-search-form button { flex-shrink: 0; padding: 9px 15px; border: 0; border-radius: 7px; color: #fff; background: var(--primary); font-size: 13px; font-weight: 600; cursor: pointer; }
.home-search-form button:hover { background: var(--primary-dark); }
.home-section-heading { width: 100%; max-width: 900px; display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.home-section-heading h2 { color: var(--text); font-size: 17px; }
.home-section-heading span { color: var(--text-3); font-size: 11px; }
.home-page > .home-body { flex-direction: column; justify-content: center; }
.home-latest { width: calc(100% - 32px); max-width: 900px; margin: 0 auto 18px; }
.home-latest-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-latest-item { min-width: 0; padding: 14px 16px; text-align: left; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.home-latest-item span,.home-latest-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-latest-item span { margin-bottom: 5px; color: var(--text-3); font-size: 11px; }
.home-latest-item strong { font-size: 14px; }
.home-latest-item:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); }
.home-latest-loading { color: var(--text-3); font-size: 12px; }
.home-search-copy > * + * { margin-left: 12px; }
.home-search-form > * + * { margin-left: 10px; }
.home-about-btn {
    position: absolute;
    top: 4px;
    right: 0;
    background: rgba(255,255,255,0.6);
    border: 1px solid var(--border);
    color: var(--text-2);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.home-about-btn .icon { width: 17px; height: 17px; }
.home-about-btn:hover {
    background: var(--card);
    border-color: var(--primary-light);
    color: var(--primary);
}
.home-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px 40px;
}
.magazine-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 300px;
    width: 100%;
}
.magazine-card {
    background: var(--card);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.magazine-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.magazine-card:active { transform: translateY(-1px); }

/* Magazine Covers */
.mag-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    flex-shrink: 0;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Chrome 69 fallback: padding-top hack for 3:4 aspect ratio */
    height: auto;
}
@supports not (aspect-ratio: 3 / 4) {
    .mag-cover {
        position: relative;
        height: 0;
        padding-top: 133.3333%;
    }
    .mag-cover-inner {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        display: flex !important;
    }
}
.mag-cover-qs {
    background-image: url('../img/cover_qs.jpg?v=20260920a');
    background-color: #8b0000;
}
.mag-cover-hqwg {
    background-image: url('../img/cover_hqwg.jpg?v=20261030a');
    background-color: #8b0000;
}
.mag-cover-djyj {
    background-image: url('../img/cover_djyj.jpg?v=20261030a');
    background-color: #8b0000;
}
.mag-cover-inner {
    display: none;
}
.mag-cover-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1.2;
    margin-bottom: 4px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.mag-cover-sub {
    font-size: 7px;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 8px;
}
.mag-cover-line {
    width: 30px;
    height: 1px;
    background: rgba(255,255,255,0.4);
    margin: 0 auto 8px;
}
.mag-cover-edition {
    font-size: 8px;
    opacity: 0.8;
    line-height: 1.4;
}

.mag-info {
    flex: 1;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.mag-info h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.mag-desc {
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 8px;
}
.mag-meta {
    font-size: 12px;
    color: var(--primary-dark);
    font-weight: 600;
}

/* ===== Home Guide Entry ===== */
.home-guide-entry {
    padding: 0 16px 8px;
    max-width: 360px;
    width: 100%;
    margin: 0 auto;
}
.guide-link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s var(--ease);
    box-shadow: var(--shadow);
}
.guide-link-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.guide-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: #fdecec;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}
.guide-card-icon .icon { width: 18px; height: 18px; }
.guide-card-text { flex: 1; min-width: 0; }
.guide-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 2px;
}
.guide-card-desc {
    font-size: 11px;
    color: var(--text-3);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.guide-card-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-3);
    flex-shrink: 0;
}

.home-footer {
    text-align: center;
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    color: var(--text-3);
    font-size: 11px;
}

/* ===== App Header (mobile: top bar) ===== */
.sidebar-header {
    background: linear-gradient(135deg, var(--mag-color-dark, var(--primary-dark)) 0%, var(--mag-color, var(--primary)) 100%);
    color: #f6f3f2;
    padding: 14px 48px 12px;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 12px rgba(3,2,2,0.12);
}
.sidebar-brand h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 2px;
}
.sidebar-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.app-subtitle {
    font-size: 11px;
    opacity: 0.75;
    font-weight: 400;
}
.header-home-btn {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none;
    color: #f6f3f2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease);
}
.header-home-btn .icon { width: 18px; height: 18px; }
.header-home-btn:hover { background: rgba(255,255,255,0.22); }
.header-about-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none;
    color: #f6f3f2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease);
}
.header-about-btn .icon { width: 17px; height: 17px; }
.header-about-btn:hover { background: rgba(255,255,255,0.22); }
.search-status {
    font-size: 10px;
    opacity: 0.6;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
}
.search-status::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-3);
    flex-shrink: 0;
}
.search-status.ready::before { background: #75c862; }
.search-status.loading::before {
    background: #f1cc44;
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ===== Search Bar ===== */
.search-intro { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.search-intro strong { color: var(--text); font-size: 13px; }
.search-intro span { color: var(--text-3); font-size: 11px; }
@media (max-width: 520px) {
    .search-intro { align-items: flex-start; flex-direction: column; }
    .search-intro span { margin-top: 2px; }
}
.search-bar {
    background: var(--card);
    padding: 12px 16px 14px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 99;
}
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-box .search-icon {
    position: absolute;
    left: 14px;
    width: 17px;
    height: 17px;
    color: var(--text-3);
    pointer-events: none;
    z-index: 1;
}
#searchInput {
    flex: 1;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
    -webkit-appearance: none;
}
#searchInput:focus {
    outline: none;
    border-color: var(--mag-color, var(--primary-light));
    background: var(--card);
}
#searchInput::placeholder { color: var(--text-3); }
.search-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    background: var(--mag-color, var(--primary));
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s var(--ease);
    white-space: nowrap;
    flex-shrink: 0;
}
.search-btn:hover { opacity: 0.9; }
.search-btn:active { transform: scale(0.97); }

.filters {
    display: flex;
    gap: 10px;
    margin-top: 9px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}
.scope-group {
    display: flex;
    gap: 2px;
    background: var(--bg);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    padding: 2px;
}
.scope-option {
    font-size: 12px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s var(--ease);
}
/* ===== 单选/复选框：自绘 =====
   Chrome 69 不支持 accent-color（Chrome 93+），也不支持 appearance 简写（Chrome 84+），
   故统一用 -webkit-appearance 自绘，各浏览器观感一致。 */
.scope-option input[type="radio"],
.filter-check input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    margin: 0;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    background: var(--card);
    border: 1.5px solid var(--text-3);
    cursor: pointer;
    transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.scope-option input[type="radio"] { border-radius: 50%; }
.filter-check input[type="checkbox"] { border-radius: 3px; }
.scope-option input[type="radio"]:checked,
.filter-check input[type="checkbox"]:checked {
    background-color: var(--mag-color, var(--primary));
    border-color: var(--mag-color, var(--primary));
}
.scope-option input[type="radio"]:checked {
    background-image: radial-gradient(circle at center, #fff 0, #fff 4px, transparent 4.5px);
}
.filter-check input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.2l3 3 6-6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 14px 14px;
    background-repeat: no-repeat;
}
.scope-option.checked,
.scope-option:has(input:checked) {
    background: var(--mag-color, var(--primary));
    color: white;
}
.scope-option.checked input[type="radio"]:checked,
.scope-option:has(input:checked) input[type="radio"]:checked {
    background-color: #fff;
    border-color: #fff;
}
.scope-option.checked input[type="radio"]:checked {
    background-image: radial-gradient(circle at center, var(--mag-color, var(--primary)) 0, var(--mag-color, var(--primary)) 4px, transparent 4.5px);
}
.filter-check {
    font-size: 12px;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    cursor: pointer;
}

/* ===== 检索范围：本刊 / 三刊 ===== */
.mag-scope-group {
    flex-shrink: 0;
}
/* 三刊模式下隐藏与正文相关的控件（跨刊只搜标题） */
.filters--all .scope-group--content,
.filters--all .filter-check--content {
    display: none;
}

/* ===== 跨刊结果的分组标题 ===== */
.result-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.result-group-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 12px 2px 4px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--border);
}
.result-group-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}
.result-group-count {
    font-size: 12px;
    color: var(--text-3);
}
.result-group-cont {
    font-size: 12px;
    color: var(--text-3);
}

/* ===== 主页：三刊搜索浮层 ===== */
.global-search {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    overflow-y: auto;
    z-index: 300;
    -webkit-overflow-scrolling: touch;
}
.global-search[hidden] { display: none; }
/* 浮层打开时锁住背景滚动 */
body.global-search-active { overflow: hidden; }
.gs-panel {
    max-width: 720px;
    margin: 0 auto;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 40px;
}
.gs-head {
    position: sticky;
    top: 0;
    background: var(--bg);
    padding-bottom: 10px;
    z-index: 2;
}
.gs-box {
    background: var(--card);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 4px 6px 4px 2px;
}
.gs-box #globalSearchInput {
    border: none;
    background: transparent;
    padding-left: 38px;
}
.gs-box #globalSearchInput:focus {
    background: transparent;
}
.gs-close {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gs-close .icon { width: 16px; height: 16px; }
.gs-hint {
    font-size: 12px;
    color: var(--text-3);
    margin: 8px 2px 0;
}
.gs-count {
    font-size: 13px;
    color: var(--text-2);
    margin: 12px 2px 8px;
}
.gs-count:empty { display: none; }

/* ===== 正文搜索：显式触发按钮 ===== */
.body-search-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0 14px;
}
.body-search-actions[hidden] { display: none; }
.btn-ghost {
    padding: 8px 16px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}
.btn-ghost:hover {
    border-color: var(--mag-color, var(--primary));
    color: var(--mag-color, var(--primary));
}
.btn-ghost:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-ghost--warn {
    color: var(--primary);
    border-color: var(--primary-light);
}
.bs-progress {
    font-size: 13px;
    color: var(--text-2);
}
.bs-hint,
.bs-done {
    font-size: 12px;
    color: var(--text-3);
}

/* ===== Desktop Nav ===== */
.nav-tabs {
    gap: 4px;
    padding: 8px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    max-width: var(--maxw);
    margin: 0 auto;
}
.nav-tab {
    display: flex;
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-2);
    transition: all 0.25s var(--ease);
    font-weight: 500;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    border-radius: var(--radius-sm);
}
.nav-tab .icon { width: 18px; height: 18px; }
.nav-tab:hover {
    background: var(--bg);
    color: var(--text);
}
.nav-tab.active {
    color: var(--mag-color, var(--primary));
    font-weight: 600;
    background: rgba(139, 0, 0, 0.08);
}
.nav-tab.active::after {
    content: "";
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--mag-color, var(--primary));
    border-radius: 2px;
}

/* ===== Bottom Nav (Mobile) ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 200;
    box-shadow: 0 -1px 12px rgba(3,2,2,0.06);
}
.bn-item {
    flex: 1;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-3);
    font-size: 10px;
    position: relative;
    transition: color 0.2s var(--ease);
}
.bn-item.active { color: var(--mag-color, var(--primary)); font-weight: 600; }
.bn-item .icon { width: 22px; height: 22px; }

/* ===== Fav Badge ===== */
.fav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    background: var(--fav);
    color: white;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    margin-left: 2px;
    vertical-align: top;
    line-height: 1;
}
.fav-badge:empty, .fav-badge[data-count="0"] { display: none; }
.bn-item .fav-badge {
    position: absolute;
    top: 5px;
    right: 22%;
    min-width: 15px;
    height: 15px;
    font-size: 9px;
}

/* ===== Content ===== */
.content { padding: 12px 12px 32px; max-width: var(--maxw); margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

/* ===== Result Info ===== */
.result-info {
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 8px;
    padding: 0 4px;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 20px 4px 8px;
    flex-wrap: wrap;
}
.page-btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s var(--ease);
    padding: 0 8px;
}
.page-btn:hover:not(:disabled):not(.active) {
    border-color: var(--mag-color, var(--primary-light));
    color: var(--mag-color, var(--primary));
    background: var(--bg);
}
.page-btn.active {
    background: var(--mag-color, var(--primary));
    color: white;
    border-color: var(--mag-color, var(--primary));
    font-weight: 600;
}
.page-btn:disabled {
    color: var(--border-2);
    cursor: default;
}
.page-ellipsis { color: var(--text-3); padding: 0 4px; font-size: 13px; }
.page-info { font-size: 12px; color: var(--text-3); margin-left: 8px; }

/* ===== Result Cards ===== */
.results-list { display: flex; flex-direction: column; gap: 10px; }
.result-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 15px 18px 14px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.25s var(--ease);
    position: relative;
    border: 1px solid transparent;
}
.result-card:active { transform: scale(0.995); }
.result-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--mag-color, var(--primary-light));
    transform: translateY(-1px);
}
.rc-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
    line-height: 1.5;
    padding-right: 32px;
}
.rc-meta {
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.rc-tag {
    display: inline-block;
    background: #f2ecea;
    color: var(--text-2);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}
.rc-tag.no-body { background: #f3eeec; color: var(--text-3); }
.rc-author { color: var(--mag-color-dark, var(--primary-dark)); font-size: 12px; font-weight: 500; }
.rc-snippet {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.65;
    max-height: 4.4em;
    overflow: hidden;
}
.rc-fav-btn {
    position: absolute;
    top: 11px;
    right: 11px;
    border: none;
    background: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--border-2);
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
}
.rc-fav-btn .icon { width: 18px; height: 18px; }
.rc-fav-btn:hover { background: #faf3e6; color: var(--fav); }
.rc-fav-btn.active { color: var(--fav); }
.rc-fav-btn.active:hover { background: #faefd8; }

/* ===== Highlight ===== */
.hl {
    background: var(--highlight);
    color: var(--highlight-text);
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* ===== Section View ===== */
.section-list { display: flex; flex-direction: column; gap: 10px; }
.section-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.25s var(--ease);
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid transparent;
}
.section-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--mag-color, var(--primary-light));
    transform: translateY(-1px);
}
.section-card:active { transform: translateY(0); }
.sc-name { flex: 1; font-weight: 600; font-size: 15px; color: var(--text); }
.sc-count { font-size: 13px; color: var(--text-3); white-space: nowrap; min-width: 44px; text-align: right; font-weight: 500; }
.sc-unit { display: none; }

/* ===== Catalog View ===== */
.catalog-list { display: flex; flex-direction: column; gap: 10px; }
.year-block {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.yb-header {
    background: linear-gradient(135deg, var(--mag-color-dark, var(--primary-dark)) 0%, var(--mag-color, var(--primary)) 100%);
    color: #f2eeec;
    padding: 13px 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: opacity 0.2s var(--ease);
}
.yb-header:hover { opacity: 0.92; }
.yb-header h3 { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.yb-info { font-size: 12px; opacity: 0.8; }
.yb-right { display: flex; align-items: center; gap: 10px; }
.yb-toggle {
    transition: transform 0.3s var(--ease);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}
.yb-toggle .icon { width: 16px; height: 16px; }
.year-block.collapsed .yb-toggle { transform: rotate(-90deg); }
.year-block.collapsed .yb-body { display: none; }
.issue-row { border-bottom: 1px solid var(--border); }
.issue-row:last-child { border-bottom: none; }
.ir-header {
    padding: 13px 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.15s var(--ease);
}
.ir-header:hover { background: var(--bg-2); }
.ir-title { font-weight: 600; font-size: 15px; color: var(--text); }
.ir-count {
    font-size: 12px;
    color: var(--text-3);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.ir-right { display: flex; align-items: center; gap: 8px; }
.ir-toggle {
    transition: transform 0.3s var(--ease);
    color: var(--text-3);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ir-toggle .icon { width: 14px; height: 14px; }
.issue-row.collapsed .ir-toggle { transform: rotate(-90deg); }
.issue-row.collapsed .ir-body { display: none; }
.ir-body { padding: 8px 18px 12px; }
.sec-group {
    margin: 6px 0;
    padding-left: 14px;
    border-left: 3px solid var(--border-2);
    transition: border-color 0.2s var(--ease);
}
.sec-group:hover { border-left-color: var(--mag-color, var(--primary-light)); }
.sg-title {
    font-weight: 700;
    color: var(--mag-color-dark, var(--primary-dark));
    font-size: 13px;
    margin: 8px 0 4px;
}
.sg-title .count { font-size: 12px; color: var(--text-3); font-weight: 400; }
.art-item {
    padding: 7px 10px;
    margin: 2px 0;
    font-size: 15px;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.15s var(--ease);
    line-height: 1.5;
    border-radius: var(--radius-sm);
}
.art-item:hover {
    color: var(--mag-color, var(--primary));
    background: var(--bg-2);
}
.art-item .ai-author { color: var(--text-3); font-size: 13px; }

/* ===== Favorites View ===== */
.fav-empty {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-3);
}
.fav-empty .fav-empty-icon { width: 40px; height: 40px; margin: 0 auto 14px; color: var(--border-2); display: flex; justify-content: center; }
.fav-empty .fav-empty-icon .icon { width: 40px; height: 40px; }
.fav-empty .fav-empty-text { font-size: 15px; font-weight: 500; color: var(--text-2); }
.fav-empty .fav-empty-hint { font-size: 13px; margin-top: 6px; color: var(--text-3); }
.fav-header {
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.fh-count { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.fh-count .icon { width: 16px; height: 16px; color: var(--fav); }
.fh-actions { display: flex; gap: 8px; }
.fh-actions button {
    padding: 6px 12px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    background: var(--card);
    cursor: pointer;
    font-size: 12px;
    color: var(--text-2);
    transition: all 0.2s var(--ease);
}
.fh-actions button:hover { border-color: var(--mag-color, var(--primary-light)); color: var(--mag-color, var(--primary)); }

/* ===== Back to Top with Progress Ring ===== */
.back-to-top {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--card);
    color: var(--mag-color, var(--primary));
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 210;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
}
.back-to-top .icon {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
}
.back-to-top .progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.back-to-top .progress-ring-bg {
    fill: none;
    stroke: var(--border-2);
    stroke-width: 2.5;
}
.back-to-top .progress-ring-fg {
    fill: none;
    stroke: var(--mag-color, var(--primary));
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 131.95;
    stroke-dashoffset: 131.95;
    transition: stroke-dashoffset 0.05s linear;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--mag-color, var(--primary));
    color: white;
}
.back-to-top:hover .progress-ring-bg {
    stroke: rgba(255,255,255,0.25);
}
.back-to-top:hover .progress-ring-fg {
    stroke: white;
}
.back-to-top:active { transform: scale(0.92); }

/* ===== Article Page ===== */
.article-page {
    background: var(--bg);
    position: relative;
    z-index: 200;
    min-height: 100vh;
}
.article-page-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 10px 0 12px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    box-shadow: 0 1px 3px rgba(3,2,2,0.04);
    position: relative;
}
/* 头部内容与正文栏同宽同边距：返回键、主标题、元信息、正文左边缘始终对齐。
   网格布局：返回按钮与工具栏各占一格，主标题与元信息各占整行。
   之前工具栏是绝对定位、靠标题的 padding-right 避让，导致长标题被挤成
   窄条、每行右侧都留一大块空白。grid 让主标题真正独占整行。 */
.ap-header-inner {
    max-width: calc(var(--article-w-base, 760px) + var(--article-w-delta, 0px));
    margin: 0 auto;
    padding: 0 var(--article-gutter, 18px);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "back  actions"
        "title title"
        "meta  meta";
    align-items: center;
}
.ap-back-btn {
    grid-area: back;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--mag-color, var(--primary));
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 0;
    margin-bottom: 0;
    transition: opacity 0.15s var(--ease);
}
.ap-back-btn .icon { width: 18px; height: 18px; }
.ap-back-btn:active { opacity: 0.6; }
.ap-actions {
    grid-area: actions;
    display: flex;
    gap: 6px;
}
.ap-fav-btn, .ap-original-link, .ap-copy-btn {
    border: none;
    background: #f2ecea;
    color: var(--text-2);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
    text-decoration: none;
}
.ap-fav-btn .icon, .ap-original-link .icon, .ap-copy-btn .icon { width: 17px; height: 17px; }
.ap-fav-btn:hover, .ap-original-link:hover, .ap-copy-btn:hover {
    background: #ebe3df;
    color: var(--mag-color, var(--primary));
}
.ap-copy-btn.copied { color: #2e7d32; }
.ap-fav-btn.active {
    color: var(--fav);
    background: #fae5c1;
}
.ap-settings-btn {
    border: none;
    background: #f2ecea;
    color: var(--text-2);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-serif);
    line-height: 1;
}
.ap-settings-btn:hover {
    background: #ebe3df;
    color: var(--mag-color, var(--primary));
}
.ap-settings-btn.active {
    background: var(--mag-color, var(--primary));
    color: white;
}

/* Settings Panel */
.ap-settings-panel {
    position: fixed;
    /* 下移一行，避开右上角的操作按钮组（Aa / 收藏 / 原文 / 复制链接） */
    top: calc(56px + env(safe-area-inset-top, 0px));
    right: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 14px 16px;
    z-index: 300;
    min-width: 240px;
    display: none;
    gap: 14px;
    flex-direction: column;
    /* 设置项增多后需要滚动，避免小屏超出视口 */
    max-height: calc(100vh - 68px);
    max-height: calc(100vh - 68px - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.ap-settings-panel.show {
    display: flex;
    animation: aspIn 0.18s var(--ease);
}
.asp-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: none;
    color: var(--text-3);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s var(--ease);
}
.asp-close-btn .icon { width: 15px; height: 15px; }
.asp-close-btn:hover { background: var(--bg-2); color: var(--text); }
@keyframes aspIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.asp-section { display: flex; flex-direction: column; gap: 8px; }
.asp-label {
    font-size: 12px;
    color: var(--text-3);
    font-weight: 600;
}
.asp-btn-group {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    padding: 3px;
}
.asp-btn {
    flex: 1;
    border: none;
    background: none;
    color: var(--text-2);
    font-size: 13px;
    padding: 7px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    font-family: inherit;
}
.asp-btn:hover { color: var(--text); }
.asp-btn.active {
    background: var(--mag-color, var(--primary));
    color: white;
    font-weight: 600;
}

.ap-title {
    grid-area: title;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text);
    margin: 12px 0 4px;
}
.ap-meta {
    grid-area: meta;
    font-size: 13px;
    color: var(--text-3);
}

/* Article Body */
.article-page-body {
    max-width: calc(var(--article-w-base, 760px) + var(--article-w-delta, 0px));
    margin: 0 auto;
    padding: 24px var(--article-gutter, 18px) 56px;
    font-family: var(--font-serif);
    font-size: var(--article-fs, 20px);
    line-height: var(--article-lh, 2.05);
    color: var(--text);
}
.article-page-body p {
    margin-bottom: 16px;
    text-indent: var(--article-indent, 2em);
    text-align: justify;
    text-justify: inter-ideograph;
}
.article-page-body p.md-heading {
    text-indent: var(--article-indent, 2em);
    text-align: left;
    font-weight: 700;
    color: var(--text);
    margin-top: 24px;
    font-size: calc(var(--article-fs, 20px) * 1.15);
}
.article-page-body p.md-heading[id], .article-page-body p.md-subheading[id] { scroll-margin-top: 76px; }
.article-layout { position: relative; }
.article-toc { position: absolute; left: 24px; top: 28px; width: 190px; max-height: 70vh; overflow: auto; padding: 12px; border-left: 2px solid var(--border-2); color: var(--text-2); }
.article-toc strong,.article-toc a { display: block; margin-bottom: 8px; }
.article-toc a { color: inherit; font-size: 12px; text-decoration: none; }
.article-toc a:hover { color: var(--primary); }
@media (max-width: 1100px) { .article-toc { display: none; } }
@media (max-width: 640px) { .home-latest-list { grid-template-columns: 1fr; } }
.article-page-body p.md-bold {
    text-indent: var(--article-indent, 2em);
    text-align: left;
    font-weight: 700;
    color: var(--mag-color-dark, var(--primary-dark));
    margin-top: 18px;
}
.article-page-body p.md-subheading {
    text-indent: var(--article-indent, 2em);
    text-align: left;
    font-weight: 700;
    color: var(--text);
    font-size: var(--article-fs, 20px);
    margin-top: 22px;
}
.article-page-body :is(h1, h2, h3, h4, h5, h6) {
    text-indent: var(--article-indent, 2em);
}
.article-page-body strong { font-weight: 700; }
.article-page-body div {
    margin-bottom: 16px;
    text-indent: 0;
}
.article-page-body div:last-child { margin-bottom: 0; }
.article-page-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 16px auto;
    border-radius: var(--radius-sm);
}
.article-page-body a {
    color: var(--mag-color, var(--primary));
    text-decoration: none;
    border-bottom: 1px solid var(--border-2);
    transition: border-color 0.2s var(--ease);
}
.article-page-body a:hover {
    border-bottom-color: var(--mag-color, var(--primary));
}
.article-page-body strong > img {
    margin: 16px auto;
}
.article-page-body .no-body {
    text-align: center;
    color: var(--text-3);
    padding: 48px 0;
    font-size: 14px;
    text-indent: 0;
}
.article-page-body .no-body small { display: block; margin-top: 6px; font-size: 12px; }
.article-page-body .retry-btn {
    margin-top: 16px;
    padding: 8px 20px;
    border: 1px solid var(--mag-color, var(--primary-light));
    border-radius: var(--radius-sm);
    background: var(--mag-color, var(--primary));
    color: white;
    cursor: pointer;
    font-size: 13px;
    transition: opacity 0.2s var(--ease);
}
.article-page-body .retry-btn:hover { opacity: 0.9; }
.article-page-body .article-loading {
    text-align: center;
    padding: 48px 0;
    color: var(--text-3);
    text-indent: 0;
}

/* ===== Section Page ===== */
.section-page {
    background: var(--bg);
    z-index: 150;
    min-height: 100vh;
}
.section-page-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(3,2,2,0.04);
}
.sp-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--mag-color, var(--primary));
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 0;
    margin-bottom: 6px;
    transition: opacity 0.15s var(--ease);
}
.sp-back-btn .icon { width: 18px; height: 18px; }
.sp-back-btn:active { opacity: 0.6; }
.sp-title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text);
}
.sp-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.sp-meta { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.sp-search-input {
    flex: 1;
    min-width: 120px;
    max-width: 240px;
    margin-left: auto;
    padding: 6px 12px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
    -webkit-appearance: none;
}
.sp-search-input:focus { outline: none; border-color: var(--mag-color, var(--primary-light)); background: var(--card); }
.sp-search-input::placeholder { color: var(--text-3); }
.section-page-search { display: none; }

.section-page-body {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 12px 16px 56px;
}
.sp-year-group { margin-bottom: 18px; }
.sp-year-header {
    font-weight: 700;
    color: var(--mag-color-dark, var(--primary-dark));
    font-size: 14px;
    padding: 10px 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}
.sp-issue-group { margin-left: 4px; margin-bottom: 10px; }
.sp-issue-label {
    font-size: 13px;
    color: var(--text-3);
    font-weight: 600;
    padding: 4px 0 3px;
}
.sp-article {
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-2);
    border-left: 3px solid var(--border);
    margin-bottom: 3px;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
    line-height: 1.5;
    border-radius: 0 4px 4px 0;
}
.sp-article:hover { border-left-color: var(--mag-color, var(--primary)); color: var(--mag-color, var(--primary)); background: var(--bg); }
.sp-article .author { color: var(--text-3); font-size: 13px; }
.sp-article.no-body {
    cursor: default;
    color: var(--text-3);
    border-left-color: var(--border-2);
}
.sp-article.no-body:hover { border-left-color: var(--border-2); color: var(--text-3); background: none; }
.sp-no-body-tag {
    display: inline-block;
    background: #f3eeec;
    color: var(--text-3);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 6px;
    vertical-align: middle;
}

/* ===== About Page ===== */
.about-page {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow-y: auto;
    background: var(--bg);
    z-index: 250;
}
.about-page-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(3,2,2,0.04);
}
.ab-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--mag-color, var(--primary));
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 0;
    margin-bottom: 4px;
    transition: opacity 0.15s var(--ease);
}
.ab-back-btn .icon { width: 18px; height: 18px; }
.ab-back-btn:active { opacity: 0.6; }
.ab-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}
.about-page-body {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 20px 56px;
}
.about-section { margin-bottom: 28px; }
.about-section h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--mag-color-dark, var(--primary-dark));
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--border);
}
.about-section p {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.8;
    margin-bottom: 6px;
}
.about-section strong { color: var(--text); }
.about-mag-list {
    list-style: none;
    margin: 8px 0 12px;
}
.about-mag-list li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-2);
}
.about-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--mag-color, var(--primary));
    font-size: 14px;
    text-decoration: none;
    padding: 8px 14px;
    background: var(--card);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    margin: 6px 0;
    transition: all 0.2s var(--ease);
}
.about-link:hover { border-color: var(--mag-color, var(--primary-light)); background: var(--bg); }
.about-link .icon { width: 16px; height: 16px; }
.about-github { font-weight: 600; }
.about-github .icon { width: 18px; height: 18px; }
.about-note {
    font-size: 12px !important;
    color: var(--text-3) !important;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8f1ed;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border-2);
}
.about-footer {
    text-align: center;
    padding: 24px 0 0;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}
.about-footer p { font-size: 12px; color: var(--text-3); }

/* ===== Loading ===== */
.loading { text-align: center; padding: 48px 0; color: var(--text-3); font-size: 14px; }
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2.5px solid var(--border);
    border-top-color: var(--mag-color, var(--primary));
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Dark Mode Overrides (hardcoded colors) ===== */
html[data-theme="dark"] .ap-fav-btn,
html[data-theme="dark"] .ap-original-link,
html[data-theme="dark"] .ap-copy-btn,
html[data-theme="dark"] .ap-settings-btn {
    background: #45403e;
}
html[data-theme="dark"] .ap-fav-btn:hover,
html[data-theme="dark"] .ap-original-link:hover,
html[data-theme="dark"] .ap-copy-btn:hover,
html[data-theme="dark"] .ap-settings-btn:hover {
    background: #504a48;
}
html[data-theme="dark"] .ap-fav-btn.active {
    background: #5d4c30;
}
html[data-theme="dark"] .mag-cover { filter: brightness(0.85); }
@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] .ap-fav-btn,
    html[data-theme="auto"] .ap-original-link,
    html[data-theme="auto"] .ap-copy-btn,
    html[data-theme="auto"] .ap-settings-btn {
        background: #45403e;
    }
    html[data-theme="auto"] .ap-fav-btn:hover,
    html[data-theme="auto"] .ap-original-link:hover,
    html[data-theme="auto"] .ap-copy-btn:hover,
    html[data-theme="auto"] .ap-settings-btn:hover {
        background: #504a48;
    }
    html[data-theme="auto"] .ap-fav-btn.active {
        background: #5d4c30;
    }
    html[data-theme="auto"] .mag-cover { filter: brightness(0.85); }
}

/* ===== Desktop (>=768px) ===== */
@media (min-width: 768px) {
    :root { --header-h: 80px; --search-h: 80px; --article-w-base: 860px; --article-gutter: 48px; }
    .desktop-only { display: flex; }
    .mobile-only { display: none; }
    body { padding-bottom: 0; font-size: 15px; }

    /* Left-right layout: sidebar + main */
    body.mag-active #app {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
    }
    /* Override: hide #app when section/article/about pages are active */
    body.mag-active.section-active #app,
    body.mag-active.article-active #app,
    body.mag-active.about-active #app {
        display: none;
    }
    .app-sidebar {
        width: 380px;
        flex-shrink: 0;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        background: var(--bg-2);
        border-right: 1px solid var(--border);
        z-index: 100;
    }
    .app-sidebar::-webkit-scrollbar { width: 4px; }
    .app-sidebar::-webkit-scrollbar-track { background: transparent; }
    .app-sidebar::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
    .app-sidebar::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
    .app-main {
        flex: 1;
        min-width: 0;
    }

    /* Home */
    .home-header { padding: calc(32px + env(safe-area-inset-top, 0px)) 24px 20px; }
    .home-title { font-size: 36px; letter-spacing: 10px; }
    .home-subtitle { font-size: 14px; letter-spacing: 6px; }
    .home-about-btn { width: 38px; height: 38px; top: 8px; }
    .home-about-btn .icon { width: 19px; height: 19px; }
    .home-search { margin: 0 auto 18px; }
    .home-search-copy strong { font-size: 17px; }
    .home-search-copy span { font-size: 12px; }
    .home-search-form { min-height: 58px; padding-left: 18px; }
    .home-search-form input { font-size: 16px; }
    .home-search-form button { padding: 11px 20px; }
    .home-search-btn { width: 38px; height: 38px; top: 8px; right: 50px; }
    .home-search-btn .icon { width: 19px; height: 19px; }
    .magazine-grid {
        flex-direction: row;
        max-width: 900px;
        gap: 28px;
    }
    .magazine-card {
        flex-direction: column;
        flex: 1;
    }
    .mag-cover {
        width: 100%;
        aspect-ratio: 3 / 4;
    }
    .mag-cover-title { font-size: 28px; }
    .mag-cover-sub { font-size: 9px; }
    .mag-cover-edition { font-size: 10px; }
    .mag-info { padding: 20px 22px; }
    .mag-info h2 { font-size: 20px; }
    .mag-desc { font-size: 13px; }
    .mag-meta { font-size: 13px; }
    .home-guide-entry { max-width: 900px; }

    /* Sidebar Header (desktop) - spacious grand */
    .sidebar-header {
        background: var(--card);
        color: var(--text);
        padding: 44px 36px 28px;
        text-align: left;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid var(--border);
        position: relative;
    }
    .sidebar-header::after {
        content: "";
        position: absolute;
        bottom: -1px;
        left: 36px;
        width: 48px;
        height: 2px;
        background: var(--mag-color, var(--primary));
        border-radius: 1px;
    }
    .sidebar-brand h1 {
        font-size: 30px;
        letter-spacing: 3px;
        margin-bottom: 10px;
        color: var(--text);
        font-weight: 800;
    }
    .sidebar-meta { justify-content: flex-start; }
    .app-subtitle { font-size: 14px; color: var(--text-3); opacity: 1; }
    .search-status { font-size: 12px; opacity: 1; color: var(--text-3); }
    .header-home-btn {
        width: 36px; height: 36px;
        left: auto; top: 36px; right: 58px;
        transform: none;
        background: transparent;
        border: none;
        color: var(--text-3);
        border-radius: 8px;
    }
    .header-home-btn:hover {
        background: var(--bg);
        color: var(--mag-color);
    }
    .header-about-btn {
        width: 36px; height: 36px;
        right: 20px; top: 36px;
        transform: none;
        background: transparent;
        border: none;
        color: var(--text-3);
        border-radius: 8px;
    }
    .header-about-btn:hover {
        background: var(--bg);
        color: var(--mag-color);
    }
    .header-home-btn .icon, .header-about-btn .icon { width: 19px; height: 19px; }

    /* Search (in sidebar) */
    .search-bar {
        padding: 28px 36px 32px;
        position: relative;
        top: auto;
        z-index: auto;
        border-bottom: 1px solid var(--border);
        background: var(--card);
    }
    #searchInput { font-size: 15px; padding: 13px 16px 13px 44px; }
    .search-btn { padding: 13px 26px; font-size: 14px; }
    .filters { margin-top: 18px; flex-direction: column; align-items: stretch; gap: 12px; }
    .scope-group { justify-content: space-between; }
    .scope-option { font-size: 12px; padding: 6px 10px; flex: 1; justify-content: center; }
    .filter-check { font-size: 12px; justify-content: center; padding: 6px 0; background: var(--bg); border-radius: var(--radius-sm); }

    /* Nav (in main, sticky at top) */
    .nav-tabs {
        position: sticky;
        top: 0;
        z-index: 98;
        display: flex;
        padding: 8px 24px;
        background: var(--card);
        border-bottom: 1px solid var(--border);
        max-width: none;
        margin: 0;
    }
    .nav-tab { font-size: 15px; padding: 12px 16px; }

    /* Content (in main) */
    .content { padding: 20px 24px 40px; position: relative; z-index: 1; max-width: none; }
    .result-card { padding: 16px 20px; }
    .rc-title { font-size: 16px; }

    /* Section cards - grid layout */
    .section-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 16px;
    }
    .section-card {
        flex-direction: column;
        align-items: center;
        padding: 28px 20px 24px;
        text-align: center;
        gap: 0;
        position: relative;
        overflow: hidden;
    }
    .section-card::before {
        content: "";
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--mag-color-dark, var(--primary-dark)), var(--mag-color, var(--primary)));
        opacity: 0;
        transition: opacity 0.25s var(--ease);
    }
    .section-card:hover::before { opacity: 1; }
    .sc-name {
        font-size: 18px;
        font-weight: 700;
        color: var(--text);
        margin-bottom: 10px;
        line-height: 1.4;
    }
    .sc-count {
        font-size: 15px;
        font-weight: 500;
        color: var(--text-3);
        line-height: 1;
        font-variant-numeric: tabular-nums;
        display: flex;
        align-items: baseline;
        gap: 2px;
        justify-content: center;
    }
    .sc-unit {
        display: inline;
        font-size: 13px;
        color: var(--text-3);
    }

    /* Catalog */
    .year-block { border-radius: var(--radius); }
    .yb-header { padding: 15px 22px; }
    .yb-header h3 { font-size: 18px; }
    .ir-header { padding: 15px 22px; }
    .ir-title { font-size: 16px; }
    .ir-body { padding: 10px 22px 14px; }
    .art-item { font-size: 15px; padding: 8px 12px; }

    /* Article */
    .article-page-body {
        max-width: calc(var(--article-w-base, 860px) + var(--article-w-delta, 0px));
        padding: 40px var(--article-gutter, 48px) 56px;
    }
    .article-page-body p { margin-bottom: 16px; }
    .ap-title { font-size: 26px; }
    /* 让"继续阅读"条与文末导航的正文栏和 .article-page-body 对齐 */
    .ap-continue { padding: 10px var(--article-gutter, 48px); }
    .article-page-footer { padding: 0 var(--article-gutter, 48px) 72px; }
    .article-page-header { padding: 14px 0 16px; }
    .ap-back-btn { font-size: 15px; }

    /* Section Page */
    .section-page-body { padding: 16px 24px 56px; }
    .section-page-header { padding: 14px 24px 14px; }
    .sp-title { font-size: 22px; }
    .sp-search-input { font-size: 14px; padding: 8px 14px; max-width: 280px; }

    /* About */
    .about-page-body { padding: 40px 48px 56px; }
    .about-section h2 { font-size: 18px; }
    .about-section p { font-size: 15px; }

    .home-footer { font-size: 12px; padding: 24px 20px; }
}

/* ===== Wide (>=1024px) ===== */
@media (min-width: 1024px) {
    .sidebar-brand h1 { font-size: 32px; letter-spacing: 3px; }
    .mag-cover-title { font-size: 30px; }
    .app-sidebar { width: 400px; }
}

/* ===== 访问密码门 ===== */
.gate {
    position: fixed;
    /* Chrome 69 不支持 inset 简写（Chrome 87+），必须写长写兜底 */
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #4a0808 0%, #7a0d0d 40%, #8b0000 100%);
    overflow: hidden;
    transition: opacity 0.4s var(--ease), visibility 0.4s;
    opacity: 1;
    visibility: visible;
}
.gate--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.gate-bg {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.gate-bg-pattern {
    position: absolute;
    top: -50%; right: -50%; bottom: -50%; left: -50%;
    inset: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 215, 160, 0.10) 0%, transparent 35%),
        radial-gradient(circle at 80% 70%, rgba(255, 180, 120, 0.08) 0%, transparent 35%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.015) 0 2px, transparent 2px 18px);
    animation: gateDrift 24s linear infinite;
}
@keyframes gateDrift {
    from { transform: translate(0, 0) rotate(0deg); }
    to   { transform: translate(-5%, -5%) rotate(360deg); }
}
.gate-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 252, 248, 0.97);
    border-radius: 18px;
    padding: 44px 36px 32px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.35),
        0 6px 18px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(139, 0, 0, 0.12);
    text-align: center;
    animation: gateCardIn 0.6s var(--ease) both;
}
@keyframes gateCardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.gate-emblem {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, #8b0000, #6a0000);
    color: #fde8c0;
    box-shadow: 0 6px 18px rgba(139, 0, 0, 0.32), inset 0 2px 0 rgba(255, 255, 255, 0.15);
    position: relative;
}
.gate-emblem::after {
    content: "";
    position: absolute;
    top: -6px; right: -6px; bottom: -6px; left: -6px;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(139, 0, 0, 0.25);
    opacity: 0.6;
}
.gate-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: #2a0808;
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}
.gate-subtitle {
    font-size: 14px;
    color: #6b5d5d;
    margin-bottom: 28px;
    line-height: 1.6;
}
.gate-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
}
.gate-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #d6c8c4;
    border-radius: 10px;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    overflow: hidden;
}
.gate-input-wrap:focus-within {
    border-color: #8b0000;
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.12);
}
.gate-input-wrap.gate-shake {
    animation: gateShake 0.5s var(--ease);
    border-color: #c0392b;
}
@keyframes gateShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(4px); }
}
.gate-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    padding: 14px 16px;
    font-size: 16px;
    color: #2a0808;
    letter-spacing: 0.1em;
    -webkit-appearance: none;
    appearance: none;
}
.gate-input::placeholder {
    color: #b3a3a0;
    letter-spacing: 0.05em;
}
.gate-input--err {
    color: #c0392b;
}
.gate-toggle {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #8b0000;
    width: 40px;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease);
}
.gate-toggle:hover {
    background: rgba(139, 0, 0, 0.06);
}
.gate-toggle .icon { width: 18px; height: 18px; }
.gate-submit {
    border: none;
    background: linear-gradient(135deg, #8b0000, #6a0000);
    color: #fff;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s;
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.28);
}
.gate-submit:hover {
    box-shadow: 0 6px 18px rgba(139, 0, 0, 0.38);
    transform: translateY(-1px);
}
.gate-submit:active { transform: translateY(0); }
.gate-submit .icon { width: 18px; height: 18px; }
.gate-hint {
    min-height: 18px;
    font-size: 13px;
    line-height: 1.4;
    color: #6b5d5d;
    margin: 0;
}
.gate-hint--err { color: #c0392b; font-weight: 600; }
.gate-hint--ok  { color: #2a7a3b; font-weight: 600; }
.gate-footer {
    margin-top: 24px;
    font-size: 12px;
    color: #9a8c8a;
    line-height: 1.6;
    padding-top: 18px;
    border-top: 1px dashed rgba(139, 0, 0, 0.18);
}
body.gate-active { overflow: hidden; }

@media (max-width: 480px) {
    .gate-card { padding: 36px 24px 24px; border-radius: 14px; }
    .gate-title { font-size: 19px; }
    .gate-subtitle { font-size: 13px; margin-bottom: 22px; }
    .gate-emblem { width: 64px; height: 64px; margin-bottom: 14px; }
    .gate-emblem svg { width: 44px; height: 44px; }
    .gate-input { font-size: 15px; padding: 12px 14px; }
    .gate-submit { padding: 12px 16px; font-size: 14px; }
    .gate-footer { font-size: 11px; margin-top: 18px; padding-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .gate-bg-pattern { animation: none; }
    .gate-card { animation: none; }
    .gate-input-wrap.gate-shake { animation: none; }
    /* 全局收敛动效。Chrome 69 不认识该媒体查询，整块自动忽略。 */
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   阅读体验增强（行距 / 页宽 / 纸张 / 阅读位置 / 上下篇 / 相关阅读）
   ============================================================ */

/* ---- 页宽 / 页边距 ----
   之前页宽只用 max-width 表达（基准 860px + 偏移），而窄视口下元素宽被视口
   顶住，max-width 完全不生效，"宽"这一档是死档、"窄"也只差十几像素，
   用户点按钮看不到任何变化。现在改成双机制：
     1) --article-gutter 控制左右留白（真正的"页边距"），三档硬拉开差异，
        任何视口宽度下都能看出变化；
     2) --article-w-delta 控制 max-width，在宽屏上继续调整整栏宽度。
   档位由 <html data-article-width="narrow|standard|wide"> 驱动（app.js 的
   applyWidth 写入），属性选择器优先级高于 :root 默认值。 */
html[data-article-width="narrow"] { --article-gutter: 40px; }
html[data-article-width="wide"]   { --article-gutter: 6px; }
@media (min-width: 768px) {
    html[data-article-width="narrow"] { --article-gutter: 112px; }
    html[data-article-width="wide"]   { --article-gutter: 12px; }
}

/* ---- 继续上次阅读 ---- */
.ap-continue {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(var(--article-w-base, 760px) + var(--article-w-delta, 0px));
    margin: 0 auto;
    padding: 10px var(--article-gutter, 18px);
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-2);
}
.ap-continue[hidden] { display: none; }
.ap-continue-icon { width: 15px; height: 15px; color: var(--mag-color, var(--primary)); flex-shrink: 0; }
.ap-continue-text { flex: 1; }
.ap-continue-text strong { color: var(--mag-color, var(--primary)); }
.ap-continue-btn {
    border: none;
    background: var(--mag-color, var(--primary));
    color: #fff;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
}
.ap-continue-close {
    border: none;
    background: none;
    color: var(--text-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    padding: 0;
    flex-shrink: 0;
}
.ap-continue-close .icon { width: 13px; height: 13px; }

/* ---- 文末：上下篇 + 相关阅读 ---- */
.article-page-footer {
    max-width: calc(var(--article-w-base, 760px) + var(--article-w-delta, 0px));
    margin: 0 auto;
    padding: 0 var(--article-gutter, 18px) 72px;
}
.article-page-footer[hidden] { display: none; }
.ap-nav {
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}
.ap-nav-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.ap-nav-item:hover { border-color: var(--mag-color, var(--primary)); background: var(--bg-2); }
.ap-nav-dir {
    font-size: 12px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 4px;
}
.ap-nav-dir .icon { width: 13px; height: 13px; }
.ap-nav-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text);
    /* 完整显示标题，不再限制两行 */
    overflow-wrap: break-word;
    word-break: break-word;
}
.ap-nav-empty { flex: 1; }

.ap-related {
    margin-top: 26px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}
.ap-related-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}
.ap-related-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ap-related-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: background 0.15s var(--ease);
}
.ap-related-item:hover { background: var(--border); }
.ap-related-meta { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.ap-related-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* ---- 搜索框快捷键提示 ---- */
.search-kbd {
    display: none;
    align-self: center;
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--text-3);
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
    line-height: 1.6;
}
@media (min-width: 768px) {
    .search-kbd { display: inline-block; }
    .search-box:focus-within .search-kbd { display: none; }
}

/* ---- 纸张底色：仅浅色模式有意义，深色模式下隐藏该设置项 ---- */
html[data-theme="dark"] .asp-section--light-only { display: none; }
@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] .asp-section--light-only { display: none; }
}

/* ---- 键盘焦点样式 ----
   Chrome 69 不支持 :focus-visible（Chrome 86+），先用 :focus 兜底；
   现代浏览器再用 :focus:not(:focus-visible) 去掉鼠标点击时的焦点框
   （:not() 里的未知伪类是合法语法，只是在 Chrome 69 上永不匹配）。 */
:focus { outline: 2px solid var(--mag-color, var(--primary)); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* ---- 长列表渲染优化 ----
   content-visibility 需 Chrome 85+，放在 @supports 里，老浏览器整块忽略。 */
@supports (content-visibility: auto) {
    .art-item { content-visibility: auto; contain-intrinsic-size: 40px; }
    .result-card { content-visibility: auto; contain-intrinsic-size: 96px; }
}

/* ============================================================
   Chrome 69 兼容层
   ------------------------------------------------------------
   · flex 的 gap 需 Chrome 84+。Chrome 69 只支持 grid 的 gap（Chrome 66+），
     因此**不能**用 `@supports not (gap: 1px)` 判断——Chrome 66~83 会被误判为
     "已支持 flex gap"。这里统一用 aspect-ratio（Chrome 88+）作为旧版浏览器标记，
     与文件上方的 `@supports not (aspect-ratio: 3 / 4)` 写法保持一致。
   · 本块生效于 Chrome 87 及更早。其中 Chrome 84~87 其实已经支持 flex gap，
     若只补 margin 就会与 gap 叠加成双倍间距；所以先把 gap 归零、间距一律
     交给 margin，保证 Chrome 69 → 88+ 的渲染结果完全一致。
   · grid 容器的 gap 自 Chrome 66 起就支持，不归零（见 .section-list）。
   · inset 简写需 Chrome 87+，已在各处补 top/right/bottom/left 长写兜底。
   · accent-color 需 Chrome 93+，已改为自绘单选/复选框（各浏览器观感一致）。
   ============================================================ */
@supports not (aspect-ratio: 3 / 4) {

    /* ---- 横向排列：后续元素补左边距 ---- */
    .guide-link-card { gap: 0; }
    .guide-link-card > * + * { margin-left: 12px; }
    .sidebar-meta { gap: 0; }
    .sidebar-meta > * + * { margin-left: 8px; }
    .search-box { gap: 0; }
    .search-box > * + * { margin-left: 8px; }
    .scope-group { gap: 0; }
    .scope-group > * + * { margin-left: 2px; }
    .nav-tabs { gap: 0; }
    .nav-tabs > * + * { margin-left: 4px; }
    .pagination { gap: 0; }
    .pagination > * + * { margin-left: 4px; }
    .rc-meta { gap: 0; }
    .rc-meta > * + * { margin-left: 4px; }
    .section-card { gap: 0; }
    .section-card > * + * { margin-left: 16px; }
    .yb-right { gap: 0; }
    .yb-right > * + * { margin-left: 10px; }
    .ir-right { gap: 0; }
    .ir-right > * + * { margin-left: 8px; }
    .fh-actions { gap: 0; }
    .fh-actions > * + * { margin-left: 8px; }
    .ap-back-btn { gap: 0; }
    .ap-back-btn > * + * { margin-left: 4px; }
    .ap-actions { gap: 0; }
    .ap-actions > * + * { margin-left: 6px; }
    .asp-btn-group { gap: 0; }
    .asp-btn-group > * + * { margin-left: 4px; }
    .sp-back-btn { gap: 0; }
    .sp-back-btn > * + * { margin-left: 4px; }
    .sp-title-row { gap: 0; }
    .sp-title-row > * + * { margin-left: 10px; }
    .ab-back-btn { gap: 0; }
    .ab-back-btn > * + * { margin-left: 4px; }
    .gate-submit { gap: 0; }
    .gate-submit > * + * { margin-left: 8px; }

    /* ---- 纵向排列：后续元素补上边距 ---- */
    .magazine-grid { gap: 0; }
    .magazine-grid > * + * { margin-top: 20px; }
    .bn-item { gap: 0; }
    .bn-item > * + * { margin-top: 3px; }
    .results-list { gap: 0; }
    .results-list > * + * { margin-top: 10px; }
    .section-list { gap: 0; }
    .section-list > * + * { margin-top: 10px; }
    .catalog-list { gap: 0; }
    .catalog-list > * + * { margin-top: 10px; }
    .asp-section { gap: 0; }
    .asp-section > * + * { margin-top: 8px; }
    .gate-form { gap: 0; }
    .gate-form > * + * { margin-top: 14px; }

    /* ---- 跨刊结果分组 ---- */
    .result-group { gap: 0; }
    .result-group > * + * { margin-top: 10px; }
    .result-group-head { gap: 0; }
    .result-group-head > * + * { margin-left: 8px; }

    /* ---- 主页搜索浮层 ---- */
    .gs-box { gap: 0; }
    .gs-box > * + * { margin-left: 8px; }

    /* ---- 正文搜索显式触发按钮 ---- */
    .body-search-actions { gap: 0; }
    .body-search-actions > * + * { margin-left: 10px; }

    /* ---- .filters 基础为横向（可换行） ---- */
    .filters { gap: 0; }
    .filters > * + * { margin-left: 10px; }

    /* ---- 裸文本 / 伪元素是匿名 flex 项，> * + * 选不中，改为给前置元素补右边距 ---- */
    .search-status { gap: 0; }
    .search-status::before { margin-right: 4px; }
    .nav-tab { gap: 0; }
    .nav-tab .icon { margin-right: 6px; }
    .nav-tab .fav-badge { margin-left: 8px; }   /* 原生 gap 6px + 徽标自带 2px */
    .scope-option { gap: 0; }
    .scope-option input[type="radio"] { margin-right: 3px; }
    .filter-check { gap: 0; }
    .filter-check input[type="checkbox"] { margin-right: 4px; }
    .fh-count { gap: 0; }
    .fh-count svg { margin-right: 6px; }
    .about-link { gap: 0; }
    .about-link svg { margin-right: 6px; }

    /* ---- .sc-count 前置为裸文本，给后置 .sc-unit 补左边距 ---- */
    .sc-count { gap: 0; }
    .sc-count .sc-unit { margin-left: 2px; }

    /* ---- 阅读设置面板：关闭按钮绝对定位，只有两个 .asp-section 参与纵向排列 ---- */
    .ap-settings-panel { gap: 0; }
    .ap-settings-panel > .asp-section + .asp-section { margin-top: 14px; }

    /* ---- 阅读体验增强相关容器 ---- */
    .ap-continue { gap: 0; }
    .ap-continue > * + * { margin-left: 8px; }
    .ap-nav { gap: 0; }
    .ap-nav > * + * { margin-left: 12px; }
    .ap-nav-item { gap: 0; }
    .ap-nav-item > * + * { margin-top: 4px; }
    .ap-nav-dir { gap: 0; }
    .ap-nav-dir > * + * { margin-left: 4px; }
    .ap-related-list { gap: 0; }
    .ap-related-list > * + * { margin-top: 8px; }
    .ap-related-item { gap: 0; }
    .ap-related-item > * + * { margin-left: 8px; }

    /* ---- ≥768px 时方向/间距发生变化的容器 ---- */
    @media (min-width: 768px) {
        .magazine-grid { gap: 0; }
        .magazine-grid > * + * { margin-top: 0; margin-left: 28px; }  /* 改为横向 */
        .filters { gap: 0; }
        .filters > * + * { margin-left: 0; margin-top: 12px; }        /* 改为纵向 */
        .section-list { gap: 16px; }                                 /* 改为 grid，用 grid gap */
        .section-list > * + * { margin-top: 0; }
        .section-card { gap: 0; }
        .section-card > * + * { margin-left: 0; margin-top: 0; }      /* 改为纵向且 gap: 0 */
    }
}

/* ===== PWA：离线提示条 / 新版本提示（P2-1） ===== */
.offline-bar {
    display: none;
    position: fixed;
    top: var(--header-h, 56px);
    left: 0;
    right: 0;
    z-index: 190;
    padding: 9px 16px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}
body.is-offline .offline-bar { display: block; }

/* Page-level editorial rhythm */
.home-page { background: radial-gradient(ellipse at 50% -10%, #fffdfa 0, var(--bg) 58%); }
.home-header { padding-top: calc(38px + env(safe-area-inset-top, 0px)); }
.home-title { font-size: 34px; letter-spacing: 8px; }
.home-subtitle { letter-spacing: 5px; }
.home-search { margin-top: 18px; margin-bottom: 30px; }
.home-search-form { min-height: 62px; border-radius: 14px; }
.home-search-form button { border-radius: 9px; }
.home-latest { margin-bottom: 34px; }
.home-body { flex: none; }
.home-body > .home-section-heading { width: 100%; }
.home-latest { padding-top: 8px; }
.home-latest-item { display: flex; flex-direction: column; justify-content: center; min-height: 126px; }
.magazine-card { cursor: default; }
.magazine-card:hover { transform: none; box-shadow: 0 5px 20px rgba(49,37,23,.06); }
.mag-cover { position: relative; }
.mag-info h2 { font-size: 22px; }
.mag-desc { min-height: 2.8em; }
.home-latest-item { min-height: 104px; padding: 18px; border-radius: 14px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.home-latest-item:hover { transform: translateY(-2px); }
.home-body { padding-top: 16px; }
.magazine-grid { max-width: 1000px; }
.magazine-card { border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 5px 20px rgba(49,37,23,.06); }
.mag-cover { border-radius: 15px 15px 0 0; }
.mag-info { align-items: flex-start; text-align: left; padding: 18px 20px 20px; }
.home-section-heading h2 { letter-spacing: .04em; }
.guide-link-card { border-radius: 12px; padding: 15px 18px; }
.app-sidebar { background: var(--bg-2); }
.sidebar-header { background: var(--primary-dark); }
.search-bar { border-bottom-color: var(--border); }
.search-intro { margin-bottom: 14px; }
.nav-tabs { padding-top: 12px; padding-bottom: 12px; }
.content { padding-top: 22px; }
.section-card, .result-card, .year-block, .fav-card { border-radius: 14px; }
.section-card, .result-card, .year-block { box-shadow: 0 3px 14px rgba(49,37,23,.045); }
.article-page-header { padding-bottom: 20px; }
.ap-header-inner { grid-template-columns: 1fr; grid-template-areas: "back" "title" "meta"; }
.article-page-header .ap-back-btn { margin-bottom: 8px; }
.reader-toolbar { position: sticky; top: 0; z-index: 210; background: var(--card); border-bottom: 1px solid var(--border); box-shadow: 0 5px 18px rgba(49,37,23,.045); }
.reader-toolbar-inner { max-width: 1220px; min-height: 54px; margin: auto; padding: 7px 24px; display: flex; align-items: center; }
.reader-toolbar-inner > * + * { margin-left: 16px; }
.reader-toolbar-back,.reader-toc-toggle { border: 0; background: transparent; color: var(--text-2); font-size: 13px; cursor: pointer; white-space: nowrap; }
.reader-toolbar-back { display: flex; align-items: center; }
.reader-toolbar-back .icon { margin-right: 6px; }
.reader-toolbar-back .icon { width: 16px; height: 16px; }
.reader-toolbar-back:hover,.reader-toc-toggle:hover { color: var(--primary); }
.reader-toolbar-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 12px; }
.reader-toolbar .ap-actions { flex-shrink: 0; }
.reader-toolbar .ap-actions > * { border-radius: 8px; }
.reader-toc-toggle[hidden],.article-toc[hidden] { display: none !important; }
.article-layout { max-width: 1220px; margin: auto; }
.article-toc { position: sticky; top: 78px; align-self: start; width: 100%; max-height: calc(100vh - 100px); padding: 18px 20px; box-shadow: none; border: 1px solid var(--border); }
.article-toc strong { font-size: 13px; color: var(--text); }
.article-toc a { padding: 3px 0; }
.article-toc button { display: block; width: 100%; padding: 4px 0; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 12px; line-height: 1.6; text-align: left; cursor: pointer; }
.article-toc button:hover { color: var(--primary); }
.ap-title { font-size: 29px; line-height: 1.42; letter-spacing: .015em; margin-top: 20px; }
.ap-meta { line-height: 1.8; }
.article-page-body { padding-top: 38px; }
.article-page-body p { margin-bottom: 1.1em; }
.article-page-body p.md-heading { margin-top: 2em; padding-bottom: .38em; border-bottom: 1px solid var(--border); }
.article-toc { border-left: 0; border-radius: 12px; background: var(--card); box-shadow: var(--shadow-md); }
.article-toc a { line-height: 1.65; }
@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] {
        --bg: #201f1d; --bg-2: #292724; --card: #302e2a;
        --text: #eee9df; --text-2: #c3bbae; --text-3: #9d958a;
        --border: #45413b; --border-2: #575148;
    }
}
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(158,41,34,.4); outline-offset: 3px; }
@media (min-width: 768px) {
    .home-body { padding-top: 8px; }
    .magazine-grid { gap: 24px; }
    .mag-cover { aspect-ratio: 4 / 3; }
    .home-latest-list { grid-template-columns: 1.2fr 1fr 1fr; }
    .article-layout { max-width: 1260px; margin: 0 auto; }
    .article-toc { left: 24px; }
}
@media (min-width: 1101px) {
    .article-layout:has(.article-toc:not([hidden])) { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 36px; padding: 0 24px; }
    .article-layout:has(.article-toc:not([hidden])) .article-page-body { width: 100%; }
}
@media (max-width: 1100px) {
    .article-toc { display: none; }
    .article-toc.is-open { display: block; position: sticky; top: 54px; z-index: 205; width: calc(100% - 32px); max-width: 760px; margin: 0 auto; max-height: 45vh; overflow: auto; }
}
@media (max-width: 767px) {
    .home-header { padding-top: calc(28px + env(safe-area-inset-top, 0px)); }
    .home-title { font-size: 29px; }
    .home-latest { margin-bottom: 22px; }
    .home-latest-item { min-height: 0; }
    .ap-title { font-size: 23px; }
    .reader-toolbar-inner { padding: 7px 14px; }
    .reader-toolbar-inner > * + * { margin-left: 9px; }
    .reader-toolbar-back span,.reader-toolbar-title { display: none; }
    .reader-toolbar-back { padding: 8px; }
    .reader-toolbar .ap-actions { gap: 4px; }
    .reader-toolbar .ap-actions > * { width: 32px; height: 32px; }
    .reader-toc-toggle { margin-right: auto; font-weight: 600; }
    .magazine-card { cursor: pointer; }
}

.update-toast {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 195;
    max-width: calc(100% - 32px);
    padding: 10px 18px;
    border: 1px solid var(--border-2);
    border-radius: 999px;
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
    transform: translateX(-50%);
    cursor: pointer;
}
.update-toast.show { display: block; }

/* ===== 打印 ===== */
@media print {
    .app-sidebar,
    .nav-tabs,
    .bottom-nav,
    .search-bar,
    .offline-bar,
    .update-toast,
    .back-to-top,
    .ap-back-btn,
    .ap-actions,
    .article-settings-panel,
    .ap-continue,
    .home-page,
    .global-search,
    .pagination,
    .filters {
        display: none !important;
    }
    .app-main {
        margin: 0 !important;
        padding: 0 !important;
    }
    /* 文章抬头要留：里面是标题与期号/字数；
       打印稿没有标题就只是一堆匿名正文。只把返回键和操作按钮藏掉。 */
    .article-page-header {
        background: transparent !important;
        border-bottom: 1px solid #999 !important;
        padding: 0 0 8px !important;
    }
    .ap-title {
        color: #000 !important;
    }
    /* 抬头与正文栏同宽，否则打印稿里标题居中、正文顶到纸边，两边对不齐 */
    .ap-header-inner {
        max-width: none !important;
        padding: 0 !important;
    }
    .article-page-body {
        max-width: none !important;
        padding: 0 !important;
        font-size: 12pt !important;
        color: #000 !important;
        background: #fff !important;
    }
    .article-page {
        position: static !important;
    }
    .ap-related,
    .article-page-footer {
        display: block !important;
    }
    a[href]::after {
        content: "";
    }
}

/* Source: books.css */
/* Book-library presentation for home and magazine browsing. */
:root {
  --library-bg: #f5f5f7;
  --library-ink: #1d1d1f;
  --library-muted: #6e6e73;
  --library-accent: #a6382d;
}
.home-page { background: var(--library-bg); color: var(--library-ink); }
.home-header { text-align: left; padding: 42px 24px 16px; }
.home-header-inner { max-width: 1120px; }
.home-eyebrow { color: var(--library-accent); font-size: 12px; font-weight: 700; letter-spacing: .12em; margin-bottom: 10px; }
.home-title { color: var(--library-ink); font-size: clamp(38px, 5vw, 58px); line-height: 1.12; letter-spacing: -.035em; margin-bottom: 12px; }
.home-subtitle { color: var(--library-muted); font-size: 16px; font-weight: 400; letter-spacing: 0; }
.home-about-btn { top: 2px; width: 40px; height: 40px; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.home-search { max-width: 1120px; margin: 12px auto 44px; }
.home-search-copy { margin-bottom: 12px; }
.home-search-copy strong { font-size: 14px; }
.home-search-copy span { font-size: 12px; }
.home-search-form { max-width: 760px; min-height: 56px; background: #fff; border: 1px solid #e7e7eb; border-radius: 14px; box-shadow: 0 3px 18px rgba(0,0,0,.045); }
.home-search-form button { background: var(--library-accent); border-radius: 10px; }
.home-body { display: block; padding: 0 24px 44px; }
.home-body > .home-section-heading, .home-latest { max-width: 1120px; }
.home-section-heading { margin-bottom: 22px; }
.home-section-heading h2 { color: var(--library-ink); font-size: 25px; font-weight: 750; letter-spacing: -.025em; }
.home-section-heading span { color: var(--library-muted); font-size: 13px; }
.magazine-grid { max-width: 1120px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px; }
.magazine-card { display: block; min-width: 0; text-align: left; text-decoration: none; border: 0; border-radius: 0; padding: 0; background: transparent; box-shadow: none; cursor: pointer; }
.magazine-card:hover { transform: none; box-shadow: none; }
.mag-cover { width: 100%; max-width: 310px; aspect-ratio: 3 / 4; border-radius: 5px 10px 10px 5px; background-size: cover; box-shadow: 2px 4px 10px rgba(30,24,20,.18), 12px 22px 34px rgba(30,24,20,.12); transition: transform .22s ease, box-shadow .22s ease; }
.magazine-card:hover .mag-cover, .magazine-card:focus-visible .mag-cover { transform: translateY(-5px); box-shadow: 2px 7px 14px rgba(30,24,20,.18), 15px 28px 42px rgba(30,24,20,.16); }
.mag-info { padding: 22px 2px 0; align-items: flex-start; text-align: left; }
.mag-info h2 { color: var(--library-ink); font-size: 21px; line-height: 1.3; margin-bottom: 5px; }
.mag-desc { color: var(--library-muted); min-height: 0; margin-bottom: 7px; font-size: 13px; }
.mag-meta { color: var(--library-muted); font-size: 12px; font-weight: 500; }
.home-latest { width: calc(100% - 48px); margin-bottom: 48px; }
.home-latest-list { gap: 16px; }
.home-latest-item { min-height: 115px; border: 0; border-radius: 15px; background: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.045); }
.home-latest-item span { color: var(--library-muted); }
.home-latest-item strong { color: var(--library-ink); line-height: 1.45; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.home-guide-entry { max-width: 1120px; }
.guide-link-card { background: transparent; border: 0; border-top: 1px solid #dedee3; border-radius: 0; box-shadow: none; }
.guide-link-card:hover { background: rgba(255,255,255,.6); box-shadow: none; transform: none; }
body.mag-active #app { background: var(--library-bg); }
.app-sidebar { background: #fff; border-right: 1px solid #e8e8ec; }
.sidebar-header { background: #fff; box-shadow: none; border-bottom: 0; }
.sidebar-brand h1 { color: var(--library-ink); letter-spacing: -.02em; }
.sidebar-meta, .app-subtitle { color: var(--library-muted); }
.search-bar { background: #fff; border-bottom: 0; }
.search-intro { flex-direction: column; align-items: flex-start; }
.search-intro strong { color: var(--library-ink); font-size: 15px; }
.search-intro span { color: var(--library-muted); line-height: 1.5; }
#searchInput { background: var(--library-bg); border: 1px solid transparent; border-radius: 11px; }
#searchInput:focus { background: #fff; border-color: #b7b7bd; }
.nav-tabs { background: var(--library-bg); border-bottom: 1px solid #e5e5e9; }
.nav-tab { border-radius: 10px; }
.nav-tab.active { background: #fff; color: var(--library-ink); box-shadow: 0 1px 5px rgba(0,0,0,.06); }
.nav-tab.active::after { display: none; }
.content { max-width: 1120px; padding: 32px 30px 64px; }
.section-card, .result-card, .year-block { background: #fff; border: 1px solid #ececef; box-shadow: 0 2px 10px rgba(0,0,0,.035); }
.section-card:hover, .result-card:hover { border-color: #d4d4d9; box-shadow: 0 8px 24px rgba(0,0,0,.065); }
@media (min-width: 768px) {
  .app-sidebar { width: 320px; }
  .sidebar-header { padding: 42px 28px 20px; }
  .search-bar { padding: 18px 28px 28px; }
  .mag-cover { aspect-ratio: 3 / 4; }
}
@media (max-width: 767px) {
  .home-header { padding: 30px 22px 16px; }
  .home-title { font-size: 40px; }
  .home-subtitle { font-size: 14px; }
  .home-search { width: calc(100% - 44px); margin: 14px auto 32px; }
  .home-search-copy { display: block; }
  .home-search-copy span { display: block; margin: 2px 0 0; }
  .home-body { padding: 0 0 34px 22px; }
  .home-body > .home-section-heading { padding-right: 22px; }
  .magazine-grid { display: flex; overflow-x: auto; gap: 20px; padding: 0 22px 22px 0; scroll-snap-type: x mandatory; }
  .magazine-card { flex: 0 0 176px; scroll-snap-align: start; }
  .mag-cover { width: 176px; height: 235px; aspect-ratio: auto; }
  .mag-info { padding-top: 17px; }
  .mag-info h2 { font-size: 18px; }
  .mag-desc { line-height: 1.4; }
  .home-latest { width: calc(100% - 44px); }
  .home-latest-list { grid-template-columns: 1fr; }
  .sidebar-header { padding: 18px 56px 12px; }
  .sidebar-brand h1 { color: var(--library-ink); }
  .sidebar-meta, .app-subtitle { color: var(--library-muted); }
  .header-home-btn, .header-about-btn { color: var(--library-ink); background: #f1f1f4; }
  .search-bar { padding: 16px 20px 18px; }
  .content { padding: 22px 18px 80px; }
}
html[data-theme="dark"] .home-page, html[data-theme="dark"] body.mag-active #app { --library-bg: #202024; --library-ink: #f3f3f5; --library-muted: #aaaab2; background: var(--library-bg); }
/* A quieter shelf with complete, uncropped covers. */
.home-page { background: #fafafa; }
.home-header { padding-top: 28px; padding-bottom: 8px; }
.home-header-inner, .home-search, .home-body > .home-section-heading, .home-latest { max-width: 920px; }
.home-eyebrow { display: none; }
.home-title { font-size: 32px; letter-spacing: -.02em; margin-bottom: 3px; }
.home-subtitle { font-size: 13px; }
.home-search { margin-top: 16px; margin-bottom: 30px; }
.home-search-form { max-width: 620px; min-height: 48px; box-shadow: none; }
.home-section-heading { margin-bottom: 15px; }
.home-section-heading h2 { font-size: 19px; }
.home-body { padding-bottom: 26px; }
.magazine-grid { max-width: 920px; gap: 30px; }
.mag-cover { width: 100%; max-width: 210px; aspect-ratio: 3 / 4; background-size: contain; background-color: #fff; box-shadow: 0 5px 16px rgba(20,20,24,.11); }
.magazine-card:hover .mag-cover, .magazine-card:focus-visible .mag-cover { transform: translateY(-3px); box-shadow: 0 9px 20px rgba(20,20,24,.16); }
.mag-info { padding-top: 13px; }
.mag-info h2 { font-size: 17px; }
.mag-desc { display: none; }
.home-latest { margin-bottom: 26px; }
.home-latest-list { display: block; }
.home-latest-item { display: grid; grid-template-columns: 175px minmax(0, 1fr); align-items: center; width: 100%; min-height: 0; padding: 10px 2px; border-bottom: 1px solid #e6e6e9; border-radius: 0; background: transparent; box-shadow: none; }
.home-latest-item:hover { transform: none; box-shadow: none; background: transparent; }
.home-latest-item span { margin: 0; }
.home-latest-item strong { display: block; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; }
.home-guide-entry { max-width: 920px; }
/* Search opens from the magazine header only when requested. */
.header-search-btn { position: absolute; right: 62px; top: 36px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--library-muted); cursor: pointer; }
.header-search-btn:hover, body.mag-search-open .header-search-btn { background: var(--library-bg); color: var(--library-ink); }
.header-search-btn .icon { width: 19px; height: 19px; }
.search-bar { display: none; }
body.mag-search-open .search-bar { display: block; }
.reader-toolbar { position: static; box-shadow: none; }
.article-page .back-to-top { position: static; transform: none; margin: 10px auto 40px; }
.article-page .back-to-top.show { transform: none; }
@media (min-width: 768px) {
  .header-home-btn { right: 106px; }
}
@media (max-width: 767px) {
  .home-header { padding: 25px 22px 8px; }
  .home-title { font-size: 29px; }
  .home-search { margin-bottom: 26px; }
  .magazine-grid { gap: 18px; }
  .magazine-card { flex-basis: 148px; }
  .mag-cover { width: 148px; height: 200px; aspect-ratio: auto; }
  .home-latest-item { grid-template-columns: 1fr; gap: 2px; padding: 9px 2px; }
  .home-latest-item strong { font-size: 13px; }
  .header-search-btn { top: 50%; right: 52px; transform: translateY(-50%); width: 32px; height: 32px; }
}
html[data-theme="dark"] .home-search-form, html[data-theme="dark"] .home-latest-item, html[data-theme="dark"] .app-sidebar, html[data-theme="dark"] .sidebar-header, html[data-theme="dark"] .search-bar, html[data-theme="dark"] .nav-tab.active, html[data-theme="dark"] .section-card, html[data-theme="dark"] .result-card, html[data-theme="dark"] .year-block { background: #2c2c31; border-color: #3c3c43; }
html[data-theme="dark"] .nav-tabs { background: #202024; border-color: #3c3c43; }
html[data-theme="dark"] .home-title, html[data-theme="dark"] .home-section-heading h2, html[data-theme="dark"] .mag-info h2, html[data-theme="dark"] .home-latest-item strong, html[data-theme="dark"] .sidebar-brand h1 { color: #f3f3f5; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .home-page, html[data-theme="auto"] body.mag-active #app { --library-bg: #202024; --library-ink: #f3f3f5; --library-muted: #aaaab2; background: var(--library-bg); }
  html[data-theme="auto"] .home-search-form, html[data-theme="auto"] .home-latest-item, html[data-theme="auto"] .app-sidebar, html[data-theme="auto"] .sidebar-header, html[data-theme="auto"] .search-bar, html[data-theme="auto"] .nav-tab.active, html[data-theme="auto"] .section-card, html[data-theme="auto"] .result-card, html[data-theme="auto"] .year-block { background: #2c2c31; border-color: #3c3c43; }
  html[data-theme="auto"] .nav-tabs { background: #202024; border-color: #3c3c43; }
  html[data-theme="auto"] .home-title, html[data-theme="auto"] .home-section-heading h2, html[data-theme="auto"] .mag-info h2, html[data-theme="auto"] .home-latest-item strong, html[data-theme="auto"] .sidebar-brand h1 { color: #f3f3f5; }
}

/* Source: one.css */
/* Editorial layout inspired by the quiet hierarchy of ONE. */
.home-page { background: #fff; color: #252525; }
.home-header { padding: 24px 22px 18px; border-bottom: 1px solid #e9e9e9; text-align: center; }
.home-header-inner { max-width: 1000px; }
.home-title { font-size: 28px; font-weight: 700; letter-spacing: .14em; }
.home-subtitle { font-size: 11px; letter-spacing: .16em; color: #8a8a8a; }
.home-about-btn { top: 4px; border: 0; box-shadow: none; background: none; }
.home-feature { max-width: 1000px; margin: 40px auto 32px; padding: 0 22px; display: grid; grid-template-columns: minmax(220px, 380px) minmax(0,1fr); gap: 62px; align-items: center; }
.home-feature-cover { display: block; width: 100%; aspect-ratio: 3 / 4; background: #f2f2f2 url('../img/cover_qs.jpg?v=20260920a') center / contain no-repeat; box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.home-feature-text { padding: 18px 0; }
.home-feature-kicker, .home-feature-issue { display: block; color: #888; font-size: 11px; letter-spacing: .12em; }
.home-feature-issue { margin-top: 18px; }
.home-feature-text h2 { margin: 24px 0 34px; max-width: 14em; color: #202020; font-family: var(--font-serif); font-size: clamp(25px,3.2vw,38px); font-weight: 600; line-height: 1.55; }
.home-feature-read { border: 0; border-bottom: 1px solid #222; background: none; padding: 0 0 6px; color: #222; font-size: 13px; cursor: pointer; }
.home-feature-read span { margin-left: 16px; }
.home-search { max-width: 956px; margin: 0 auto 46px; }
.home-search-copy { display: none; }
.home-search-form { max-width: none; min-height: 44px; border: 0; border-top: 1px solid #ececec; border-bottom: 1px solid #ececec; border-radius: 0; box-shadow: none; padding-left: 6px; }
.home-search-form button { background: none; color: #555; border-radius: 0; padding: 8px 6px; }
.home-search-form button:hover { background: none; color: #111; }
.home-body { padding: 0 22px 42px; }
.home-body > .home-section-heading, .home-latest { max-width: 956px; }
.home-section-heading { padding-bottom: 10px; border-bottom: 1px solid #ddd; }
.home-section-heading h2 { font-size: 17px; font-weight: 600; letter-spacing: .03em; }
.home-section-heading span { color: #999; font-size: 11px; }
.magazine-grid { max-width: 956px; gap: 28px; }
.magazine-card { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 18px; align-items: center; }
.mag-cover { width: 92px; height: 124px; aspect-ratio: auto; max-width: none; border-radius: 0; background-size: contain; box-shadow: 0 2px 7px rgba(0,0,0,.1); }
.magazine-card:hover .mag-cover { transform: none; box-shadow: 0 4px 11px rgba(0,0,0,.14); }
.mag-info { padding: 0; }
.mag-info h2 { font-size: 17px; color: #222; }
.mag-desc { display: block; color: #999; font-size: 11px; line-height: 1.5; }
.mag-meta { color: #888; }
.home-latest { margin-bottom: 30px; }
.home-latest-item { grid-template-columns: 150px minmax(0,1fr); border-bottom-color: #eee; }
.home-latest-item:hover strong { color: #a6382d; }
.home-guide-entry { max-width: 956px; }
body.mag-active #app { background: #fff; }
.app-sidebar { background: #fafafa; border-right: 1px solid #e7e7e7; }
.sidebar-header, .search-bar { background: #fafafa; }
.sidebar-brand h1 { font-family: var(--font-serif); font-weight: 600; }
.nav-tabs { background: #fff; border-bottom: 1px solid #e8e8e8; }
.nav-tab.active { box-shadow: none; background: none; color: #222; border-bottom: 2px solid #222; border-radius: 0; }
.content { max-width: 1000px; }
.year-block, .section-card, .result-card { border: 0; border-bottom: 1px solid #e8e8e8; border-radius: 0; box-shadow: none; }
.year-block:hover, .section-card:hover, .result-card:hover { box-shadow: none; }
.yb-header { background: none; color: #333; border-bottom: 1px solid #e8e8e8; }
.yb-header h3 { color: #333; font-family: var(--font-serif); font-weight: 600; }
.yb-info, .yb-toggle { color: #888; }
.ir-header { padding: 16px 22px; }
.ir-count { background: none; }
.art-item { border-radius: 0; }
.art-item:hover { background: #f7f7f7; }
/* Article actions use plain labels and thin separation. */
.reader-toolbar { background: #fff; border-bottom: 1px solid #e8e8e8; }
.reader-toolbar-inner { min-height: 52px; }
.reader-toolbar .ap-actions { gap: 0; }
.reader-toolbar .ap-actions > * { width: auto; height: 36px; padding: 0 12px; border-radius: 0; background: none; color: #666; font-family: var(--font-sans); font-size: 12px; font-weight: 400; text-decoration: none; }
.reader-toolbar .ap-actions > * + * { border-left: 1px solid #e8e8e8; }
.reader-toolbar .ap-actions > *:hover { background: none; color: #222; }
.reader-toolbar .ap-actions .active { background: none; color: #a6382d; }
.reader-toolbar .ap-actions span { margin-left: 5px; white-space: nowrap; }
.reader-toolbar-back { color: #555; }
@media (min-width: 768px) { .app-sidebar { width: 280px; } }
@media (max-width: 767px) {
  .home-header { padding: 18px 20px 12px; }
  .home-title { font-size: 22px; }
  .home-subtitle { font-size: 10px; }
  .home-feature { margin: 22px auto 24px; padding: 0 20px; grid-template-columns: 38% minmax(0,1fr); gap: 20px; }
  .home-feature-text { padding: 0; }
  .home-feature-cover { box-shadow: 0 2px 8px rgba(0,0,0,.09); }
  .home-feature-issue { margin-top: 8px; }
  .home-feature-text h2 { margin: 12px 0 18px; font-size: 19px; line-height: 1.45; }
  .home-feature-read { font-size: 12px; }
  .home-search { width: calc(100% - 40px); margin-bottom: 30px; }
  .home-body { padding: 0 20px 30px; }
  .magazine-grid { display: block; overflow: visible; padding: 0; }
  .magazine-card { width: 100%; margin-bottom: 14px; display: grid; grid-template-columns: 70px minmax(0,1fr); gap: 16px; }
  .mag-cover { width: 70px; height: 94px; }
  .mag-info h2 { font-size: 15px; }
  .home-latest { width: calc(100% - 40px); }
  .home-latest-item { grid-template-columns: 1fr; }
  .reader-toolbar .ap-actions > * { padding: 0 6px; }
  .reader-toolbar .ap-actions span { display: none; }
}
html[data-theme="dark"] .home-feature-text h2, html[data-theme="dark"] .home-feature-read, html[data-theme="dark"] .yb-header, html[data-theme="dark"] .yb-header h3 { color: #eee; }
html[data-theme="dark"] .home-feature-read, html[data-theme="dark"] .home-header, html[data-theme="dark"] .home-section-heading, html[data-theme="dark"] .home-search-form, html[data-theme="dark"] .yb-header { border-color: #484848; }
html[data-theme="dark"] .reader-toolbar { background: #302e2a; border-color: #484848; }
html[data-theme="dark"] .reader-toolbar .ap-actions > * { color: #d0cbc7; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .home-feature-text h2, html[data-theme="auto"] .home-feature-read, html[data-theme="auto"] .yb-header, html[data-theme="auto"] .yb-header h3 { color: #eee; }
  html[data-theme="auto"] .home-feature-read, html[data-theme="auto"] .home-header, html[data-theme="auto"] .home-section-heading, html[data-theme="auto"] .home-search-form, html[data-theme="auto"] .yb-header { border-color: #484848; }
  html[data-theme="auto"] .reader-toolbar { background: #302e2a; border-color: #484848; }
  html[data-theme="auto"] .reader-toolbar .ap-actions > * { color: #d0cbc7; }
}

/* Compact supplementary links below the three journals. */
.home-guides { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; width: calc(100% - 44px); max-width: 956px; margin: 10px auto 0; }
.home-guide-entry { max-width: 956px; padding: 0; }
.guide-link-card { min-height: 42px; padding: 9px 2px; border: 0; border-top: 1px solid #e7e7e7; border-radius: 0; background: transparent; box-shadow: none; gap: 9px; }
.guide-link-card:hover { color: #111; background: transparent; box-shadow: none; transform: none; }
.guide-card-icon { width: 22px; height: 22px; background: none; color: #777; }
.guide-card-icon .icon { width: 15px; height: 15px; }
.guide-card-title { margin: 0; color: #555; font-size: 12px; font-weight: 500; }
.guide-card-desc { display: none; }
.guide-card-arrow { width: 12px; height: 12px; }
.home-footer { padding-top: 18px; color: #999; }

/* Journal and article share the same quiet editorial language. */
.article-page { background: var(--bg); }
.article-page-header { background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: none; padding-bottom: 28px; }
.ap-header-inner { grid-template-columns: 1fr auto; grid-template-areas: "back toc" "title title" "meta meta"; }
.ap-back-btn, .reader-toc-toggle { color: var(--text-2); font-size: 13px; font-weight: 400; }
.reader-toc-toggle { grid-area: toc; justify-self: end; margin: 0; padding: 5px 0; }
.ap-title { font-family: var(--font-serif); font-size: clamp(27px, 3vw, 36px); font-weight: 600; letter-spacing: 0; line-height: 1.48; margin: 28px 0 12px; }
.ap-meta { color: var(--text-3); font-size: 12px; }
.article-page-body { padding-top: 44px; }
.article-page-body p { line-height: inherit; }
.article-page-body p.md-heading { border-color: var(--border); }
.article-toc { border: 0; border-left: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; }
.ap-continue { background: transparent; }

.article-page-footer { padding-bottom: 88px; }
.ap-related { margin: 0 0 36px; padding-top: 24px; border-top: 1px solid var(--border); }
.ap-related-title { font-family: var(--font-serif); font-size: 17px; font-weight: 600; }
.reading-operation-menu[hidden] { display: none !important; }
.reading-operation-menu { padding: 23px 0 28px; border-top: 1px solid var(--border); }
.reading-operation-menu .ap-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.reading-operation-menu .ap-actions > * { box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 58px; margin: 0; padding: 5px; border: 0; border-right: 1px solid var(--border); border-radius: 0; background: transparent; color: var(--text-2); font: 12px var(--font-sans); text-decoration: none; cursor: pointer; }
.reading-operation-menu .ap-actions > *:last-child { border-right: 0; }
.reading-operation-menu .ap-actions > *:hover, .reading-operation-menu .ap-actions > *.active { color: var(--text); background: transparent; }
.reading-operation-menu .ap-actions span { margin: 0; }
.reading-operation-menu .ap-actions .icon { width: 17px; height: 17px; }
.reading-operation-menu .ap-settings-btn { font-family: var(--font-serif); font-size: 18px; font-weight: 500; }
.reading-operation-menu .ap-settings-btn span { font: 12px var(--font-sans); }
.reading-operation-menu .ap-settings-panel { position: relative; top: auto; right: auto; z-index: auto; min-width: 0; max-height: none; overflow: visible; margin-top: 24px; padding: 22px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; }
.reading-operation-menu .ap-settings-panel.show { animation: none; }
.reading-operation-menu .asp-close-btn { top: 16px; right: 0; }
.ap-nav { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: stretch; gap: 0; padding-top: 0; border-top: 1px solid var(--border); }
.ap-nav > button { min-width: 0; min-height: 86px; margin: 0; padding: 17px 13px; border: 0; border-radius: 0; background: transparent; color: var(--text); font-family: var(--font-sans); cursor: pointer; }
.ap-nav > button:hover:not(:disabled) { background: var(--bg-2); }
.ap-nav > button:disabled { color: var(--text-3); cursor: default; }
.ap-bottom-prev { text-align: left; }
.ap-bottom-next { text-align: right; }
.ap-bottom-prev span, .ap-bottom-next span { display: block; margin-bottom: 7px; color: var(--text-3); font-size: 12px; }
.ap-bottom-prev strong, .ap-bottom-next strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-serif); font-size: 14px; font-weight: 500; }
.ap-nav .ap-bottom-action { width: 92px; border-right: 1px solid var(--border); border-left: 1px solid var(--border); font-size: 13px; white-space: nowrap; }
.ap-bottom-action span { display: inline-block; margin-left: 2px; font-size: 17px; transition: transform .2s; }
.ap-bottom-action[aria-expanded="true"] span { transform: rotate(45deg); }

@media (max-width: 767px) {
  .home-guides { grid-template-columns: 1fr; gap: 0; width: calc(100% - 40px); }
  .home-guide-entry { width: 100%; }
  .article-page-header { padding-bottom: 23px; }
  .ap-header-inner { grid-template-columns: 1fr auto; grid-template-areas: "back toc" "title title" "meta meta"; }
  .ap-title { font-size: 25px; margin-top: 25px; }
  .article-page-body { padding-top: 31px; }
  .ap-nav > button { min-height: 72px; padding: 12px 7px; }
  .ap-nav .ap-bottom-action { width: 68px; }
  .ap-bottom-prev strong, .ap-bottom-next strong { font-size: 12px; }
  .reading-operation-menu .ap-actions > * { height: 54px; }
}

/* Large, uncropped covers carry the journal selection. */
.magazine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(22px, 4vw, 48px); max-width: 1000px; align-items: start; }
.magazine-grid > * + * { margin: 0; }
.magazine-card { display: block; min-width: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-decoration: none; }
.magazine-card:hover { transform: none; box-shadow: none; }
.mag-cover { width: 100%; max-width: none; height: auto; aspect-ratio: 3 / 4; border-radius: 0; background-size: contain; background-color: #fff; box-shadow: 0 8px 24px rgba(20,20,24,.12); }
.magazine-card:hover .mag-cover, .magazine-card:focus-visible .mag-cover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(20,20,24,.17); }
.mag-info { padding: 17px 0 0; background: transparent; }
.mag-info h2 { font-size: 20px; }
.mag-desc { display: none; }
.mag-meta { margin-top: 6px; }

/* Fixed article navigation. The action tray opens upward from the dock. */
body.article-active { --reading-dock-height: 86px; }
.article-page-body { padding-bottom: 70px; }
.article-page-footer { padding-bottom: calc(var(--reading-dock-height, 86px) + 44px + env(safe-area-inset-bottom, 0px)); }
.reading-dock[hidden] { display: none !important; }
.reading-dock { position: fixed; inset: auto 0 0; z-index: 220; padding: 0 18px env(safe-area-inset-bottom, 0px); border-top: 1px solid var(--border); background: var(--card); box-shadow: 0 -8px 28px rgba(0,0,0,.06); }
.reading-dock .ap-nav, .reading-dock .reading-operation-menu { width: 100%; max-width: 900px; margin: 0 auto; }
.reading-dock .ap-nav { border: 0; }
.reading-dock .reading-operation-menu { max-height: calc(100vh - var(--reading-dock-height, 86px) - 44px); overflow-y: auto; overscroll-behavior: contain; }
.article-page .back-to-top { position: fixed; right: 20px; bottom: calc(var(--reading-dock-height, 86px) + 20px + env(safe-area-inset-bottom, 0px)); z-index: 225; margin: 0; transform: translateY(10px); }
.article-page .back-to-top.show { transform: translateY(0); }

@media (max-width: 767px) {
  .magazine-grid { display: flex; gap: 18px; overflow-x: auto; overflow-y: hidden; width: calc(100vw - 20px); max-width: none; margin: 0; padding: 4px 22px 20px 0; scroll-snap-type: x mandatory; }
  .magazine-grid > * + * { margin: 0; }
  .magazine-card { flex: 0 0 clamp(178px, 53vw, 218px); width: auto; margin: 0; scroll-snap-align: start; }
  .mag-cover { width: 100%; height: auto; aspect-ratio: 3 / 4; }
  .mag-info { padding-top: 12px; }
  .mag-info h2 { font-size: 17px; }
  body.article-active { --reading-dock-height: 72px; }
  .reading-dock { padding-inline: 10px; }
  .article-page .back-to-top { right: 14px; width: 44px; height: 44px; }
}
@media print {
  .reading-dock { display: none !important; }
  .article-page-footer { padding-bottom: 0; }
}

/* Home: three journals are the primary composition. */
.home-eyebrow { display: none; }
.home-header { padding: 30px 22px 24px; }
.home-title { font-family: var(--font-serif); font-size: 30px; letter-spacing: .12em; }
.home-body { padding: 52px 26px 16px; }
.magazine-grid { grid-template-columns: repeat(3, minmax(0, 330px)); justify-content: center; gap: clamp(28px, 4vw, 60px); width: 100%; max-width: 1120px; margin: 0 auto; }
.magazine-card { text-align: center; }
.mag-cover { aspect-ratio: 3 / 4; }
.mag-info { align-items: center; text-align: center; padding-top: 20px; }
.mag-info h2 { font-family: var(--font-serif); font-size: 22px; font-weight: 600; }
.mag-meta { margin-top: 4px; font-size: 12px; }
.home-search { width: calc(100% - 52px); max-width: 640px; margin: 30px auto 58px; }
.home-search-form { min-height: 48px; }

/* Current issue list and reading settings open above the fixed reading dock. */
body.article-active { --reading-dock-height: 70px; }
.reading-dock .ap-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reading-dock .ap-nav > button { min-height: 70px; padding: 14px 10px; text-align: center; font-size: 14px; font-weight: 500; }
.reading-dock .ap-nav > button + button { border-left: 1px solid var(--border); }
.reading-dock .ap-nav > button.active { background: var(--bg-2); }
.reading-dock .ap-nav .ap-bottom-next { width: auto; }
.reading-operation-menu .ap-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reading-issue-menu[hidden] { display: none !important; }
.reading-dock .reading-issue-menu { width: 100%; max-width: 900px; max-height: calc(100vh - var(--reading-dock-height, 70px) - 44px); margin: 0 auto; overflow-y: auto; overscroll-behavior: contain; padding: 20px 10px 24px; }
.reading-issue-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.reading-issue-heading strong { font-family: var(--font-serif); font-size: 16px; font-weight: 600; }
.reading-issue-heading span { flex: none; color: var(--text-3); font-size: 12px; }
.reading-issue-list { display: grid; }
.reading-issue-item { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; width: 100%; padding: 12px 10px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; font-family: var(--font-sans); cursor: pointer; }
.reading-issue-item:hover, .reading-issue-item.active { background: var(--bg-2); }
.reading-issue-item.active .reading-issue-title { font-weight: 600; }
.reading-issue-number { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.reading-issue-title { font-size: 14px; line-height: 1.55; }

@media (max-width: 767px) {
  .home-header { padding: 24px 20px 19px; }
  .home-title { font-size: 26px; }
  .home-body { padding: 34px 20px 8px; }
  .magazine-grid { display: grid; grid-template-columns: minmax(0, 340px); justify-content: center; gap: 45px; width: 100%; max-width: none; padding: 0; overflow: visible; }
  .magazine-card { width: 100%; max-width: 340px; }
  .mag-cover { width: 100%; aspect-ratio: 3 / 4; }
  .mag-info { padding-top: 14px; }
  .mag-info h2 { font-size: 19px; }
  .home-search { width: calc(100% - 40px); margin: 32px auto 42px; }
  body.article-active { --reading-dock-height: 64px; }
  .reading-dock .ap-nav > button { min-height: 64px; font-size: 13px; }
  .reading-dock .reading-issue-menu { padding-inline: 2px; }
}

/* Source: system.css */
/* Shared editorial system for the reading site. The three guide pages keep their own styles. */
:root {
  --primary: #96382f;
  --primary-light: #ad5145;
  --primary-dark: #722b25;
  --mag-color: var(--primary);
  --mag-color-dark: var(--primary-dark);
  --accent: var(--primary);
  --fav: var(--primary);
  --bg: #f7f5f0;
  --bg-2: #f0ede6;
  --card: #fffefb;
  --text: #292723;
  --text-2: #625e57;
  --text-3: #827c73;
  --border: #e4dfd6;
  --border-2: #d4cdc1;
  --highlight: #e9dfb9;
  --highlight-text: #392b1c;
  --radius: 7px;
  --radius-sm: 5px;
  --radius-lg: 9px;
  --shadow: none;
  --shadow-md: 0 5px 20px rgba(36, 32, 26, .06);
  --shadow-lg: 0 14px 36px rgba(36, 32, 26, .1);
  --library-bg: var(--bg);
  --library-ink: var(--text);
  --library-muted: var(--text-3);
  --library-accent: var(--primary);
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", serif;
}
html[data-theme="dark"] {
  --primary: #d59083;
  --primary-light: #e5a79c;
  --primary-dark: #c67c70;
  --mag-color: var(--primary);
  --mag-color-dark: var(--primary-dark);
  --fav: var(--primary);
  --bg: #201f1d;
  --bg-2: #292722;
  --card: #302e29;
  --text: #eeeae2;
  --text-2: #c8c1b5;
  --text-3: #a9a194;
  --border: #48443d;
  --border-2: #5a554b;
  --highlight: #62532b;
  --highlight-text: #f4e4bf;
}
html[data-theme="dark"] .home-page,
html[data-theme="dark"] body.mag-active #app {
  --library-bg: var(--bg);
  --library-ink: var(--text);
  --library-muted: var(--text-3);
  background: var(--bg);
}
html[data-theme="dark"] .home-search-form,
html[data-theme="dark"] .app-sidebar,
html[data-theme="dark"] .sidebar-header,
html[data-theme="dark"] .search-bar,
html[data-theme="dark"] .nav-tab.active,
html[data-theme="dark"] .section-card,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] .year-block { background: var(--bg); border-color: var(--border); }
html[data-theme="dark"] .nav-tabs { background: var(--card); border-color: var(--border); }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --primary: #d59083;
    --primary-light: #e5a79c;
    --primary-dark: #c67c70;
    --mag-color: var(--primary);
    --mag-color-dark: var(--primary-dark);
    --fav: var(--primary);
    --bg: #201f1d;
    --bg-2: #292722;
    --card: #302e29;
    --text: #eeeae2;
    --text-2: #c8c1b5;
    --text-3: #a9a194;
    --border: #48443d;
    --border-2: #5a554b;
    --highlight: #62532b;
    --highlight-text: #f4e4bf;
  }
  html[data-theme="auto"] .home-page,
  html[data-theme="auto"] body.mag-active #app {
    --library-bg: var(--bg);
    --library-ink: var(--text);
    --library-muted: var(--text-3);
    background: var(--bg);
  }
  html[data-theme="auto"] .home-search-form,
  html[data-theme="auto"] .app-sidebar,
  html[data-theme="auto"] .sidebar-header,
  html[data-theme="auto"] .search-bar,
  html[data-theme="auto"] .nav-tab.active,
  html[data-theme="auto"] .section-card,
  html[data-theme="auto"] .result-card,
  html[data-theme="auto"] .year-block { background: var(--bg); border-color: var(--border); }
  html[data-theme="auto"] .nav-tabs { background: var(--card); border-color: var(--border); }
}

body, button, input { font-family: var(--font-sans); }
body { background: var(--bg); color: var(--text); }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.icon { stroke-linecap: round; stroke-linejoin: round; }

/* Pages, surface and navigation. */
.home-page, body.mag-active #app, .article-page, .section-page, .about-page, .global-search { background: var(--bg); color: var(--text); }
.home-header, .article-page-header, .section-page-header, .about-page-header { background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: none; }
.home-title, .sidebar-brand h1, .ap-title, .sp-title, .ab-title, .gate-title { font-family: var(--font-serif); color: var(--text); font-weight: 600; }
.home-title, .mag-info h2, .sidebar-brand h1 { color: var(--text); }
.home-about-btn, .header-home-btn, .header-about-btn, .header-search-btn { border: 0; border-radius: var(--radius-sm); background: transparent; box-shadow: none; color: var(--text-2); }
.home-about-btn:hover, .header-home-btn:hover, .header-about-btn:hover, .header-search-btn:hover, body.mag-search-open .header-search-btn { background: var(--bg-2); color: var(--text); }
.header-home-btn .icon, .header-about-btn .icon, .header-search-btn .icon, .home-about-btn .icon { width: 18px; height: 18px; }
.app-sidebar { background: var(--bg); border-right: 1px solid var(--border); }
.sidebar-header, .search-bar { background: var(--bg); box-shadow: none; }
.sidebar-brand h1 { letter-spacing: .03em; }
.sidebar-meta, .app-subtitle, .search-status { color: var(--text-3); }
.search-status { opacity: 1; }
.nav-tabs, .bottom-nav { background: var(--card); border-color: var(--border); box-shadow: none; }
.nav-tab, .bn-item { color: var(--text-2); }
.nav-tab:hover { background: var(--bg-2); color: var(--text); }
.nav-tab.active { background: transparent; color: var(--text); border-bottom: 2px solid var(--primary); border-radius: 0; box-shadow: none; }
.bn-item.active { color: var(--primary); }
.nav-tab .icon, .bn-item .icon { width: 20px; height: 20px; stroke-width: 1.8; }
.fav-badge { background: var(--primary); color: var(--card); border-radius: 3px; }

/* Search and controls use the same quiet geometry. */
.home-search-form, .gs-box, #searchInput, .sp-search-input, .search-box, .gate-input-wrap { border-color: var(--border-2); border-radius: var(--radius-sm); background: var(--card); box-shadow: none; }
.home-search-form { border: 1px solid var(--border); }
.home-search-form input, #searchInput, #globalSearchInput, .sp-search-input { color: var(--text); }
.home-search-form input::placeholder, #searchInput::placeholder, #globalSearchInput::placeholder, .sp-search-input::placeholder { color: var(--text-3); }
#searchInput:focus-visible, #globalSearchInput:focus-visible, .sp-search-input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.home-search-form button, .search-btn { border-radius: var(--radius-sm); background: var(--primary); color: var(--card); box-shadow: none; }
.home-search-form button:hover, .search-btn:hover { background: var(--primary-dark); color: var(--card); opacity: 1; }
.gs-head { background: var(--bg); }
.gs-close, .ab-back-btn, .sp-back-btn, .ap-back-btn, .reader-toc-toggle { color: var(--text-2); }
.gs-close:hover, .ab-back-btn:hover, .sp-back-btn:hover, .ap-back-btn:hover, .reader-toc-toggle:hover { color: var(--primary); }
.scope-group, .asp-btn-group { border-color: var(--border); border-radius: var(--radius-sm); background: var(--bg-2); }
.scope-option, .asp-btn { border-radius: 3px; color: var(--text-2); }
.scope-option.checked, .scope-option:has(input:checked), .asp-btn.active { background: var(--primary); color: var(--card); }
.scope-option input[type="radio"]:checked, .filter-check input[type="checkbox"]:checked { border-color: var(--primary); background-color: var(--primary); }
.asp-label { color: var(--text-3); }
.btn-ghost, .page-btn { border-color: var(--border); border-radius: var(--radius-sm); background: var(--card); color: var(--text-2); box-shadow: none; }
.btn-ghost:hover, .page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: var(--card); }

/* Catalog, sections, results and favorites read as one continuous index. */
.content { max-width: 1040px; }
.year-block, .section-card, .result-card, .fav-card, .fav-header { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; }
.year-block:hover, .section-card:hover, .result-card:hover, .fav-card:hover { border-color: var(--border-2); background: var(--bg-2); box-shadow: none; transform: none; }
.yb-header { background: transparent; color: var(--text); border-bottom: 1px solid var(--border); }
.yb-header h3, .sp-year-header { font-family: var(--font-serif); color: var(--text); font-weight: 600; letter-spacing: 0; }
.yb-info, .yb-toggle, .ir-count, .rc-meta, .sc-count, .sp-meta { color: var(--text-3); }
.ir-count, .rc-tag, .sp-no-body-tag { background: var(--bg-2); border-radius: 3px; color: var(--text-2); }
.ir-header, .art-item, .sp-article, .ap-related-item, .reading-issue-item { border-radius: 0; }
.ir-header:hover, .art-item:hover, .sp-article:hover, .ap-related-item:hover, .reading-issue-item:hover { background: var(--bg-2); color: var(--text); }
.sec-group, .sp-article, .article-toc { border-left-color: var(--border); }
.sg-title, .rc-author, .result-group-name { color: var(--primary); }
.rc-fav-btn, .ap-fav-btn { color: var(--text-3); }
.rc-fav-btn.active, .ap-fav-btn.active { color: var(--primary); background: transparent; }
.rc-fav-btn:hover { background: var(--bg-2); color: var(--primary); }
.hl { background: var(--highlight); color: var(--highlight-text); border-radius: 2px; }

/* Secondary pages follow the reading page's typography and rules. */
.section-page-header, .about-page-header { box-shadow: none; }
.sp-title, .ab-title { font-size: clamp(21px, 2.4vw, 27px); line-height: 1.45; }
.section-page-body, .about-page-body { padding-top: 28px; }
.about-section h2 { font-family: var(--font-serif); font-size: 17px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border); }
.about-section p, .about-mag-list li { color: var(--text-2); }
.about-link { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 7px 0; color: var(--primary); }
.about-link:hover { background: transparent; border-color: var(--primary); }
.sp-article { border-left-width: 2px; }
.sp-article:hover { border-left-color: var(--primary); }

/* Article controls share the catalog's line and accent treatment. */
.article-page-body { color: var(--text); }
.ap-continue { border-color: var(--border); }
.ap-continue-btn, .article-page-body .retry-btn { border-radius: var(--radius-sm); background: var(--primary); color: var(--card); }
.reading-dock { background: var(--card); border-color: var(--border); box-shadow: 0 -6px 24px rgba(36, 32, 26, .06); }
.reading-dock .ap-nav > button, .reading-operation-menu .ap-actions > * { color: var(--text-2); }
.reading-dock .ap-nav > button:hover:not(:disabled), .reading-dock .ap-nav > button.active, .reading-operation-menu .ap-actions > *:hover { background: var(--bg-2); color: var(--primary); }
.reading-issue-item.active { background: var(--bg-2); color: var(--primary); }
.reading-operation-menu .ap-settings-panel { background: transparent; box-shadow: none; }
.article-page .back-to-top { background: var(--card); color: var(--primary); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.article-page .back-to-top .progress-ring-fg { stroke: var(--primary); }

/* The access gate uses the same paper, ink and restrained accent. */
.gate-bg { background: var(--bg-2); }
.gate-bg-pattern { background: none; animation: none; }
.gate-card { max-width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.gate-emblem { width: 64px; height: 64px; border-radius: var(--radius-sm); background: var(--bg-2); color: var(--primary); box-shadow: none; }
.gate-emblem svg { stroke-width: 1.8; }
.gate-emblem::after { display: none; }
.gate-title { color: var(--text); letter-spacing: .04em; }
.gate-subtitle, .gate-hint, .gate-footer { color: var(--text-3); }
.gate-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 13%, transparent); }
.gate-input { color: var(--text); }
.gate-toggle { color: var(--text-2); }
.gate-submit { background: var(--primary); color: var(--card); border-radius: var(--radius-sm); box-shadow: none; }
.gate-submit:hover { background: var(--primary-dark); box-shadow: none; }
.gate-footer { border-top: 1px solid var(--border); }

@media (max-width: 767px) {
  .app-sidebar { background: var(--bg); }
  .sidebar-header { background: var(--bg); border-bottom: 1px solid var(--border); }
  .bottom-nav { background: var(--card); }
  .content { padding-inline: 18px; }
  .section-page-body, .about-page-body { padding-top: 22px; }
}
@media print {
  .reading-dock, .bottom-nav, .gate { display: none !important; }
  .home-page, .article-page, .section-page, .about-page { background: white !important; color: black !important; }
}

/* Editorial composition: the covers lead, the interface steps back. */
.home-header { padding-block: 36px 28px; }
.home-title { font-size: clamp(30px, 3vw, 38px); letter-spacing: .11em; }
.home-body { padding-top: clamp(44px, 5vw, 72px); padding-bottom: 20px; }
.magazine-grid { max-width: 1080px; gap: clamp(28px, 4.5vw, 64px); }
.mag-cover { box-shadow: 0 12px 28px rgba(36, 32, 26, .11); }
.magazine-card:hover .mag-cover, .magazine-card:focus-visible .mag-cover { transform: translateY(-3px); box-shadow: 0 17px 34px rgba(36, 32, 26, .16); }
.mag-info { padding-top: 21px; }
.mag-info h2 { font-size: 20px; letter-spacing: .02em; }
.mag-meta { color: var(--text-3); font-size: 11px; }
.home-search { max-width: 520px; margin-top: 50px; margin-bottom: 58px; }
.home-search-form { min-height: 44px; background: transparent; border: 0; border-bottom: 1px solid var(--border-2); border-radius: 0; }
.home-search-form button { padding-inline: 12px; border-radius: 0; background: transparent; color: var(--text-2); font-weight: 500; }
.home-search-form button:hover { background: transparent; color: var(--primary); }

/* A journal is a title page followed by an index, not a dashboard. */
@media (min-width: 768px) {
  body.mag-active #app { display: block; }
  .app-sidebar { position: relative; width: 100%; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar-header { max-width: 1000px; margin: 0 auto; padding: 60px 26px 42px; text-align: left; border: 0; }
  .sidebar-header::after { display: none; }
  .sidebar-brand h1 { font-size: clamp(36px, 4vw, 52px); line-height: 1.2; letter-spacing: .04em; margin-bottom: 13px; }
  .sidebar-meta { justify-content: flex-start; }
  .app-subtitle, .search-status { font-size: 12px; }
  .header-home-btn, .header-search-btn, .header-about-btn { top: 57px; width: 36px; height: 36px; transform: none; }
  .header-home-btn { left: auto; right: 110px; }
  .header-search-btn { right: 66px; }
  .header-about-btn { right: 22px; }
  .search-bar { max-width: 1000px; margin: 0 auto; padding: 8px 26px 28px; border: 0; }
  .search-intro { margin-bottom: 13px; }
  .filters { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px 16px; margin-top: 13px; }
  .scope-group { justify-content: flex-start; }
  .scope-option { flex: none; }
  .filter-check { padding: 4px 0; background: transparent; }
  .app-main { width: 100%; }
  .nav-tabs { position: sticky; top: 0; z-index: 98; justify-content: flex-start; gap: 34px; max-width: none; padding: 0 max(26px, calc((100% - 948px) / 2)); margin: 0; background: var(--bg); }
  .nav-tabs > * + * { margin-left: 0; }
  .nav-tab { flex: none; padding: 17px 1px 15px; border-bottom: 2px solid transparent; border-radius: 0; font-size: 14px; }
  .nav-tab .icon { display: none; }
  .nav-tab.active { border-bottom-color: var(--primary); }
  .content { width: 100%; max-width: 1000px; margin: 0 auto; padding: 36px 26px 90px; }
}
.year-block { margin-bottom: 42px; border-bottom: 0; }
.yb-header { padding: 0 0 17px; margin-bottom: 3px; }
.yb-header h3 { font-size: clamp(23px, 2.3vw, 29px); line-height: 1.35; }
.yb-info { font-size: 12px; }
.issue-row { border-bottom: 1px solid var(--border); }
.ir-header { min-height: 66px; padding: 13px 2px; }
.ir-title { font-family: var(--font-serif); font-size: 17px; font-weight: 600; }
.ir-count { padding: 0; background: transparent; border-radius: 0; font-size: 12px; }
.ir-body { padding: 9px 0 22px; }
.sec-group { padding-left: 18px; border-left-width: 1px; margin: 12px 0; }
.sg-title { margin: 9px 0 5px; font-size: 13px; font-weight: 600; }
.art-item { padding: 9px 12px; margin: 0; font-size: 15px; line-height: 1.6; }
.section-list, .results-list, .catalog-list { gap: 0; }
.section-list { display: block; }
.section-list > * + *, .results-list > * + *, .catalog-list > * + * { margin-top: 0; }
.section-card, .result-card { padding: 18px 2px; }
.section-card { flex-direction: row; align-items: center; text-align: left; gap: 16px; overflow: visible; }
.section-card::before { display: none; }
.sc-name { margin: 0; }
.sc-count { margin-left: auto; justify-content: flex-end; }
.sc-name, .rc-title { font-family: var(--font-serif); font-size: 17px; font-weight: 600; }
.rc-meta { font-size: 12px; }
.fav-header, .fav-card { padding-inline: 2px; }

/* Quiet article page: strong title, readable column, small persistent controls. */
.article-page-header { padding-bottom: 36px; }
.ap-title { font-size: clamp(30px, 3.1vw, 42px); line-height: 1.45; margin-top: 38px; margin-bottom: 18px; }
.ap-meta { font-size: 12px; line-height: 1.8; }
.article-page-body { padding-top: 50px; }
.article-page-body p { margin-bottom: 1.25em; }
.article-layout:has(.article-toc:not([hidden])) { display: block; max-width: none; padding: 0; }
.article-layout:has(.article-toc:not([hidden])) .article-page-body { width: auto; }
.article-toc:not([hidden]) { display: none; }
.article-toc.is-open { display: block; position: fixed; top: 76px; right: max(18px, calc((100vw - 1050px) / 2)); left: auto; z-index: 230; width: min(320px, calc(100vw - 36px)); max-height: min(65vh, 580px); margin: 0; padding: 20px 22px; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.ap-related { margin-top: 12px; }
body.article-active { --reading-dock-height: 58px; }
.reading-dock { box-shadow: 0 -2px 14px rgba(36, 32, 26, .045); }
.reading-dock .ap-nav > button { min-height: 58px; padding: 10px 8px; font-size: 13px; font-weight: 500; }
.reading-dock .ap-nav > button + button { border-left: 0; }
.reading-dock .ap-nav > button.active { background: transparent; box-shadow: inset 0 2px 0 var(--primary); }
.reading-dock .ap-nav > button:hover:not(:disabled) { background: var(--bg-2); }
.article-page .back-to-top { width: 42px; height: 42px; right: 18px; bottom: calc(var(--reading-dock-height, 58px) + 18px + env(safe-area-inset-bottom, 0px)); box-shadow: none; }

@media (max-width: 767px) {
  .home-header { padding-block: 26px 20px; }
  .home-body { padding-top: 32px; }
  .magazine-grid { gap: 42px; }
  .mag-info { padding-top: 15px; }
  .home-search { margin-top: 35px; margin-bottom: 42px; }
  .sidebar-header { box-shadow: none; }
  .sidebar-brand h1 { font-size: 23px; letter-spacing: .04em; }
  .content { padding-top: 22px; }
  .yb-header h3 { font-size: 22px; }
  .ir-header { min-height: 58px; }
  .ir-title { font-size: 16px; }
  .article-page-header { padding-bottom: 26px; }
  .ap-title { font-size: 27px; margin-top: 28px; }
  .article-page-body { padding-top: 34px; }
  body.article-active { --reading-dock-height: 56px; }
  .reading-dock .ap-nav > button { min-height: 56px; font-size: 12px; }
  .article-page .back-to-top { right: 12px; width: 40px; height: 40px; }
}

.ap-header-inner { grid-template-columns: 1fr; grid-template-areas: "toc" "title" "meta"; }
.reader-toc-toggle { min-height: 36px; }

/* Settings float above the dock and leave the article visible while they change. */
.reading-dock .reading-operation-menu { position: absolute; right: max(18px, calc((100vw - 1000px) / 2)); bottom: calc(100% + 10px); left: auto; box-sizing: border-box; width: min(376px, calc(100vw - 36px)); max-width: none; max-height: min(50vh, 420px); margin: 0; padding: 16px 18px 12px; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.reading-operation-menu .ap-settings-panel { margin: 0; padding: 6px 0 0; border: 0; }
.reading-operation-menu .asp-close-btn { top: 0; right: 0; width: 32px; height: 32px; }
.reading-operation-menu .ap-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--border); }
.reading-operation-menu .ap-actions > * { height: 48px; border-right: 0; }
.article-page:has(.reading-operation-menu:not([hidden])) .back-to-top,
.article-page:has(.reading-issue-menu:not([hidden])) .back-to-top { opacity: 0; visibility: hidden; pointer-events: none; }

@media (max-width: 767px) {
  .reading-dock .reading-operation-menu { right: 12px; width: min(376px, calc(100vw - 24px)); max-height: 50vh; padding-inline: 16px; }
}

/* Source: modern.css */
/* Modern reading layer. Keep the three topical guides in their own visual system. */
:root {
  --bg: #f3f4f7;
  --bg-2: #e9ebf0;
  --card: #ffffff;
  --text: #20232a;
  --text-2: #515764;
  --text-3: #777e8a;
  --border: #dfe2e9;
  --border-2: #cfd4df;
  --primary: #a43a38;
  --primary-dark: #812e2d;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --shadow-md: 0 12px 30px rgba(30, 39, 60, .08);
  --shadow-lg: 0 24px 60px rgba(30, 39, 60, .16);
  --float-shadow: 0 5px 18px rgba(30, 39, 60, .08);
  --glass-surface: color-mix(in srgb, var(--card) 78%, transparent);
  --glass-border: color-mix(in srgb, var(--card) 68%, var(--border));
  --glass-shadow: 0 10px 32px rgba(26, 35, 55, .10), inset 0 1px rgba(255,255,255,.72);
}
html[data-theme="dark"] {
  --bg: #191c22; --bg-2: #252a33; --card: #2b3039;
  --text: #f2f3f5; --text-2: #c6cad3; --text-3: #a4aab5;
  --border: #404650; --border-2: #565c67;
  --primary: #e39b95; --primary-dark: #f0b2ac;
  --glass-surface: color-mix(in srgb, var(--card) 84%, transparent);
  --glass-border: color-mix(in srgb, var(--card) 35%, var(--border));
  --glass-shadow: 0 10px 32px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.08);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #191c22; --bg-2: #252a33; --card: #2b3039;
    --text: #f2f3f5; --text-2: #c6cad3; --text-3: #a4aab5;
    --border: #404650; --border-2: #565c67;
    --primary: #e39b95; --primary-dark: #f0b2ac;
    --glass-surface: color-mix(in srgb, var(--card) 84%, transparent);
    --glass-border: color-mix(in srgb, var(--card) 35%, var(--border));
    --glass-shadow: 0 10px 32px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.08);
  }
}
body { background: var(--bg); color: var(--text); }
.home-page, body.mag-active #app, .section-page, .about-page { background: var(--bg); color: var(--text); }
.home-header, .app-sidebar, .sidebar-header, .search-bar, .nav-tabs { background: transparent; }
.article-page { --bg: #f2f0e9; --bg-2: #e9e6dc; --card: #f8f6f0; --border: #deddd5; --border-2: #d1d0c6; }
html[data-theme="dark"] .article-page { --bg: #191c22; --bg-2: #252a33; --card: #2b3039; --border: #404650; --border-2: #565c67; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .article-page { --bg: #191c22; --bg-2: #252a33; --card: #2b3039; --border: #404650; --border-2: #565c67; }
}

/* Home: the actual cover art is the content. */
.home-page { min-height: 100vh; background: radial-gradient(ellipse 70% 38% at 50% 35%, #e7eaf1 0%, var(--bg) 100%); }
.home-header { border: 0; padding: 26px 28px 0; }
.home-header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: auto; }
.home-eyebrow { display: none; }
.home-title { margin: 0; font: 650 22px/1.4 var(--font-sans); letter-spacing: .045em; }
.home-header-actions { display: flex; align-items: center; gap: 7px; }
.home-search-icon, .home-about-btn { position: static; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--glass-border); border-radius: 14px; background: color-mix(in srgb, var(--card) 58%, transparent); color: var(--text-2); backdrop-filter: saturate(160%) blur(14px); box-shadow: inset 0 1px rgba(255,255,255,.55); cursor: pointer; }
.home-search-icon:hover, .home-about-btn:hover { background: var(--glass-surface); color: var(--text); }
.home-search-icon .icon, .home-about-btn .icon { width: 20px; height: 20px; }
.home-search-icon span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.home-body { padding: clamp(46px, 7vh, 92px) 28px 40px; }
.magazine-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 260px)); justify-content: center; align-items: start; gap: clamp(22px, 3vw, 42px); width: 100%; max-width: 1180px; margin: auto; padding: 0; overflow: visible; }
@media (min-width: 768px) and (max-width: 1100px) {
  .magazine-grid { grid-template-columns: repeat(2, minmax(0, 280px)); }
}
.nav-tab[hidden], .bn-item[hidden] { display: none !important; }
.article-page-body p.md-heading { color: var(--mag-color-dark, var(--primary-dark)); border-bottom: 0; }
.article-page-body p.md-subheading { color: var(--text); }
.magazine-card { display: block; min-width: 0; width: 100%; margin: 0; text-decoration: none; color: var(--text); }
.mag-cover { box-sizing: border-box; width: 100%; height: auto; aspect-ratio: 3 / 4; max-width: none; overflow: hidden; border: 1px solid rgba(20,30,50,.08); border-radius: 7px; background: #fff !important; box-shadow: 0 11px 28px rgba(35,40,55,.11), 0 2px 5px rgba(35,40,55,.05); filter: none !important; transition: transform .25s ease, box-shadow .25s ease; }
.mag-cover img { display: block; width: 100%; height: 100%; object-fit: contain; }
.magazine-card:hover .mag-cover, .magazine-card:focus-visible .mag-cover { transform: translateY(-4px); box-shadow: 0 17px 34px rgba(35,40,55,.15); }
.mag-info { padding: 19px 0 0; text-align: center; align-items: center; }
.mag-info h2 { margin: 0 0 4px; font: 650 20px/1.4 var(--font-sans); color: var(--text); }
.mag-desc { display: none; }
.mag-meta { margin: 0; color: var(--text-3); font-size: 13px; line-height: 1.5; }
.home-resume { display: flex; align-items: center; gap: 12px; width: min(440px, 100%); margin: 0 auto 30px; padding: 11px 15px; border: 1px solid var(--glass-border); border-radius: 16px; background: var(--glass-surface); color: var(--text); text-align: left; cursor: pointer; }
.home-resume[hidden] { display: none; }
.home-resume-label { flex: none; color: var(--primary); font-size: 12px; font-weight: 650; }
.home-resume-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.home-resume-progress { flex: none; margin-left: auto; color: var(--text-3); font-size: 11px; }
.home-search { display: none; }
.home-guides { margin-top: 22px; }
.home-footer { padding: 28px 20px 32px; color: var(--text-3); }

/* Magazine: the cover and index provide identity; utilities share one quiet row. */
body.mag-active #app { min-height: 100vh; }
.app-sidebar { border: 0; }
.sidebar-header { box-sizing: border-box; position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 6px; max-width: 1190px; margin: auto; }
.sidebar-brand { display: none; }
.header-home-btn, .header-search-btn, .header-about-btn { position: static; z-index: 2; flex: 0 0 42px; width: 42px; height: 42px; transform: none; border: 1px solid var(--glass-border); border-radius: 14px; background: color-mix(in srgb, var(--card) 58%, transparent); color: var(--text-2); backdrop-filter: saturate(160%) blur(14px); box-shadow: inset 0 1px rgba(255,255,255,.55); }
.header-home-btn:hover, .header-search-btn:hover, .header-about-btn:hover { background: var(--glass-surface); color: var(--text); }
.app-sidebar .search-bar { display: none; box-sizing: border-box; max-width: 1138px; margin: 0 auto 12px; padding: 22px 26px; border: 1px solid var(--glass-border); border-radius: 20px; background: var(--glass-surface); backdrop-filter: saturate(170%) blur(20px); box-shadow: var(--glass-shadow); }
body.mag-search-open .app-sidebar .search-bar { display: block; }
.app-sidebar .search-box { gap: 8px; }
.app-sidebar #searchInput { min-width: 0; border-radius: 12px; background: var(--bg); }
.app-sidebar .search-btn { min-height: 43px; border-radius: 12px; background: var(--primary); }
.app-sidebar .scope-group { padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2); }
.app-sidebar .scope-option { min-height: 30px; border-radius: 9px; }
.app-sidebar .scope-option.checked, .app-sidebar .scope-option:has(input:checked) { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(25,30,45,.06); }
.app-sidebar .scope-option.checked input[type="radio"]:checked, .app-sidebar .scope-option:has(input:checked) input[type="radio"]:checked { border-color: var(--primary); background-color: var(--primary); background-image: radial-gradient(circle at center, #fff 0, #fff 4px, transparent 4.5px); }
.journal-cover { min-width: 0; }
.journal-cover img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: contain; border: 1px solid rgba(20,30,50,.08); border-radius: 7px; background: #fff; box-shadow: 0 14px 34px rgba(35,40,55,.11); }
.nav-tabs { border: 1px solid var(--glass-border); border-radius: 16px; background: var(--glass-surface); backdrop-filter: saturate(180%) blur(24px); box-shadow: none; }
.nav-tab { border: 0; border-radius: 12px; }
.nav-tab.active { border: 0; border-radius: 12px; background: color-mix(in srgb, var(--card) 80%, transparent); box-shadow: none; color: var(--text); }
.year-block { margin-bottom: 14px; padding: 0 22px; border: 1px solid color-mix(in srgb, var(--border) 55%, transparent); border-radius: 20px; background: color-mix(in srgb, var(--card) 91%, transparent); box-shadow: none; }
.year-block:hover { background: var(--card); border-color: var(--border-2); }
.yb-header { padding: 20px 0 11px; margin: 0; border: 0; }
.yb-header h3 { font-family: var(--font-sans); font-size: 21px; font-weight: 650; }
.issue-row { border: 0; }
.ir-header { padding-inline: 12px; border-radius: 12px; transition: background .18s ease, color .18s ease; }
.issue-row:not(.collapsed) > .ir-header { background: color-mix(in srgb, var(--card) 48%, var(--bg-2)); color: var(--text); }
.ir-header:hover { background: var(--bg-2); border-radius: 12px; }
.ir-title { font-family: var(--font-sans); font-size: 16px; font-weight: 600; }
.ir-body { padding-top: 2px; }
.sec-group { margin: 9px 0; padding-left: 8px; border: 0; }
.sec-group:hover { border: 0; }
.art-item { position: relative; border-radius: 12px; }
.art-item:hover, .art-item:focus-visible { border-radius: 12px; background: var(--bg-2); color: var(--text); }
.art-item.is-current { border-radius: 12px; background: color-mix(in srgb, var(--primary) 6%, var(--card)); color: var(--text); font-weight: 600; }
.art-item.is-current::before { display: none; }
.art-item { display: block; width: 100%; border: 0; background: transparent; text-align: left; font-family: inherit; }
.yb-header:focus-visible, .ir-header:focus-visible, .art-item:focus-visible, .result-card-main:focus-visible, .section-card:focus-visible, .sp-article:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.yb-header:focus-visible, .ir-header:focus-visible { outline-offset: -2px; }
.result-card-main { display: block; width: 100%; padding: 17px 20px; border: 0; border-radius: inherit; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.result-card-main .rc-title, .result-card-main .rc-snippet { display: block; }
.section-card { width: 100%; color: inherit; font: inherit; text-align: left; }
.sp-article:not(.no-body) { display: block; width: 100%; text-align: left; font-family: inherit; cursor: pointer; }
.section-card, .result-card, .fav-card { border-color: var(--border); }
.section-card:hover, .result-card:hover, .fav-card:hover { border-radius: 12px; }
.sc-name, .rc-title { font-family: var(--font-sans); }
html[data-theme="dark"] .year-block, html[data-theme="dark"] .nav-tab.active { background: var(--card); border-color: var(--border); }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .year-block, html[data-theme="auto"] .nav-tab.active { background: var(--card); border-color: var(--border); }
}

/* Shared search: a spacious desktop sheet and a native-feeling phone sheet. */
.global-search { box-sizing: border-box; display: flex; align-items: flex-start; justify-content: center; top: var(--gs-viewport-top, 0px); bottom: auto; height: var(--gs-viewport-height, 100dvh); padding: clamp(32px, 9vh, 90px) 20px 28px; overflow: hidden; background: rgba(22,27,38,.38); backdrop-filter: blur(10px); }
.gs-panel { box-sizing: border-box; width: min(720px, 100%); max-width: none; max-height: calc(100% - clamp(60px, 12vh, 118px)); margin: 0; padding: 26px 28px 30px; overflow-y: auto; border: 1px solid var(--glass-border); border-radius: 28px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: saturate(180%) blur(28px); box-shadow: 0 28px 72px rgba(18,25,40,.22), inset 0 1px rgba(255,255,255,.55); }
.gs-head { position: static; padding: 0; background: transparent; }
.gs-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.gs-title-row h2 { margin: 0; color: var(--text); font: 680 27px/1.3 var(--font-sans); letter-spacing: -.025em; }
.gs-close { width: 38px; height: 38px; border-radius: 12px; background: var(--bg); color: var(--text-2); }
.gs-close:hover { background: var(--bg-2); color: var(--text); }
.gs-close .icon { width: 17px; height: 17px; }
.gs-box { height: 56px; padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--bg); transition: border-color .18s ease, background .18s ease; }
.gs-box:focus-within { border-color: var(--primary); background: var(--card); }
.gs-box .search-icon { left: 18px; width: 20px; height: 20px; }
.gs-box #globalSearchInput { min-width: 0; height: 100%; padding: 0 18px 0 52px; outline: none; font: 450 16px/1.4 var(--font-sans); -webkit-appearance: none; appearance: none; }
.gs-box #globalSearchInput:focus-visible { outline: none; }
.gs-hint { margin: 14px 2px 0; color: var(--text-3); font-size: 13px; line-height: 1.5; }
.gs-filters { display: flex; flex-wrap: nowrap; width: max-content; max-width: 100%; gap: 3px; margin: 19px 0 18px; padding: 4px; overflow-x: auto; border-radius: 15px; background: var(--bg); scrollbar-width: none; }
.gs-filters::-webkit-scrollbar { display: none; }
.gs-filters button { flex: 0 0 auto; min-height: 38px; padding: 0 17px; border: 0; border-radius: 11px; background: transparent; color: var(--text-2); font: 560 13px/1.3 var(--font-sans); cursor: pointer; }
.gs-filters button:hover { color: var(--text); }
.gs-filters button.active { border: 0; background: var(--card); color: var(--text); box-shadow: 0 1px 5px rgba(25,30,45,.09); font-weight: 680; }
.gs-body-search[hidden] { display: none; }
.gs-body-search { display: flex; align-items: center; justify-content: space-between; box-sizing: border-box; width: 100%; min-height: 46px; margin: -2px 0 18px; padding: 0 15px; border: 0; border-radius: 13px; background: var(--bg); color: var(--text-2); font: 570 13px/1.4 var(--font-sans); cursor: pointer; }
.gs-body-search:hover { background: var(--bg-2); color: var(--text); }
.gs-body-search .icon { width: 17px; height: 17px; }
.gs-count { margin: 12px 2px 10px; color: var(--text-3); font-size: 13px; }
.global-search .results-list { padding-bottom: 4px; }

/* Lists and secondary pages share the same quiet control geometry. */
.section-page-header { border-bottom: 0; background: var(--bg); box-shadow: none; }
.sp-back-btn { width: fit-content; min-height: 38px; margin-bottom: 10px; padding: 0 12px; border: 1px solid var(--glass-border); border-radius: 12px; background: var(--glass-surface); backdrop-filter: saturate(180%) blur(18px); color: var(--text-2); font-size: 13px; }
.sp-back-btn:hover { background: var(--bg-2); color: var(--text); }
.sp-title { font-family: var(--font-sans); font-weight: 650; }
.sp-search-input { min-height: 39px; border-color: var(--border); border-radius: 12px; background: var(--card); }
.sp-issue-group { margin-left: 0; }
.sp-article { margin: 3px 0; padding: 11px 16px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--card) 72%, transparent); color: var(--text-2); line-height: 1.55; }
.sp-article:hover { border: 0; border-radius: 12px; background: var(--glass-surface); color: var(--text); }
.sp-article.no-body { border: 0; color: var(--text-3); }
.sp-article.no-body:hover { border: 0; background: color-mix(in srgb, var(--card) 72%, transparent); color: var(--text-3); }
.sp-no-body-tag { margin-left: 8px; padding: 2px 7px; border-radius: 7px; }
.section-card, .result-card, .fav-card { border: 1px solid var(--glass-border); border-radius: 15px; background: color-mix(in srgb, var(--card) 91%, transparent); box-shadow: inset 0 1px rgba(255,255,255,.48); }
.section-card { box-sizing: border-box; min-height: 60px; padding: 16px 20px; }
.section-card .sc-name { min-width: 0; overflow-wrap: anywhere; }
.section-card .sc-count { flex: none; }
.result-card, .fav-card { box-sizing: border-box; }
.result-card { padding: 0; }
.fav-card { padding: 17px 20px; }
.result-card .rc-fav-btn { z-index: 1; }
.fav-header { box-sizing: border-box; padding: 12px 20px; border: 1px solid var(--glass-border); border-radius: 15px; background: color-mix(in srgb, var(--card) 91%, transparent); box-shadow: inset 0 1px rgba(255,255,255,.48); }
.section-card:hover, .result-card:hover, .fav-card:hover { border-color: var(--border-2); border-radius: 15px; background: var(--card); box-shadow: none; }
.section-list > * + *, .results-list > * + * { margin-top: 8px; }
.fh-actions button { min-height: 36px; border-color: var(--border); border-radius: 11px; }

/* About: a calm grouped sheet, aligned with the journal index. */
.about-page { background: var(--bg); }
.about-page-header { position: relative; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 900px); justify-content: center; padding: 34px 26px 8px; border: 0; background: transparent; box-shadow: none; }
.ab-back-btn { justify-self: start; min-height: 40px; margin: 0; padding: 0 14px; border: 1px solid var(--glass-border); border-radius: 13px; background: var(--glass-surface); backdrop-filter: saturate(180%) blur(18px); color: var(--text-2); font-size: 13px; font-weight: 550; box-shadow: var(--glass-shadow); }
.ab-back-btn:hover { border-color: var(--border-2); background: var(--card); color: var(--text); }
.ab-title { margin: 26px 0 0; font: 680 clamp(30px, 3.8vw, 42px)/1.3 var(--font-sans); letter-spacing: -.02em; }
.about-page-body { box-sizing: border-box; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; width: 100%; max-width: 952px; padding: 18px 26px 64px; }
.about-section { min-width: 0; margin: 0; padding: 26px 28px; border: 1px solid var(--glass-border); border-radius: 23px; background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: saturate(150%) blur(18px); box-shadow: var(--glass-shadow); }
.about-section:first-child, .about-section:nth-child(2) { grid-column: 1 / -1; }
.about-section h2 { margin: 0 0 15px; padding: 0; border: 0; color: var(--text); font: 650 18px/1.45 var(--font-sans); }
.about-section p, .about-mag-list li { color: var(--text-2); font-size: 14px; line-height: 1.8; }
.about-mag-list { margin: 13px 0 16px; padding: 0; }
.about-mag-list li { padding: 5px 0; }
.about-link { box-sizing: border-box; display: flex; width: fit-content; max-width: 100%; min-height: 40px; margin: 5px 0 15px; padding: 8px 12px; overflow-wrap: anywhere; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text-2); font-size: 12px; line-height: 1.5; text-decoration: none; }
.about-link:hover { border-color: var(--border-2); background: var(--bg-2); color: var(--text); }
.about-link .icon { flex: none; color: var(--primary); }
.about-note { margin-top: 14px; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--bg-2) !important; color: var(--text-3) !important; }
.about-footer { grid-column: 1 / -1; margin: 0; padding: 18px 0 0; border: 0; }

/* Reading: paper stays opaque while the five-action dock floats above it. */
.ap-title { font-family: var(--font-sans); font-weight: 680; letter-spacing: -.018em; }
.ap-header-inner { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "meta"; }
.article-page-header { border-color: var(--border); }
.ap-related { box-sizing: border-box; max-width: 760px; margin: 12px auto 0; padding: 26px 0 40px; border-top: 1px solid var(--border); }
.ap-related-heading { margin-bottom: 19px; }
.ap-related-kicker { display: block; color: var(--primary); font: 700 10px/1 var(--font-sans); letter-spacing: .18em; }
.ap-related-title { margin: 8px 0 0; color: var(--text); font: 650 25px/1.35 var(--font-sans); }
.ap-related-list { display: grid; gap: 9px; }
.ap-related-item { box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; min-height: 72px; margin: 0; padding: 13px 16px; border: 1px solid var(--border); border-radius: 15px; background: var(--card); color: var(--text); text-align: left; box-shadow: none; cursor: pointer; }
.ap-related-item:hover, .ap-related-item:focus-visible { border-color: var(--border-2); border-radius: 15px; background: var(--bg-2); }
.ap-related-copy { min-width: 0; }
.ap-related-name { display: block; overflow: visible; text-overflow: clip; white-space: normal; font: 600 16px/1.5 var(--font-sans); }
.ap-related-meta { display: block; margin-top: 4px; color: var(--text-3); font-size: 11px; line-height: 1.4; }
.ap-related-arrow { flex: none; color: var(--text-3); font-size: 20px; line-height: 1; }
body.article-active { --reading-dock-height: 86px; --reader-shortcut-size: 44px; --dock-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
.reading-dock { position: fixed; inset: auto auto var(--dock-bottom) 50%; box-sizing: border-box; width: min(540px, calc(100% - 28px)); padding: 5px; transform: translateX(-50%); border: 1px solid var(--glass-border); border-radius: 23px; background: color-mix(in srgb, var(--card) 68%, transparent); backdrop-filter: saturate(165%) blur(16px); box-shadow: inset 0 1px rgba(255,255,255,.6); }
.reading-dock .ap-nav { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); width: 100%; max-width: none; margin: 0; padding: 0; border: 0; }
.reading-dock .ap-nav > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 60px; padding: 7px 2px; border: 0; border-radius: 17px; box-shadow: none; color: var(--text-2); font: 550 11px/1.3 var(--font-sans); white-space: nowrap; }
.reading-dock .ap-nav > button span { display: block; margin: 0; font: inherit; }
.reading-dock .ap-nav > button:disabled { opacity: .42; }
.reading-dock .ap-nav > button + button { border: 0; }
.reading-dock .ap-nav > button.active, .reading-dock .ap-nav > button:hover:not(:disabled) { background: color-mix(in srgb, var(--card) 72%, transparent); box-shadow: inset 0 1px rgba(255,255,255,.5); color: var(--primary); }
.reading-dock .ap-nav .icon { display: block; width: 21px; height: 21px; }
.reading-dock .reading-operation-menu, .reading-dock .reading-issue-menu { position: absolute; box-sizing: border-box; right: 0; bottom: calc(100% + 10px); left: auto; width: min(380px, calc(100vw - 28px)); max-width: none; max-height: min(52vh, 460px); margin: 0; overflow-y: auto; border: 1px solid var(--glass-border); border-radius: 20px; background: color-mix(in srgb, var(--card) 97%, transparent); backdrop-filter: saturate(170%) blur(28px); box-shadow: var(--glass-shadow); }
.reading-dock .reading-operation-menu { max-height: min(76dvh, 440px); padding: 16px; }
.reading-dock .reading-issue-menu { padding: 16px 12px; }
.reading-issue-heading { align-items: center; gap: 8px; margin: 0 4px 8px; padding: 0 4px 8px; border: 0; }
.reading-issue-heading strong { min-width: 0; font: 650 15px/1.4 var(--font-sans); }
.reading-issue-heading span { font-size: 11px; }
.reading-issue-list { gap: 3px; }
.reading-issue-item { gap: 10px; min-height: 47px; padding: 10px 9px; border: 0; border-radius: 12px; }
.reading-issue-item:hover { border-radius: 12px; background: color-mix(in srgb, var(--card) 55%, var(--bg-2)); }
.reading-issue-item.active { border-radius: 12px; background: color-mix(in srgb, var(--primary) 10%, var(--card)); color: var(--text); }
.reading-issue-item.active .reading-issue-number { color: var(--primary); }
.reading-issue-item.active .reading-issue-title { color: var(--text); }
.reading-operation-menu .ap-settings-panel { display: none; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.reading-operation-menu .ap-settings-panel.show { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 10px; }
.reading-operation-menu .asp-title { grid-column: 1 / -1; margin: 0 38px 0 0; font: 650 17px/1.5 var(--font-sans); color: var(--text); }
.reading-operation-menu .asp-close-btn { top: 0; right: 0; width: 30px; height: 30px; border-radius: 10px; }
.reading-operation-menu .asp-section { display: flex; flex-direction: column; gap: 5px; min-width: 0; min-height: 0; }
.reading-operation-menu .asp-section:has(#fontSizeGroup), .reading-operation-menu .asp-section:has(#themeGroup) { grid-column: 1 / -1; }
.reading-operation-menu .asp-label { color: var(--text-2); font-size: 11px; font-weight: 550; }
.reading-operation-menu .asp-btn-group { display: flex; gap: 2px; min-width: 0; margin: 0; padding: 2px; border: 1px solid var(--glass-border); border-radius: 12px; background: color-mix(in srgb, var(--bg-2) 80%, transparent); }
.reading-operation-menu .asp-btn-group > * + * { margin-left: 0; }
.reading-operation-menu .asp-btn { min-width: 0; min-height: 31px; padding: 4px 2px; border-radius: 9px; color: var(--text-2); font-size: 11px; white-space: nowrap; }
.reading-operation-menu .asp-btn.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(25,30,45,.08); }
.reading-operation-menu .ap-actions { gap: 6px; margin-top: 11px; padding-top: 0; border: 0; }
.reading-operation-menu .ap-actions > * { min-height: 43px; height: 43px; border: 0; border-radius: 11px; background: color-mix(in srgb, var(--bg) 82%, transparent); color: var(--text-2); }
.reading-operation-menu .ap-actions > *:hover, .reading-operation-menu .ap-actions > *.active { border-radius: 11px; background: var(--bg-2); color: var(--text); }
.article-page .back-to-top { right: max(18px, calc((100vw - 1020px) / 2)); bottom: calc(var(--dock-bottom) + 78px + 12px); width: 46px; height: 46px; border: 1px solid var(--glass-border); border-radius: 16px; background: color-mix(in srgb, var(--card) 68%, transparent); color: var(--text-2); backdrop-filter: saturate(165%) blur(16px); box-shadow: 0 4px 16px rgba(26,35,55,.08), inset 0 1px rgba(255,255,255,.6); }
.article-page .back-to-top .icon { width: 19px; height: 19px; }
.article-page .back-to-top .progress-ring { inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); }
.article-page .back-to-top .progress-ring-bg { stroke: color-mix(in srgb, var(--text-3) 18%, transparent); stroke-width: 2; }
.article-page .back-to-top .progress-ring-fg { stroke: color-mix(in srgb, var(--primary) 65%, var(--text-3)); stroke-width: 2; }
.article-page .back-to-top:hover { background: color-mix(in srgb, var(--card) 82%, transparent); color: var(--text); }
.article-page .back-to-top:hover .progress-ring-bg { stroke: color-mix(in srgb, var(--text-3) 24%, transparent); }
.article-page .back-to-top:hover .progress-ring-fg { stroke: color-mix(in srgb, var(--primary) 65%, var(--text-3)); }
.article-page .back-to-top:active { transform: scale(.96); }
.article-page:has(.reading-operation-menu:not([hidden])) .back-to-top.show,
.article-page:has(.reading-issue-menu:not([hidden])) .back-to-top.show { opacity: 0; visibility: hidden; pointer-events: none; }
.article-toc.is-open { border: 1px solid var(--glass-border); border-radius: 18px; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: saturate(170%) blur(22px); box-shadow: var(--glass-shadow); }

@media (min-width: 768px) {
  .sidebar-header { padding: 18px 26px 12px; }
  .app-main { display: grid; grid-template-columns: minmax(230px, 315px) minmax(0, 1fr); align-items: start; column-gap: clamp(40px, 6vw, 86px); box-sizing: border-box; max-width: 1190px; margin: auto; padding: 22px 26px 100px; }
  .journal-cover { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 24px; }
  .nav-tabs { grid-column: 2; position: relative; top: auto; display: flex; width: max-content; max-width: 100%; gap: 2px; margin: 0; padding: 4px; }
  .nav-tab { padding: 10px 19px; font-size: 14px; }
  .content { grid-column: 2; width: 100%; max-width: none; min-width: 0; margin: 0; padding: 25px 0 0; }
}
@media (max-width: 767px) {
  body { --mobile-dock-bottom: max(6px, calc(env(safe-area-inset-bottom, 0px) - 12px)); }
  .home-page { background: var(--bg); }
  .home-header { padding: 18px 20px 0; }
  .home-title { font-size: 20px; }
  .home-body { padding: 34px 20px 18px; }
  .magazine-grid { display: grid; grid-template-columns: minmax(0, 330px); justify-content: center; gap: 42px; width: 100%; max-width: none; padding: 0; overflow: visible; }
  .magazine-card { width: 100%; max-width: 330px; }
  .mag-info { padding-top: 14px; text-align: center; align-items: center; }
  .mag-info h2 { font-size: 19px; }
  .home-guides { margin-top: 10px; }
  .global-search { align-items: flex-end; padding: 0; }
  .gs-panel { position: relative; width: 100%; max-height: min(88%, 88dvh); margin: 0; padding: 27px 20px calc(25px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 28px 28px 0 0; box-shadow: 0 -14px 48px rgba(18,25,40,.18); }
  .gs-panel::before { content: ''; position: absolute; top: 10px; left: 50%; width: 36px; height: 4px; transform: translateX(-50%); border-radius: 4px; background: var(--border-2); }
  .gs-title-row { margin-bottom: 17px; }
  .gs-title-row h2 { font-size: 25px; }
  .gs-filters { box-sizing: border-box; display: grid; grid-template-columns: .72fr .72fr 1.22fr 1.22fr; width: 100%; margin-block: 16px; overflow: visible; }
  .gs-filters button { min-width: 0; padding-inline: 3px; white-space: nowrap; }
  .sidebar-header { min-height: 0; padding: 12px 16px 8px; border-bottom: 0; }
  .sidebar-brand { display: block; flex: 1 1 auto; min-width: 0; margin: 0; text-align: left; pointer-events: none; }
  .sidebar-brand h1 { overflow: hidden; margin: 0; color: var(--text); font: 650 19px/1.4 var(--font-sans); letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar-brand .sidebar-meta { display: none; }
  .sidebar-header .header-home-btn { display: none; }
  .header-home-btn, .header-search-btn, .header-about-btn { flex-basis: 40px; width: 40px; height: 40px; }
  .journal-cover { display: none; }
  .app-sidebar .search-bar { width: calc(100% - 28px); margin: 0 14px 14px; padding: 18px 14px; box-shadow: none; }
  .app-sidebar .search-intro { gap: 3px; margin-bottom: 12px; }
  .app-sidebar .search-intro span { line-height: 1.45; }
  .app-sidebar .filters { justify-content: flex-start; gap: 8px; margin-top: 14px; }
  .app-sidebar .search-kbd { display: none; }
  .content { padding: 18px 16px 96px; }
  .year-block { padding-inline: 15px; border-radius: 17px; }
  .yb-header h3 { font-size: 19px; }
  .bottom-nav { box-sizing: border-box; right: auto; bottom: var(--mobile-dock-bottom); left: 50%; width: min(420px, calc(100% - 28px)); height: 64px; padding: 5px; transform: translateX(-50%); border: 1px solid var(--glass-border); border-radius: 21px; background: var(--glass-surface); backdrop-filter: saturate(180%) blur(24px); box-shadow: none; }
  .bn-item { flex: 1; min-width: 0; min-height: 52px; gap: 2px; border-radius: 16px; color: var(--text-3); font-size: 10px; font-weight: 550; }
  .bn-item.active { border-radius: 16px; background: color-mix(in srgb, var(--card) 80%, transparent); color: var(--text); font-weight: 650; box-shadow: none; }
  .bn-item .icon { width: 20px; height: 20px; }
  .bn-item .fav-badge { top: 2px; right: calc(50% - 27px); }
  .bn-home { color: var(--text-2); }
  .about-page-header { padding: 21px 18px 7px; }
  .ab-title { margin-top: 20px; font-size: 29px; }
  .about-page-body { grid-template-columns: minmax(0,1fr); gap: 13px; padding: 16px 16px 50px; }
  .about-section { padding: 21px 19px; border-radius: 19px; }
  .about-section:first-child, .about-section:nth-child(2) { grid-column: 1; }
  .about-section h2 { font-size: 17px; }
  .reading-operation-menu .asp-section { grid-template-columns: 55px minmax(0, 1fr); gap: 6px; }
  .reading-operation-menu .asp-btn { font-size: 11px; }
  .ap-related { margin-top: 6px; padding: 22px 0 26px; }
  .ap-related-title { font-size: 23px; }
  .ap-related-item { min-height: 68px; padding: 12px 14px; }
  .ap-related-name { font-size: 15px; }
  body.article-active { --reading-dock-height: 64px; --dock-bottom: var(--mobile-dock-bottom); }
  .reading-dock { width: min(420px, calc(100% - 28px)); border-radius: 21px; }
  .reading-dock .ap-nav > button { min-height: 52px; font-size: 10px; }
  .reading-dock .ap-nav .icon { width: 20px; height: 20px; }
  .article-page .back-to-top { right: 12px; bottom: calc(var(--dock-bottom) + 64px + 10px); }
  .reading-dock .reading-operation-menu, .reading-dock .reading-issue-menu { right: 0; width: min(380px, calc(100vw - 28px)); }
  .article-page-body { padding-bottom: 108px; }
}
@media (prefers-reduced-motion: reduce) {
  .mag-cover { transition: none; }
}
@media print {
  .reading-dock { display: none !important; }
}
