/* 基础重置：让盒模型更好理解 */
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  color: #243042;
  background: #f7f3ea;
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

p,
li,
blockquote,
h1,
h2,
h3 {
  overflow-wrap: break-word;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 252, 245, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #eadfcb;
}

.nav,
.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

nav {
  display: flex;
  gap: 18px;
  font-size: 15px;
}

nav.nav {
  min-height: auto;
  justify-content: flex-start;
}

.hero {
  padding: 90px 0 75px;
  background:
    radial-gradient(circle at 20% 20%, #fff1bd 0, transparent 30%),
    linear-gradient(135deg, #fffaf0, #e8f0ff);
  border-bottom: 1px solid #eadfcb;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #906b24;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(34px, 8vw, 72px);
  line-height: 1.1;
  letter-spacing: -1px;
}

.hero-text {
  max-width: 680px;
  margin: 24px 0;
  font-size: 18px;
  color: #526071;
}

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

.button {
  display: inline-block;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: #243042;
  color: white;
  font: inherit;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.button.ghost {
  background: transparent;
  color: #243042;
  border: 1px solid #243042;
}

.quick-search,
.search-box {
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid #eadfcb;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(36, 48, 66, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.quick-search:focus-within,
.search-box:focus-within {
  border-color: #d6b36a;
  box-shadow: 0 16px 34px rgba(36, 48, 66, 0.09), 0 0 0 4px rgba(214, 179, 106, 0.16);
}

.quick-search {
  display: flex;
  align-items: center;
  max-width: 620px;
  margin: 26px 0 18px;
  padding: 8px;
  gap: 8px;
}

.quick-search input,
.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #243042;
  font: inherit;
}

.quick-search input::placeholder,
.search-box input::placeholder {
  color: #8a94a6;
}

.quick-search input {
  padding: 8px 10px;
}

.quick-search button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  background: #243042;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.search-box {
  position: relative;
  display: grid;
  gap: 14px;
  margin: 28px 0;
  padding: 22px;
  overflow: hidden;
}

.search-box::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 12% 18%, rgba(255, 241, 189, 0.58), transparent 30%);
}

.search-box label,
.search-row {
  position: relative;
}

.search-box label {
  display: block;
  margin-bottom: 0;
  color: #243042;
  font-weight: 800;
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #eadfcb;
  border-radius: 999px;
  background: #fffdf7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-row:focus-within {
  border-color: #d6b36a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 3px rgba(214, 179, 106, 0.14);
}

.search-row input {
  padding: 8px 10px;
}

.search-row .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.search-results {
  display: grid;
  gap: 14px;
}

.search-result {
  padding: 22px;
  border: 1px solid #eadfcb;
  border-radius: 18px;
  background: #fffdf7;
  box-shadow: 0 10px 30px rgba(36, 48, 66, 0.04);
}

.search-result h2 {
  margin: 4px 0 8px;
}

.search-result p:last-child {
  margin-bottom: 0;
}

.section {
  padding: 56px 0;
}

.section h2,
.page-content h1,
.article h1 {
  margin-top: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 18px;
}

.card,
.poem-card,
.about-box,
.article,
.quote-box {
  min-width: 0;
  background: #fffdf7;
  border: 1px solid #eadfcb;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(36, 48, 66, 0.06);
}

.card {
  padding: 22px;
}

.card h3 {
  margin: 6px 0 10px;
}

.tag {
  display: inline-block;
  margin: 0 0 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f0e2c5;
  color: #73531c;
  font-size: 13px;
  font-weight: 700;
}

.tag.type-home,
.wiki-link.type-home,
.backlink-card.type-home {
  --link-accent: #7b5fef;
  --link-accent-soft: #ece8ff;
  --link-accent-border: #c9beff;
}

.tag.type-archive,
.wiki-link.type-archive,
.backlink-card.type-archive {
  --link-accent: #8a5d00;
  --link-accent-soft: #f9efd9;
  --link-accent-border: #e4c985;
}

.tag.type-page,
.wiki-link.type-page,
.backlink-card.type-page {
  --link-accent: #2f6f73;
  --link-accent-soft: #e2f2ed;
  --link-accent-border: #a7d7cc;
}

.tag.type-post,
.wiki-link.type-post,
.backlink-card.type-post {
  --link-accent: #9a4f6d;
  --link-accent-soft: #f7e4ec;
  --link-accent-border: #e5aac1;
}

.tag[class*="type-"] {
  background: var(--link-accent-soft);
  color: var(--link-accent);
}

.quote-box {
  margin-top: 20px;
  margin-bottom: 60px;
  padding: 30px;
  text-align: center;
}

blockquote {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
}

.page-content {
  max-width: 820px;
}

.lead {
  font-size: 18px;
  color: #526071;
}

.poem-card {
  margin: 24px 0;
  padding: 28px;
}

.poem-card h2 {
  margin: 0;
}

.author,
.meta,
.muted {
  color: #7a8699;
  font-size: 14px;
}

.poem-text {
  margin: 20px 0;
  padding-left: 18px;
  border-left: 4px solid #d6b36a;
  font-size: 19px;
}

.read-more {
  font-weight: 800;
  color: #8a5d00;
}

.article-layout {
  max-width: 820px;
  padding: 56px 0;
}

.article {
  padding: clamp(24px, 5vw, 48px);
}

.article h1 {
  font-size: clamp(32px, 6vw, 54px);
  line-height: 1.15;
}

.article h2 {
  margin-top: 34px;
}

.poem-highlight {
  margin: 28px 0;
  padding: 24px;
  background: #f9efd9;
  border-radius: 18px;
}

.wiki-link {
  color: var(--link-accent, #8a5d00);
  font-weight: 800;
  border-bottom: 2px solid var(--link-accent-border, #e4c985);
  background: linear-gradient(to top, var(--link-accent-soft, #f9efd9) 42%, transparent 42%);
}

.backlinks-section {
  margin-top: 36px;
  padding-top: 8px;
  border-top: 1px solid #eadfcb;
}

.backlinks-section h2 {
  margin-bottom: 4px;
}

.backlinks-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.backlink-card {
  --link-accent: #8a5d00;
  --link-accent-soft: #fffaf0;
  --link-accent-border: #e4c985;
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid #eadfcb;
  border-left: 4px solid var(--link-accent);
  border-radius: 16px;
  background: linear-gradient(90deg, var(--link-accent-soft), #fffdf7 56%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.backlink-card:hover {
  text-decoration: none;
  border-color: var(--link-accent-border);
  box-shadow: 0 12px 26px rgba(36, 48, 66, 0.08);
  transform: translateY(-1px);
}

.backlink-card span {
  color: var(--link-accent);
  font-size: 12px;
  font-weight: 800;
}

.backlink-card small {
  color: #7a8699;
  font-size: 13px;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #efe6d4;
}

.about-box {
  margin: 24px 0;
  padding: 26px;
}

.site-footer {
  padding: 32px 0;
  border-top: 1px solid #eadfcb;
  color: #7a8699;
  text-align: center;
}

/* 手机屏幕适配 */
@media (max-width: 720px) {
  .container {
    width: min(1080px, calc(100% - 28px));
  }

  .nav,
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
  }

  nav,
  nav.nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
  }

  nav a {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(36, 48, 66, 0.06);
  }

  .logo {
    font-size: 20px;
  }

  .hero {
    padding: 48px 0 44px;
  }

  .hero h1,
  .article h1 {
    letter-spacing: 0;
  }

  .hero-text,
  .lead {
    font-size: 16px;
  }

  .quick-search,
  .search-row,
  .hero-actions {
    flex-direction: column;
  }

  .button,
  .quick-search button {
    width: 100%;
    padding: 12px 16px;
  }

  .search-row {
    border-radius: 20px;
  }

  .search-row .button {
    width: 100%;
  }

  .section {
    padding: 40px 0;
  }

  .card,
  .poem-card,
  .about-box,
  .quote-box,
  .article {
    border-radius: 18px;
    padding: 20px;
  }

  .quote-box {
    margin-bottom: 40px;
  }

  blockquote {
    font-size: 22px;
  }

  .poem-text {
    padding-left: 14px;
    font-size: 17px;
  }

  .article-layout {
    padding: 36px 0;
  }

  .poem-highlight {
    padding: 18px;
  }
}

@media (max-width: 380px) {
  .container {
    width: min(1080px, calc(100% - 20px));
  }

  nav,
  nav.nav {
    gap: 6px;
  }

  nav a {
    padding: 5px 8px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .card,
  .poem-card,
  .about-box,
  .quote-box,
  .article {
    padding: 18px;
  }
}
