:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --surface: #fffdf8;
  --surface-2: #ebe5da;
  --text: #17201d;
  --muted: #66706b;
  --line: #ddd5c8;
  --blue: #1b5a50;
  --blue-dark: #123f38;
  --cyan: #528b82;
  --orange: #b46b3d;
  --green: #287c5b;
  --danger: #c53a43;
  --shadow: 0 8px 24px rgba(25, 36, 52, .08);
  --content: 1360px;
  --radius: 7px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101815;
  --surface: #18211e;
  --surface-2: #25302c;
  --text: #f2eee5;
  --muted: #a6afa9;
  --line: #34403b;
  --blue: #70b6a8;
  --blue-dark: #96cdbf;
  --cyan: #79b7ad;
  --orange: #d99a70;
  --green: #48c68f;
  --danger: #ff7078;
  --shadow: 0 10px 30px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.65; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }

.site-header { position: sticky; top: 0; z-index: 50; height: 64px; background: color-mix(in srgb, var(--surface) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.nav-shell { height: 100%; max-width: var(--content); margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 240px minmax(260px, 620px) 1fr; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; font-size: 19px; font-weight: 800; }
.brand.small { font-size: 16px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; color: white; background: var(--blue); font-family: Georgia, serif; font-size: 22px; font-weight: 800; box-shadow: 5px 5px 0 color-mix(in srgb, var(--cyan) 38%, transparent); }
.brand.small .brand-mark { width: 28px; height: 28px; font-size: 17px; }
.nav-search { height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.nav-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent); }
.search-icon { position: relative; width: 16px; height: 16px; border: 2px solid var(--muted); border-radius: 50%; flex: 0 0 auto; }
.search-icon::after { content: ""; position: absolute; right: -4px; bottom: -3px; width: 6px; height: 2px; background: var(--muted); transform: rotate(45deg); }
.nav-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; }
.nav-search kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); background: var(--surface); font-size: 11px; }
.nav-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.nav-link { padding: 7px 8px; color: var(--muted); font-weight: 600; }
.nav-link:hover { color: var(--blue); }
.icon-button { width: 38px; height: 38px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; font-size: 21px; }
.icon-button:hover { border-color: var(--line); color: var(--text); background: var(--surface-2); }

.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 6px; font-weight: 700; transition: .18s ease; }
.primary-button { color: white; background: var(--blue); box-shadow: 0 3px 0 color-mix(in srgb, var(--blue-dark) 90%, black); }
.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); }
.secondary-button { color: var(--text); border-color: var(--line); background: var(--surface); }
.secondary-button:hover { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 50%, var(--line)); }
.compact { min-height: 35px; padding: 0 13px; font-size: 14px; }
.full { width: 100%; }

.home-shell { max-width: var(--content); margin: 0 auto; padding: 30px 24px 60px; display: grid; grid-template-columns: 220px minmax(0, 760px) 280px; gap: 28px; align-items: start; }
.left-rail, .right-rail { position: sticky; top: 94px; display: grid; gap: 24px; }
.profile-panel { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.profile-avatar { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 14px; border-radius: 50%; color: white; background: linear-gradient(135deg, var(--blue) 0 58%, var(--cyan) 58% 78%, var(--orange) 78%); font-family: Georgia, serif; font-size: 32px; font-weight: 800; }
.profile-panel strong { font-size: 18px; }
.profile-panel p { margin: 3px 0 15px; color: var(--muted); font-size: 14px; }
.profile-panel .secondary-button { width: 100%; }
.topic-nav { display: grid; gap: 4px; }
.topic-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 5px; color: var(--muted); font-size: 14px; font-weight: 600; }
.topic-nav a span { width: 20px; color: var(--blue); text-align: center; font-size: 18px; }
.topic-nav a:hover, .topic-nav a.active { color: var(--text); background: var(--surface); }
.tag-panel { padding-top: 4px; }
.panel-heading h2 { margin: 0; font-size: 17px; }
.tag-cloud { margin-top: 10px; display: grid; gap: 2px; }
.tag-cloud a { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 4px; color: var(--muted); font-size: 13px; }
.tag-cloud a:hover { color: var(--blue); background: var(--surface); }
.tag-cloud span { color: color-mix(in srgb, var(--muted) 70%, transparent); }

.feed { min-width: 0; }
.feed-heading, .section-heading, .admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.eyebrow { margin-bottom: 3px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.feed-heading h1 { margin: 0; font-size: 27px; line-height: 1.2; }
.feed-tabs { display: flex; gap: 18px; }
.feed-tabs a { position: relative; padding-bottom: 6px; color: var(--muted); font-size: 14px; font-weight: 700; }
.feed-tabs a.active { color: var(--text); }
.feed-tabs a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--blue); }
.post-card { margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 0 rgba(0, 0, 0, .02); transition: transform .18s ease, box-shadow .18s ease; }
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.post-cover { display: block; aspect-ratio: 2.2 / 1; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .post-cover img { transform: scale(1.015); }
.post-body { padding: 22px 26px 19px; }
.post-author { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.post-author .mini-avatar, .mini-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; color: white; background: var(--blue); font-family: Georgia, serif; font-weight: 800; }
.post-author div { display: grid; line-height: 1.35; }
.post-author strong { font-size: 13px; }
.post-author span { color: var(--muted); font-size: 12px; }
.post-body h2 { margin-bottom: 8px; font-size: 24px; line-height: 1.3; letter-spacing: 0; }
.post-body h2 a:hover { color: var(--blue); }
.post-body > p { margin-bottom: 13px; color: var(--muted); font-size: 15px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.post-tags a { padding: 3px 8px; border-radius: 4px; color: var(--muted); background: var(--surface-2); font-size: 12px; }
.post-tags a:hover { color: var(--blue); }
.post-meta { display: flex; align-items: center; gap: 18px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.post-meta a { margin-left: auto; color: var(--blue); font-weight: 700; }

.trend-panel { border-top: 3px solid var(--blue); padding: 18px 16px 10px; background: var(--surface); }
.trend-panel ol { margin: 14px 0 0; padding: 0; list-style: none; }
.trend-panel li { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.trend-panel li > span { color: color-mix(in srgb, var(--blue) 55%, var(--line)); font: 700 20px/1 Georgia, serif; }
.trend-panel li div { display: grid; gap: 4px; }
.trend-panel li a { font-size: 14px; font-weight: 700; line-height: 1.4; }
.trend-panel li a:hover { color: var(--blue); }
.trend-panel small { color: var(--muted); font-size: 11px; }
.note-panel { display: flex; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.status-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 14%, transparent); }
.note-panel strong { font-size: 14px; }
.note-panel p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 28px; font-size: 14px; }
.pagination a { color: var(--blue); font-weight: 700; }
.pagination span { color: var(--muted); }
.empty-state { padding: 68px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; }
.empty-state.standalone { min-height: 65vh; border: 0; border-radius: 0; display: grid; align-content: center; justify-items: center; }
.empty-icon { margin-bottom: 12px; color: var(--blue); font: 800 38px/1 Georgia, serif; }
.empty-state h1, .empty-state h2 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); }

.article-shell { max-width: 1440px; margin: 0 auto; padding: 34px 24px 60px; display: grid; grid-template-columns: 76px minmax(0, 860px) 240px; justify-content: center; gap: 30px; align-items: start; }
.article-actions { position: sticky; top: 100px; display: grid; justify-content: center; gap: 14px; }
.article-actions button { display: grid; place-items: center; width: 48px; min-height: 48px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--surface); }
.article-actions button:hover { color: var(--blue); border-color: var(--blue); }
.article-actions button span { font-size: 23px; line-height: 1; }
.article-actions button b { margin-top: -6px; font-size: 11px; }
.article-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.article-cover { margin: 0; aspect-ratio: 2.2 / 1; overflow: hidden; border-bottom: 1px solid var(--line); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-header { padding: 48px 64px 34px; }
.article-header h1 { max-width: 760px; margin: 16px 0 14px; font-size: 42px; line-height: 1.18; letter-spacing: 0; }
.article-summary { max-width: 700px; color: var(--muted); font-size: 18px; }
.post-author.large { margin: 24px 0 0; }
.post-author.large .mini-avatar { width: 42px; height: 42px; }
.article-content { padding: 0 64px 60px; color: color-mix(in srgb, var(--text) 91%, var(--muted)); font-size: 17px; line-height: 1.9; }
.article-content h2 { margin: 2.3em 0 .65em; padding-top: .4em; color: var(--text); font-size: 29px; line-height: 1.35; }
.article-content h3 { margin: 1.8em 0 .5em; color: var(--text); font-size: 22px; }
.article-content p { margin-bottom: 1.2em; }
.article-content a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.article-content blockquote { margin: 1.8em 0; padding: 16px 22px; border-left: 4px solid var(--orange); background: color-mix(in srgb, var(--orange) 8%, var(--surface)); color: var(--text); }
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content pre { max-width: 100%; overflow: auto; margin: 1.6em 0; padding: 20px 22px; border-radius: 6px; color: #e8edf5; background: #111820; font: 14px/1.7 Consolas, "SFMono-Regular", monospace; }
.article-content code { padding: 2px 5px; border-radius: 3px; color: var(--danger); background: var(--surface-2); font: .9em Consolas, monospace; }
.article-content pre code { padding: 0; color: inherit; background: transparent; }
.article-content table { width: 100%; margin: 1.7em 0; border-collapse: collapse; font-size: 15px; }
.article-content th, .article-content td { padding: 10px 12px; border: 1px solid var(--line); }
.article-content th { background: var(--surface-2); }
.article-content img { margin: 1.8em auto; border-radius: 5px; }
.article-end { margin: 0 64px 48px; padding: 34px; border-top: 1px solid var(--line); text-align: center; }
.end-mark { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 12px; border-radius: 6px; color: white; background: var(--blue); font-family: Georgia, serif; font-weight: 800; }
.article-end h2 { margin-bottom: 4px; font-size: 18px; }
.article-end p { margin: 0; color: var(--muted); font-size: 13px; }
.article-toc { position: sticky; top: 98px; }
.toc-inner { padding-left: 18px; border-left: 1px solid var(--line); }
.toc-inner ul { margin: 8px 0 0; padding: 0; list-style: none; }
.toc-inner li { margin: 7px 0; }
.toc-inner ul ul { padding-left: 12px; }
.toc-inner a { color: var(--muted); font-size: 12px; line-height: 1.45; }
.toc-inner a:hover { color: var(--blue); }
.muted { color: var(--muted); font-size: 12px; }
.comments-section, .related-section { max-width: 860px; margin: 0 auto 60px; }
.section-heading h2 { margin: 0; font-size: 25px; }
.section-heading > span { color: var(--muted); font-size: 13px; }
.comment-form { display: grid; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.comment-form label, .auth-card label, .editor-settings label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.honeypot { position: absolute !important; left: -9999px !important; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 5px; outline: 0; color: var(--text); background: var(--surface); }
input, select { height: 42px; padding: 0 12px; }
textarea { padding: 10px 12px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent); }
.comment-form .primary-button { justify-self: end; }
.comment-list { margin-top: 20px; display: grid; gap: 12px; }
.comment { display: flex; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.comment > div { flex: 1; }
.comment > div > div { display: flex; justify-content: space-between; }
.comment time { color: var(--muted); font-size: 12px; }
.comment p { margin: 6px 0 0; color: var(--muted); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.related-grid a { min-width: 0; padding: 22px; border-right: 1px solid var(--line); }
.related-grid a:last-child { border-right: 0; }
.related-grid span { color: var(--blue); font-size: 11px; }
.related-grid h3 { margin: 8px 0; font-size: 17px; line-height: 1.45; }
.related-grid p { margin: 0; color: var(--muted); font-size: 12px; }

.about-hero { max-width: 1180px; min-height: calc(100vh - 170px); margin: 0 auto; padding: 70px 24px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 80px; align-items: center; }
.about-copy h1 { margin: 8px 0 24px; font-size: 60px; line-height: 1.08; }
.about-copy > p:not(.eyebrow) { max-width: 610px; color: var(--muted); font-size: 18px; }
.about-links { display: flex; gap: 12px; margin-top: 30px; }
.about-visual { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #173f38; }
.visual-grid { position: absolute; inset: 0; opacity: .38; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 28px 28px; }
.monogram { position: absolute; right: 12%; top: 2%; color: white; font: 700 280px/1 Georgia, serif; }
.visual-label { position: absolute; left: 34px; right: 34px; bottom: 34px; display: flex; justify-content: space-between; align-items: end; color: white; border-top: 2px solid var(--orange); padding-top: 13px; }
.visual-label strong { font-size: 20px; }
.visual-label span { font-size: 12px; }
.principles { max-width: 1180px; margin: 0 auto 80px; padding: 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principles div { padding: 32px 28px; border-right: 1px solid var(--line); }
.principles div:last-child { border-right: 0; }
.principles span { color: var(--orange); font: 700 15px Georgia, serif; }
.principles h2 { margin: 12px 0 8px; font-size: 20px; }
.principles p { margin: 0; color: var(--muted); font-size: 14px; }

.auth-shell { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 50px 20px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 17px; padding: 36px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.large-mark { width: 48px; height: 48px; font-size: 28px; }
.auth-card .eyebrow { margin: 7px 0 -12px; }
.auth-card h1 { margin: 0 0 6px; font-size: 28px; }
.admin-shell { max-width: 1180px; margin: 0 auto; padding: 46px 24px 80px; }
.admin-heading h1 { margin: 0; font-size: 30px; }
.admin-actions { display: flex; gap: 10px; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.metric-strip div { display: grid; gap: 2px; padding: 21px 24px; border-right: 1px solid var(--line); }
.metric-strip div:last-child { border-right: 0; }
.metric-strip strong { font-size: 25px; }
.metric-strip span { color: var(--muted); font-size: 12px; }
.admin-panel { margin-bottom: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-panel > .panel-heading { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
th { color: var(--muted); background: var(--surface-2); font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
td > strong { display: block; max-width: 460px; }
.table-tags { color: var(--muted); font-size: 11px; }
.status-badge { display: inline-flex; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.status-badge.published { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.status-badge.draft { color: var(--orange); background: color-mix(in srgb, var(--orange) 12%, transparent); }
.row-actions { display: flex; gap: 12px; justify-content: flex-end; }
.row-actions a, .row-actions button { border: 0; color: var(--blue); background: transparent; font-size: 12px; }
.row-actions button { color: var(--danger); }
.moderation-row { display: flex; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.moderation-row:last-child { border-bottom: 0; }
.moderation-row span { margin-left: 10px; color: var(--muted); font-size: 11px; }
.moderation-row p { margin: 8px 0 0; color: var(--muted); }
.moderation-row > div:last-child { display: flex; gap: 8px; }
.editor-shell { min-height: calc(100vh - 64px); background: var(--surface); }
.editor-form { max-width: 1360px; margin: 0 auto; }
.editor-topbar { position: sticky; top: 64px; z-index: 20; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.editor-topbar > div { display: flex; align-items: center; gap: 18px; }
.editor-topbar a { color: var(--muted); font-size: 13px; }
.editor-topbar select { width: 150px; height: 36px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.editor-main { min-width: 0; padding: 42px 56px 80px; border-right: 1px solid var(--line); }
.title-input { height: auto; padding: 0 0 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 36px; font-weight: 800; }
.title-input:focus, .content-input:focus { box-shadow: none; }
.content-input { min-height: 660px; padding: 28px 0; border: 0; border-radius: 0; color: var(--text); font: 16px/1.85 Consolas, "Microsoft YaHei", monospace; resize: vertical; }
.editor-settings { padding: 30px 24px; display: grid; align-content: start; gap: 18px; background: var(--bg); }
.editor-settings h2 { margin: 0 0 4px; font-size: 16px; }
.check-row { display: flex !important; align-items: center; gap: 9px !important; color: var(--text) !important; }
.check-row input { width: 17px; height: 17px; }

.toast-stack { position: fixed; z-index: 100; top: 78px; right: 22px; display: grid; gap: 8px; }
.toast { min-width: 260px; padding: 12px 16px; border-left: 4px solid var(--blue); border-radius: 5px; background: var(--surface); box-shadow: var(--shadow); font-size: 13px; }
.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--green); }
.site-footer { max-width: var(--content); margin: 0 auto; padding: 36px 24px 48px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 44px; color: var(--muted); font-size: 12px; }
.site-footer > div > p { margin: 8px 0 0; }
.site-footer nav { display: flex; gap: 18px; }
.site-footer a:hover { color: var(--blue); }
.site-footer > p { margin: 0; }

@media (max-width: 1120px) {
  .home-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .right-rail { display: none; }
  .article-shell { grid-template-columns: 64px minmax(0, 820px); }
  .article-toc { display: none; }
}

@media (max-width: 820px) {
  .site-header { height: 58px; }
  .nav-shell { padding: 0 16px; grid-template-columns: auto 1fr auto; gap: 10px; }
  .brand > span:last-child { display: none; }
  .brand-mark { width: 32px; height: 32px; }
  .nav-search { height: 38px; }
  .nav-search kbd, .nav-link { display: none; }
  .nav-actions { gap: 2px; }
  .home-shell { display: block; padding: 20px 14px 50px; }
  .left-rail { position: static; display: block; }
  .profile-panel, .tag-panel { display: none; }
  .topic-nav { display: flex; gap: 7px; overflow-x: auto; margin: 0 -14px 20px; padding: 0 14px 4px; scrollbar-width: none; }
  .topic-nav a { flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--line); background: var(--surface); }
  .topic-nav a span { width: auto; font-size: 15px; }
  .feed-heading { margin-bottom: 14px; }
  .feed-heading h1 { font-size: 23px; }
  .post-body { padding: 18px 17px 16px; }
  .post-body h2 { font-size: 21px; }
  .post-cover { aspect-ratio: 1.78 / 1; }
  .post-meta { gap: 12px; }
  .post-meta span:nth-child(2) { display: none; }
  .article-shell { display: block; padding: 14px 10px 40px; }
  .article-actions { position: fixed; z-index: 30; left: 50%; bottom: 16px; top: auto; transform: translateX(-50%); display: flex; padding: 6px; border: 1px solid var(--line); border-radius: 30px; background: var(--surface); box-shadow: var(--shadow); }
  .article-actions button { width: 43px; min-height: 43px; border: 0; }
  .article-header { padding: 28px 22px 24px; }
  .article-header h1 { font-size: 31px; }
  .article-summary { font-size: 16px; }
  .article-content { padding: 0 22px 42px; font-size: 16px; line-height: 1.85; }
  .article-content h2 { font-size: 24px; }
  .article-end { margin: 0 22px 36px; padding: 28px 8px; }
  .comments-section, .related-section { margin: 0 14px 44px; }
  .related-grid { grid-template-columns: 1fr; }
  .related-grid a { border-right: 0; border-bottom: 1px solid var(--line); }
  .related-grid a:last-child { border-bottom: 0; }
  .about-hero { min-height: auto; padding: 54px 20px 30px; grid-template-columns: 1fr; gap: 40px; }
  .about-copy h1 { font-size: 44px; }
  .about-visual { max-width: 520px; width: 100%; }
  .principles { grid-template-columns: 1fr; padding: 0 20px; border: 0; }
  .principles div { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-strip div:nth-child(2) { border-right: 0; }
  .metric-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .admin-heading { align-items: start; }
  .editor-topbar { top: 58px; }
  .editor-grid { display: block; }
  .editor-main { padding: 28px 20px; border-right: 0; }
  .title-input { font-size: 28px; }
  .editor-settings { border-top: 1px solid var(--line); }
  .site-footer { grid-template-columns: 1fr; gap: 20px; padding: 30px 20px 90px; }
}

@media (max-width: 520px) {
  .nav-shell { grid-template-columns: auto 1fr auto; }
  .nav-actions .primary-button { display: none; }
  .feed-tabs { gap: 12px; }
  .post-body h2 { font-size: 19px; }
  .post-meta { font-size: 11px; }
  .article-header h1 { font-size: 27px; }
  .form-row { grid-template-columns: 1fr; }
  .about-copy h1 { font-size: 39px; }
  .visual-label { left: 20px; right: 20px; bottom: 20px; }
  .monogram { font-size: 210px; }
  .admin-shell { padding: 30px 12px 60px; }
  .admin-heading { display: block; }
  .admin-actions { margin-top: 15px; }
  .metric-strip div { padding: 16px; }
  .editor-topbar { padding: 0 12px; }
  .editor-topbar > div:first-child strong { display: none; }
}

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

/* Editorial intelligence workspace */
.editorial-shell { max-width: 1380px; margin: 0 auto; padding: 42px 24px 80px; }
.editorial-heading { align-items: center; }
.editorial-heading h1 { margin: 0; font-size: 30px; }
.model-state { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--surface); font-size: 12px; font-weight: 700; }
.model-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.model-state.ready i { background: var(--green); }
.editorial-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.editorial-tabs { display: flex; gap: 4px; min-height: 48px; padding: 5px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); scrollbar-width: none; }
.editorial-tabs::-webkit-scrollbar { display: none; }
.editorial-tabs a { display: grid; place-items: center; padding: 0 17px; border-radius: 4px; color: var(--muted); font-size: 13px; font-weight: 700; }
.editorial-tabs a.active { color: white; background: var(--blue); }
.radar-list { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.radar-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 28px; gap: 16px; align-items: center; min-height: 116px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.radar-row:last-child { border-bottom: 0; }
.radar-row:hover { background: color-mix(in srgb, var(--blue) 4%, var(--surface)); }
.heat-index { display: grid; place-items: center; align-content: center; width: 58px; height: 58px; border: 1px solid color-mix(in srgb, var(--orange) 35%, var(--line)); border-radius: 50%; color: var(--orange); }
.heat-index strong { font-size: 19px; line-height: 1; }
.heat-index span { margin-top: 3px; font-size: 9px; }
.radar-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.radar-content h2 { margin: 8px 0 3px; font-size: 18px; line-height: 1.4; }
.radar-content p { margin: 0; color: var(--muted); font-size: 12px; }
.row-arrow { color: var(--blue); font-size: 20px; }
.status-badge.candidate, .status-badge.selected, .status-badge.researched, .status-badge.archived,
.status-badge.outlined, .status-badge.drafted, .status-badge.reviewed, .status-badge.rejected {
  color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent);
}
.status-badge.researched, .status-badge.reviewed { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.status-badge.archived, .status-badge.rejected { color: var(--muted); background: var(--surface-2); }
.compact-empty { padding: 46px 20px; border: 0; }
.editorial-side { display: grid; gap: 16px; }
.ops-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ops-panel .panel-heading { padding: 15px 16px; border-bottom: 1px solid var(--line); }
.ops-list { display: grid; }
.ops-list a { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.ops-list a:last-child { border-bottom: 0; }
.ops-list strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.ops-list small { grid-column: 2; color: var(--muted); font-size: 10px; }
.run-list { padding: 5px 15px; }
.run-list > div { position: relative; display: grid; grid-template-columns: 12px 1fr; gap: 1px 7px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.run-list > div:last-child { border-bottom: 0; }
.run-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--green); }
.run-dot.partial { background: var(--orange); }
.run-dot.failed { background: var(--danger); }
.run-list strong { font-size: 12px; }
.run-list small { grid-column: 2; color: var(--muted); font-size: 10px; }
.muted-line { margin: 0; padding: 16px; color: var(--muted); font-size: 12px; }
.source-section { margin-top: 28px; }
.source-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.source-table td:first-child { min-width: 270px; }
.source-table td:first-child strong, .source-table td:first-child span { display: block; }
.source-table td:first-child span { max-width: 440px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.source-ok { color: var(--green); }
.source-off { color: var(--muted); }
.source-error { color: var(--danger); border-bottom: 1px dotted var(--danger); cursor: help; }
.text-button { border: 0; color: var(--blue); background: transparent; font-size: 12px; }
.source-add { display: grid; grid-template-columns: 1.1fr .7fr 2fr .55fr .65fr .85fr auto; gap: 10px; align-items: end; margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.source-add label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.source-add input, .source-add select { height: 36px; font-size: 12px; }
.manual-material-form { display: grid; grid-template-columns: 1.2fr 1.8fr .8fr 1.2fr auto; gap: 10px; align-items: end; margin-bottom: 12px; padding: 15px; border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: var(--radius); background: var(--surface); }
.manual-material-form label, .event-source-add label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.manual-material-form input { height: 36px; font-size: 12px; }

.event-shell { max-width: 1540px; margin: 0 auto; padding: 26px 24px 80px; }
.event-topbar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; color: var(--muted); font-size: 12px; }
.event-topbar > div { display: flex; align-items: center; gap: 12px; }
.event-header { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 25px 0 26px; border-bottom: 1px solid var(--line); }
.event-header > div:first-child { max-width: 920px; }
.event-header h1 { margin: 5px 0 7px; font-size: 32px; line-height: 1.3; }
.event-header p:not(.eyebrow) { margin: 0; color: var(--muted); }
.event-actions { display: flex; gap: 9px; flex: 0 0 auto; }
.event-grid { display: grid; grid-template-columns: 300px minmax(420px, 1fr) 350px; gap: 22px; margin-top: 24px; align-items: start; }
.evidence-column, .dossier-column, .angle-column { min-width: 0; }
.evidence-column, .angle-column { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow-y: auto; }
.column-heading { display: flex; align-items: center; justify-content: space-between; min-height: 38px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.column-heading h2 { margin: 0; font-size: 15px; }
.column-heading span { color: var(--muted); font-size: 10px; }
.evidence-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.event-source-add { margin-bottom: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.event-source-add summary { color: var(--blue); font-size: 11px; font-weight: 700; cursor: pointer; }
.event-source-add form { display: grid; gap: 8px; margin-top: 10px; }
.evidence-list a { display: grid; grid-template-columns: 28px 1fr; gap: 3px 8px; padding: 13px; border-bottom: 1px solid var(--line); }
.evidence-list a:last-child { border-bottom: 0; }
.evidence-list a:hover strong { color: var(--blue); }
.evidence-list strong { font-size: 12px; line-height: 1.45; }
.evidence-list small, .evidence-list p { grid-column: 2; margin: 0; color: var(--muted); font-size: 9px; }
.evidence-list p { margin-top: 4px; font-size: 10px; line-height: 1.5; }
.trust-tier { display: grid; place-items: center; width: 26px; height: 22px; border-radius: 3px; color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); font-size: 9px; font-weight: 800; }
.tier-2 { color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.tier-3 { color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, transparent); }
.dossier-column { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.dossier-column > .column-heading { margin: 0; padding: 0 20px; }
.dossier-content { padding: 8px 32px 42px; font-size: 15px; line-height: 1.75; }
.dossier-content p,
.dossier-content li,
.dossier-content a { overflow-wrap: anywhere; word-break: break-word; }
.dossier-content h2 { margin-top: 1.8em; font-size: 20px; }
.dossier-content h3 { font-size: 16px; }
.angle-form { display: grid; gap: 11px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.angle-form label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.angle-form textarea { min-height: 54px; font-size: 12px; line-height: 1.5; }
.angle-list { display: grid; gap: 10px; margin-top: 14px; }
.angle-item { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.angle-item > div:first-child { display: flex; justify-content: space-between; }
.angle-item h3 { margin: 10px 0 6px; font-size: 14px; line-height: 1.45; }
.angle-item p { margin: 0; color: var(--muted); font-size: 11px; }
.angle-item details { margin-top: 10px; }
.angle-item summary { color: var(--blue); font-size: 11px; cursor: pointer; }
.angle-item pre { max-height: 280px; overflow: auto; padding: 10px; border-radius: 4px; white-space: pre-wrap; color: var(--text); background: var(--surface-2); font: 10px/1.55 Consolas, monospace; }
.angle-actions { display: flex; gap: 7px; margin-top: 12px; }
.draft-heading, .revision-heading { margin-top: 22px; }

.draft-shell { min-height: calc(100vh - 64px); background: var(--surface); }
.draft-topbar { position: sticky; top: 64px; }
.draft-topbar > div:last-child, .draft-topbar > div:last-child form { display: flex; gap: 8px; }
.draft-grid { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 420px; }
.draft-editor { min-width: 0; padding: 40px 54px 80px; border-right: 1px solid var(--line); }
.draft-context { margin-bottom: 26px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.draft-context span { color: var(--muted); font-size: 13px; }
.draft-editor .content-input { min-height: 720px; }
.review-column { min-width: 0; padding: 28px 25px 70px; background: var(--bg); }
.review-content { padding: 0; font-size: 13px; line-height: 1.7; }
.review-content h2 { font-size: 17px; }
.revision-list { display: grid; }
.revision-list div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.revision-list time { color: var(--muted); }

@media (max-width: 1180px) {
  .event-grid { grid-template-columns: 260px minmax(0, 1fr); }
  .angle-column { position: static; grid-column: 1 / -1; max-height: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .angle-column > .column-heading, .angle-column > .draft-heading { grid-column: 1 / -1; }
  .angle-list { margin-top: 0; }
  .source-add { grid-template-columns: repeat(3, 1fr); }
  .source-add .source-url { grid-column: span 2; }
  .manual-material-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .editorial-shell, .event-shell { padding: 26px 14px 60px; }
  .editorial-layout { grid-template-columns: 1fr; }
  .editorial-side { grid-template-columns: 1fr 1fr; }
  .editorial-tabs { overflow-x: auto; }
  .editorial-tabs a { flex: 0 0 auto; min-height: 38px; }
  .source-add { grid-template-columns: 1fr 1fr; }
  .source-add .source-url { grid-column: 1 / -1; }
  .manual-material-form { grid-template-columns: 1fr 1fr; }
  .event-header { display: block; }
  .event-actions { margin-top: 18px; }
  .event-grid { display: block; }
  .evidence-column, .angle-column { position: static; max-height: none; margin-bottom: 24px; }
  .angle-column { display: block; }
  .angle-list { margin-top: 14px; }
  .draft-grid { grid-template-columns: 1fr; }
  .draft-editor { padding: 30px 20px 50px; border-right: 0; }
  .review-column { border-top: 1px solid var(--line); }
  .draft-topbar { top: 58px; height: auto; min-height: 64px; flex-wrap: wrap; padding: 10px 14px; }
}

@media (max-width: 560px) {
  .editorial-heading { display: block; }
  .editorial-heading .admin-actions { margin-top: 14px; }
  .radar-row { grid-template-columns: 48px minmax(0, 1fr); padding: 14px 12px; }
  .heat-index { width: 45px; height: 45px; }
  .row-arrow { display: none; }
  .radar-content h2 { font-size: 15px; }
  .editorial-side { grid-template-columns: 1fr; }
  .source-add { grid-template-columns: 1fr; }
  .source-add .source-url { grid-column: auto; }
  .manual-material-form { grid-template-columns: 1fr; }
  .event-topbar { display: block; }
  .event-topbar > div { margin-top: 9px; flex-wrap: wrap; }
  .event-header h1 { font-size: 24px; }
  .event-actions { display: grid; }
  .dossier-content { padding: 6px 18px 30px; }
  .draft-topbar > div:last-child { width: 100%; overflow-x: auto; }
}
