:root {
  --ink: #2a1f17;
  --ink-soft: #5c4636;
  --muted: #8a7360;
  --paper: #fff8f2;
  --surface: #ffffff;
  --line: #f0ddd0;
  --orange: #e67a2e;
  --orange-deep: #c45a14;
  --orange-soft: #fff0e4;
  --sand: #ffc98a;
  --sand-deep: #e89a3c;
  --shadow: 0 12px 40px rgba(42, 31, 23, 0.08);
  --radius: 14px;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #ffe3c8 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 20%, #ffd9b0 0%, transparent 50%),
    linear-gradient(180deg, #fff4ea 0%, var(--paper) 40%, #ffefe3 100%);
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(255, 248, 242, 0.88);
  border-bottom: 1px solid rgba(240, 221, 208, 0.9);
}

.header-inner,
.section-inner,
.footer-inner {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 64px;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: #fff;
  white-space: nowrap;
  background: var(--orange);
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  line-height: 1.2;
  transition: background 0.2s ease, transform 0.2s ease;
}

.logo:hover {
  background: var(--orange-deep);
  transform: translateY(-1px);
}

.nav {
  display: flex;
  gap: 1.1rem;
  margin-left: auto;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.nav a:hover {
  color: var(--orange);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--orange);
  color: #fff;
}

.btn-primary:hover {
  background: var(--orange-deep);
}

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-ghost {
  background: var(--orange-soft);
  color: var(--orange-deep);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-ghost:hover {
  background: #ffe2c8;
}

/* Hero */
.hero {
  position: relative;
  min-height: min(88vh, 720px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(92, 38, 8, 0.82) 0%, rgba(196, 90, 20, 0.58) 42%, rgba(42, 31, 23, 0.35) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 900'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop stop-color='%23e67a2e'/%3E%3Cstop offset='1' stop-color='%23ffc98a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='1600' height='900' fill='%237a3410'/%3E%3Cpath d='M0 620Q220 520 420 580T820 540T1200 600T1600 520V900H0Z' fill='%23b85a18' opacity='.85'/%3E%3Cpath d='M0 700Q260 620 480 680T900 640T1300 700T1600 640V900H0Z' fill='%23d97a2e' opacity='.7'/%3E%3Ccircle cx='1180' cy='220' r='120' fill='url(%23g)' opacity='.35'/%3E%3Ccircle cx='1280' cy='280' r='70' fill='%23ffc98a' opacity='.25'/%3E%3Cg fill='none' stroke='%23ffc98a' stroke-opacity='.22' stroke-width='2'%3E%3Cpath d='M80 180h140M80 200h90M980 120h180M980 140h110'/%3E%3C/g%3E%3C/svg%3E")
      center / cover no-repeat;
  transform: scale(1.02);
  animation: heroDrift 18s ease-in-out infinite alternate;
}

@keyframes heroDrift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.06) translate3d(-1.2%, 1%, 0); }
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 7rem 0 4.5rem;
  animation: riseIn 0.9s ease both;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.hero h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-lead {
  margin: 0 0 1.6rem;
  max-width: 34rem;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Sections */
.categories,
.posts,
.about {
  padding: 3.5rem 0;
}

.categories h2,
.posts h2,
.about h2 {
  margin: 0 0 0.4rem;
  font-size: 1.65rem;
}

.section-desc,
.result-meta {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.chip:hover {
  border-color: var(--orange);
  color: var(--orange-deep);
  transform: translateY(-1px);
}

.chip.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.posts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.search-wrap input {
  width: min(100%, 280px);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 0.7rem 1rem;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-wrap input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(230, 122, 46, 0.18);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}

.post-card {
  appearance: none;
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  animation: cardIn 0.45s ease both;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: #f0c5a0;
  box-shadow: 0 18px 44px rgba(26, 43, 46, 0.12);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.tag-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.author-mini {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.75rem;
  background: var(--orange-soft);
  color: var(--orange-deep);
}

.tag.urgent {
  background: #fde8e1;
  color: #a8432c;
}

.post-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.08rem;
  line-height: 1.35;
}

.excerpt {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.about-inner {
  max-width: 42rem;
}

.about p {
  margin: 0;
  color: var(--ink-soft);
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(230, 122, 46, 0.08), transparent 40%),
    #fff1e6;
  padding: 2.4rem 0 2rem;
  text-align: center;
}

.footer-brand {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--orange-deep);
  letter-spacing: 0.04em;
}

.footer-copy,
.footer-note {
  margin: 0.25rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-icp {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.92rem;
}

.footer-icp a {
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
}

.footer-icp a:hover {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

/* Dialog */
.post-dialog {
  border: none;
  padding: 0;
  max-width: min(92vw, 560px);
  background: transparent;
}

.post-dialog::backdrop {
  background: rgba(18, 32, 34, 0.55);
  backdrop-filter: blur(3px);
}

.dialog-panel {
  position: relative;
  margin: 0;
  background: var(--surface);
  border-radius: 18px;
  padding: 1.6rem 1.5rem 1.4rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
}

.dialog-close {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--orange-deep);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover {
  background: #ffe2c8;
}

#dialogBody h3 {
  margin: 0 0 0.75rem;
  padding-right: 2rem;
  font-size: 1.25rem;
}

.dialog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.dialog-body {
  color: var(--ink-soft);
  white-space: pre-wrap;
  margin: 0 0 1rem;
}

.dialog-meta {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .logo {
    font-size: 0.95rem;
    padding: 0.4rem 0.85rem;
  }

  .nav {
    display: none;
  }

  .hero {
    min-height: 78vh;
  }

  .hero-content {
    padding: 5.5rem 0 3.2rem;
  }

  .brand {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .posts-toolbar {
    align-items: stretch;
  }

  .search-wrap input {
    width: 100%;
  }
}
