:root {
  --ink: #25302b;
  --muted: #68736d;
  --paper: #f8f6f0;
  --surface: #fffefa;
  --line: #dedbd1;
  --accent: #b95738;
  --accent-dark: #8d3e28;
  --green: #315c4c;
  --shadow: 0 16px 42px rgba(48, 55, 50, .07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, .button { cursor: pointer; }
.container { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.container-narrow { width: min(760px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0, 0, 0, 0); overflow: hidden; }
.muted { color: var(--muted); }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(222, 219, 209, .8); background: rgba(248, 246, 240, .92); backdrop-filter: blur(14px); }
.nav-wrap { min-height: 72px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 11px; align-items: center; font-family: Georgia, "Songti SC", serif; font-size: 20px; font-weight: 700; letter-spacing: .05em; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; color: white; border-radius: 50% 50% 45% 55%; background: var(--accent); transform: rotate(-4deg); }
.site-header nav { display: flex; align-items: center; gap: 26px; color: #4c5752; }
.site-header nav a:hover, .link-button:hover { color: var(--accent); }
.inline-form { display: inline; margin: 0; }
.link-button, .danger-link { padding: 0; border: 0; color: inherit; background: none; }
.danger-link { color: #a83f38; }

.hero { overflow: hidden; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 82% 18%, rgba(185, 87, 56, .12), transparent 24%), linear-gradient(140deg, #f3eee2, #faf9f4); }
.hero-inner { padding: 86px 0 76px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 12px; font-weight: 750; letter-spacing: .18em; }
.hero h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(42px, 7vw, 72px); font-weight: 500; line-height: 1.16; letter-spacing: -.03em; }
.hero p:not(.eyebrow) { max-width: 560px; margin: 18px 0 30px; color: var(--muted); font-size: 18px; }
.search-form { display: flex; max-width: 600px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.search-form input { flex: 1; min-width: 0; padding: 11px 14px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-form button, .button { padding: 11px 20px; border: 1px solid var(--accent); border-radius: 9px; color: white; background: var(--accent); font-weight: 700; transition: .18s ease; }
.search-form button:hover, .button:hover { border-color: var(--accent-dark); background: var(--accent-dark); transform: translateY(-1px); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 64px; padding-block: 68px 90px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 24px; }
.section-heading h2, .side-card h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 30px; font-weight: 500; }
.result-count { color: var(--muted); font-size: 14px; }
.post-list { display: grid; gap: 18px; }
.post-card { padding: 28px 30px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: .2s ease; }
.post-card:hover { border-color: #c9bdb0; box-shadow: var(--shadow); transform: translateY(-2px); }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }
.post-meta a { color: var(--accent); font-weight: 700; }
.post-card h3 { margin: 9px 0 8px; font-family: Georgia, "Songti SC", serif; font-size: 27px; font-weight: 550; line-height: 1.35; }
.post-card h3 a:hover { color: var(--accent); }
.post-card > p { margin: 0; color: var(--muted); }
.card-footer { display: flex; gap: 20px; align-items: end; justify-content: space-between; margin-top: 20px; }
.tag-row, .tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 4px 9px; border-radius: 99px; color: var(--green); background: #edf2ed; font-size: 12px; }
.tag:hover, .tag.active { color: white; background: var(--green); }
.tag small { margin-left: 3px; opacity: .7; }
.read-more { flex: none; color: var(--accent); font-size: 14px; font-weight: 700; }
.sidebar { display: grid; align-content: start; gap: 22px; }
.side-card { padding: 23px; border-top: 2px solid var(--ink); background: rgba(255, 254, 250, .55); }
.side-card h2 { margin-bottom: 16px; font-size: 22px; }
.filter-list { display: grid; }
.filter-list a { display: flex; justify-content: space-between; padding: 9px 3px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.filter-list a:hover, .filter-list a.active { color: var(--accent); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 34px; color: var(--muted); font-size: 14px; }
.pagination a { color: var(--accent); font-weight: 700; }
.empty-state { padding: 62px 20px; border: 1px dashed #c7c1b5; border-radius: 16px; text-align: center; background: rgba(255,255,255,.35); }
.empty-state > span { color: var(--accent); font-family: Georgia, serif; font-size: 48px; }
.empty-state h1, .empty-state h3 { margin: 8px 0; font-family: Georgia, "Songti SC", serif; }
.empty-state p { margin: 0 0 22px; color: var(--muted); }
.empty-state.standalone { margin-block: 100px; }

.article { padding-block: 64px 100px; }
.back-link { display: inline-block; margin-bottom: 28px; color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--accent); }
.article-header { padding-bottom: 38px; border-bottom: 1px solid var(--line); }
.article-header h1 { margin: 15px 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(38px, 6vw, 58px); font-weight: 520; line-height: 1.2; }
.article-excerpt { margin: 0 0 20px; color: var(--muted); font-size: 19px; }
.prose { padding-top: 38px; font-family: Georgia, "Songti SC", serif; font-size: 18px; line-height: 1.9; }
.prose h1, .prose h2, .prose h3 { margin: 1.8em 0 .6em; line-height: 1.35; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose pre { overflow-x: auto; padding: 18px; border-radius: 10px; color: #ecefea; background: #26302c; }
.prose code { padding: .15em .35em; border-radius: 4px; background: #ebe7de; font-family: ui-monospace, Consolas, monospace; font-size: .88em; }
.prose pre code { padding: 0; background: transparent; }
.prose blockquote { margin-inline: 0; padding-left: 20px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose img { max-width: 100%; }

.flash { margin-top: 18px; padding: 12px 16px; border-radius: 9px; color: #27513e; background: #e2f1e8; }
.flash-error { color: #852f2a; background: #f7e4df; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.auth-shell { display: grid; min-height: calc(100vh - 150px); place-items: center; padding-block: 60px; }
.auth-panel { width: min(440px, 100%); padding: 36px; }
.auth-panel h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 38px; }
label { display: grid; gap: 7px; margin-top: 20px; font-size: 14px; font-weight: 700; }
input, textarea { width: 100%; padding: 11px 13px; border: 1px solid #cbc7bd; border-radius: 9px; outline: 0; color: var(--ink); background: white; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(185, 87, 56, .12); }
textarea { resize: vertical; }
.full-width { display: block; width: 100%; margin-top: 22px; text-align: center; }
.button-secondary { border-color: var(--line); color: var(--ink); background: transparent; }
.button-secondary:hover { border-color: #c7c1b5; color: var(--accent); background: #f3f0e8; }

.admin-shell, .editor-shell { padding-block: 56px 90px; }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.admin-heading.compact { margin-bottom: 18px; }
.admin-heading h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 42px; font-weight: 520; }
.admin-heading p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 18px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); background: #f3f0e8; font-size: 12px; letter-spacing: .06em; }
td small { display: block; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
.actions { text-align: right; white-space: nowrap; }
td.actions { display: table-cell; }
td.actions > * { margin-left: 12px; color: var(--accent); font-size: 13px; }
.status { padding: 4px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.status.published { color: #27513e; background: #e2f1e8; }
.status.draft { color: #685d46; background: #eee9dc; }
.empty-cell { padding: 50px; text-align: center; color: var(--muted); }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.editor-main, .editor-sidebar { padding: 28px; }
.editor-main label:first-child, .editor-sidebar label:first-child { margin-top: 0; }
.content-editor { min-height: 470px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; line-height: 1.7; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.checkbox-label { grid-template-columns: auto 1fr; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.checkbox-label input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }
.checkbox-label span { display: grid; }
.checkbox-label small { color: var(--muted); font-weight: 400; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-inner { display: grid; justify-items: center; gap: 10px; padding-block: 28px; text-align: center; }
.footer-inner > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; align-items: center; }
.footer-inner strong { color: var(--ink); }
.filing-links { justify-content: center; }
.filing-links a:hover { color: var(--accent); }

.about-page { padding-block: 72px 100px; }
.about-page h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(40px, 6vw, 58px); font-weight: 520; }
.about-lead { margin: 18px 0 36px; color: var(--muted); font-size: 19px; }
.about-card { margin-bottom: 30px; padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.about-card h2 { margin: 0 0 12px; font-family: Georgia, "Songti SC", serif; font-size: 26px; font-weight: 520; }
.about-card p { margin: 0 0 24px; color: var(--muted); }
.site-facts { display: grid; margin: 0; }
.site-facts div { display: grid; grid-template-columns: 100px 1fr; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); }
.site-facts dt { color: var(--muted); }
.site-facts dd { margin: 0; font-weight: 700; }

@media (max-width: 820px) {
  .content-grid, .editor-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { padding-block: 62px; }
  .admin-heading { align-items: start; }
}

@media (max-width: 560px) {
  .container, .container-narrow { width: min(100% - 24px, 1120px); }
  .site-header nav { gap: 14px; }
  .hero h1 { font-size: 42px; }
  .content-grid { gap: 40px; padding-block: 46px 70px; }
  .sidebar { grid-template-columns: 1fr; }
  .post-card { padding: 22px; }
  .card-footer, .admin-heading { display: grid; }
  .admin-heading .button { text-align: center; }
  .article { padding-block: 40px 70px; }
  .article-header h1 { font-size: 38px; }
  .table-wrap { border-radius: 10px; }
  .editor-main, .editor-sidebar, .auth-panel { padding: 22px; }
  .about-page { padding-block: 46px 70px; }
  .about-card { padding: 22px; }
}

