:root {
  --bg: #F1F3F4;
  --surface: #FFFFFF;
  --header: #D5E2E7;
  --border: #B6C7CE;
  --teal: #245B6B;
  --teal-dark: #1B4652;
  --ink: #292D30;
  --muted: #606C73;
  --gold: #C9A227;
  --red: #A33B2C;
  --green: #2F6B45;
  --shadow: 0 1px 0 rgba(41, 45, 48, 0.04);
  --max: 1240px;
  --read: 740px;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.55;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--teal-dark); }
a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

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

.shell {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand img {
  width: min(260px, 58vw);
  height: auto;
  background: #000;
}
.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav {
  display: none;
  align-items: center;
  gap: 0.15rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.35rem 0.15rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--teal);
  border-bottom-color: var(--teal);
}
.nav .forum-label {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--teal-dark);
  background: var(--header);
  border: 1px solid var(--border);
  vertical-align: 0.1em;
}
.icon-btn,
.menu-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  width: 2.5rem;
  height: 2.5rem;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover,
.menu-btn:hover { background: var(--header); }
.icon-btn svg,
.menu-btn svg { width: 1.15rem; height: 1.15rem; }

.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 0.75rem 0 1rem;
}
.mobile-nav.is-open { display: block; }
.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mobile-nav a {
  display: block;
  padding: 0.7rem 0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.mobile-search {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.mobile-search input,
.side-search input,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  padding: 0.65rem 0.75rem;
  font: inherit;
}
.mobile-search button,
.btn {
  appearance: none;
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0.65rem 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn-ghost {
  background: var(--surface);
  color: var(--teal);
}
.btn-ghost:hover {
  background: var(--header);
  color: var(--teal-dark);
}

@media (min-width: 960px) {
  .nav { display: flex; }
  .menu-btn { display: none; }
  .brand img { width: 280px; }
}

/* Banner */
.hero-banner {
  position: relative;
  min-height: 180px;
  max-height: 280px;
  height: clamp(180px, 28vw, 260px);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #9aabb3;
}
.hero-banner picture,
.hero-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}
.hero-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(241, 243, 244, 0.88) 0%, rgba(241, 243, 244, 0.72) 38%, rgba(241, 243, 244, 0.18) 68%, rgba(241, 243, 244, 0.05) 100%);
}
.hero-copy {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.25rem 0;
  max-width: 34rem;
}
.hero-copy h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.55rem, 3.4vw, 2.25rem);
}
.hero-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 32rem;
}

/* Forum notice */
.forum-strip {
  background: var(--header);
  border-bottom: 1px solid var(--border);
}
.forum-strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  padding: 0.95rem 0;
}
.forum-strip-copy {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  min-width: min(100%, 36rem);
}
.forum-icon {
  flex: 0 0 auto;
  color: var(--teal);
  margin-top: 0.15rem;
}
.forum-strip h2 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
}
.forum-strip p {
  margin: 0;
  color: var(--muted);
  max-width: 46rem;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid #D6C49A;
  background: #E8D9B8;
  color: var(--teal-dark);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}
.status-pill::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--gold);
}

/* Layout */
.page-main {
  padding: 1.35rem 0 2.5rem;
}
.editorial {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 960px) {
  .editorial {
    grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 0.75fr);
    gap: 1.5rem;
    align-items: start;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 4px;
  overflow: hidden;
}
.panel-title {
  margin: 0;
  padding: 0.55rem 0.85rem;
  background: var(--header);
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
}
.panel-body { padding: 0.85rem; }
.panel-share .panel-title { background: #E8EEF0; }

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
}
.btn.icon-search {
  width: 2.6rem;
  padding: 0;
}
.btn.icon-search svg { width: 1.1rem; height: 1.1rem; }
.btn-soft {
  background: #E8D9B8;
  border-color: #D6C49A;
  color: var(--teal-dark);
}
.btn-soft:hover {
  background: #DFD0A8;
  border-color: #C9B58A;
  color: var(--teal-dark);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.85rem;
  padding: 0.45rem 0.7rem;
  background: var(--header);
  border: 1px solid var(--border);
}
.section-head h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.05rem;
}

.cat {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--teal);
  text-decoration: none;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.meta time { font-variant-numeric: tabular-nums; }

/* Featured */
.featured {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.featured .frame {
  aspect-ratio: 21 / 9;
  border-bottom: 1px solid var(--border);
}
.featured-body { padding: 1rem 1.1rem 1.25rem; }
.featured h2 {
  margin: 0.35rem 0 0.5rem;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
}
.featured h2 a {
  color: inherit;
  text-decoration: none;
}
.featured h2 a:hover { color: var(--teal); }
.featured .lede {
  margin: 0 0 0.85rem;
  color: var(--muted);
  max-width: 48rem;
}
.more-link {
  font-weight: 700;
  text-decoration: none;
}
.more-link::after { content: " →"; }

/* Article grid */
.story-grid {
  display: grid;
  gap: 0.9rem;
}
@media (min-width: 700px) {
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .editorial .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.story-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.story-card .frame {
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--border);
}
.story-card-body {
  padding: 0.8rem 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}
.story-card h3 {
  margin: 0;
  font-size: 1.08rem;
}
.story-card h3 a {
  color: inherit;
  text-decoration: none;
}
.story-card h3 a:hover { color: var(--teal); }
.story-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.card-more { margin-top: auto !important; padding-top: 0.35rem; }
.grid-foot {
  margin-top: 0.9rem;
  text-align: right;
}

/* Sidebar */
.sidebar {
  display: grid;
  gap: 0.9rem;
}
.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.side-list li {
  border-bottom: 1px solid var(--border);
}
.side-list li:last-child { border-bottom: 0; }
.side-list a {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}
.side-list a:hover { color: var(--teal); }
.side-list .count {
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.side-search {
  display: grid;
  gap: 0.5rem;
}
.side-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.year-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.year-cloud a {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg);
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
}
.year-cloud a:hover {
  background: var(--header);
  color: var(--teal);
}

/* History + contribute */
.history-block,
.contribute-block {
  margin-top: 1.5rem;
}
.history-intro,
.page-intro {
  margin: 0.35rem 0 1rem;
  color: var(--muted);
  max-width: 42rem;
}
.history-grid {
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 800px) {
  .history-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  min-width: 0;
}
.history-card .frame {
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid var(--border);
}
.history-card-body { padding: 0.8rem 0.85rem 1rem; }
.history-card .period {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.03em;
}
.history-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}
.history-card h3 a {
  color: inherit;
  text-decoration: none;
}
.history-card h3 a:hover { color: var(--teal); }
.history-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.contribute {
  display: grid;
  gap: 0;
  background: #EFE6D6;
  border: 1px solid #D7CBB5;
  overflow: hidden;
  border-radius: 4px;
}
@media (min-width: 860px) {
  .contribute { grid-template-columns: 1.05fr 1fr; }
}
.contribute-visual {
  min-height: 220px;
  background:
    linear-gradient(135deg, rgba(36, 91, 107, 0.12), rgba(239, 230, 214, 0.55)),
    url("/images/banner.webp") center/cover no-repeat;
  border-bottom: 1px solid #D7CBB5;
}
@media (min-width: 860px) {
  .contribute-visual { border-bottom: 0; border-right: 1px solid #D7CBB5; min-height: 100%; }
}
.contribute-copy { padding: 1.35rem 1.25rem 1.5rem; }
.contribute-copy h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}
.contribute-copy p {
  margin: 0 0 1rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  background: #1F3036;
  color: #D7E0E4;
  border-top: 1px solid #163037;
  margin-top: 1.5rem;
}
.footer-grid {
  display: grid;
  gap: 1.25rem;
  padding: 1.7rem 0 1.2rem;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 1.35fr 0.9fr 0.9fr 0.9fr; }
}
.footer-brand img { width: 180px; margin-bottom: 0.6rem; }
.footer-brand p,
.footer-note {
  margin: 0;
  color: #A9B7BD;
  font-size: 0.95rem;
}
.footer-col h3 {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: #F1F3F4;
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-col a {
  display: inline-block;
  padding: 0.2rem 0;
  text-decoration: none;
  color: #D7E0E4;
  font-weight: 600;
}
.footer-col a:hover { color: #fff; }
.footer-col .forum-label {
  background: #31464D;
  border-color: #3E575F;
  color: #E8D9B8;
}
.footer-bottom {
  border-top: 1px solid #31464D;
  padding: 0.85rem 0 1.35rem;
  display: grid;
  gap: 0.35rem;
  color: #A9B7BD;
  font-size: 0.88rem;
}
.footer-bottom a { color: #A9B7BD; }

/* Article page */
.page-banner {
  height: 110px;
  background:
    linear-gradient(90deg, rgba(241, 243, 244, 0.9), rgba(241, 243, 244, 0.35)),
    url("/images/banner.webp") center/cover no-repeat;
  border-bottom: 1px solid var(--border);
}
.crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.crumb a { text-decoration: none; font-weight: 600; }
.article-shell {
  width: min(100% - 2rem, var(--read));
  margin: 1.25rem auto 2.5rem;
}
.article-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.15rem 1.1rem 1.5rem;
}
@media (min-width: 700px) {
  .article-surface { padding: 1.5rem 1.75rem 2rem; }
}
.article-surface h1 {
  margin: 0.35rem 0 0.55rem;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}
.article-lede {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 1.12rem;
}
.event-label {
  display: inline-block;
  margin: 0.35rem 0 0.15rem;
  padding: 0.2rem 0.5rem;
  background: var(--header);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-dark);
}
.lead-figure {
  margin: 1rem 0 1.15rem;
}
.lead-figure .frame { aspect-ratio: 16 / 9; border: 1px solid var(--border); }
.lead-figure figcaption {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.prose {
  font-size: 1.125rem;
  line-height: 1.7;
}
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1rem; }
.prose h2 {
  font-size: 1.4rem;
  margin: 1.6rem 0 0.5rem;
}
.prose h3 {
  font-size: 1.15rem;
  margin: 1.25rem 0 0.4rem;
  font-family: var(--sans);
}
.prose blockquote {
  margin: 1rem 0;
  padding: 0.35rem 0 0.35rem 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}
.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.55rem;
  text-align: left;
}
.prose th { background: var(--header); }
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.25rem 0 0;
}
.tag-row a,
.tag-row span {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}
.author-box,
.related-box,
.forum-link-box {
  margin-top: 1.1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.author-box h2,
.related-box h2,
.forum-link-box h2 {
  margin: 0 0 0.4rem;
  font-family: var(--sans);
  font-size: 1rem;
}
.related-box ul {
  margin: 0;
  padding-left: 1.1rem;
}
.related-box li { margin: 0.25rem 0; }

/* Generic pages */
.page-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.15rem 1.1rem 1.4rem;
}
@media (min-width: 700px) {
  .page-surface { padding: 1.35rem 1.5rem 1.6rem; }
}
.page-surface h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.55rem, 2.8vw, 2.1rem);
}
.update-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}
.update-list li {
  border-top: 1px solid var(--border);
  padding: 0.85rem 0;
}
.update-list h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-family: var(--sans);
}
.update-list p { margin: 0; color: var(--muted); }
.field {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.9rem;
}
.field label { font-weight: 700; font-size: 0.95rem; }
.field .hint { color: var(--muted); font-size: 0.88rem; font-weight: 400; }
.field textarea { min-height: 9rem; resize: vertical; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.notice {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  background: var(--header);
}
.notice-ok {
  border-color: #9bb8a5;
  background: #e8f2eb;
}
.notice-err {
  border-color: #c9a0a0;
  background: #f8ecec;
}
.empty {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 959px) {
  .shell { width: min(100% - 1.25rem, var(--max)); }
  .hero-banner { height: 170px; }
  .hero-banner::after {
    background: linear-gradient(180deg, rgba(241, 243, 244, 0.78), rgba(241, 243, 244, 0.55) 55%, rgba(241, 243, 244, 0.2));
  }
}
