:root {
  --bg: #f8f7f2;
  --surface: #ffffff;
  --surface-soft: #eef4f1;
  --ink: #20242c;
  --muted: #68707b;
  --line: #dfe4df;
  --accent: #137c6b;
  --accent-strong: #0b5f55;
  --warm: #cf6145;
  --gold: #a87622;
  --blue: #3e5fbf;
  --shadow: 0 18px 45px rgba(35, 38, 45, 0.12);
  --radius: 8px;
  --max: 1160px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", serif;
}

:root[data-theme="dark"] {
  --bg: #15171b;
  --surface: #20242a;
  --surface-soft: #26332f;
  --ink: #f3f1ea;
  --muted: #a8b0b9;
  --line: #343a42;
  --accent: #48b8a7;
  --accent-strong: #75d3c2;
  --warm: #e1876f;
  --gold: #d2a352;
  --blue: #8ea5ff;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 55%, transparent), transparent 360px),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
}

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

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

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

button,
input,
textarea {
  font: inherit;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
}

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

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

.site-header-inner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 20px;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 24px;
}

.site-branding {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.custom-logo-link {
  flex: 0 0 auto;
}

.custom-logo {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
}

.brand-copy {
  min-width: 0;
}

.site-title {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.2;
}

.site-description {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.main-navigation ul {
  display: flex;
  gap: 6px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  display: block;
  padding: 8px 11px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.2;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  background: var(--surface);
  color: var(--ink);
}

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

.search-toggle,
.theme-toggle,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.search-toggle span {
  padding: 0 2px;
  font-size: 0.9rem;
}

.theme-toggle-mark {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 0 50%, transparent 50%);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span:not(.screen-reader-text) {
  width: 18px;
  height: 2px;
  background: currentColor;
}

.site-search {
  border-top: 1px solid var(--line);
}

.site-search-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
}

.search-form {
  display: flex;
  gap: 10px;
  width: 100%;
}

.search-form label {
  flex: 1;
}

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

.search-form button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
}

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

.button-primary:hover,
.search-form button:hover {
  background: var(--accent-strong);
  color: #fff;
}

.button-ghost,
.button-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.site-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px 72px;
}

.site-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 34px;
  align-items: end;
  min-height: min(680px, calc(100vh - 78px));
  padding: 82px 0 54px;
}

.hero-copy {
  max-width: 760px;
}

.hero-kicker,
.section-heading p,
.archive-header p,
.not-found p {
  margin: 0 0 10px;
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 10ch;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(3.3rem, 8vw, 7.5rem);
  line-height: 0.95;
}

.hero-intro {
  max-width: 620px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 1.12rem;
}

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

.hero-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.live-clock {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.live-clock span,
.hero-stats span {
  color: var(--muted);
  font-size: 0.86rem;
}

.live-clock strong {
  color: var(--accent);
  font-size: 2.2rem;
  line-height: 1;
}

.hero-stats {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.hero-stats div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.hero-stats strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.hero-panel p {
  margin: 18px 0;
  color: var(--muted);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-links a {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.86rem;
}

.social-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.topic-strip,
.content-section,
.related-posts {
  padding: 50px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2,
.archive-header h1,
.single-title,
.not-found h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.06;
}

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

.section-link {
  color: var(--accent);
  font-weight: 700;
}

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

.topic-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.topic-list span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.topic-list small {
  min-width: 28px;
  color: var(--gold);
  text-align: right;
}

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

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

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

.post-list .post-card {
  grid-template-columns: 260px minmax(0, 1fr);
}

.post-thumb {
  display: block;
  min-height: 210px;
  overflow: hidden;
  background: var(--surface-soft);
}

.post-list .post-thumb {
  min-height: 100%;
}

.post-thumb img {
  width: 100%;
  height: 100%;
  min-height: 210px;
  object-fit: cover;
  transition: transform 220ms ease;
}

.post-card:hover .post-thumb img {
  transform: scale(1.035);
}

.post-thumb-placeholder {
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--accent) 35%, var(--ink));
}

.post-thumb-placeholder span {
  font-family: var(--font-serif);
  font-size: 4rem;
  line-height: 1;
}

.post-card-body {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 20px;
}

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

.entry-category {
  color: var(--blue);
  font-weight: 750;
}

.entry-title {
  margin: 0;
  color: var(--ink);
  font-size: 1.28rem;
  line-height: 1.28;
}

.entry-title a {
  overflow-wrap: anywhere;
}

.entry-summary {
  color: var(--muted);
}

.entry-summary p {
  margin: 0;
}

.read-more {
  width: fit-content;
  color: var(--accent);
  font-weight: 750;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.button[disabled] {
  cursor: default;
  opacity: 0.65;
}

.archive-layout {
  padding-top: 58px;
}

.archive-header {
  max-width: 780px;
  margin-bottom: 34px;
}

.archive-description {
  margin-top: 14px;
  color: var(--muted);
}

.content-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.widget-area {
  display: grid;
  gap: 16px;
}

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

.widget-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.widget ul {
  margin: 0;
  padding-left: 18px;
}

.widget li + li {
  margin-top: 8px;
}

.single-layout {
  max-width: 920px;
  padding-top: 62px;
}

.single-article {
  padding-bottom: 38px;
}

.single-header {
  margin-bottom: 28px;
}

.single-header .entry-meta {
  margin-bottom: 14px;
}

.single-featured-image {
  margin: 0 0 32px;
  overflow: hidden;
  border-radius: var(--radius);
}

.single-featured-image img {
  width: 100%;
}

.entry-content {
  color: color-mix(in srgb, var(--ink) 92%, var(--muted));
  font-size: 1.06rem;
}

.entry-content > * {
  margin-top: 0;
  margin-bottom: 1.25em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 2em;
  color: var(--ink);
  line-height: 1.2;
}

.entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.entry-content blockquote {
  margin-left: 0;
  padding: 4px 0 4px 18px;
  border-left: 4px solid var(--warm);
  color: var(--muted);
}

.entry-content pre {
  overflow-x: auto;
  padding: 18px;
  border-radius: var(--radius);
  background: #10151a;
  color: #eef6f3;
}

.entry-content code {
  padding: 0.12em 0.3em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.entry-content pre code {
  padding: 0;
  background: transparent;
}

.tag-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.tag-links a {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.86rem;
}

.post-navigation {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.nav-previous,
.nav-next {
  min-width: 0;
}

.nav-next {
  text-align: right;
}

.nav-subtitle {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.nav-title {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 750;
}

.comments-area,
.not-found,
.empty-state {
  margin-top: 34px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.comment-list {
  padding-left: 24px;
}

.comment-list .children {
  margin-top: 14px;
}

.comment-body {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.comment-form input:not([type="submit"]),
.comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
}

.form-submit .submit {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 750;
}

.not-found-search {
  margin: 20px 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 28px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 42px 24px;
}

.footer-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
}

.footer-brand p:not(.footer-title),
.site-credit {
  color: var(--muted);
}

.footer-widgets {
  display: grid;
  gap: 16px;
}

.footer-navigation {
  grid-column: 1 / -1;
}

.footer-navigation ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-credit {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.9rem;
}

.pagination,
.comments-pagination {
  margin-top: 26px;
}

.nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  margin-right: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.nav-links .current {
  background: var(--accent);
  color: #fff;
}

@media (max-width: 980px) {
  .site-header-inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .main-navigation {
    display: none;
    grid-column: 1 / -1;
  }

  .main-navigation.is-open {
    display: block;
  }

  .main-navigation ul {
    display: grid;
    gap: 4px;
    padding-top: 10px;
  }

  .site-hero,
  .content-with-sidebar,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .site-hero {
    min-height: auto;
    padding-top: 54px;
  }

  .hero-panel {
    max-width: 560px;
  }

  .topic-list,
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header-inner {
    gap: 10px;
    padding: 12px 16px;
  }

  .header-tools {
    gap: 6px;
  }

  .search-toggle {
    min-width: 48px;
    padding: 0 8px;
  }

  .site-main {
    padding-right: 16px;
    padding-left: 16px;
  }

  .site-search-inner {
    padding-right: 16px;
    padding-left: 16px;
  }

  .site-hero {
    padding: 42px 0 38px;
  }

  .hero-copy h1 {
    max-width: 12ch;
    font-size: clamp(2.8rem, 16vw, 4.6rem);
  }

  .hero-actions,
  .section-heading-row,
  .search-form {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .search-form button {
    width: 100%;
  }

  .topic-list,
  .post-grid,
  .post-list .post-card,
  .nav-links {
    grid-template-columns: 1fr;
  }

  .post-list .post-thumb {
    min-height: 210px;
  }

  .single-layout {
    padding-top: 42px;
  }

  .comments-area,
  .not-found,
  .empty-state {
    padding: 20px;
  }

  .footer-inner {
    padding-right: 16px;
    padding-left: 16px;
  }

  .nav-next {
    text-align: left;
  }
}
