/* ===== Design Tokens ===== */
:root {
    --primary: oklch(0.48 0.17 27);
    --primary-light: oklch(0.58 0.14 27);
    --primary-dark: oklch(0.38 0.14 27);
    --accent: oklch(0.62 0.15 30);
    --bg: oklch(0.975 0.004 30);
    --card: oklch(0.995 0.002 30);
    --text: oklch(0.22 0.01 30);
    --text-2: oklch(0.45 0.012 30);
    --text-3: oklch(0.6 0.01 30);
    --border: oklch(0.91 0.005 30);
    --border-2: oklch(0.88 0.006 30);
    --highlight: oklch(0.95 0.07 85);
    --highlight-text: oklch(0.35 0.12 27);
    --fav: oklch(0.65 0.16 65);
    --radius: 8px;
    --radius-sm: 5px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px oklch(0.2 0.01 30 / 0.06);
    --shadow-md: 0 2px 8px oklch(0.2 0.01 30 / 0.08);
    --shadow-lg: 0 8px 30px oklch(0.2 0.01 30 / 0.12);
    --maxw: 920px;
    --header-h: 56px;
    --search-h: 96px;
    --bottom-h: 56px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font-sans: -apple-system, "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

/* ===== 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;
}
.desktop-only { display: none; }
.mobile-only { display: block; }
svg { display: inline-block; vertical-align: middle; }
.icon { width: 1em; height: 1em; flex-shrink: 0; }
button { font-family: inherit; }

/* ===== App / Article Page 切换 ===== */
#app { display: block; }
#articlePage { display: none; }
body.article-active #app { display: none; }
body.article-active #articlePage { display: block; }
body.article-active { padding-bottom: 0; }

/* ===== Header ===== */
.app-header {
    background: var(--primary-dark);
    color: oklch(0.98 0.005 30);
    padding: 10px 20px 8px;
    text-align: center;
}
.app-header h1 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 1px;
}
.app-subtitle {
    font-size: 10px;
    opacity: 0.7;
    font-weight: 400;
    display: inline;
}
.app-subtitle::before { content: ""; }
.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: oklch(0.6 0.15 145); }
.search-status.loading::before {
    background: var(--accent);
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ===== Search Bar (sticky, 标题下方) ===== */
.search-bar {
    background: var(--card);
    padding: 8px 16px 10px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 99;
}
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.search-box .search-icon {
    position: absolute;
    left: 14px;
    width: 17px;
    height: 17px;
    color: var(--text-3);
    pointer-events: none;
}
#searchInput {
    width: 100%;
    padding: 9px 36px 9px 40px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    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(--primary-light);
    background: var(--card);
}
#searchInput::placeholder { color: var(--text-3); }
.search-clear {
    position: absolute;
    right: 6px;
    border: none;
    background: var(--border);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
}
.search-clear .icon { width: 13px; height: 13px; }
.search-clear:hover { background: var(--border-2); }

.filters {
    display: flex;
    gap: 8px;
    margin-top: 7px;
    flex-wrap: wrap;
    align-items: center;
}
.filters select {
    padding: 4px 8px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    background: var(--card);
    color: var(--text-2);
    max-width: 44%;
}
.filters select:focus { outline: none; border-color: var(--primary-light); }
.filter-check {
    font-size: 12px;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    cursor: pointer;
}
.filter-check input { width: 14px; height: 14px; cursor: pointer; accent-color: var(--primary); }

/* ===== Desktop Nav (3 tabs, no display:flex in base to avoid overriding desktop-only) ===== */
.nav-tabs {
    gap: 2px;
    padding: 0 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    max-width: var(--maxw);
    margin: 0 auto;
}
.nav-tab {
    flex: 1;
    padding: 13px 12px 11px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-2);
    transition: color 0.2s var(--ease);
    font-weight: 500;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
}
.nav-tab .icon { width: 17px; height: 17px; }
.nav-tab.active {
    color: var(--primary);
    font-weight: 600;
}
.nav-tab.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

/* ===== 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;
}
.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(--primary); font-weight: 600; }
.bn-item .icon { width: 21px; height: 21px; }

/* ===== 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: 10px 12px 24px; 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;
}

/* ===== Result Cards ===== */
.results-list { display: flex; flex-direction: column; gap: 8px; }
.result-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 13px 16px 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: box-shadow 0.2s var(--ease), transform 0.15s var(--ease);
    position: relative;
}
.result-card:active { transform: scale(0.995); }
.result-card:hover { box-shadow: var(--shadow-md); }
.rc-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    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: oklch(0.95 0.01 30);
    color: var(--text-2);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}
.rc-tag.no-body { background: oklch(0.95 0.003 30); color: var(--text-3); }
.rc-author { color: 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: oklch(0.95 0.01 65); color: var(--fav); }
.rc-fav-btn.active { color: var(--fav); }
.rc-fav-btn.active:hover { background: oklch(0.95 0.02 65); }

/* ===== 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: 8px; }
.section-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: box-shadow 0.2s var(--ease);
    display: flex;
    align-items: center;
    gap: 14px;
}
.section-card:hover { box-shadow: var(--shadow-md); }
.sc-name { flex: 1; font-weight: 600; font-size: 14px; color: var(--text); }
.sc-bar {
    width: 72px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}
.sc-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}
.sc-count { font-size: 12px; color: var(--text-3); white-space: nowrap; min-width: 40px; text-align: right; }

/* ===== Catalog View ===== */
.catalog-list { display: flex; flex-direction: column; gap: 8px; }
.year-block {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.yb-header {
    background: var(--primary-dark);
    color: oklch(0.97 0.005 30);
    padding: 11px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.yb-header h3 { font-size: 15px; font-weight: 600; }
.yb-info { font-size: 11px; opacity: 0.75; }
.yb-right { display: flex; align-items: center; gap: 10px; }
.yb-toggle {
    transition: transform 0.3s var(--ease);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.yb-toggle .icon { width: 14px; height: 14px; }
.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: 10px 16px;
    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); }
.ir-title { font-weight: 600; font-size: 13px; color: var(--text); }
.ir-count { font-size: 11px; color: var(--text-3); }
.ir-right { display: flex; align-items: center; gap: 8px; }
.ir-toggle {
    transition: transform 0.3s var(--ease);
    color: var(--text-3);
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ir-toggle .icon { width: 12px; height: 12px; }
.issue-row.collapsed .ir-toggle { transform: rotate(-90deg); }
.issue-row.collapsed .ir-body { display: none; }
.ir-body { padding: 6px 16px 10px; }
.sec-group {
    margin: 4px 0;
    padding-left: 12px;
    border-left: 2px solid var(--border-2);
}
.sg-title {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 12px;
    margin: 5px 0 3px;
}
.sg-title .count { font-size: 11px; color: var(--text-3); font-weight: 400; }
.art-item {
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    transition: color 0.15s var(--ease);
    line-height: 1.5;
}
.art-item:hover { color: var(--primary); }
.art-item .ai-author { color: var(--text-3); font-size: 12px; }

/* ===== 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;
    font-family: inherit;
    color: var(--text-2);
    transition: all 0.2s var(--ease);
}
.fh-actions button:hover { border-color: var(--primary-light); color: var(--primary); }

/* ===== Article Page (独立文章页面) ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    z-index: 201;
    width: 0%;
    transition: width 0.05s linear;
    display: none;
}
body.article-active .reading-progress { display: block; }

.article-page {
    min-height: 100vh;
    background: var(--bg);
}
.article-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 oklch(0.2 0.01 30 / 0.04);
}
.ap-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    padding: 4px 0;
    margin-bottom: 6px;
    transition: opacity 0.15s var(--ease);
}
.ap-back-btn .icon { width: 18px; height: 18px; }
.ap-back-btn:active { opacity: 0.6; }
.ap-actions {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: 12px;
    display: flex;
    gap: 6px;
}
.ap-fav-btn, .ap-original-link {
    border: none;
    background: oklch(0.95 0.01 30);
    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 { width: 17px; height: 17px; }
.ap-fav-btn:hover, .ap-original-link:hover {
    background: oklch(0.92 0.01 30);
    color: var(--primary);
}
.ap-fav-btn.active {
    color: var(--fav);
    background: oklch(0.95 0.04 65);
}
.ap-title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 4px;
    padding-right: 84px;
}
.ap-meta {
    font-size: 12px;
    color: var(--text-3);
}

/* Article body */
.article-page-body {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 18px 56px;
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.95;
    color: var(--text);
}
.article-page-body p {
    margin-bottom: 14px;
    text-indent: 2em;
    text-align: justify;
    text-justify: inter-ideograph;
}
.article-page-body p.md-heading {
    text-indent: 0;
    text-align: left;
    font-weight: 700;
    color: var(--text);
    margin-top: 22px;
    font-size: 17px;
}
.article-page-body p.md-bold {
    text-indent: 0;
    text-align: left;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 16px;
}
.article-page-body strong { font-weight: 700; }
.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(--primary-light);
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: background 0.2s var(--ease);
}
.article-page-body .retry-btn:hover { background: var(--primary-dark); }
.article-page-body .article-loading {
    text-align: center;
    padding: 48px 0;
    color: var(--text-3);
    text-indent: 0;
}

/* ===== Section Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: oklch(0.15 0.01 30 / 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 0;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: var(--card);
    width: 100%;
    max-width: 720px;
    min-height: 100vh;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalIn 0.25s var(--ease);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-header {
    background: var(--primary-dark);
    color: oklch(0.97 0.005 30);
    padding: 20px 24px 18px;
    padding-right: 60px;
    position: relative;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
}
.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    line-height: 1.5;
}
.modal-meta { font-size: 12px; opacity: 0.75; }
.modal-close {
    position: absolute;
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 14px;
    background: oklch(1 0 0 / 0.15);
    border: none;
    color: oklch(0.97 0.005 30);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease);
}
.modal-close .icon { width: 16px; height: 16px; }
.modal-close:hover { background: oklch(1 0 0 / 0.28); }

.modal-body {
    padding: 20px;
    font-size: 14px;
    line-height: 1.75;
    color: var(--text);
}
.modal-search-bar {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--card);
    z-index: 5;
}
.modal-search-bar input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
}
.modal-search-bar input:focus { outline: none; border-color: var(--primary-light); background: var(--card); }

.modal-year-group { margin: 0 20px 14px; }
.modal-year-header {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 13px;
    padding: 10px 0 5px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 5px;
}
.modal-issue-group { margin-left: 12px; margin-bottom: 6px; }
.modal-issue-label { font-size: 12px; color: var(--text-3); font-weight: 600; padding: 2px 0; }
.modal-article {
    padding: 5px 0 5px 12px;
    font-size: 14px;
    color: var(--text-2);
    border-left: 2px solid var(--border);
    margin-bottom: 2px;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
    line-height: 1.5;
}
.modal-article:hover { border-left-color: var(--primary); color: var(--primary); }
.modal-article .author { color: var(--text-3); font-size: 13px; }

/* ===== 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(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Desktop (>=768px) ===== */
@media (min-width: 768px) {
    :root { --header-h: 80px; --search-h: 80px; }
    .desktop-only { display: flex; }
    .mobile-only { display: none; }
    body { padding-bottom: 0; font-size: 15px; }

    .app-header {
        padding: 22px 30px 18px;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    .app-header h1 { font-size: 26px; }
    .app-subtitle { font-size: 13px; }
    .search-status { font-size: 11px; }

    .search-bar {
        padding: 12px 24px 14px;
        position: sticky;
        top: var(--header-h);
        z-index: 99;
    }
    #searchInput { font-size: 15px; }
    .filters select { max-width: none; font-size: 13px; }
    .filter-check { font-size: 13px; }

    .nav-tabs {
        position: sticky;
        top: calc(var(--header-h) + var(--search-h));
        z-index: 98;
        display: flex;
        padding: 0 24px;
    }
    .nav-tab { font-size: 15px; }

    .content { padding: 16px 24px 32px; }
    .result-card { padding: 16px 20px; }
    .rc-title { font-size: 16px; }

    .article-page-body {
        padding: 40px 48px 56px;
        font-size: 17px;
        line-height: 2.05;
    }
    .article-page-body p { margin-bottom: 16px; }
    .ap-title { font-size: 24px; padding-right: 90px; }
    .article-page-header { padding: 14px 24px 16px; }
    .ap-back-btn { font-size: 15px; }

    .modal-overlay { padding: 30px 16px; }
    .modal-box {
        border-radius: var(--radius-lg);
        min-height: auto;
        max-height: calc(100vh - 60px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .modal-header { padding: 24px 30px 20px; padding-right: 60px; padding-top: 24px; }
    .modal-header h2 { font-size: 21px; }
    .modal-close { top: 18px; width: 34px; height: 34px; }
    .modal-close .icon { width: 18px; height: 18px; }
    .modal-body { overflow-y: auto; flex: 1; }
}

/* ===== Wide (>=1024px) ===== */
@media (min-width: 1024px) {
    .app-header h1 { font-size: 28px; letter-spacing: 2px; }
}
