/* 生肖年份指南 · Chinese Zodiac Guide — Editorial Luxury, cinnabar + jade */
:root {
  --bg: oklch(97.6% 0.012 85);
  --bg-2: oklch(94.5% 0.016 85);
  --card: oklch(99.3% 0.006 85);
  --ink: oklch(24% 0.022 40);
  --ink-2: oklch(41% 0.02 45);
  --muted: oklch(55% 0.018 55);
  --line: oklch(88% 0.014 70);
  --line-strong: oklch(80% 0.018 65);
  --accent: oklch(48% 0.17 30);
  --accent-2: oklch(60% 0.15 35);
  --accent-soft: oklch(94% 0.035 35);
  --jade: oklch(48% 0.09 170);
  --jade-soft: oklch(94% 0.025 170);
  --gold: oklch(62% 0.11 80);
  --gold-soft: oklch(95% 0.03 85);
  --violet: oklch(48% 0.1 305);
  --violet-soft: oklch(94% 0.03 305);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-1: 0 1px 2px rgba(45, 32, 24, 0.06);
  --shadow-2: 0 18px 42px -20px rgba(45, 32, 24, 0.24);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Songti SC", "STSong", serif;
  --sans: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

/* components that set display:flex/grid would otherwise override [hidden] (E12) */
[hidden] { display: none !important; }

html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 560px at 84% -8%, oklch(94% 0.035 35 / 0.55), transparent 62%),
    radial-gradient(900px 520px at -8% 28%, oklch(94% 0.025 170 / 0.5), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  letter-spacing: 0.001em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap;
}
.brand .mark {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: var(--bg);
  font-family: var(--serif); font-size: 17px; line-height: 1;
}
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  text-decoration: none; color: var(--ink-2);
  padding: 7px 11px; border-radius: 9px; font-size: 14.5px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.visits {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
}
.visits b { font-family: var(--mono); font-size: 13px; color: var(--ink); font-weight: 600; min-width: 1ch; }
.lang {
  text-decoration: none; font-size: 13px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 5px 12px; color: var(--ink-2); white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.lang:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.hero { padding: 58px 0 30px; }
.home-hero { display: grid; grid-template-columns: minmax(0, 1.45fr) auto; gap: 34px; align-items: center; }
.home-copy { min-width: 0; }
.eyebrow {
  font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 16px;
}
h1.title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.08; letter-spacing: -0.012em; max-width: 24ch;
}
h1.title em { font-style: italic; color: var(--accent); }
.lede { margin-top: 16px; font-size: 17px; color: var(--ink-2); max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.seal {
  position: relative;
  display: grid; place-items: center;
  flex: none;
  width: clamp(120px, 20vw, 190px);
  aspect-ratio: 1;
  background: var(--accent);
  color: oklch(97% 0.012 85);
  border-radius: 18px;
  font-family: var(--serif);
  font-size: clamp(72px, 12vw, 122px);
  line-height: 1;
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.seal::after {
  content: ""; position: absolute; inset: 8%;
  border: 1px solid color-mix(in oklab, oklch(97% 0.012 85) 55%, transparent);
  border-radius: 11px; pointer-events: none;
}
.seal-home { width: clamp(120px, 16vw, 176px); font-size: clamp(70px, 10vw, 112px); }
.seal-pair { width: clamp(78px, 12vw, 116px); font-size: clamp(46px, 7vw, 74px); border-radius: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  text-decoration: none; font-size: 14.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.1s ease, box-shadow 0.16s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--accent); box-shadow: var(--shadow-2); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px; min-width: 0;
}
.stat .k { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-family: var(--serif); font-size: 30px; letter-spacing: -0.01em; }
.stat .hint { font-size: 12px; color: var(--muted); }

section.block { padding: 30px 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.01em; }
.section-head p { color: var(--muted); font-size: 14px; }

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-1);
  min-width: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.card .k { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.card .v { font-family: var(--serif); font-size: 25px; letter-spacing: -0.01em; word-break: break-word; }
.card .hint { margin-top: 6px; font-size: 13px; color: var(--muted); }
.link-card { text-decoration: none; display: block; }
.link-card p { color: var(--ink-2); font-size: 14.5px; margin-top: 6px; }
.link-card:hover .k { color: var(--accent); }

.animal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.animal-grid-lg { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.animal-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); text-decoration: none; min-width: 0;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.animal-card:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--accent-soft); }
.animal-card .hanzi { font-family: var(--serif); font-size: 46px; line-height: 1; color: var(--ink); }
.animal-card .name { font-weight: 600; font-size: 15px; }
.animal-card .meta { font-size: 12px; color: var(--muted); }
.animal-card-lg { padding: 22px; }
.animal-card-lg .hanzi { font-size: 64px; }
.animal-card-lg .name { font-size: 18px; }

.year-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.year-card {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); text-decoration: none; min-width: 0;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.year-card:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--accent-soft); }
.year-card .yc-year { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.year-card .yc-animal { font-size: 14px; color: var(--ink-2); }
.year-card .yc-meta { font-size: 12px; color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fact {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  min-width: 0;
}
.fact dt { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.fact dd { margin: 0; font-family: var(--serif); font-size: 20px; word-break: break-word; }
.fact dd .mono { font-family: var(--mono); font-size: 15px; }

.detail-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 26px; padding-top: 34px; }
.detail-copy { flex: 1 1 360px; min-width: 0; }
.detail-hero .title { max-width: none; }
.pair-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-top: 30px; }
.pair-copy { flex: 1 1 340px; min-width: 0; margin-left: 10px; }
.pair-x { font-family: var(--serif); font-size: 28px; color: var(--line-strong); }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
.badge-harmony { background: var(--jade-soft); color: var(--jade); border-color: color-mix(in oklab, var(--jade) 22%, transparent); }
.badge-clash { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in oklab, var(--accent) 22%, transparent); }
.badge-harm { background: var(--gold-soft); color: oklch(48% 0.1 75); border-color: color-mix(in oklab, var(--gold) 30%, transparent); }
.badge-xing { background: var(--violet-soft); color: var(--violet); border-color: color-mix(in oklab, var(--violet) 22%, transparent); }
.badge-neutral { background: var(--bg-2); color: var(--muted); border-color: var(--line); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); text-decoration: none; font-size: 13px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.chip b { font-family: var(--mono); font-weight: 600; }
.chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.chip-sm { padding: 4px 9px; font-size: 12.5px; }

.element-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.element-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px; min-width: 0;
}
.element-card .k { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.element-card .v { font-family: var(--serif); font-size: 28px; margin-bottom: 8px; }

.rel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.rel-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px; min-width: 0;
}
.rel-card .k { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

.matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
}
table.matrix { border-collapse: collapse; width: 100%; font-size: 12.5px; }
table.matrix th, table.matrix td {
  padding: 7px 6px; text-align: center;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.matrix thead th { background: var(--bg-2); font-weight: 600; position: sticky; top: 0; }
table.matrix th a { text-decoration: none; color: var(--ink); }
table.matrix th a:hover { color: var(--accent); }
table.matrix td a {
  display: block; text-decoration: none; padding: 5px 2px;
  border-radius: 7px; color: var(--ink-2);
}
table.matrix td a:hover { background: var(--accent-soft); color: var(--accent); }
table.matrix td.diag a { font-weight: 700; color: var(--accent); }
table.matrix td.empty { color: var(--line-strong); }

.prose { max-width: 78ch; color: var(--ink-2); }
.prose p { margin-bottom: 14px; }
.prose ul { margin: 0 0 14px; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code {
  font-family: var(--mono); font-size: 0.92em;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 6px;
}

.callout {
  background: var(--accent-soft);
  border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 16px 18px;
  color: var(--ink-2);
}
.callout strong { color: var(--ink); }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 8px 16px; min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { border: 0; outline: none; background: transparent; width: 100%; font-size: 15px; }
.search span { color: var(--muted); font-size: 14px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th, table.data td {
  padding: 8px 14px; text-align: right;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th {
  position: sticky; top: 0;
  background: var(--bg-2);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  font-weight: 600;
}
table.data td:first-child a { text-decoration: none; font-weight: 600; color: var(--accent); }
table.data td:first-child a:hover { text-decoration: underline; }
table.data tr:hover td { background: var(--accent-soft); }
table.data td .muted-inline { color: var(--muted); font-size: 12px; }

.converter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 200px; min-width: 0; }
.field label { font-size: 12.5px; color: var(--muted); letter-spacing: 0.04em; }
.field input {
  width: 100%;
  border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 11px 14px; background: var(--card);
  font-size: 16px; font-family: var(--mono);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.result-box {
  margin-top: 12px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px;
  font-family: var(--mono); font-size: 15px;
  min-height: 44px; display: flex; align-items: center;
  word-break: break-word;
}
.result-box .muted { color: var(--muted); }
.result-box a { color: var(--accent); text-decoration: none; font-weight: 600; }
.result-box a:hover { text-decoration: underline; }
.lookup-card .hint { margin-top: 10px; font-size: 13px; color: var(--muted); }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); padding: 4px 18px;
  transition: border-color 0.15s ease;
}
.faq details[open] { border-color: var(--line-strong); }
.faq summary {
  cursor: pointer; list-style: none;
  padding: 13px 0; font-weight: 600;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 18px; font-family: var(--mono); transition: transform 0.18s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--ink-2); padding-bottom: 14px; margin: 0; max-width: 72ch; }

.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding-top: 22px; }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--line-strong); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.pager a {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.pager a:hover { border-color: var(--accent); transform: translateY(-2px); }
.pager a span { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.pager a b { font-family: var(--serif); font-size: 20px; }
.pager .next { text-align: right; align-items: flex-end; }

.site-footer { margin-top: 40px; border-top: 1px solid var(--line); padding: 34px 0 48px; color: var(--muted); font-size: 13.5px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.footer-inner a { text-decoration: none; color: var(--ink-2); }
.footer-inner a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }

.muted-inline { color: var(--muted); font-size: 12px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 1; }
html.js .reveal { animation: fadeUp 0.6s ease both; animation-delay: var(--d, 0s); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { animation: none; opacity: 1; transform: none; }
  .card, .animal-card, .year-card, .chip, .btn, .lang { transition: none; }
}

@media (max-width: 960px) {
  .animal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .animal-grid-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-hero { grid-template-columns: minmax(0, 1fr); }
  .seal-home { display: none; }
}
@media (max-width: 640px) {
  .grid-3, .grid-2, .facts { grid-template-columns: minmax(0, 1fr); }
  .animal-grid, .animal-grid-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { text-align: left; align-items: flex-start; }
  .hero { padding-top: 40px; }
  .detail-hero, .pair-hero { gap: 16px; }
  .pair-copy { margin-left: 0; flex-basis: 100%; }
  .seal { width: 108px; font-size: 66px; }
  .seal-pair { width: 72px; font-size: 44px; }
}
@media (max-width: 560px) {
  .header-inner { height: auto; flex-wrap: wrap; padding: 10px 0; gap: 8px 14px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: 2px; }
  .nav a { white-space: nowrap; }
  .header-right { gap: 10px; }
  .visits span.lbl { display: none; }
  .animal-card .hanzi { font-size: 38px; }
  .animal-card-lg .hanzi { font-size: 52px; }
}
