/* 理想乡~Cloudland — paper, ink, and a quiet place to read.
   Loaded after the legacy component sheet to preserve existing behavior. */
:root {
    color-scheme: light;
    --bg: #ffffff; --bg-secondary: #f5f6f7; --bg-sidebar: #f8f9fa;
    --text: #28352c; --text-secondary: #626d60; --text-muted: #667060;
    --border: #e1e5e3; --primary: #536846; --primary-hover: #3b5032;
    --primary-light: #e8efe9; --primary-ghost: #f1f5f2;
    --accent: #657b54; --accent-light: #f1f5f2; --code-bg: #f5f6f7;
    --surface: #ffffff; --surface-strong: #ffffff;
    --sidebar-surface-rgb: 248, 249, 250;
    --surface-on-bg: rgba(255,255,255,.92); --surface-on-bg-strong: rgba(255,255,255,.96);
    --surface-on-bg-hover: rgba(83,104,70,.09); --surface-on-bg-active: rgba(83,104,70,.16);
    --art-circle: #edf2ee; --art-line: #bdc7ae; --art-paper: #ffffff; --art-ribbon: #a9b88e;
    --font-sans: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-display: 'Songti SC', 'STSong', 'SimSun', serif;
    --navbar-height: 72px; --sidebar-width: 246px;
    --radius: 10px; --radius-lg: 16px; --radius-sm: 6px;
    --card-shadow: none; --card-hover-shadow: 0 4px 18px rgba(40,53,44,.05);
    --focus-ring: 0 0 0 3px rgba(83,104,70,.2);
}
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #1b211d; --bg-secondary: #252d26; --bg-sidebar: #202720;
    --text: #e5e9df; --text-secondary: #adb7a7; --text-muted: #9aa593;
    --border: #3b4639; --primary: #b4c99d; --primary-hover: #d4e4c4;
    --primary-light: #35422e; --primary-ghost: #2e3929; --accent: #b4c99d; --accent-light: #2e3929;
    --code-bg: #252e26; --surface: #232b24; --surface-strong: #273129;
    --sidebar-surface-rgb: 32,39,32; --surface-on-bg: rgba(27,33,29,.92); --surface-on-bg-strong: rgba(27,33,29,.96);
    --surface-on-bg-hover: rgba(180,201,157,.1); --surface-on-bg-active: rgba(180,201,157,.18);
    --art-circle: #323e2c; --art-line: #63745a; --art-paper: #34402f; --art-ribbon: #8fa876;
}
/* Keep the canvas and body in sync with surfaces during theme changes.
   The canvas also supplies the base behind translucent custom backgrounds. */
html { background: var(--bg); }
body, [data-theme="dark"] body { background: var(--bg); transition: none; }
body.has-custom-background, [data-theme="dark"] body.has-custom-background { background: transparent; }
button, input, select, textarea { font-family: var(--font-sans); }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }

.article-source-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 24px; }
.article-source-actions .btn-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; }
.article-source-actions button:disabled { opacity: .6; cursor: wait; }
.article-source-status { flex-basis: 100%; color: var(--text-secondary); font-size: 13px; overflow-wrap: anywhere; }
.article-source-status:empty { display: none; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 16px; top: -70px; z-index: 1000; padding: 10px 18px; background: var(--text); color: var(--bg); border-radius: 6px; }
.skip-link:focus { top: 12px; }
.navbar, [data-theme="dark"] .navbar { height: var(--navbar-height); background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: none; padding: 0 28px; gap: 18px; }
.logo { gap: 10px; font-size: 20px; letter-spacing: 1px; }
.logo-icon { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; }
.logo-english { white-space: nowrap; letter-spacing: 0; }
.logo-caption { display: block; font-size: 11px; font-weight: 400; letter-spacing: 1px; line-height: 1.3; color: var(--text-secondary); }
.search-box { max-width: 440px; }
.search-box input, [data-theme="dark"] .search-box input { height: 39px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-secondary); box-shadow: none; font-size: 14px; }
.search-box input:focus { background: var(--surface); box-shadow: var(--focus-ring); border-color: var(--primary); }
.search-hint { font-family: var(--font-sans); padding: 0 7px; }
.menu-toggle, .theme-toggle, .btn-new-article, .btn-background, .user-pill { box-shadow: none; border-radius: 7px; }
.layout { padding-top: var(--navbar-height); }
.sidebar { top: var(--navbar-height); width: var(--sidebar-width); background: rgba(var(--sidebar-surface-rgb), var(--sidebar-bg-opacity)); border-right: 1px solid var(--border); }
.sidebar-nav { min-height: 100%; display: flex; flex-direction: column; padding: 24px 14px 16px; }
.sidebar-home, .sidebar-overview { display: flex; align-items: center; gap: 11px; margin: 0 0 5px; padding: 10px 12px; min-height: 42px; border: 0; border-radius: 7px; color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.sidebar-home:hover, .sidebar-overview:hover { color: var(--primary); background: var(--primary-ghost); }
.sidebar-home.active, .sidebar-overview.active { color: var(--primary); background: var(--primary-light); }
.sidebar-home { order: 1; } .sidebar-overview { order: 2; }
.sidebar-header { order: 3; margin: 22px 8px 8px; padding: 0; }
.sidebar-icon { display: none; } .sidebar-title { font-size: 12px; font-weight: 500; letter-spacing: 1px; }
.category-tree { order: 4; padding: 0 0 24px; }
.category-tree a { font-size: 14px; font-weight: 400; min-height: 39px; padding: 8px 10px 8px 30px; margin: 2px 0; border-radius: 6px; }
.category-tree a:hover, .category-tree a.active { background: var(--primary-light); color: var(--primary); box-shadow: none; }
.category-tree .cat-count { background: transparent; color: var(--text-muted); font-size: 12px; }
.cat-toggle { top: 11px; left: 5px; }
.sidebar-footer { order: 5; position: static; margin-top: auto; padding: 18px 8px 0; border-top: 1px solid var(--border); }
.sidebar-note { font-size: 11px; color: var(--text-muted); margin-bottom: 14px; }
.sidebar-login { width: 100%; justify-content: center; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; font-size: 13px; min-height: 38px; }
.main { margin-left: var(--sidebar-width); min-width: 0; min-height: calc(100vh - var(--navbar-height)); }
.content { width: 100%; max-width: 1260px; padding: 28px 44px 48px; margin: 0 auto; }
.home-topline { display: flex; align-items: center; justify-content: space-between; color: var(--text-secondary); font-size: 12px; gap: 12px; }
.home-topline > span { color: var(--primary); }
.home-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 15px; align-items: center; padding: 32px 0 34px; margin-bottom: 0; text-align: left; border-bottom: 1px solid var(--border); }
.home-hero::before { display: none; }
.home-hero h1 { color: var(--text); -webkit-text-fill-color: var(--text); background: none; font-family: var(--font-display); font-size: clamp(30px, 2.8vw, 45px); font-weight: 600; letter-spacing: 2px; line-height: 1.55; margin-bottom: 16px; }
.home-hero p { font-size: 13px; line-height: 2; color: var(--text-secondary); }
.hero-art { max-width: 325px; width: 100%; justify-self: center; }
.hero-art svg { width: 100%; height: auto; display: block; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: 24px; }
.hero-primary { padding: 10px 18px; min-height: 41px; border: 1px solid var(--primary); background: var(--primary); color: var(--bg); border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.hero-primary:hover { background: var(--primary-hover); }
.hero-secondary { font-size: 13px; color: var(--text-secondary); }
.section-header { gap: 14px; margin: 26px 0 16px; flex-wrap: wrap; }
.section-header h2 { font-size: 17px; font-weight: 650; letter-spacing: .3px; }
.section-header h1 { font-size: 28px; font-weight: 650; }
.section-description { font-size: 12px; color: var(--text-muted); }
.section-line { background: var(--border); }
.text-button { border: 0; background: transparent; color: var(--primary); font-size: 12px; cursor: pointer; padding: 5px 0; margin-left: auto; }
.home-categories { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.knowledge-card { display: flex; flex-direction: column; min-width: 0; padding: 18px 16px 15px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); }
.knowledge-card:hover { border-color: var(--primary); background: var(--primary-ghost); }
.knowledge-card-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--primary); background: var(--primary-ghost); border-radius: 7px; margin-bottom: 12px; }
.knowledge-card strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.knowledge-card small { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.home-reading-grid { display: grid; grid-template-columns: minmax(0,1fr) 245px; gap: 30px; margin-top: 6px; }
.home-aside { padding-top: 29px; }
.article-list { display: flex; flex-direction: column; gap: 12px; }
.article-list li { border: 1px solid var(--border); border-radius: 9px; background: var(--surface); box-shadow: none; backdrop-filter: none; }
.article-list li::before { display: none; }
.article-list li:hover { transform: none; border-color: var(--primary); box-shadow: none; }
.article-list li > a { display: block; font-size: 17px; line-height: 1.65; font-weight: 600; color: var(--text); padding: 19px 22px 8px; overflow-wrap: anywhere; }
.article-list .article-excerpt { color: var(--text-secondary); font-size: 13px; padding: 0 22px 12px; line-height: 1.9; }
.article-list .meta { font-size: 12px; padding: 0 22px 17px; color: var(--text-muted); gap: 6px; flex-wrap: wrap; }
.article-list .meta a { padding: 0; font-size: 12px; font-weight: 500; color: var(--primary); }
.article-list .tag, .article-meta .tag { background: var(--primary-ghost); color: var(--primary); box-shadow: none; border-radius: 4px; font-size: 11px; font-weight: 400; }
#recentArticles .article-list { gap: 0; }
#recentArticles .article-list li { border-width: 0 0 1px; border-radius: 0; background: transparent; }
#recentArticles .article-list li:hover { background: var(--primary-ghost); border-color: var(--border); }
#recentArticles .article-list li > a { padding: 16px 8px 7px 0; font-size: 16px; }
#recentArticles .article-list li:first-child > a { padding-top: 4px; }
#recentArticles .article-excerpt { padding: 0 8px 10px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#recentArticles .meta { padding: 0 8px 17px 0; }
#recentArticles .tags { margin-left: auto; }
.daily-quote, [data-theme="dark"] .daily-quote { background: var(--bg-secondary); border: 0; border-radius: 10px; padding: 22px; margin: 0 0 22px; box-shadow: none; backdrop-filter: none; text-align: left; }
.daily-quote::before { display: none; }
.daily-quote-label { color: var(--primary); font-size: 12px; font-weight: 500; letter-spacing: 1px; }
.quote-mark { display: block; height: 38px; margin-top: 7px; color: var(--primary); font: 60px/1 Georgia, serif; opacity: .45; }
.daily-quote blockquote { color: var(--text); font-family: var(--font-display); font-size: 18px; line-height: 1.9; font-weight: 500; }
.daily-quote-date { margin-top: 18px; font-size: 11px; color: var(--text-secondary); }
.knowledge-summary { padding: 0 6px; }
.knowledge-summary h2 { font-size: 13px; font-weight: 500; }
.knowledge-summary dl { display: flex; gap: 32px; padding: 15px 0; }
.knowledge-summary dl > div { display: flex; flex-direction: column-reverse; }
.knowledge-summary dt { font-size: 11px; color: var(--text-muted); }
.knowledge-summary dd { font-size: 27px; line-height: 1.6; font-weight: 500; }
.knowledge-summary > a { font-size: 12px; }
.home-empty { grid-column: 1/-1; padding: 28px 20px; border: 1px dashed var(--border); border-radius: 8px; color: var(--text-secondary); }
.home-empty strong { display: block; font-size: 15px; font-weight: 500; color: var(--text); }
.home-empty p { font-size: 13px; margin: 5px 0 8px; }
.home-empty button { margin: 0; font-size: 13px; }
.breadcrumb { color: var(--text-secondary); font-size: 13px; margin-bottom: 28px; }
.article h1 { color: var(--text); background: none; -webkit-text-fill-color: var(--text); font-size: 32px; line-height: 1.5; letter-spacing: 0; }
.article { font-size: 16px; line-height: 1.95; }
.article h2 { font-size: 24px; border-color: var(--border); }
.article h3 { font-size: 20px; }
.article blockquote { background: var(--primary-ghost); border-left-color: var(--primary); border-radius: 0 6px 6px 0; }
.article pre { border: 1px solid var(--border); box-shadow: none; border-radius: 8px; }
.toc-nav { border-left-color: var(--border); }
.toc-item.active { color: var(--primary); background: var(--primary-ghost); }
.modal, .user-dropdown, .overview-stat, .overview-panel, .overview-heading { background: var(--surface); border: 1px solid var(--border); box-shadow: none; }
.modal { box-shadow: 0 24px 90px rgba(0,0,0,.18); border-radius: 14px; }
.btn-submit, .editor-save-btn, .overview-new-article { background: var(--primary); color: var(--bg); box-shadow: none; }
.btn-submit:hover, .editor-save-btn:hover { background: var(--primary-hover); }
.overview-category-bar { background: var(--primary); }
.overview-stat-value { color: var(--primary); }
.overview-stat::before { background: var(--primary); opacity: .5; }
[data-theme="dark"] .toc-item.active { color: var(--primary); text-shadow: none; }
.form-group input, .form-group select, .form-group textarea, .editor-meta-field input, .editor-meta-field select { background: var(--bg); border-color: var(--border); box-shadow: none; }
.editor-topbar, .editor-meta-bar { background: var(--bg); border-color: var(--border); box-shadow: none; }
.editor-pane-left textarea { background: var(--bg); font-family: var(--font-mono); }
.editor-pane-right { background: var(--surface); border-color: var(--border); }
.editor-preview-content { max-width: 820px; margin: auto; }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0; margin: 0; padding: 20px 40px; color: var(--text-muted); border-top: 1px solid var(--border); font-size: 11px; }
#icpNumber { min-width: 0; overflow-wrap: anywhere; }
.footer-brand { color: var(--text-secondary); font-weight: 600; }
.footer-brand > span { margin-left: 12px; color: var(--text-muted); font-weight: 400; }
.back-to-top { background: var(--surface); color: var(--primary); box-shadow: var(--card-hover-shadow); border: 1px solid var(--border); border-radius: 8px; }
@media (min-width: 1500px) { .content { padding-top: 36px; } .home-hero { padding-top: 42px; padding-bottom: 44px; } }
@media (max-width: 1150px) { .content { padding: 26px 28px 40px; } .home-reading-grid { grid-template-columns: minmax(0,1fr) 210px; gap: 22px; } .home-categories { grid-template-columns: repeat(2,minmax(0,1fr)); } .hero-art { max-width: 260px; } .section-description { display: none; } }
@media (max-width: 900px) and (min-width: 769px) { .home-reading-grid { grid-template-columns: 1fr; } .home-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding-top: 0; } .home-hero { grid-template-columns: 1fr; } .hero-art { display: none; } }
@media (max-width: 768px) {
    :root { --navbar-height: 64px; }
    .navbar { padding: 0 16px; gap: 12px; }
    .logo { font-size: 17px; gap: 7px; } .logo-icon { width: 30px; height: 30px; } .logo-caption { display: none; }
    .search-box { max-width: none; min-width: 0; }
    .search-box input { height: 38px; font-size: 13px; }
    .sidebar { width: min(290px, 85vw); top: var(--navbar-height); }
    .sidebar-overlay { inset: var(--navbar-height) 0 0; }
    .sidebar-nav { padding-top: 24px; }
    .main { margin-left: 0; }
    .content { padding: 24px 22px 35px; }
    .home-hero { padding: 26px 0 30px; grid-template-columns: 1.4fr 1fr; }
    .home-hero h1 { font-size: 31px; }
    .home-hero p { font-size: 13px; }
    .home-reading-grid { grid-template-columns: minmax(0,1fr) 210px; }
    .hero-art { max-width: 230px; }
    .hero-actions { gap: 16px; }
    .site-footer { padding-inline: 22px; }
    .editor-meta-bar { gap: 10px; }
}
@media (max-width: 560px) {
    :root { --navbar-height: 104px; }
    .navbar, [data-theme="dark"] .navbar { padding: 0 12px; gap: 8px; }
    .navbar .logo { display: flex; flex-shrink: 0; line-height: 1.3; }
    .navbar .logo-english { display: block; font-size: 11px; font-weight: 500; } .logo-icon { display: none; }
    .navbar .menu-toggle, .navbar .theme-toggle { width: 36px; min-width: 36px; min-height: 40px; padding: 8px; }
    .search-box input { padding-right: 10px; padding-left: 30px; } .search-icon { left: 9px; width: 14px; } .search-hint { display: none; }
    .navbar .btn-new-article, .navbar .btn-background { min-width: 32px; min-height: 36px; padding: 7px; }
    .navbar .btn-new-article span, .navbar .btn-background span, .navbar .user-name { display: none; }
    .navbar .user-pill { padding: 4px; gap: 2px; min-width: 32px; }
    .content { padding: 20px 20px 32px; }
    .home-topline { font-size: 11px; }
    .home-hero { display: block; position: relative; padding: 30px 0 28px; }
    .home-hero h1 { font-size: 31px; line-height: 1.55; }
    .home-hero p { max-width: 310px; }
    .hero-art { display: none; }
    .desktop-break { display: none; }
    .hero-actions { margin-top: 22px; gap: 20px; }
    .hero-primary { min-height: 44px; }
    .home-categories { gap: 10px; }
    .knowledge-card { padding: 15px; }
    .home-reading-grid { display: block; }
    .home-aside { padding-top: 25px; }
    .daily-quote { padding: 24px; }
    .knowledge-summary { padding: 0 4px; }
    .knowledge-summary dl { gap: 50px; }
    .section-header { margin-top: 24px; }
    #recentArticles .tags { margin-left: 0; }
    .article h1 { font-size: 28px; }
    .article { font-size: 15px; }
    .site-footer { padding-inline: 20px; flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Penpot wireframes: centered landing/profile, three-column reading workspace. */
:root { --navbar-height: 86px; --sidebar-width: 223px; }
.navbar, [data-theme="dark"] .navbar { padding: 0 34px; gap: 16px; }
.navbar .logo { font-size: 19px; }
.navbar .search-box { margin: 0 auto; width: min(437px, 34vw); }
.header-login { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border: 1px solid var(--primary); border-radius: 7px; background: var(--primary); color: var(--bg); cursor: pointer; white-space: nowrap; }
.header-login:hover { background: var(--primary-hover); }
.navbar #sidebarLoginArea { flex-shrink: 0; }
.navbar .user-pill { border-radius: 50%; padding: 0; width: 40px; height: 40px; justify-content: center; }
.navbar .user-name, .navbar .user-pill > svg { display: none; }
.user-dropdown { min-width: 150px; top: calc(100% + 12px); }
body[data-page="home"] .sidebar, body[data-page="profile"] .sidebar,
body[data-page="home"] .menu-toggle, body[data-page="profile"] .menu-toggle,
body[data-page="home"] .search-box, body[data-page="profile"] .search-box { display: none; }
body[data-page="home"] .logo, body[data-page="profile"] .logo { margin-right: auto; }
body[data-page="home"] .main, body[data-page="profile"] .main { margin-left: 0; }
body[data-page="home"] .content { max-width: none; padding: 0 24px; }
#homePage > .home-hero { display: flex; flex-direction: column; justify-content: center; width: min(562px, 100%); min-height: calc(100svh - var(--navbar-height) - 80px); margin: 0 auto; padding: 54px 0 70px; border: 0; gap: 30px; text-align: center; }
.home-intro { width: 100%; min-height: 350px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px 24px; background: rgba(var(--sidebar-surface-rgb), .65); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 12px; }
body[data-page="home"] #sidebarLoginArea { display: none !important; }
.home-author-avatar { width: 88px; height: 88px; object-fit: cover; border-radius: 50%; border: 1px solid var(--border); margin-bottom: 16px; }
.home-author-label { font-size: 13px; color: var(--text-secondary); letter-spacing: 2px; margin-bottom: 12px; }
.home-intro #homeTitle { max-width: 100%; font-size: clamp(30px, 4vw, 43px); letter-spacing: 2px; overflow-wrap: anywhere; }
#homeAuthorBio { max-width: 100%; white-space: pre-line; overflow-wrap: anywhere; }
.home-author-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 20px; margin-top: 20px; font-size: 14px; }
.home-author-links a { color: var(--primary); }
.home-hero h1 { font-size: 55px; font-weight: 600; letter-spacing: 10px; margin: 0 0 24px; }
.home-hero p { font-size: 15px; line-height: 2; }
.home-hero .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; width: 100%; padding: 0 16px; margin: 0; }
.hero-actions .hero-primary, .hero-actions .hero-secondary { min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; font-size: 15px; font-weight: 500; border-radius: 7px; cursor: pointer; }
.hero-actions .hero-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.hero-actions .hero-secondary:hover { border-color: var(--primary); background: var(--primary-ghost); }
.sidebar-nav { padding-top: 22px; }
.sidebar-footer:empty { display: none; }
.content { max-width: 1120px; padding: 32px 40px 48px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 650px) 155px; gap: 32px; justify-content: center; }
.article-main { padding: 0 0 48px; }
.toc-sidebar { display: block; width: auto; position: sticky; top: calc(var(--navbar-height) + 30px); align-self: start; }
.toc-title { margin: 0 0 14px 16px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.toc-nav { position: static; transform: none; max-height: calc(100vh - var(--navbar-height) - 100px); }
.article h1 { font-size: 32px; }
#profilePage { width: min(588px, 100%); margin: 0 auto; }
.profile-container { max-width: none; padding: 30px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
body[data-page="profile"] .content { padding-top: 36px; }
.home-reading-grid { grid-template-columns: minmax(0, 1fr) 170px; }
.home-categories { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.site-footer { min-height: 60px; }
body[data-page="home"] .site-footer, body[data-page="profile"] .site-footer { padding: 20px 24px; }
@media (min-width: 1300px) {
    body[data-page="article"] .content { max-width: 970px; margin-inline: auto; }
}
@media (max-width: 1100px) {
    .navbar, [data-theme="dark"] .navbar { padding: 0 20px; gap: 10px; }
    .content { padding: 28px; }
    .site-footer { padding-inline: 28px; }
    .article-layout { grid-template-columns: minmax(0, 1fr) 140px; gap: 24px; }
    .home-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-reading-grid { display: block; }
    .navbar .logo-english { display: block; font-size: 12px; }
    .logo-caption { display: none; }
}
@media (max-width: 900px) { .article-layout { display: block; } .toc-sidebar { display: none; } }
@media (max-width: 768px) {
    :root { --navbar-height: 72px; }
    .navbar .search-box { flex: 1; width: auto; }
    .navbar .btn-new-article span, .navbar .btn-background span { display: none; }
    .sidebar { width: min(290px, 85vw); }
    .main { margin-left: 0; }
    .home-hero { padding-top: 36px; padding-bottom: 48px; }
    .home-intro { min-height: 330px; }
    .content { padding: 24px; }
    .site-footer { padding-inline: 24px; }
}
@media (max-width: 560px) {
    :root { --navbar-height: 112px; }
    body[data-page="home"], body[data-page="profile"] { --navbar-height: 72px; }
    .navbar, [data-theme="dark"] .navbar { padding: 8px 12px; gap: 8px; }
    .navbar .search-box { flex: 1 0 100%; width: 100%; }
    .navbar .logo { font-size: 17px; }
    .navbar .logo-english { font-size: 11px; }
    .navbar .btn-background { width: 34px; min-width: 34px; }
    .navbar .theme-toggle, .navbar .menu-toggle { width: 34px; min-width: 34px; }
    .header-login { padding: 0 12px; min-height: 36px; font-size: 13px; }
    .header-login svg { display: none; }
    .home-hero { min-height: calc(100svh - var(--navbar-height) - 64px); gap: 22px; }
    .home-intro { min-height: 300px; padding: 28px 18px; }
    .home-hero h1 { font-size: 43px; letter-spacing: 6px; }
    .home-hero .hero-actions { gap: 14px; padding: 0; }
    .hero-actions .hero-primary, .hero-actions .hero-secondary { padding: 0 16px; min-height: 50px; font-size: 14px; }
    .content { padding: 24px 18px; }
    .site-footer { padding-inline: 18px; }
    .profile-container { padding: 20px 16px; }
}

.navbar .logo > span { display: block; }
.sidebar-library { order: 2; }
@media (max-width: 560px) {
    .navbar .logo { display: flex; }
    #homePage > .home-hero { padding: 32px 0 40px; min-height: calc(100svh - var(--navbar-height) - 64px); gap: 22px; }
}
@media (max-width: 360px) {
    .navbar .logo-english { display: none; }
    .navbar .menu-toggle { margin-right: 0; }
}
