/* ============================================================
   蜜桃97导航 — E-Ink / Paper 主题样式表
   ============================================================ */

/* ---------- 0. Google Font import ---------- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* ---------- 1. CSS 变量 ---------- */
:root {
  --paper:    #fdfbf7;
  --paper-2:  #f5f5f5;
  --ink:      #1a1a1a;
  --ink-2:    #3a3a3a;
  --ink-3:    #6a6a6a;
  --border:   #d8d4cc;
  --border-2: #c8c4bc;
  --accent:   #1a1a1a;
  --radius:   10px;
  --nav-h:    56px;
  --wrap:     780px;
  --font:     'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --serif:    'Noto Serif SC', 'Songti SC', Georgia, serif;
}

/* ---------- 2. Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  line-height: 1.75;
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Paper noise texture */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  padding-bottom: calc(var(--nav-h) + 8px);
}

a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
transition: none !important;

/* ---------- 3. Bottom Nav (固定底部条) ---------- */
header {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--paper-2);
  border-top: 1px solid var(--border);
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
}

header nav {
  display: contents;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  padding-left: 4px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  justify-content: flex-end;
  padding-right: 4px;
}

.nav-brand {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  padding: 0 12px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.nav-left a,
.nav-right a {
  font-size: 0.72rem;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  padding: 0 10px;
  height: var(--nav-h);
  min-height: 40px;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
  transition: none;
  color: var(--ink-2);
}

.nav-left a:first-child { border-left: none; }
.nav-right a:last-child { border-right: none; }

.nav-left a:hover,
.nav-right a:hover { background: var(--paper); color: var(--ink); }

/* ---------- 4. Page Eyebrow (面包屑) ---------- */
.page-eyebrow {
  font-size: 0.75rem;
  color: var(--ink-3);
  padding: 14px 20px 0;
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.eyebrow-home,
.eyebrow-parent { color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
.eyebrow-sep { color: var(--border-2); }
.eyebrow-cur { color: var(--ink); }

/* ---------- 5. Wrap / Containers ---------- */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

main {
  flex: 1;
}

/* ---------- 6. Hero (首页) ---------- */
.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column-reverse;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-media {
  flex: 1;
  overflow: hidden;
  background: var(--paper-2);
  min-height: 240px;
  position: relative;
}

.hero-media--empty {
  background: var(--paper-2);
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 28px,
    var(--border) 28px,
    var(--border) 29px
  );
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(15%) contrast(1.05);
}

.hero-text {
  background: var(--paper);
  padding: 32px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  border-top: 1px solid var(--border);
  max-width: 100%;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: 3px 10px;
  margin-bottom: 14px;
  border-radius: 3px;
}

.hero-h1 {
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  max-width: 560px;
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--ink-2);
  max-width: 480px;
  line-height: 1.65;
}

/* ---------- 7. Page Headers ---------- */
.page-header {
  padding: 36px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.review-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  border: 1px solid var(--ink);
  padding: 2px 8px;
  margin-bottom: 12px;
  border-radius: 3px;
}

.page-h1 {
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.page-meta {
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-bottom: 10px;
}

.page-meta time { font-variant-numeric: tabular-nums; }

.page-lead {
  font-size: 0.95rem;
  color: var(--ink-2);
  line-height: 1.7;
  max-width: 640px;
}

/* ---------- 8. Content / Prose ---------- */
.content-section {
  margin-bottom: 40px;
}

.prose {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--ink);
}

.prose h2 { font-size: 1.15rem; font-weight: 700; margin: 2.2em 0 0.6em; }
.prose h3 { font-size: 1rem;   font-weight: 500; margin: 1.8em 0 0.5em; color: var(--ink-2); }
.prose h4 { font-size: 0.95rem; font-weight: 500; margin: 1.4em 0 0.4em; }
.prose p  { margin: 0 0 1.1em; }
.prose ul, .prose ol { margin: 0 0 1em 1.4em; list-style: initial; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.35em; }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
.prose blockquote {
  border-left: 3px solid var(--border-2);
  padding-left: 16px;
  color: var(--ink-2);
  margin: 1.2em 0;
}
.prose a { color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.92rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose th { background: var(--paper-2); font-weight: 500; }
.prose code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.88em;
  background: var(--paper-2);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.prose pre {
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin: 1.2em 0;
}
.prose pre code { background: none; border: none; padding: 0; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); margin: 1.2em 0; }

/* FAQ 专属 */
.faq-prose h2 { font-size: 1.05rem; font-weight: 700; }

/* ---------- 9. Section Titles (h2 + hr) ---------- */
.index-section,
.rank-list-section,
.also-section {
  margin-bottom: 40px;
}

.index-section h2,
.rank-list-section h2,
.also-section h2,
.review-header h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0;
  display: inline-block;
}

.index-section h2 + hr,
.rank-list-section h2 + hr,
.also-section h2 + hr {
  border: none;
  border-top: 2px solid var(--ink);
  margin: 6px 0 20px;
}

/* ---------- 10. Tables (子页列表 — table > tbody > tr > td) ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--paper);
}

.rank-table thead tr {
  background: var(--paper-2);
  border-bottom: 1px solid var(--border-2);
}

.rank-table th {
  padding: 10px 14px;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-align: left;
  color: var(--ink-3);
  white-space: nowrap;
}

.rank-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: none;
}

.rank-table tbody tr:last-child { border-bottom: none; }
.rank-table tbody tr:hover { background: var(--paper-2); }

.rank-table td { padding: 12px 14px; vertical-align: top; }

.td-rank {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  white-space: nowrap;
  width: 3em;
}

.td-title { font-weight: 500; white-space: nowrap; }
.td-title a { text-decoration: none; color: var(--ink); }
.td-title a:hover { text-decoration: underline; }

.td-desc { color: var(--ink-2); max-width: 320px; }
.td-date { white-space: nowrap; color: var(--ink-3); font-size: 0.78rem; font-variant-numeric: tabular-nums; }

/* ---------- 11. Also Links ---------- */
.also-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.also-link {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  font-size: 0.82rem;
  font-weight: 400;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  transition: none;
}

.also-link:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ---------- 12. Review Hero ---------- */
.review-header {
  padding: 36px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.review-hero {
  margin-bottom: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.review-hero-img {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  filter: grayscale(10%) contrast(1.05);
}

.review-header-text { }

/* ---------- 13. Footer (三列 dl) ---------- */
footer {
  background: var(--paper-2);
  border-top: 1px solid var(--border);
  padding: 0 0 calc(var(--nav-h) + 16px);
  margin-top: 60px;
}

.footer-cta {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 40px 20px;
}

.footer-cta-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
}

.footer-cta-sub {
  font-size: 0.88rem;
  opacity: 0.75;
  margin-bottom: 20px;
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 24px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius);
  border: none;
}

.footer-cta-btn:hover { opacity: 0.9; }

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  max-width: 960px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.footer-cols dl {
  padding: 28px 20px 24px;
  border-right: 1px solid var(--border);
}

.footer-cols dl:last-child { border-right: none; }

.footer-cols dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}

.footer-cols dd {
  margin: 0 0 8px;
  font-size: 0.82rem;
}

.footer-cols dd a {
  color: var(--ink-2);
  text-decoration: none;
  display: block;
  padding: 3px 0;
  min-height: 28px;
  display: flex;
  align-items: center;
}

.footer-cols dd a:hover { color: var(--ink); text-decoration: underline; }

.footer-bottom {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--ink-3);
}

.footer-bottom-links {
  display: flex;
  gap: 16px;
}

.footer-bottom-links a {
  color: var(--ink-3);
  text-decoration: none;
  font-size: 0.75rem;
  min-height: 28px;
  display: flex;
  align-items: center;
}

.footer-bottom-links a:hover { text-decoration: underline; color: var(--ink); }

/* ---------- 14. Scroll Reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal-block {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.45s ease, transform 0.45s ease;
  }
  .reveal-block.is-visible {
    opacity: 1;
    transform: none;
  }
  .reveal-item {
    opacity: 0;
    transform: translateY(10px);
    transition:
      opacity 0.35s ease calc(var(--i, 0) * 60ms),
      transform 0.35s ease calc(var(--i, 0) * 60ms);
  }
  .reveal-item.is-visible {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-block, .reveal-item {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- 15. Mobile Responsive ---------- */
@media (max-width: 600px) {
  :root { --nav-h: 52px; }
  html { font-size: 16px; }

  .hero { min-height: 70vh; }
  .hero-text { padding: 24px 16px 20px; }
  .hero-h1 { font-size: 1.5rem; }

  header {
    grid-template-columns: 1fr auto 1fr;
    overflow: hidden;
  }

  .nav-left, .nav-right {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-left::-webkit-scrollbar,
  .nav-right::-webkit-scrollbar { display: none; }

  .nav-left a, .nav-right a { font-size: 0.68rem; padding: 0 8px; }
  .nav-brand { font-size: 0.78rem; padding: 0 10px; }

  .wrap { padding: 0 14px; }

  .footer-cols {
    grid-template-columns: 1fr;
  }
  .footer-cols dl {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px 14px;
  }
  .footer-cols dl:last-child { border-bottom: none; }

  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }

  .rank-table th:nth-child(3),
  .rank-table td:nth-child(3) { display: none; }

  .page-eyebrow { padding: 10px 14px 0; }
}

@media (min-width: 601px) and (max-width: 900px) {
  .footer-cols {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-cols dl:nth-child(2) { border-right: none; }
  .footer-cols dl:nth-child(1),
  .footer-cols dl:nth-child(2) { border-bottom: 1px solid var(--border); }
}

/* ---------- 16. Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
