:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #eef3ed;
  --ink: #17211f;
  --muted: #66716e;
  --line: #dce4df;
  --accent: #087f7b;
  --accent-strong: #045f5d;
  --accent-soft: #dff3ef;
  --warm: #bc5a3c;
  --gold: #b68416;
  --danger: #b42318;
  --shadow: 0 18px 44px rgba(23, 33, 31, 0.09);
  --radius: 8px;
  --page: min(1180px, calc(100vw - 32px));
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111513;
  --surface: #191f1d;
  --surface-soft: #202b28;
  --ink: #ecf4f1;
  --muted: #a2b0ab;
  --line: #30403b;
  --accent: #38b7a8;
  --accent-strong: #70d6cc;
  --accent-soft: #173b37;
  --warm: #e07b5f;
  --gold: #e3b64f;
  --danger: #f97066;
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(8, 127, 123, 0.12), transparent 30rem),
    linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--bg) 88%, var(--surface)));
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: var(--page);
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--accent), var(--warm)),
    var(--accent);
  color: #fff;
  box-shadow: 0 10px 20px color-mix(in srgb, var(--accent) 28%, transparent);
}

.brand span:last-child {
  white-space: nowrap;
}

.site-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.nav-link,
.icon-button,
.button,
.chip,
.tab-button,
.reaction-button,
.bulk-select,
.select-like {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.nav-link.active,
.nav-link:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
}

.icon-button.danger {
  color: var(--danger);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.ghost {
  border-color: transparent;
  background: transparent;
}

.button.danger {
  color: var(--danger);
}

.admin-entry {
  opacity: 0.72;
}

.admin-entry:hover {
  opacity: 1;
}

.main-shell {
  width: var(--page);
  margin: 0 auto;
  padding: 28px 0 56px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.section-title {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-weight: 800;
}

.view-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.view-head p {
  max-width: 58ch;
  margin: 10px 0 0;
  color: var(--muted);
}

.home-intro {
  min-height: 240px;
  align-items: center;
  padding: 30px 0 20px;
}

.home-intro .section-title {
  max-width: 820px;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 1.02;
}

.home-intro p:not(.section-kicker) {
  max-width: 66ch;
  font-size: 1.04rem;
}

.featured-story {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 28px;
  align-items: stretch;
  margin: 8px 0 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
}

.featured-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 14px;
}

.featured-copy h2 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2rem, 4.4vw, 4.4rem);
  line-height: 1.03;
  letter-spacing: 0;
}

.featured-copy h2 button,
.featured-cover {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0;
}

.featured-copy h2 button:hover {
  color: var(--accent-strong);
}

.featured-copy p {
  max-width: 50ch;
  margin: 0;
  color: var(--muted);
}

.featured-cover {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.featured-cover img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  transition: transform 0.26s ease;
}

.featured-cover:hover img {
  transform: scale(1.025);
}

.wuyan-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  min-height: 340px;
  padding: 48px 0 30px;
  border-bottom: 1px solid var(--line);
}

.wuyan-hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: KaiTi, STKaiti, "KaiTi_GB2312", "Noto Serif CJK SC", serif;
  font-size: clamp(3rem, 7.5vw, 7rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: 0;
}

.wuyan-hero p:not(.section-kicker) {
  max-width: 68ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.wuyan-overview {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 24px 0;
}

.wuyan-overview > div:last-child > p {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 800;
}

.wuyan-count {
  display: grid;
  place-items: center;
  width: 138px;
  height: 138px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 25%, color-mix(in srgb, var(--gold) 18%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface) 82%, transparent);
  font-family: KaiTi, STKaiti, "KaiTi_GB2312", "Noto Serif CJK SC", serif;
}

.wuyan-count strong {
  font-size: 3.4rem;
  line-height: 0.9;
}

.wuyan-count span {
  color: var(--muted);
}

.wuyan-feature {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1fr);
  gap: 30px;
  align-items: center;
  margin: 8px 0 28px;
  padding: clamp(24px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 88%, var(--accent-soft)), var(--surface)),
    var(--surface);
  box-shadow: 0 18px 42px rgba(23, 33, 31, 0.08);
}

.wuyan-feature h2 {
  margin: 0;
  font-family: KaiTi, STKaiti, "KaiTi_GB2312", "Noto Serif CJK SC", serif;
  font-size: clamp(2.7rem, 6vw, 5.4rem);
  font-weight: 500;
  line-height: 1.05;
}

.wuyan-feature > div:first-child > p:last-child {
  color: var(--muted);
  font-size: 1.05rem;
}

.wuyan-feature-lines,
.wuyan-lines {
  font-family: KaiTi, STKaiti, "KaiTi_GB2312", "Noto Serif CJK SC", serif;
}

.wuyan-feature-lines {
  display: grid;
  gap: 8px;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.85;
}

.wuyan-feature-lines p,
.wuyan-lines p {
  margin: 0;
}

.wuyan-feature-lines p:first-child::first-letter {
  color: var(--warm);
  font-size: 1.7em;
}

.wuyan-grid {
  columns: 2 380px;
  column-gap: 20px;
}

.wuyan-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 20px;
  padding: clamp(19px, 3vw, 28px);
  break-inside: avoid;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, var(--surface-soft)), var(--surface)),
    var(--surface);
  box-shadow: 0 12px 28px rgba(23, 33, 31, 0.055);
}

.wuyan-card header {
  display: flex;
  gap: 13px;
  align-items: start;
  margin-bottom: 15px;
}

.wuyan-card header span {
  color: color-mix(in srgb, var(--warm) 70%, var(--muted));
  font-family: ui-serif, Georgia, serif;
  font-size: 0.82rem;
  font-weight: 800;
}

.wuyan-card h2 {
  margin: 0;
  font-family: KaiTi, STKaiti, "KaiTi_GB2312", "Noto Serif CJK SC", serif;
  font-size: clamp(1.65rem, 3.6vw, 2.3rem);
  font-weight: 500;
  line-height: 1.18;
}

.wuyan-card header p {
  margin: 5px 0 0;
  color: var(--muted);
}

.wuyan-lines {
  display: grid;
  gap: 3px;
  font-size: clamp(1.18rem, 2.2vw, 1.44rem);
  line-height: 1.95;
}

.poem-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.poetry-gateway {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: center;
  margin: 4px 0 30px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.poetry-gateway h2 {
  max-width: 14ch;
  margin: 0;
  font-family: KaiTi, STKaiti, "KaiTi_GB2312", "Noto Serif CJK SC", serif;
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0;
}

.poetry-gateway p {
  max-width: 54ch;
  color: var(--muted);
}

.poetry-gateway-lines {
  display: grid;
  gap: 10px;
  font-family: KaiTi, STKaiti, "KaiTi_GB2312", "Noto Serif CJK SC", serif;
}

.poetry-gateway-lines article {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-left: 3px solid color-mix(in srgb, var(--warm) 64%, var(--accent));
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.poetry-gateway-lines strong {
  font-size: 1.08rem;
  font-weight: 600;
}

.poetry-gateway-lines span {
  color: var(--muted);
  font-size: 1.05rem;
}

.poetry-head {
  align-items: center;
  min-height: 260px;
}

.poetry-head .section-title {
  max-width: 780px;
  font-family: KaiTi, STKaiti, "KaiTi_GB2312", "Noto Serif CJK SC", serif;
  font-size: clamp(2.6rem, 6vw, 5.6rem);
  font-weight: 500;
}

.poetry-count {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  font-family: KaiTi, STKaiti, "KaiTi_GB2312", "Noto Serif CJK SC", serif;
}

.poetry-count strong {
  font-size: 3rem;
  line-height: 0.9;
}

.poetry-count span {
  color: var(--muted);
}

.poetry-author-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 24px;
}

.poetry-author-strip span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--muted);
}

.poetry-grid {
  columns: 2 360px;
  column-gap: 20px;
}

.poem-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 20px;
  padding: clamp(20px, 3vw, 30px);
  break-inside: avoid;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, var(--accent-soft)), var(--surface)),
    var(--surface);
  box-shadow: 0 14px 34px rgba(23, 33, 31, 0.06);
}

.poem-card header {
  display: flex;
  align-items: start;
  gap: 14px;
  margin-bottom: 18px;
}

.poem-index {
  color: color-mix(in srgb, var(--warm) 72%, var(--muted));
  font-family: ui-serif, Georgia, serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.poem-card h2 {
  margin: 0;
  font-family: KaiTi, STKaiti, "KaiTi_GB2312", "Noto Serif CJK SC", serif;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  font-weight: 500;
  line-height: 1.18;
}

.poem-card header p {
  margin: 5px 0 0;
  color: var(--muted);
}

.poem-text {
  font-family: KaiTi, STKaiti, "KaiTi_GB2312", "Noto Serif CJK SC", serif;
  font-size: clamp(1.22rem, 2.2vw, 1.48rem);
  line-height: 2.05;
}

.poem-text p {
  margin: 0;
}

.poem-text .first-line::first-letter {
  color: var(--warm);
  font-size: 1.55em;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.search-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  margin-bottom: 18px;
}

.field,
.select-like {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 11px;
  outline: none;
}

.field:focus,
.select-like:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

textarea.field {
  min-height: 160px;
  resize: vertical;
}

.post-list {
  display: grid;
  gap: 14px;
}

.post-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  min-height: 170px;
  overflow: hidden;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding-top: 14px;
}

.post-card.compact {
  grid-template-columns: 116px minmax(0, 1fr);
  min-height: 118px;
  box-shadow: none;
}

.post-cover {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.post-cover img {
  width: 100%;
  height: 100%;
  min-height: 170px;
  object-fit: cover;
}

.post-card.compact .post-cover img {
  min-height: 118px;
}

.post-body {
  display: grid;
  align-content: center;
  gap: 9px;
  padding: 18px 18px 18px 0;
}

.post-title {
  margin: 0;
  font-size: clamp(1.2rem, 2.4vw, 1.58rem);
  line-height: 1.22;
  letter-spacing: 0;
}

.post-title button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0;
}

.post-title button:hover {
  color: var(--accent-strong);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 13px;
  color: var(--muted);
  font-size: 0.9rem;
}

.excerpt {
  margin: 0;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 9px;
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.86rem;
  text-decoration: none;
}

.chip.muted {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.chip.warm {
  border-color: color-mix(in srgb, var(--warm) 30%, var(--line));
  background: color-mix(in srgb, var(--warm) 13%, var(--surface));
  color: var(--warm);
}

.chip button,
.chip.is-button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.side-stack {
  display: grid;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  padding: 18px;
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  letter-spacing: 0;
}

.author-box {
  display: grid;
  gap: 12px;
}

.author-main {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-soft);
}

.author-main strong {
  display: block;
  font-size: 1.05rem;
}

.author-main span {
  color: var(--muted);
  font-size: 0.9rem;
}

.author-box p {
  margin: 0;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.9rem;
  line-height: 1;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 24px;
  align-items: start;
}

.article-hero {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.article-hero img {
  width: 100%;
  height: min(44vw, 420px);
  min-height: 260px;
  object-fit: cover;
}

.article-head {
  padding: 24px;
}

.article-head h1 {
  margin: 10px 0 12px;
  font-size: clamp(2rem, 4.8vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.article-content {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(20px, 4vw, 38px);
  margin-top: 16px;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  scroll-margin-top: 92px;
  line-height: 1.25;
  letter-spacing: 0;
}

.article-content p,
.article-content li {
  color: color-mix(in srgb, var(--ink) 86%, var(--muted));
}

.article-content blockquote {
  margin: 18px 0;
  padding: 10px 16px;
  border-left: 4px solid var(--accent);
  background: var(--surface-soft);
  color: var(--muted);
}

.article-content pre {
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #101614;
  color: #e9f5f1;
  padding: 16px;
  line-height: 1.5;
}

.article-content code {
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--warm);
  padding: 2px 5px;
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.article-content img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.tok-comment {
  color: #7fa99d;
}

.tok-string {
  color: #ffcf8a;
}

.tok-keyword {
  color: #84d7ff;
}

.toc {
  position: sticky;
  top: 92px;
}

.toc ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent-strong);
}

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.reaction-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0 11px;
}

.comment-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.comment {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.comment.reply {
  margin-left: 32px;
  background: var(--surface-soft);
}

.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.comment p {
  margin: 8px 0 0;
}

.archive-list {
  display: grid;
  gap: 18px;
}

.archive-year {
  border-left: 3px solid var(--accent);
  padding-left: 18px;
}

.archive-month {
  margin-top: 12px;
}

.archive-month h3 {
  margin: 0 0 8px;
  color: var(--muted);
}

.archive-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.friend-grid,
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.friend-card,
.media-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}

.friend-card a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.admin-tabs {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 8px;
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 0 12px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.tab-button.active,
.tab-button:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.admin-panel {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.field-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.field-label strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.published::before {
  background: var(--accent);
}

.status-dot.draft::before {
  background: var(--gold);
}

.status-dot.archived::before {
  background: var(--warm);
}

.media-card {
  display: grid;
  gap: 10px;
}

.media-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface-soft);
}

.rss-box {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101614;
  color: #e9f5f1;
  padding: 16px;
  overflow: auto;
  white-space: pre;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.42);
}

.modal {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.modal h2 {
  margin: 0 0 12px;
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatch {
  width: 34px;
  height: 34px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--line);
}

.swatch.active {
  box-shadow: 0 0 0 3px var(--accent);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 32px;
  color: var(--muted);
}

.footer-inner {
  width: var(--page);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2.1;
}

.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;
}

@media (max-width: 960px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    grid-column: 1 / -1;
    order: 3;
    padding-bottom: 10px;
  }

  .home-grid,
  .article-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .featured-story {
    grid-template-columns: 1fr;
  }

  .wuyan-hero,
  .wuyan-feature {
    grid-template-columns: 1fr;
  }

  .poetry-gateway {
    grid-template-columns: 1fr;
  }

  .featured-copy h2 {
    max-width: 16ch;
  }

  .toc,
  .admin-tabs {
    position: static;
  }

  .admin-tabs {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }
}

@media (max-width: 700px) {
  :root {
    --page: min(100vw - 22px, 1180px);
  }

  body {
    padding-bottom: 78px;
  }

  .site-header {
    position: sticky;
  }

  .header-inner {
    min-height: 64px;
  }

  .site-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    overflow: visible;
  }

  .site-nav .nav-link {
    min-height: 48px;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
    font-size: 0.76rem;
  }

  .site-nav .lucide {
    width: 17px;
    height: 17px;
  }

  .main-shell {
    padding-top: 18px;
  }

  .view-head {
    align-items: start;
    flex-direction: column;
  }

  .home-intro {
    min-height: 0;
    padding: 18px 0 8px;
  }

  .home-intro .section-title {
    font-size: clamp(2.2rem, 14vw, 3.7rem);
  }

  .featured-story {
    gap: 18px;
    margin-bottom: 24px;
    padding: 20px 0;
  }

  .featured-copy h2 {
    max-width: none;
    font-size: clamp(2rem, 10vw, 3.2rem);
  }

  .featured-cover,
  .featured-cover img {
    min-height: 220px;
  }

  .wuyan-hero {
    min-height: 0;
    padding: 24px 0 20px;
  }

  .wuyan-hero h1 {
    font-size: clamp(2.7rem, 14vw, 4.5rem);
  }

  .wuyan-overview {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .wuyan-count {
    width: 104px;
    height: 104px;
  }

  .wuyan-count strong {
    font-size: 2.5rem;
  }

  .wuyan-feature {
    gap: 18px;
    margin-bottom: 22px;
    padding: 22px;
  }

  .wuyan-feature h2 {
    font-size: clamp(2.35rem, 12vw, 4rem);
  }

  .wuyan-feature-lines {
    font-size: clamp(1.32rem, 6vw, 1.72rem);
  }

  .wuyan-grid {
    columns: 1;
  }

  .poetry-gateway {
    margin-bottom: 22px;
    padding: 18px 0;
  }

  .poetry-gateway h2,
  .poetry-head .section-title {
    max-width: none;
    font-size: clamp(2.2rem, 12vw, 3.8rem);
  }

  .poetry-head {
    min-height: 0;
  }

  .poetry-count {
    width: 96px;
    height: 96px;
  }

  .poetry-count strong {
    font-size: 2.3rem;
  }

  .poetry-grid {
    columns: 1;
  }

  .search-bar,
  .post-card,
  .post-card.compact,
  .form-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .post-card,
  .post-card.compact {
    min-height: auto;
    gap: 12px;
  }

  .post-cover img,
  .post-card.compact .post-cover img {
    min-height: auto;
    aspect-ratio: 16 / 9;
  }

  .post-body {
    padding: 0 0 16px;
  }

  .article-hero img {
    min-height: 210px;
  }

  .article-head {
    padding: 18px;
  }

  .comment.reply {
    margin-left: 14px;
  }
}

@media (max-width: 460px) {
  .header-actions .button span {
    display: none;
  }

  .brand span:last-child {
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tool-row {
    width: 100%;
  }

  .tool-row .button,
  .tool-row .select-like {
    flex: 1 1 auto;
  }
}
