:root {
  color-scheme: light;
  --bg: #f7f3ea;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #1f2421;
  --muted: #6d746e;
  --line: #ded6c6;
  --accent: #0f6b5e;
  --accent-strong: #0a5148;
  --warm: #c85f3d;
  --shadow: 0 18px 50px rgba(50, 42, 31, 0.11);
  --radius: 8px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151715;
  --surface: #20231f;
  --surface-strong: #282c27;
  --ink: #f4f0e8;
  --muted: #b8b6ad;
  --line: #3b4038;
  --accent: #63c2af;
  --accent-strong: #8bd7c7;
  --warm: #ef956f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui,
    sans-serif;
  line-height: 1.65;
}

body.is-locked {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 44px;
  gap: 22px;
  align-items: center;
  min-height: 72px;
  padding: 0 clamp(18px, 4vw, 54px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 0.75rem;
}

.top-nav {
  display: flex;
  gap: clamp(12px, 2vw, 30px);
  color: var(--muted);
  font-size: 0.95rem;
}

.top-nav a:hover {
  color: var(--ink);
}

.icon-button,
.dialog-close {
  display: grid;
  place-items: center;
  width: 44px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover,
.dialog-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  position: relative;
  display: grid;
  min-height: min(660px, calc(100vh - 72px));
  margin-bottom: 28px;
  overflow: hidden;
  border-radius: 0 0 var(--radius) var(--radius);
  background: #111;
  isolation: isolate;
}

.hero-media,
.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-media img {
  object-fit: cover;
}

.hero::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(90deg, rgba(10, 17, 14, 0.76), rgba(10, 17, 14, 0.26) 56%, rgba(10, 17, 14, 0.08)),
    linear-gradient(0deg, rgba(10, 17, 14, 0.48), transparent 46%);
}

.hero-content {
  position: relative;
  z-index: 2;
  align-self: end;
  max-width: 720px;
  padding: clamp(34px, 7vw, 84px);
  color: #fffaf0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f5b28f;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-content p:not(.eyebrow) {
  max-width: 610px;
  margin: 22px 0 0;
  color: rgba(255, 250, 240, 0.86);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-action,
.secondary-action,
.newsletter button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-weight: 800;
}

.primary-action,
.newsletter button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.secondary-action {
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #fffaf0;
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 380px) 1fr;
  gap: 16px;
  align-items: end;
  padding: 18px 0 30px;
}

.search-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.search-field input,
.newsletter input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  padding: 0 14px;
}

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

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  padding: 0 15px;
}

.filter-tab.is-active,
.filter-tab:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  align-items: start;
  padding-bottom: 54px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-heading.compact {
  display: block;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1.15;
}

.compact h2 {
  font-size: 1.1rem;
}

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

.post-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.post-card.featured {
  grid-column: 1 / -1;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1fr);
}

.post-image {
  min-height: 230px;
  background: var(--line);
}

.post-card.featured .post-image {
  min-height: 360px;
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-body {
  display: flex;
  flex-direction: column;
  min-height: 252px;
  padding: 22px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.post-tag {
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-strong);
  padding: 2px 9px;
  font-weight: 800;
}

.post-card h3 {
  margin: 14px 0 10px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(1.35rem, 2.8vw, 2.1rem);
  line-height: 1.12;
}

.post-card:not(.featured) h3 {
  font-size: 1.35rem;
}

.post-card p {
  margin: 0;
  color: var(--muted);
}

.read-more {
  align-self: flex-start;
  margin-top: auto;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 900;
  padding: 22px 0 0;
}

.read-more:hover {
  color: var(--warm);
}

.sidebar {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 18px;
}

.profile,
.series,
.newsletter {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.profile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  object-fit: cover;
}

.profile h2 {
  margin: 16px 0 6px;
  font-size: 1.25rem;
}

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

.series a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.series strong {
  color: var(--accent-strong);
  white-space: nowrap;
}

.newsletter form {
  display: grid;
  gap: 10px;
}

.newsletter label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.newsletter button {
  width: 100%;
  cursor: pointer;
}

.form-note,
.empty-state {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.post-dialog {
  width: min(820px, calc(100% - 30px));
  max-height: min(86vh, 860px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 0;
}

.post-dialog::backdrop {
  background: rgba(10, 12, 10, 0.58);
  backdrop-filter: blur(8px);
}

.dialog-close {
  position: sticky;
  top: 14px;
  float: right;
  margin: 14px 14px 0 0;
  z-index: 2;
}

.dialog-hero {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.dialog-body {
  padding: clamp(24px, 5vw, 48px);
}

.dialog-body h2 {
  margin: 8px 0 12px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.02;
}

.dialog-body p {
  color: var(--muted);
}

.dialog-body .article-copy {
  color: var(--ink);
  font-size: 1.05rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 1fr 44px;
  }

  .top-nav {
    display: none;
  }

  .hero {
    min-height: 620px;
  }

  .controls,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .filter-tabs {
    justify-content: flex-start;
  }

  .sidebar {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  main,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    min-height: 580px;
  }

  .hero-content {
    padding: 28px;
  }

  h1 {
    font-size: clamp(3rem, 16vw, 4.9rem);
  }

  .post-grid,
  .post-card.featured,
  .sidebar {
    grid-template-columns: 1fr;
  }

  .post-card.featured .post-image,
  .post-image {
    min-height: 230px;
  }

  .post-body {
    min-height: 230px;
  }

  .site-footer {
    display: block;
  }
}

@media (max-width: 460px) {
  .site-header {
    min-height: 64px;
    padding: 0 12px;
  }

  .brand small {
    display: none;
  }

  .hero-content {
    padding: 24px;
  }

  .filter-tab {
    flex: 1 1 auto;
  }
}
