:root {
    --bg: #07131f;
    --bg-deep: #06101a;
    --surface: #0b1926;
    --surface-raised: #102131;
    --surface-hover: #142839;
    --text: #f1eee6;
    --text-cool: #e8eef2;
    --muted: #899aa8;
    --muted-strong: #b7c2ca;
    --jade: #82c7a7;
    --jade-strong: #9bd9bb;
    --jade-soft: rgba(130, 199, 167, .12);
    --border: #263746;
    --border-soft: rgba(137, 154, 168, .18);
    --danger: #ef9393;
    --focus: rgba(130, 199, 167, .35);
    --sidebar: 200px;
    --appbar: 76px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --shadow: 0 18px 60px rgba(0, 0, 0, .24);
    --font-ui: Inter, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-editorial: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", Georgia, serif;
    --reader-size: 18px;
    --duration: 170ms;
}
html[data-reader-size="15"] { --reader-size: 15px; }
html[data-reader-size="16"] { --reader-size: 16px; }
html[data-reader-size="17"] { --reader-size: 17px; }
html[data-reader-size="18"] { --reader-size: 18px; }
html[data-reader-size="19"] { --reader-size: 19px; }
html[data-reader-size="20"] { --reader-size: 20px; }
html[data-reader-size="21"] { --reader-size: 21px; }
html[data-reader-size="22"] { --reader-size: 22px; }
html[data-reader-size="23"] { --reader-size: 23px; }

* { box-sizing: border-box; }
html { min-width: 300px; min-height: 100%; background: var(--bg); color-scheme: dark; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 73% -18%, rgba(77, 143, 150, .12), transparent 31rem),
        linear-gradient(135deg, var(--bg) 0%, var(--bg-deep) 100%);
    color: var(--text-cool);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-shell { min-height: 100vh; min-height: 100dvh; }
.appbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    height: var(--appbar);
    display: grid;
    grid-template-columns: var(--sidebar) minmax(320px, 780px) 1fr;
    align-items: center;
    gap: 30px;
    padding: 0 30px;
    border-bottom: 1px solid var(--border);
    background: rgba(6, 16, 26, .9);
    backdrop-filter: blur(18px);
}
.brand-button {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 10px;
    padding: 6px;
    border: 0;
    background: transparent;
    font: 700 20px/1 var(--font-editorial);
    cursor: pointer;
}
.brand-button img { filter: saturate(.72) brightness(1.18); }
.appbar-search {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(13, 29, 43, .86);
    transition: border-color var(--duration), background var(--duration), box-shadow var(--duration);
}
.appbar-search:focus-within {
    border-color: var(--jade);
    background: var(--surface-raised);
    box-shadow: 0 0 0 4px var(--focus);
}
.appbar-search svg { width: 19px; color: var(--muted); }
.appbar-search input {
    min-width: 0;
    flex: 1;
    height: 42px;
    border: 0;
    outline: 0;
    color: var(--text-cool);
    background: transparent;
    font-size: 14px;
}
.appbar-search input::placeholder { color: #718493; }
.appbar-search kbd {
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--muted);
    background: rgba(255, 255, 255, .02);
    font: 11px/1.2 var(--font-ui);
}
.session-toggle {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--muted-strong);
    cursor: pointer;
    font-size: 13px;
    transition: border-color var(--duration), color var(--duration), background var(--duration);
}
.session-toggle:hover { border-color: var(--jade); color: var(--text); }
.session-toggle[aria-checked="true"] { border-color: rgba(130, 199, 167, .48); color: var(--jade-strong); background: var(--jade-soft); }
.session-toggle svg { width: 18px; }

.sidebar {
    position: fixed;
    inset: var(--appbar) auto 0 0;
    z-index: 40;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 26px 18px 30px;
    border-right: 1px solid var(--border);
    background: rgba(6, 16, 26, .52);
}
.sidebar nav { display: grid; gap: 6px; }
.nav-item {
    position: relative;
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--muted-strong);
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: color var(--duration), background var(--duration), border-color var(--duration);
}
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .025); }
.nav-item.is-active {
    color: var(--jade-strong);
    border-color: rgba(130, 199, 167, .08);
    background: linear-gradient(90deg, rgba(130, 199, 167, .15), rgba(130, 199, 167, .06));
}
.nav-item svg { width: 21px; height: 21px; }
.nav-count {
    min-width: 19px;
    padding: 2px 5px;
    border-radius: 10px;
    color: var(--jade-strong);
    background: var(--jade-soft);
    font-size: 10px;
    text-align: center;
}
.sidebar-note {
    padding: 20px 4px 0;
    border-top: 1px solid var(--border-soft);
    color: #6f8291;
    font-size: 11px;
    line-height: 1.6;
}
.sidebar-note p { margin: 9px 0 0; }
.privacy-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--jade);
    box-shadow: 0 0 0 5px var(--jade-soft);
}

.workspace {
    min-height: 100vh;
    min-height: 100dvh;
    margin-left: var(--sidebar);
    padding-top: var(--appbar);
}
.panel { display: none; min-height: calc(100vh - var(--appbar)); animation: panel-in 180ms ease-out; }
.panel.is-active { display: block; }
@keyframes panel-in { from { opacity: .55; transform: translateY(3px); } }

.explore-panel.is-active {
    display: grid;
    grid-template-columns: minmax(560px, 1fr) minmax(350px, 520px);
    gap: clamp(28px, 4vw, 70px);
    width: min(100% - 72px, 1380px);
    margin: 0 auto;
    padding: clamp(56px, 8vh, 92px) 0 70px;
}
.explore-main { min-width: 0; }
.welcome h1 {
    margin: 0;
    color: var(--text);
    font: 600 clamp(35px, 4vw, 53px)/1.22 var(--font-editorial);
    letter-spacing: -.045em;
}
.welcome p {
    max-width: 580px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.75;
}
.hero-search { margin-top: 34px; }
.hero-search-box {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 68px;
    padding: 7px 8px 7px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    box-shadow: var(--shadow);
    transition: border-color var(--duration), box-shadow var(--duration);
}
.hero-search-box:focus-within { border-color: var(--jade); box-shadow: 0 0 0 4px var(--focus), var(--shadow); }
.hero-search-box > svg { width: 22px; flex: 0 0 auto; color: var(--muted); }
.hero-search-box input {
    min-width: 0;
    flex: 1;
    height: 50px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-cool);
    font-size: 16px;
}
.hero-search-box input::placeholder { color: #768796; }
.hero-search-box button {
    align-self: stretch;
    min-width: 96px;
    border: 1px solid var(--jade);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(130, 199, 167, .32), rgba(130, 199, 167, .2));
    color: #e5fff1;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--duration), transform var(--duration);
}
.hero-search-box button:hover { background: rgba(130, 199, 167, .36); }
.hero-search-box button:active { transform: translateY(1px); }
.search-modes {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}
.search-modes button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--muted-strong);
    cursor: pointer;
    font-size: 13px;
    transition: color var(--duration), border-color var(--duration), background var(--duration);
}
.search-modes button:hover { color: var(--text); border-color: #3b5365; }
.search-modes button[aria-checked="true"] { color: var(--jade-strong); border-color: rgba(130, 199, 167, .58); background: var(--jade-soft); }
.search-modes svg { width: 18px; }
.mode-letter { font: 700 17px/1 Georgia, serif; }
.mode-letter-serif { font-size: 16px; }
.wing-divider {
    display: grid;
    grid-template-columns: 1fr 44px 1fr;
    align-items: center;
    gap: 10px;
    margin: 38px 0 27px;
    opacity: .55;
}
.wing-divider span { height: 1px; background: linear-gradient(90deg, transparent, var(--border)); }
.wing-divider span:last-child { background: linear-gradient(90deg, var(--border), transparent); }
.wing-divider img { width: 31px; height: 31px; justify-self: center; filter: grayscale(1) sepia(.2) hue-rotate(90deg) opacity(.65); }

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.section-heading h2 { margin: 0; color: var(--text); font: 600 18px/1.3 var(--font-editorial); }
.text-button {
    padding: 6px 3px;
    border: 0;
    background: transparent;
    color: var(--jade);
    cursor: pointer;
    font-size: 12px;
}
.danger-text { color: var(--danger); }
.empty-list {
    padding: 34px 10px;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    color: var(--muted);
    text-align: center;
}
.empty-list p { margin: 0 0 7px; color: var(--muted-strong); font-size: 14px; }
.empty-list span { font-size: 12px; }
.reading-list { margin: 0; padding: 0; border-top: 1px solid var(--border-soft); list-style: none; }
.reading-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 13px;
    min-height: 66px;
    padding: 9px 8px 9px 4px;
    border-bottom: 1px solid var(--border-soft);
    transition: background var(--duration);
}
.reading-row:hover { background: rgba(255, 255, 255, .018); }
.source-dot {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--jade);
    background: rgba(130, 199, 167, .05);
    font: 700 12px/1 var(--font-editorial);
    text-transform: uppercase;
}
.reading-copy {
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.reading-copy strong {
    display: block;
    overflow: hidden;
    color: var(--text-cool);
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.reading-copy span {
    display: block;
    overflow: hidden;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.reading-time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.row-remove {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #657987;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--duration), color var(--duration), background var(--duration);
}
.reading-row:hover .row-remove, .row-remove:focus-visible { opacity: 1; }
.row-remove:hover { color: var(--danger); background: rgba(239, 147, 147, .08); }
.row-remove svg { width: 16px; }

.purpose-panel {
    align-self: start;
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background:
        linear-gradient(145deg, rgba(130, 199, 167, .055), transparent 42%),
        rgba(11, 25, 38, .82);
    box-shadow: var(--shadow);
}
.purpose-label {
    margin: 0 0 20px;
    color: var(--jade);
    font-size: 11px;
    letter-spacing: .08em;
}
.purpose-panel h2 {
    margin: 0;
    max-width: 440px;
    color: var(--text);
    font: 600 clamp(26px, 2.5vw, 35px)/1.35 var(--font-editorial);
    letter-spacing: -.035em;
}
.purpose-panel > p:not(.purpose-label) { margin: 20px 0 0; color: var(--muted-strong); font-size: 14px; line-height: 1.85; }
.purpose-actions { display: flex; gap: 10px; margin-top: 27px; }
.purpose-actions button, .library-empty button {
    min-height: 42px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-cool);
    cursor: pointer;
    font-size: 13px;
}
.purpose-actions button:first-child { border-color: var(--jade); color: var(--jade-strong); background: var(--jade-soft); }
.purpose-actions button:hover, .library-empty button:hover { border-color: var(--jade); }
.purpose-panel dl { margin: 34px 0 0; }
.purpose-panel dl div {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 16px;
    padding: 15px 0;
    border-top: 1px solid var(--border-soft);
}
.purpose-panel dt { color: var(--text-cool); font-size: 12px; }
.purpose-panel dd { margin: 0; color: var(--muted); font-size: 12px; }

.results-panel, .library-panel {
    width: min(100% - 72px, 920px);
    margin: 0 auto;
    padding: 48px 0 90px;
}
.results-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 14px 30px;
    padding-bottom: 23px;
    border-bottom: 1px solid var(--border);
}
.results-header .back-link { grid-column: 1 / -1; justify-self: start; }
.results-header h1 { margin: 0; color: var(--text); font: 600 32px/1.2 var(--font-editorial); letter-spacing: -.03em; }
.results-kicker { margin: 0 0 7px; color: var(--jade); font-size: 11px; }
#search-status { margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 2px;
    border: 0;
    background: transparent;
    color: var(--muted-strong);
    cursor: pointer;
    font-size: 12px;
}
.back-link:hover { color: var(--text); }
.back-link svg { width: 17px; }
.result-list { margin: 0; padding: 0; list-style: none; }
.result-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 24px;
    padding: 24px 2px 25px;
    border-bottom: 1px solid var(--border-soft);
}
.result-copy { min-width: 0; }
.result-source { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: var(--jade); font-size: 11px; }
.result-source::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.result-title {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font: 600 20px/1.45 var(--font-editorial);
    letter-spacing: -.01em;
    text-align: left;
    cursor: pointer;
    overflow-wrap: anywhere;
    transition: color var(--duration);
}
.result-title:hover { color: var(--jade-strong); }
.result-extract {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin: 9px 0 0;
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.75;
}
.result-actions { display: flex; align-items: center; gap: 8px; align-self: center; }
.result-actions button, .result-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: transparent;
    color: var(--muted-strong);
    cursor: pointer;
    font-size: 11px;
    text-decoration: none;
    white-space: nowrap;
}
.result-actions button { border-color: rgba(130, 199, 167, .46); color: var(--jade-strong); background: var(--jade-soft); }
.result-actions button:hover, .result-actions a:hover { border-color: var(--jade); color: var(--text); }
mark { padding: 0 .05em; background: transparent; color: var(--jade-strong); }

.state { padding: 58px 16px; color: var(--muted); text-align: center; }
.state h2 { margin: 0 0 9px; color: var(--text); font: 600 21px/1.35 var(--font-editorial); }
.state p { max-width: 480px; margin: 0 auto; font-size: 13px; line-height: 1.7; }
.state-action {
    min-height: 39px;
    margin-top: 20px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-raised);
    color: var(--text);
    cursor: pointer;
}
.state-action:hover { border-color: var(--jade); }
.skeletons { padding-top: 3px; }
.skeleton { padding: 26px 0; border-bottom: 1px solid var(--border-soft); }
.skeleton span {
    display: block;
    border-radius: 4px;
    background: linear-gradient(90deg, #0e1e2c 20%, #182d3e 50%, #0e1e2c 80%);
    background-size: 240% 100%;
    animation: shimmer 1.2s linear infinite;
}
.skeleton .sk-source { width: 17%; height: 10px; margin-bottom: 11px; }
.skeleton .sk-title { width: 61%; height: 21px; margin-bottom: 13px; }
.skeleton .sk-line { width: 93%; height: 11px; margin-bottom: 8px; }
.skeleton .sk-line.short { width: 71%; }
@keyframes shimmer { to { background-position: -240% 0; } }

.library-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.library-header p { margin: 0 0 7px; color: var(--jade); font-size: 11px; }
.library-header h1 { margin: 0; color: var(--text); font: 600 34px/1.2 var(--font-editorial); }
.library-empty { padding: 90px 20px; }
.library-empty h2 { margin: 0 0 10px; color: var(--text); font: 600 22px/1.3 var(--font-editorial); }
.library-empty p { margin-bottom: 22px; color: var(--muted); }
.library-list { border-top: 0; }

.reading-progress {
    position: fixed;
    z-index: 80;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--jade);
    transition: width 80ms linear;
}
.reader-toolbar {
    position: sticky;
    top: var(--appbar);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 max(24px, calc((100% - 940px) / 2));
    border-bottom: 1px solid var(--border);
    background: rgba(7, 19, 31, .94);
    backdrop-filter: blur(16px);
}
.reader-actions { display: flex; align-items: center; gap: 7px; }
.icon-text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted-strong);
    cursor: pointer;
    font-size: 11px;
    text-decoration: none;
}
.icon-text-button:hover { border-color: var(--border); color: var(--text); background: rgba(255,255,255,.02); }
.icon-text-button.is-saved { color: var(--jade-strong); border-color: rgba(130,199,167,.35); background: var(--jade-soft); }
.icon-text-button svg { width: 16px; height: 16px; }
.reader-container { width: min(100% - 48px, 760px); margin: 0 auto; padding: 54px 0 110px; }
.article-header { padding-bottom: 27px; margin-bottom: 34px; border-bottom: 1px solid var(--border); }
.article-header h1 {
    margin: 0 0 16px;
    color: var(--text);
    font: 600 clamp(31px, 5vw, 46px)/1.28 var(--font-editorial);
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}
.article-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.article-meta .source { color: var(--jade); }
.article-meta .source-url { min-width: 0; overflow-wrap: anywhere; }
.article-meta .read-time::before { content: "·"; margin-right: 14px; color: #526776; }
.reader-body {
    color: #d9dedc;
    font-family: var(--font-editorial);
    font-size: var(--reader-size);
    line-height: 1.95;
    overflow-wrap: anywhere;
}
.reader-body h1, .reader-body h2, .reader-body h3, .reader-body h4 {
    color: var(--text);
    font-family: var(--font-editorial);
    line-height: 1.42;
    letter-spacing: -.02em;
    scroll-margin-top: 150px;
}
.reader-body h1 { margin: 2em 0 .75em; font-size: 30px; }
.reader-body h2 { margin: 2em 0 .7em; padding-bottom: .45em; border-bottom: 1px solid var(--border); font-size: 25px; }
.reader-body h3 { margin: 1.75em 0 .6em; font-size: 21px; }
.reader-body h4 { margin: 1.55em 0 .55em; font-size: 18px; }
.reader-body p { margin: 0 0 1.3em; }
.reader-body a { color: var(--jade-strong); text-decoration-color: rgba(130,199,167,.4); text-underline-offset: 3px; }
.reader-body blockquote { margin: 1.8em 0; padding: .1em 0 .1em 1.2em; border-left: 2px solid var(--jade); color: var(--muted-strong); }
.reader-body ul, .reader-body ol { margin: 1em 0 1.4em; padding-left: 1.55em; }
.reader-body li { margin: .42em 0; }
.reader-body img { display: block; max-width: 100%; height: auto; margin: 1.8em auto; border-radius: var(--radius-sm); }
.reader-body figure { max-width: 100%; margin: 1.9em 0; }
.reader-body figcaption { color: var(--muted); font: 11px/1.6 var(--font-ui); text-align: center; }
.table-wrap { max-width: 100%; overflow-x: auto; margin: 1.8em 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.reader-body table { min-width: 100%; border-collapse: collapse; font: 12px/1.55 var(--font-ui); }
.reader-body th, .reader-body td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.reader-body th { color: var(--text); background: var(--surface); }
.reader-body pre { max-width: 100%; overflow: auto; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; }
.reader-body code { font-family: "Cascadia Code", Consolas, monospace; font-size: .88em; }
.reader-body hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--border); }
.reader-state-loading { padding-top: 14vh; }

.mobile-nav { display: none; }
.toast {
    position: fixed;
    z-index: 100;
    left: 50%;
    bottom: 28px;
    max-width: calc(100% - 32px);
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #132433;
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity var(--duration), transform var(--duration);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.noscript { max-width: 560px; margin: 100px auto; padding: 0 24px; color: var(--muted); }
[data-offline] .privacy-dot { background: var(--danger); box-shadow: 0 0 0 5px rgba(239,147,147,.1); }

@media (max-width: 1120px) {
    :root { --sidebar: 172px; }
    .appbar { grid-template-columns: var(--sidebar) minmax(260px, 1fr) auto; gap: 18px; padding: 0 22px; }
    .explore-panel.is-active { grid-template-columns: minmax(500px, 1fr) minmax(310px, 390px); width: min(100% - 48px, 1120px); gap: 34px; }
    .purpose-panel { padding: 26px; }
}

@media (max-width: 880px) {
    :root { --appbar: 64px; }
    .appbar {
        grid-template-columns: auto 1fr auto;
        gap: 12px;
        height: var(--appbar);
        padding: 0 16px;
    }
    .brand-button span { display: none; }
    .brand-button img { width: 34px; height: 34px; }
    .appbar-search kbd { display: none; }
    .session-toggle span { display: none; }
    .session-toggle { width: 40px; justify-content: center; padding: 0; }
    .sidebar { display: none; }
    .workspace { margin-left: 0; padding-bottom: 70px; }
    .explore-panel.is-active {
        display: block;
        width: min(100% - 36px, 720px);
        padding: 48px 0 42px;
    }
    .purpose-panel { margin-top: 42px; }
    .results-panel, .library-panel { width: min(100% - 36px, 760px); padding-top: 38px; }
    .reader-toolbar { top: var(--appbar); padding: 0 20px; }
    .mobile-nav {
        position: fixed;
        inset: auto 0 0;
        z-index: 70;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        height: 68px;
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1px solid var(--border);
        background: rgba(6,16,26,.96);
        backdrop-filter: blur(18px);
    }
    .mobile-nav button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        border: 0;
        background: transparent;
        color: var(--muted);
        font-size: 10px;
    }
    .mobile-nav button.is-active { color: var(--jade-strong); }
    .mobile-nav svg { width: 19px; height: 19px; }
    .toast { bottom: 82px; }
}

@media (max-width: 620px) {
    body {
        background:
            radial-gradient(circle at 50% -8%, rgba(77,143,150,.14), transparent 28rem),
            var(--bg);
    }
    .appbar { grid-template-columns: auto 1fr auto; }
    .appbar-search { display: none; }
    .brand-button span { display: inline; font-size: 17px; }
    .session-toggle { width: auto; padding: 0 10px; }
    .session-toggle span { display: inline; font-size: 11px; }
    .appbar-search { height: 42px; padding: 0 11px; }
    .appbar-search input { font-size: 12px; }
    .explore-panel.is-active { width: min(100% - 30px, 720px); padding-top: 42px; }
    .welcome { text-align: center; }
    .welcome h1 { font-size: clamp(31px, 9vw, 42px); line-height: 1.3; }
    .welcome p { margin-top: 14px; font-size: 13px; }
    .hero-search { margin-top: 30px; }
    .hero-search-box { min-height: 58px; padding-left: 15px; gap: 8px; }
    .hero-search-box input { height: 44px; font-size: 14px; }
    .hero-search-box button { min-width: 68px; }
    .search-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .search-modes button { justify-content: center; min-height: 40px; padding: 0 6px; font-size: 11px; }
    .search-modes button svg { display: none; }
    .wing-divider { margin: 32px 0 24px; }
    .recent-section .reading-list,
    .recent-section .empty-list {
        overflow: hidden;
        border: 1px solid rgba(10, 28, 42, .12);
        border-radius: 10px;
        background: #f2f0e9;
        box-shadow: 0 16px 36px rgba(0, 0, 0, .2);
    }
    .recent-section .reading-row { padding-inline: 12px; border-bottom-color: rgba(10, 28, 42, .12); }
    .recent-section .reading-copy strong { color: #0a1b2a; }
    .recent-section .reading-copy span,
    .recent-section .reading-time { color: #567267; }
    .recent-section .source-dot { border-color: rgba(10, 28, 42, .15); color: #426f5b; background: #faf9f4; }
    .recent-section .row-remove { color: #748279; }
    .recent-section .empty-list p { color: #183044; }
    .recent-section .empty-list span { color: #66786f; }
    .reading-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
    .reading-time { display: none; }
    .row-remove { opacity: 1; }
    .purpose-panel {
        padding: 24px 20px;
        border-color: rgba(10, 28, 42, .12);
        background: #f2f0e9;
        color: #0a1b2a;
    }
    .purpose-panel h2 { color: #0a1b2a; font-size: 27px; }
    .purpose-panel > p:not(.purpose-label) { color: #526873; }
    .purpose-panel dl div { border-top-color: rgba(10, 28, 42, .13); }
    .purpose-panel dt { color: #183044; }
    .purpose-panel dd { color: #667780; }
    .purpose-actions button { border-color: rgba(10, 28, 42, .18); color: #183044; }
    .purpose-actions button:first-child { border-color: #6e9b82; color: #315f4b; background: rgba(110, 155, 130, .1); }
    .purpose-actions { flex-direction: column; }
    .purpose-panel dl div { grid-template-columns: 78px 1fr; }
    .results-panel, .library-panel { width: min(100% - 30px, 760px); }
    .results-header { grid-template-columns: 1fr; }
    #search-status { text-align: left; }
    .result-item { grid-template-columns: 1fr; gap: 16px; }
    .result-title { font-size: 19px; }
    .result-actions { justify-content: flex-start; }
    .result-actions button, .result-actions a { min-height: 38px; }
    .library-header { align-items: flex-start; }
    .library-header h1 { font-size: 30px; }
    .reader-toolbar { min-height: 54px; padding: 0 12px; }
    .reader-actions { gap: 2px; }
    .icon-text-button { min-width: 34px; padding: 0 7px; }
    .icon-text-button span { display: none; }
    .reader-container { width: min(100% - 30px, 760px); padding-top: 38px; }
    .article-header h1 { font-size: 31px; }
    .reader-body { font-size: min(var(--reader-size), 18px); line-height: 1.9; }
}

@media (max-width: 380px) {
    .appbar { padding: 0 10px; gap: 7px; }
    .brand-button { padding: 2px; }
    .appbar-search svg { display: none; }
    .session-toggle { width: 36px; min-height: 36px; }
    .search-modes button { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
