:root {
  --bg: #f8f7f3;
  --surface: #fffefa;
  --text: #252521;
  --muted: #77766f;
  --line: #dfddd4;
  --soft: #efede5;
  --accent: #8a4e35;
  --max: 980px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.site-header, .site-main, .site-footer {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}
.site-header {
  display: grid;
  justify-items: center;
  gap: 0;
  padding: 46px 0 25px;
  border-bottom: 1px solid var(--line);
}
.brand { display: grid; justify-items: center; gap: 5px; text-align: center; text-decoration: none; }
.brand-mark { font-family: Georgia, "Songti SC", serif; font-size: 34px; letter-spacing: .08em; }
.brand-note { color: var(--muted); font-size: 12px; }
.site-nav { display: flex; justify-content: center; gap: 28px; margin-top: 34px; }
.site-nav a, .admin-link, .footer-links a, .footer-links button {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.site-nav a:hover, .site-nav a.active, .admin-link:hover, .footer-links a:hover, .footer-links button:hover { color: var(--accent); }
.admin-link { display: none; }

.site-main { min-height: calc(100vh - 160px); padding: 0 0 96px; }
.intro { max-width: 640px; margin: 0 auto 62px; padding: 62px 0 0; text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.intro h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(34px, 6vw, 62px); font-weight: 400; line-height: 1.18; letter-spacing: -.03em; }
.intro p { max-width: 540px; margin: 18px 0 0; color: var(--muted); font-size: 16px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 20px; }
.section-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 28px; font-weight: 400; }
.section-heading small { color: var(--muted); }
.section-heading a { color: var(--muted); font-size: 13px; text-decoration: none; }
.section-heading a:hover { color: var(--accent); }
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 24px; }
.subnav button, .tag, .type-label {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 3px 10px;
  font-size: 12px;
}
.subnav button.active, .subnav button:hover { border-color: var(--accent); color: var(--accent); }

.feed { display: grid; gap: 0; }
.post-card { padding: 24px 0 28px; border-top: 1px solid var(--line); }
.post-card:first-child { border-top: 0; padding-top: 0; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--muted); font-size: 12px; }
.post-title { display: inline-block; margin: 8px 0 7px; font-family: Georgia, "Songti SC", serif; font-size: 26px; font-weight: 400; line-height: 1.35; text-decoration: none; }
.post-title:hover { color: var(--accent); }
.post-card.short .post-title { font-family: inherit; font-size: 19px; font-weight: 500; }
.post-excerpt { max-width: 760px; margin: 0; color: #57564f; white-space: pre-line; }
.post-actions { display: flex; gap: 16px; margin-top: 12px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.text-button:hover { color: var(--accent); }
.media-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 18px; }
.media-card { min-height: 150px; overflow: hidden; position: relative; display: flex; align-items: end; padding: 14px; border-radius: 3px; background: linear-gradient(135deg, #d7c6b5, #9a725b 52%, #3b3934); color: #fff; }
.media-card:nth-child(2) { background: linear-gradient(135deg, #c4d0c5, #6d866e 50%, #27362a); }
.media-card:nth-child(3) { background: linear-gradient(135deg, #d7c8a8, #b2774c 50%, #493025); }
.media-card.video { min-height: 180px; background: linear-gradient(140deg, #242321, #5e5146); }
.media-card.video::before { content: "▶"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -58%); display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.7); border-radius: 50%; font-size: 17px; }
.media-card img, .media-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-card span { position: relative; z-index: 1; padding: 4px 8px; border-radius: 2px; background: rgba(0,0,0,.34); font-size: 12px; }

.resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.resource-card { padding: 18px; border: 1px solid var(--line); background: var(--surface); }
.resource-card h3 { margin: 0 0 4px; font-family: Georgia, "Songti SC", serif; font-size: 20px; font-weight: 400; }
.resource-card p { margin: 0; color: var(--muted); font-size: 14px; }
.resource-card a { display: inline-block; margin-top: 10px; color: var(--accent); font-size: 13px; }
.resource-pending { display: inline-block; margin-top: 14px; color: var(--muted); font-size: 12px; }

.detail { max-width: 760px; margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 36px; color: var(--muted); font-size: 13px; text-decoration: none; }
.back-link:hover { color: var(--accent); }
.detail h1 { margin: 0 0 12px; font-family: Georgia, "Songti SC", serif; font-size: clamp(32px, 5vw, 52px); font-weight: 400; line-height: 1.25; }
.detail-body { margin-top: 34px; font-family: Georgia, "Songti SC", serif; font-size: 18px; line-height: 2; }
.detail-body p { margin: 0 0 1.2em; }
.detail-body em { color: var(--accent); }
.detail-media { margin: 32px 0; }
.detail .media-card { min-height: 250px; }
.share-row { display: flex; flex-wrap: wrap; gap: 12px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.share-row button { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.share-row button:hover { color: var(--accent); }

.comments { margin-top: 54px; }
.comments h2 { margin: 0 0 18px; font-family: Georgia, "Songti SC", serif; font-size: 27px; font-weight: 400; }
.comment { padding: 16px 0; border-top: 1px solid var(--line); }
.comment[style] { margin-left: calc(var(--depth) * 22px); padding-left: 14px; border-left: 1px solid var(--line); }
.comment-head { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.comment-body { margin: 7px 0 0; white-space: pre-line; }
.comment-form { display: grid; gap: 10px; margin-top: 24px; }
.comment-form input, .comment-form textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: var(--text); }
.comment-form textarea { min-height: 110px; resize: vertical; }
.comment-form button, .primary-button { justify-self: start; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 2px; background: var(--accent); color: #fff; font-size: 13px; }
.comment-note { color: var(--muted); font-size: 12px; }
.empty { padding: 28px 0; color: var(--muted); border-top: 1px solid var(--line); }

.home-intro { margin-bottom: 0; }
.home-intro .eyebrow { margin-bottom: 0; }
.home-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 48px; align-items: start; }
.home-column { min-width: 0; }
.home-column + .home-column { padding-left: 32px; border-left: 1px solid var(--line); }
.home-column-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.home-column-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 30px; font-weight: 400; }
.home-column-heading a { color: var(--muted); font-size: 12px; text-decoration: none; white-space: nowrap; }
.home-column-heading a:hover { color: var(--accent); }
.home-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 30px; }
.home-card-grid .post-card { min-width: 0; }
.home-column.long .home-card-grid { display: block; }
.home-card .post-title { display: block; margin-top: 10px; font-size: 24px; line-height: 1.3; }
.home-card.short .post-title { font-size: 20px; font-weight: 600; }
.home-card .post-excerpt { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 5; font-size: 14px; line-height: 1.75; }
.home-card .media-strip { grid-template-columns: 1fr; }
.home-card .media-card { min-height: 128px; }
.home-card .post-actions { margin-top: 10px; }

.about { max-width: 660px; }
.about h1 { margin: 0 0 22px; font-family: Georgia, "Songti SC", serif; font-size: 42px; font-weight: 400; }
.about p { color: #57564f; }
.about blockquote { margin: 30px 0; padding-left: 18px; border-left: 2px solid var(--accent); color: var(--muted); }

.site-footer { display: flex; justify-content: space-between; gap: 18px; padding: 20px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer-links { display: flex; gap: 16px; }
.footer-links button { padding: 0; border: 0; background: transparent; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 10; transform: translateX(-50%); padding: 9px 14px; border-radius: 2px; background: var(--text); color: #fff; font-size: 13px; }
.toast[hidden] { display: none; }

.admin-main { max-width: 980px; margin: 0 auto; padding: 44px 0 80px; }
.admin-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.admin-head h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-weight: 400; }
.admin-tools { display: flex; align-items: center; gap: 12px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.admin-panel { padding: 22px; border: 1px solid var(--line); background: var(--surface); }
.admin-panel h2 { margin: 0 0 18px; font-family: Georgia, "Songti SC", serif; font-weight: 400; }
.admin-form { display: grid; gap: 11px; }
.admin-form label { color: var(--muted); font-size: 12px; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 2px; background: var(--bg); color: var(--text); }
.admin-form textarea { min-height: 150px; resize: vertical; }
.admin-form button { justify-self: start; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 2px; background: var(--accent); color: #fff; }
.admin-list { display: grid; gap: 0; }
.admin-item { padding: 13px 0; border-top: 1px solid var(--line); }
.admin-item:first-child { border-top: 0; }
.admin-item strong { display: block; font-weight: 500; }
.admin-item small { color: var(--muted); }
.admin-item p { margin: 6px 0 0; color: #57564f; font-size: 13px; white-space: pre-line; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.admin-actions button, .admin-outline { padding: 4px 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; }
.admin-actions button:hover, .admin-outline:hover { border-color: var(--accent); color: var(--accent); }
.admin-note { color: var(--muted); font-size: 12px; }

@media (max-width: 680px) {
  .site-header, .site-main, .site-footer { width: min(100% - 28px, var(--max)); }
  .site-header { padding: 34px 0 18px; }
  .brand-mark { font-size: 30px; }
  .site-nav { width: 100%; justify-content: space-between; gap: 10px; margin-top: 26px; }
  .site-nav a { font-size: 13px; }
  .site-main { padding: 42px 0 70px; }
  .intro { margin-bottom: 46px; padding-top: 0; }
  .intro h1 { font-size: 34px; }
  .post-title { font-size: 23px; }
  .resource-grid { grid-template-columns: 1fr; }
  .site-footer { align-items: flex-start; }
  .home-columns { display: block; }
  .home-column + .home-column { margin-top: 56px; padding: 48px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .home-card-grid { display: block; }
  .home-column-heading h2 { font-size: 27px; }
  .admin-main { width: calc(100% - 28px); padding-top: 30px; }
  .admin-head { align-items: flex-start; flex-direction: column; }
  .admin-tools { align-items: flex-start; flex-direction: column; }
  .admin-grid { grid-template-columns: 1fr; }
}
