:root {
  --night: #05131f;
  --night-deep: #030d16;
  --panel: #0a1b29;
  --panel-2: #0d2233;
  --line: rgba(211, 145, 80, .25);
  --line-soft: rgba(234, 215, 184, .12);
  --gold: #d9914d;
  --gold-bright: #efb974;
  --cream: #ead8bb;
  --ivory: #f2e8d7;
  --muted: #9ba6aa;
  --danger: #d77667;
  --sidebar: 236px;
  --serif: "Noto Serif SC", "Songti SC", STSong, Georgia, serif;
  --sans: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  background:
    radial-gradient(circle at 76% 0%, rgba(24, 58, 84, .2), transparent 32rem),
    linear-gradient(120deg, var(--night-deep), var(--night) 42%, #061522);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
::selection { color: var(--night); background: var(--gold-bright); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.site-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  padding: 56px 30px;
  border-right: 1px solid var(--line);
  background: rgba(3, 13, 22, .68);
  backdrop-filter: blur(16px);
}

.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  margin: 0 auto 34px;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 27px;
  letter-spacing: .02em;
}

.identity img {
  width: 90px;
  margin-bottom: 10px;
  filter: drop-shadow(0 9px 22px rgba(0, 0, 0, .35));
}

.site-nav { display: grid; gap: 8px; }
.site-nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #c9bda9;
  font-family: var(--serif);
  font-size: 17px;
  transition: color .2s, border-color .2s, background .2s, transform .2s;
}

.site-nav a:hover { color: var(--gold-bright); transform: translateX(2px); }
.site-nav a[aria-current="page"] {
  color: var(--gold-bright);
  border-color: rgba(218, 145, 76, .09);
  background: linear-gradient(90deg, rgba(234, 216, 187, .13), rgba(234, 216, 187, .07));
}

.site-nav svg {
  width: 22px; height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-toggle { display: none; }
.page-shell { margin-left: var(--sidebar); min-height: 100vh; }
main { width: min(1120px, calc(100% - 80px)); margin: 0 auto; padding: 70px 0 90px; }

.messages {
  position: fixed;
  z-index: 50;
  top: 24px;
  right: 28px;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 40px));
}

.message {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ivory);
  background: rgba(12, 35, 52, .97);
  box-shadow: 0 15px 40px rgba(0, 0, 0, .35);
}
.message.error { border-color: rgba(215, 118, 103, .55); }

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .28em;
}

.home-page main { width: min(1160px, calc(100% - 80px)); padding-top: 54px; }
.home-hero {
  display: grid;
  grid-template-columns: minmax(340px, .82fr) minmax(470px, 1.45fr);
  align-items: center;
  min-height: 445px;
}
.home-intro { position: relative; z-index: 2; padding-left: 4px; }
.home-intro h1 {
  margin: -6px 0 9px;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: clamp(76px, 8.5vw, 124px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.035em;
  text-shadow: 0 3px 28px rgba(224, 158, 91, .12);
}
.home-intro .lead {
  margin: 25px 0 0;
  color: #decdb2;
  font-family: var(--serif);
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.9;
  letter-spacing: .025em;
}
.gold-line {
  margin: 25px 0 0;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .12em;
}
.gold-line i { margin: 0 .45em; font-style: normal; opacity: .7; }
.hero-art-wrap {
  position: relative;
  align-self: stretch;
  margin-left: -58px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0, #000 13%, #000 86%, transparent 100%);
}
.hero-art { width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: .96; }

.recent { margin: 20px 0 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-heading h2 {
  margin: 0;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
}
.section-heading h2 span { margin-right: 8px; color: var(--gold-bright); font-size: 16px; }
.section-heading > a { color: var(--muted); font-size: 13px; transition: color .2s; }
.section-heading > a:hover { color: var(--gold-bright); }
.recent-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(7, 22, 34, .54);
}
.recent-list article + article { border-top: 1px solid var(--line-soft); }
.recent-list article a {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 64px;
  padding: 0 24px;
  transition: background .2s, padding .2s;
}
.recent-list article a:hover { padding-left: 29px; background: rgba(222, 161, 94, .055); }
.article-star { color: var(--gold-bright); font-size: 12px; }
.recent-title { overflow: hidden; font-family: var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.recent-list time { color: var(--gold); font-family: var(--serif); font-size: 14px; }

.page-header { max-width: 760px; margin: 4px 0 48px; }
.page-header.compact { margin-bottom: 54px; }
.page-header h1,
.about-page h1 {
  margin: 0 0 14px;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 400;
  line-height: 1.2;
}
.page-header > p:last-child { margin: 0; color: var(--muted); font-family: var(--serif); font-size: 18px; }

.filters { display: flex; gap: 10px; width: min(680px, 100%); margin-bottom: 21px; }
.search-field { position: relative; flex: 1; }
.search-field svg {
  position: absolute;
  top: 50%; left: 15px;
  width: 19px; height: 19px;
  transform: translateY(-50%);
  fill: none; stroke: var(--muted); stroke-width: 1.7;
}
input, textarea, select {
  width: 100%;
  color: var(--ivory);
  border: 1px solid rgba(219, 164, 103, .2);
  border-radius: 8px;
  outline: none;
  background: rgba(7, 22, 34, .82);
  transition: border-color .2s, box-shadow .2s;
}
input { min-height: 45px; padding: 9px 12px; }
textarea { padding: 12px; resize: vertical; }
select { min-height: 45px; padding: 9px 35px 9px 12px; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 145, 77, .1); }
.search-field input { padding-left: 44px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 8px 18px;
  color: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: rgba(9, 28, 43, .86);
  transition: transform .15s, color .2s, background .2s;
}
.button:hover { color: var(--ivory); background: var(--panel-2); transform: translateY(-1px); }
.button-primary { color: #1d140c; border-color: var(--gold); background: var(--gold-bright); font-weight: 650; }
.button-primary:hover { color: #120e09; background: #f4c98f; }
.button-danger { color: #fff; border-color: #a84f48; background: #a84f48; }

.category-filter, .status-filter { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 43px; }
.category-filter a, .status-filter a {
  padding: 5px 13px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
}
.category-filter a:hover, .status-filter a:hover { color: var(--cream); }
.category-filter a[aria-current="page"], .status-filter a[aria-current="page"] { color: var(--gold-bright); border-color: var(--line); background: rgba(217, 145, 77, .08); }

.writing-list { border-top: 1px solid var(--line); }
.writing-item { position: relative; max-width: 850px; padding: 35px 0 37px; border-bottom: 1px solid var(--line-soft); }
.writing-meta { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 12px; }
.writing-meta span { color: var(--gold); letter-spacing: .08em; }
.writing-meta span::after { padding-left: 14px; color: #54616a; content: "/"; }
.writing-item h2 { margin: 8px 0 8px; font-family: var(--serif); font-size: clamp(24px, 3vw, 31px); font-weight: 500; line-height: 1.45; }
.writing-item h2 a { transition: color .2s; }
.writing-item h2 a:hover { color: var(--gold-bright); }
.writing-item p { max-width: 700px; margin: 0 0 10px; color: #9ea7a8; }
.read-more { color: var(--gold); font-size: 13px; }
.read-more span { display: inline-block; transition: transform .2s; }
.read-more:hover span { transform: translateX(4px); }
.empty-state, .empty-cell { padding: 44px 24px; color: var(--muted); text-align: center; }

.pagination { display: flex; align-items: center; gap: 16px; margin-top: 35px; color: var(--muted); font-size: 13px; }
.pagination a { color: var(--gold-bright); }

.post-page { max-width: 980px; margin: 0 auto; }
.post-header { max-width: 780px; margin: 25px auto 55px; text-align: center; }
.post-category { display: inline-block; margin-bottom: 15px; color: var(--gold); font-size: 12px; letter-spacing: .14em; }
.post-header h1 { margin: 0; color: var(--ivory); font-family: var(--serif); font-size: clamp(38px, 5vw, 61px); font-weight: 450; line-height: 1.34; }
.post-deck { max-width: 680px; margin: 21px auto 17px; color: var(--muted); font-family: var(--serif); font-size: 17px; }
.post-dates { display: flex; justify-content: center; gap: 18px; color: #7e8b90; font-size: 12px; }
.post-cover { margin: 0 0 52px; }
.post-cover img { width: 100%; max-height: 550px; border: 1px solid var(--line); border-radius: 14px; object-fit: cover; }
.article-layout { position: relative; max-width: 730px; margin: 0 auto; }
.article-layout.has-toc { max-width: 100%; padding-left: 210px; }
.toc { position: sticky; top: 30px; float: left; width: 170px; margin-left: -210px; color: var(--muted); font-size: 12px; }
.toc > p { margin: 0 0 10px; color: var(--gold); letter-spacing: .1em; }
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc ul ul { padding-left: 13px; }
.toc li { margin: 5px 0; }
.toc a:hover { color: var(--cream); }
.prose { max-width: 730px; color: #d5c9b7; font-family: var(--serif); font-size: 17px; line-height: 1.95; }
.prose > *:first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { scroll-margin-top: 24px; color: var(--ivory); font-weight: 550; line-height: 1.5; }
.prose h1 { margin: 2.2em 0 .8em; font-size: 2em; }
.prose h2 { margin: 2.1em 0 .7em; padding-bottom: .32em; border-bottom: 1px solid var(--line-soft); font-size: 1.55em; }
.prose h3 { margin: 1.8em 0 .6em; font-size: 1.25em; }
.prose p, .prose ul, .prose ol { margin: 1.15em 0; }
.prose a { color: var(--gold-bright); border-bottom: 1px solid rgba(239, 185, 116, .35); }
.prose blockquote { margin: 1.6em 0; padding: .3em 1.25em; color: #b9ae9d; border-left: 3px solid var(--gold); background: rgba(217, 145, 77, .05); }
.prose code { padding: .15em .38em; color: #f2c68d; border: 1px solid rgba(217, 145, 77, .15); border-radius: 4px; background: #081824; font-family: "SFMono-Regular", Consolas, monospace; font-size: .86em; }
.prose pre { overflow: auto; margin: 1.6em 0; padding: 20px; border: 1px solid var(--line-soft); border-radius: 9px; background: #030e17; line-height: 1.65; }
.prose pre code { padding: 0; border: 0; background: none; }
.prose img { height: auto; margin: 2em auto; border-radius: 8px; }
.prose table { display: block; width: 100%; margin: 1.6em 0; overflow-x: auto; border-collapse: collapse; font-family: var(--sans); font-size: 14px; }
.prose th, .prose td { min-width: 110px; padding: 10px 13px; border: 1px solid var(--line-soft); text-align: left; }
.prose th { color: var(--ivory); background: rgba(217, 145, 77, .08); }
.post-neighbors { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; max-width: 730px; margin: 70px auto 0; padding-top: 24px; border-top: 1px solid var(--line); }
.post-neighbors div:last-child { text-align: right; }
.post-neighbors small { display: block; color: var(--muted); font-size: 11px; }
.post-neighbors a { color: var(--gold-bright); font-family: var(--serif); }

.archive { max-width: 820px; }
.archive-year { display: grid; grid-template-columns: 130px 1fr; gap: 35px; padding: 0 0 55px; }
.archive-year > h2 { margin: -9px 0 0; color: var(--ivory); font-family: var(--serif); font-size: 48px; font-weight: 400; }
.archive-month + .archive-month { margin-top: 34px; }
.archive-month h3 { margin: 0 0 9px; color: var(--gold); font-size: 12px; font-weight: 550; letter-spacing: .12em; }
.archive-month ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-soft); }
.archive-month li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.archive-month time, .archive-month li span { color: var(--muted); font-size: 12px; }
.archive-month a { font-family: var(--serif); }
.archive-month a:hover { color: var(--gold-bright); }

.about-page { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(360px, 1.1fr); gap: clamp(45px, 8vw, 105px); align-items: center; min-height: calc(100vh - 160px); }
.about-page > div { max-width: 590px; }
.about-page p { color: #aeb2ac; }
.about-page .about-lead { color: var(--cream); font-family: var(--serif); font-size: 22px; }
.about-page figure { margin: 0; }
.about-page figure img { width: 100%; border: 1px solid var(--line); border-radius: 25px; box-shadow: 0 30px 70px rgba(0, 0, 0, .3); }

/* Management */
.management-page main { width: min(1260px, calc(100% - 68px)); padding-top: 40px; }
.manage-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 34px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.manage-kicker { color: var(--gold); font-size: 11px; letter-spacing: .18em; }
.manage-header h1 { margin: 5px 0 0; color: var(--ivory); font-family: var(--serif); font-size: 34px; font-weight: 450; }
.manage-user { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 12px; }
.manage-user a, .manage-user button { color: var(--cream); }
.manage-user form { margin: 0; }
.manage-user button, .row-actions button { padding: 0; border: 0; cursor: pointer; background: none; }
.manage-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.compact-filter { margin: 0; }
.compact-filter .search-field input { padding-left: 14px; }
.status-filter { margin: 24px 0 19px; padding-bottom: 15px; border-bottom: 1px solid var(--line-soft); }
.status-filter a { border-radius: 6px; }
.status-filter span { margin-left: 4px; opacity: .55; }
.manage-table-wrap { overflow-x: auto; }
.manage-table { width: 100%; border-collapse: collapse; }
.manage-table th { padding: 10px 13px; color: #7f8c90; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 550; text-align: left; letter-spacing: .08em; }
.manage-table td { padding: 16px 13px; border-bottom: 1px solid var(--line-soft); color: #b9b6ad; font-size: 13px; }
.manage-table td:first-child { min-width: 290px; }
.manage-table td strong { display: block; color: var(--cream); font-family: var(--serif); font-size: 16px; font-weight: 500; }
.manage-table td small { color: #637177; }
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; }
.status-pill.published { color: #b7d0ae; background: rgba(109, 153, 99, .13); }
.status-pill.draft { color: #dbb985; background: rgba(217, 145, 77, .12); }
.status-pill.deleted { color: #c99790; background: rgba(177, 82, 72, .13); }
.row-actions { display: flex; justify-content: flex-end; gap: 13px; white-space: nowrap; }
.row-actions form { margin: 0; }
.row-actions a, .row-actions button { color: var(--gold-bright); font-size: 12px; }
.row-actions .danger-link, .danger-link, .danger-text { color: var(--danger); }

.editor-topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.back-link { color: var(--gold-bright); font-size: 13px; }
.editor-topline p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.save-actions { display: flex; align-items: center; gap: 9px; }
.save-status { margin-right: 7px; color: #728087; font-size: 11px; }
.save-status.error { color: var(--danger); }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 28px; }
.field { margin-bottom: 20px; }
.field > label { display: block; margin-bottom: 6px; color: #b4aa9a; font-size: 12px; }
.field label small { color: #68767c; font-weight: 400; }
.field .errorlist { margin: 5px 0 0; padding: 0; color: var(--danger); font-size: 12px; list-style: none; }
.title-field input { min-height: 56px; padding: 8px 15px; font-family: var(--serif); font-size: 23px; }
.slug-row { display: flex; align-items: center; overflow: hidden; border: 1px solid rgba(219, 164, 103, .2); border-radius: 8px; background: rgba(7, 22, 34, .82); }
.slug-row:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 145, 77, .1); }
.slug-row span { padding-left: 12px; color: #637177; font-size: 12px; white-space: nowrap; }
.slug-row input { border: 0; background: transparent; box-shadow: none; }
.markdown-editor { overflow: hidden; border: 1px solid rgba(219, 164, 103, .2); border-radius: 9px; background: rgba(5, 18, 29, .78); }
.editor-tabs { display: flex; align-items: center; height: 45px; padding: 0 10px; border-bottom: 1px solid var(--line-soft); background: rgba(13, 34, 51, .5); }
.editor-tabs button { height: 100%; padding: 0 12px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; cursor: pointer; background: none; font-size: 12px; }
.editor-tabs button.active { color: var(--gold-bright); border-bottom-color: var(--gold); }
.markdown-editor textarea { display: block; min-height: 570px; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; line-height: 1.75; }
.preview-panel { min-height: 570px; max-width: none; padding: 24px 28px; overflow: auto; }
.preview-placeholder { color: var(--muted); font-family: var(--sans); font-size: 13px; }
.editor-sidebar { padding: 18px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(8, 25, 38, .46); }
.editor-sidebar input[type="file"] { min-height: 0; padding: 8px; font-size: 11px; }
.editor-sidebar input[type="checkbox"] { width: auto; min-height: 0; }
.hint { display: block; margin-top: 5px; color: #68767c; font-size: 10px; }
.editor-note { margin-top: 28px; padding-top: 17px; color: var(--muted); border-top: 1px solid var(--line-soft); font-size: 11px; }
.editor-note strong { color: var(--cream); font-size: 12px; }
.editor-note p { margin: 4px 0; }
.form-errors { margin: 0 0 18px; padding: 10px 13px; color: #efb2a8; border: 1px solid rgba(215, 118, 103, .35); border-radius: 7px; background: rgba(163, 68, 56, .08); font-size: 13px; }

.confirm-panel, .login-panel { max-width: 540px; margin: 65px auto; padding: 32px; border: 1px solid var(--line); border-radius: 13px; background: rgba(8, 25, 38, .7); }
.confirm-panel h2, .login-panel h1 { margin: 0 0 8px; color: var(--ivory); font-family: var(--serif); font-size: 32px; font-weight: 450; }
.confirm-panel > p, .login-panel > p { color: var(--muted); }
.confirm-panel code { color: var(--gold-bright); }
.confirm-panel label, .login-panel label { display: block; margin: 14px 0 5px; color: var(--cream); font-size: 12px; }
.confirm-panel form > div { display: flex; gap: 10px; margin-top: 18px; }
.login-panel .button { width: 100%; margin-top: 20px; }

@media (max-width: 1100px) {
  :root { --sidebar: 205px; }
  .site-sidebar { padding-inline: 23px; }
  .home-hero { grid-template-columns: minmax(300px, .82fr) minmax(390px, 1.3fr); }
  .hero-art-wrap { margin-left: -70px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; }
  .save-status { display: none; }
}

@media (max-width: 860px) {
  .site-sidebar {
    width: min(290px, 82vw);
    padding: 45px 28px;
    transform: translateX(-102%);
    transition: transform .25s ease;
    box-shadow: 20px 0 50px rgba(0, 0, 0, .4);
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .site-sidebar { transform: translateX(0); }
  body.nav-open::after { position: fixed; inset: 0; z-index: 15; content: ""; background: rgba(0, 7, 12, .68); }
  .nav-toggle {
    position: fixed;
    z-index: 30;
    top: 18px; left: 18px;
    display: grid;
    gap: 4px;
    width: 42px; height: 42px;
    padding: 11px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 22, 34, .93);
  }
  .nav-toggle span:not(.sr-only) { display: block; height: 1px; background: var(--gold-bright); transition: transform .2s; }
  .page-shell { margin-left: 0; }
  main, .home-page main, .management-page main { width: min(100% - 40px, 720px); padding-top: 88px; }
  .home-hero { grid-template-columns: 1fr; min-height: 0; }
  .home-intro { text-align: center; }
  .home-intro h1 { font-size: clamp(68px, 17vw, 100px); }
  .hero-art-wrap { height: 420px; margin: -30px -20px 0; }
  .hero-art { object-fit: contain; }
  .recent { margin-top: -20px; }
  .article-layout.has-toc { padding-left: 0; }
  .toc { position: static; float: none; width: auto; margin: 0 0 38px; padding: 17px; border: 1px solid var(--line-soft); border-radius: 8px; }
  .about-page { grid-template-columns: 1fr; min-height: 0; }
  .about-page figure { max-width: 560px; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-sidebar { order: -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .editor-note { display: none; }
}

@media (max-width: 600px) {
  main, .home-page main, .management-page main { width: min(100% - 28px, 540px); padding-bottom: 60px; }
  .messages { right: 14px; }
  .home-intro .lead { font-size: 19px; }
  .gold-line { font-size: 14px; }
  .hero-art-wrap { height: 330px; margin-top: -16px; }
  .section-heading > a { display: none; }
  .recent { margin-top: 0; }
  .recent-list article a { grid-template-columns: 18px 1fr; min-height: 70px; padding: 10px 14px; }
  .recent-list time { grid-column: 2; margin-top: -12px; font-family: var(--sans); font-size: 10px; }
  .page-header { margin-bottom: 34px; }
  .page-header h1, .about-page h1 { font-size: 46px; }
  .filters { display: grid; grid-template-columns: 1fr auto; }
  .category-filter { margin-bottom: 28px; }
  .post-header { margin-top: 10px; margin-bottom: 42px; text-align: left; }
  .post-dates { justify-content: flex-start; flex-wrap: wrap; gap: 4px 12px; }
  .prose { font-size: 16px; line-height: 1.9; }
  .post-neighbors { grid-template-columns: 1fr; }
  .post-neighbors div:last-child { text-align: left; }
  .archive-year { grid-template-columns: 1fr; gap: 13px; }
  .archive-year > h2 { font-size: 40px; }
  .archive-month li { grid-template-columns: 45px 1fr; }
  .archive-month li span { display: none; }
  .about-page { gap: 35px; }
  .manage-header { align-items: flex-start; }
  .manage-user > span { display: none; }
  .manage-actions { align-items: stretch; }
  .compact-filter { grid-template-columns: 1fr; }
  .compact-filter button { display: none; }
  .manage-table th:nth-child(2), .manage-table td:nth-child(2), .manage-table th:nth-child(4), .manage-table td:nth-child(4) { display: none; }
  .editor-topline { align-items: flex-start; flex-direction: column; }
  .save-actions { width: 100%; }
  .save-actions .button { flex: 1; }
  .editor-sidebar { display: block; }
  .markdown-editor textarea, .preview-panel { min-height: 480px; }
  .confirm-panel, .login-panel { margin-top: 25px; padding: 23px; }
}

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