/* 文枢古籍 · 首页 / 主题典藏 */
:root {
  --ink: #0c1614;
  --ink-soft: #243330;
  --muted: #5e6f6a;
  --paper: #f3efe6;
  --paper-2: #e8efe9;
  --jade: #0a4f43;
  --jade-deep: #062e28;
  --jade-glow: rgba(34, 120, 98, 0.35);
  --line: rgba(12, 22, 20, 0.12);
  --font: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --display: "Noto Serif SC", "Songti SC", "STSong", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.home {
  color: var(--ink);
  font-family: var(--font);
  background: var(--paper);
  overflow-x: hidden;
}

.wash {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 560px at 8% -10%, rgba(10, 79, 67, 0.22), transparent 58%),
    radial-gradient(900px 520px at 92% 8%, rgba(28, 48, 42, 0.18), transparent 55%),
    linear-gradient(165deg, #e7efe9 0%, #f3efe6 42%, #ebe4d6 100%);
  animation: washDrift 18s ease-in-out infinite alternate;
}
.wash-soft {
  background:
    radial-gradient(900px 480px at 12% -5%, rgba(10, 79, 67, 0.14), transparent 60%),
    linear-gradient(180deg, #eef3ee, #f3efe6 50%, #ebe6db);
  animation: none;
}
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes washDrift {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.04) translate3d(-1.5%, 1%, 0); }
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 4vw, 40px);
  backdrop-filter: blur(12px);
  background: rgba(243, 239, 230, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--jade-deep);
  text-decoration: none;
  letter-spacing: 0.06em;
}
.nav-logo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(6, 46, 40, 0.18);
  background: #0a4f43;
}
.nav-side {
  margin-left: auto;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--jade);
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.nav-side:hover {
  color: var(--jade-deep);
  border-bottom-color: rgba(10, 79, 67, 0.35);
}
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px, 6vh, 64px) clamp(18px, 4vw, 40px) clamp(40px, 8vh, 72px);
}
.hero-paths {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(28px, 5vh, 44px);
  padding-top: clamp(36px, 7vh, 72px);
  padding-bottom: clamp(36px, 7vh, 72px);
}
.hero-intro .brand-mark { margin-bottom: 10px; }
.brand-mark {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: 0.1em;
  color: var(--jade-deep);
}
.hero h1,
.page-hero h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: clamp(20px, 2.8vw, 30px);
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}
.hero-lead,
.page-lead {
  margin: 0;
  max-width: 32em;
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
}
.path-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.path-mod {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  padding: 32px 28px 28px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.82);
  border-radius: 20px;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.path-mod:hover {
  transform: translateY(-4px);
  border-color: rgba(10, 79, 67, 0.35);
  box-shadow: 0 18px 40px rgba(6, 46, 40, 0.12);
}
.path-mod-ask {
  background: linear-gradient(155deg, rgba(6, 46, 40, 0.96), rgba(10, 79, 67, 0.9));
  color: #eef7f3;
  border-color: transparent;
}
.path-mod-ask:hover {
  box-shadow: 0 20px 48px rgba(6, 46, 40, 0.32);
}
.path-kicker {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.path-mod-ask .path-kicker { color: rgba(238, 247, 243, 0.55); }
.path-mod strong {
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: 0.04em;
  font-weight: 700;
}
.path-desc {
  color: var(--muted);
  line-height: 1.7;
  flex: 1;
  font-size: 14.5px;
}
.path-mod-ask .path-desc { color: rgba(238, 247, 243, 0.78); }
.path-go {
  font-weight: 600;
  color: var(--jade);
  margin-top: 8px;
  letter-spacing: 0.02em;
}
.path-mod-ask .path-go { color: #d7f0e6; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--jade);
  color: #f4fffa;
}
.btn-primary:hover { background: var(--jade-deep); }
.btn-ghost {
  background: transparent;
  color: var(--jade-deep);
  border-color: rgba(10, 79, 67, 0.35);
}
.btn-ghost:hover {
  background: rgba(10, 79, 67, 0.08);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: riseIn .8s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: calc(var(--d, 0) * 1ms);
}
@keyframes riseIn {
  to { opacity: 1; transform: translateY(0); }
}

.themes-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px clamp(18px, 4vw, 40px) 56px;
}
.page-hero {
  margin-bottom: 22px;
}
.themes-cta h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 28px;
  color: var(--jade-deep);
  letter-spacing: 0.04em;
}
.themes-cta p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.theme-rail {
  border-top: 1px solid var(--line);
  background: rgba(247, 244, 236, 0.88);
}
.theme-rail-bar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px clamp(18px, 4vw, 40px);
  display: flex;
  align-items: center;
  gap: 18px;
}
.theme-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  flex: 1;
  min-width: 0;
}
.theme-chip {
  display: inline-block;
  text-decoration: none;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color .18s ease, background .18s ease;
}
.theme-chip:hover {
  color: var(--jade-deep);
  background: rgba(10, 79, 67, 0.08);
}
.theme-rail-more {
  flex-shrink: 0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--jade);
  letter-spacing: 0.06em;
}
.theme-rail-more:hover { color: var(--jade-deep); }

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 28px clamp(18px, 4vw, 40px) 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  max-width: 1180px;
  margin: 0 auto;
}
.site-foot .beian {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.site-foot .beian:hover { color: var(--jade); }

/* 主题页 */
.page-hero { padding-top: 28px; max-width: 1180px; margin: 0 auto; padding-left: clamp(18px, 4vw, 40px); padding-right: clamp(18px, 4vw, 40px); }
.themes-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}
.themes-stats b { color: var(--jade-deep); font-family: var(--display); font-size: 22px; font-weight: 700; margin-right: 6px; }
.themes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.theme-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 18px 18px;
  background: rgba(255, 252, 246, 0.78);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 190px;
}
.theme-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  color: var(--jade-deep);
  letter-spacing: 0.04em;
}
.theme-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
  flex: 1;
}
.theme-card .meta {
  font-size: 12px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 4px;
}
.themes-cta {
  margin-top: 40px;
  padding: 28px 24px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(6, 46, 40, 0.95), rgba(10, 79, 67, 0.88));
  color: #eef7f3;
}
.themes-cta h2 { color: #f4fffa; }
.themes-cta p { color: rgba(238, 247, 243, 0.78); margin-bottom: 16px; }
.themes-cta .btn-primary {
  background: #f4fffa;
  color: var(--jade-deep);
}

@media (max-width: 960px) {
  .themes-grid { grid-template-columns: 1fr; }
  .path-grid { grid-template-columns: 1fr; }
  .hero-paths { min-height: auto; }
  .path-mod { min-height: 220px; }
  .theme-rail-bar { align-items: flex-start; }
}
@media (max-width: 560px) {
  .brand-mark { font-size: 40px; }
}


/* —— 主题检索浏览 —— */
.browse-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px clamp(18px, 4vw, 40px) 64px;
}
.browse-back {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--jade);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.browse-brand {
  font-size: clamp(32px, 5vw, 48px) !important;
  margin-bottom: 8px !important;
}
.browse-head .page-lead {
  max-width: none;
}
.browse-stats {
  white-space: nowrap;
}
.browse-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.browse-search input {
  flex: 1;
  min-width: 220px;
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.9);
  color: var(--ink);
}
.browse-search input:focus {
  outline: 2px solid rgba(10, 79, 67, 0.25);
  border-color: rgba(10, 79, 67, 0.4);
}
.browse-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 22px 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.browse-ask {
  color: var(--jade);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.browse-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.browse-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 14px;
  background: rgba(255, 252, 246, 0.82);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.browse-item:hover {
  transform: translateY(-1px);
  border-color: rgba(10, 79, 67, 0.35);
  background: #fffcf6;
}
.browse-item strong {
  font-family: var(--display);
  font-size: 18px;
  color: var(--jade-deep);
  letter-spacing: 0.03em;
}
.browse-src {
  font-size: 12px;
  color: var(--muted);
}
.browse-snip {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.browse-open {
  font-size: 12px;
  font-weight: 600;
  color: var(--jade);
  margin-top: 4px;
}
.browse-empty {
  padding: 28px 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}
.browse-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}
.browse-pager .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* 主题卡片可点击 */
a.theme-card {
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  cursor: pointer;
}
a.theme-card:hover {
  transform: translateY(-3px);
  border-color: rgba(10, 79, 67, 0.35);
  box-shadow: 0 10px 28px rgba(6, 46, 40, 0.08);
}
a.theme-card .go {
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--jade);
}

/* 复用问答页 modal 最小样式（首页独立） */
.browse-page .modal[hidden] { display: none; }
.browse-page .modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
}
.browse-page .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, 0.32);
}
.browse-page .modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(82vh, 880px);
  overflow: auto;
  background: #fffcf6;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 18px;
}
.browse-page .modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.browse-page .modal-head h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 20px;
  color: var(--jade-deep);
}
.browse-page .cite-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.browse-page .cite-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f3eee4;
  border-radius: 12px;
  padding: 14px;
  line-height: 1.7;
  font-size: 14px;
}
.browse-page .text-btn {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--jade);
  padding: 8px 10px;
  border-radius: 10px;
}
.browse-page .text-btn:hover { background: rgba(10, 79, 67, 0.08); }
