@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Rubik:wght@300;400;500;600;700&display=swap');

/* ===== 基础变量 ===== */
:root {
  --paper: #fdfbf7;
  --surface: #f5f5f5;
  --ink: #1a1a1a;
  --ink-mid: #444;
  --ink-light: #777;
  --border: #d8d4cc;
  --border-light: #e8e4de;
  --accent: #1a1a1a;
  --accent-hover: #333;
  --radius-card: 28px;
  --radius-pill: 999px;
  --radius-sm: 8px;
  --font-body: 'Rubik', 'PingFang SC', 'Noto Sans CJK SC', system-ui, sans-serif;
  --font-head: 'Outfit', 'PingFang SC', system-ui, sans-serif;
  --max-w: 1160px;
  --prose-w: 740px;
  --gap: 1.5rem;
  --transition: none;
  --noise: 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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: auto; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  background-image: var(--noise);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
ul { list-style: none; }
button, input { font-family: inherit; }

/* ===== 噪点纹理层 ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: var(--noise);
  opacity: 0.5;
  z-index: 9999;
}

/* ===== 排版 ===== */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.7rem); margin-bottom: 0.4rem; }
h3 { font-size: 1.1rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ===== 站点头部 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}
.header-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem var(--gap);
  max-width: var(--max-w);
  margin: 0 auto;
  gap: 1rem;
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.brand-logo-img { width: 36px; height: 36px; border-radius: 6px; }
.brand-name {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand-tagline {
  font-size: 0.78rem;
  color: var(--ink-light);
  display: none;
}
@media (min-width: 640px) { .brand-tagline { display: block; } }

.header-search { flex: 0 1 260px; }
.search-input {
  width: 100%;
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.875rem;
  color: var(--ink);
  outline: none;
}
.search-input:focus { border-color: var(--ink); }

/* ===== 主导航 — 药丸胶囊按钮组 ===== */
.header-nav-row {
  border-top: 1px solid var(--border-light);
  background: var(--surface);
}
.main-nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.45rem var(--gap);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav > p {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  white-space: nowrap;
  align-items: center;
}
.main-nav > p > a {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-mid);
  background: var(--paper);
  min-height: 40px;
  line-height: 1;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.main-nav > p > a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); text-decoration: none; }
.main-nav > p > a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ===== 主内容区 ===== */
.main-content { max-width: var(--max-w); margin: 0 auto; padding: 2rem var(--gap) 3rem; }

/* ===== content-section 通用：figure + aside + prose 布局 ===== */
.content-section {
  display: grid;
  grid-template-columns: 1fr min(260px, 30%);
  grid-template-rows: auto auto;
  gap: var(--gap);
  align-items: start;
}
.content-section > figure,
.content-section > .review-hero-fig,
.content-section > .ranking-header-fig,
.content-section > .compare-header-fig,
.content-section > .faq-header-fig,
.content-section > .about-header-fig,
.content-section > .privacy-header-fig,
.content-section > .page-header-fig {
  grid-column: 1 / 2;
  grid-row: 1;
}
.content-section > aside.sidebar-related,
.content-section > aside.sidebar-inline {
  grid-column: 2;
  grid-row: 1 / 3;
}
.content-section > .prose-body {
  grid-column: 1 / 2;
  grid-row: 2;
}
@media (max-width: 767px) {
  .content-section {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .content-section > figure,
  .content-section > .review-hero-fig,
  .content-section > .ranking-header-fig,
  .content-section > .compare-header-fig,
  .content-section > .faq-header-fig,
  .content-section > .about-header-fig,
  .content-section > .privacy-header-fig,
  .content-section > .page-header-fig { grid-column: 1; grid-row: 1; }
  .content-section > aside.sidebar-related,
  .content-section > aside.sidebar-inline { grid-column: 1; grid-row: 3; }
  .content-section > .prose-body { grid-column: 1; grid-row: 2; }
}

/* ===== 页面头部 figure 样式 ===== */
.page-header-fig,
.review-hero-fig figcaption,
.ranking-header-fig,
.compare-header-fig,
.faq-header-fig,
.about-header-fig,
.privacy-header-fig {
  padding: 1.5rem 0 1rem;
}
.review-hero-fig {
  position: relative;
}
.review-hero-fig .hero-img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
}
.review-hero-fig figcaption { padding-top: 1rem; }

.ranking-header-fig,
.compare-header-fig,
.faq-header-fig,
.about-header-fig,
.privacy-header-fig {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.ranking-icon,
.compare-versus,
.faq-icon,
.about-icon,
.privacy-icon {
  font-size: 2.5rem;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  flex-shrink: 0;
}

/* ===== 日期 / 徽章 ===== */
.page-date {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--ink-light);
  margin-right: 0.75rem;
}
.review-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.review-badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-mid);
  background: var(--surface);
}

/* ===== 侧边栏 ===== */
.sidebar-related {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 1.25rem;
}
.sidebar-related h2 { font-size: 0.95rem; margin-bottom: 0.25rem; }
.sidebar-related .subtitle { font-size: 0.78rem; color: var(--ink-light); margin-bottom: 0.75rem; }
.sidebar-related ul { display: flex; flex-direction: column; gap: 0.4rem; }
.sidebar-related ul li a {
  font-size: 0.85rem;
  color: var(--ink-mid);
  display: block;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.4;
}
.sidebar-related ul li:last-child a { border-bottom: none; }
.sidebar-related ul li a:hover { color: var(--ink); text-decoration: none; }
.sidebar-cta { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }

/* ===== 正文 ===== */
.prose-body { max-width: var(--prose-w); }
.prose-body h2 { margin: 2rem 0 0.5rem; }
.prose-body h3 { margin: 1.5rem 0 0.4rem; font-size: 1rem; }
.prose-body p { line-height: 1.8; color: var(--ink-mid); }
.prose-body ul, .prose-body ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.prose-body li { margin-bottom: 0.4rem; line-height: 1.7; }
.prose-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.prose-body th, .prose-body td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
}
.prose-body th { background: var(--surface); font-weight: 600; }
.prose-body blockquote {
  border-left: 3px solid var(--ink);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--ink-mid);
}
.subtitle { color: var(--ink-light); font-size: 0.9rem; margin-bottom: 0.75rem; }

/* ===== 按钮 ===== */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-head);
  cursor: pointer;
  min-height: 44px;
  text-decoration: none;
}
.btn-pill:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn-pill.btn-ghost { background: transparent; color: var(--ink); }
.btn-pill.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ===== 首页 Hero ===== */
.home-main {}
.hero-section {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2rem;
  min-height: 70vh;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 3rem;
  position: relative;
}
.hero-deco {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.hero-icon {
  font-size: 7rem;
  color: var(--border-light);
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1;
  opacity: 0.6;
}
.hero-text {
  text-align: right;
  max-width: 600px;
  z-index: 1;
}
.hero-text h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin-bottom: 0.75rem; }
.hero-text .subtitle { font-size: 1rem; color: var(--ink-mid); margin-bottom: 1.5rem; }
.hero-cta { display: flex; gap: 0.75rem; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 600px) {
  .hero-section { justify-content: center; min-height: 55vh; }
  .hero-text { text-align: center; }
  .hero-cta { justify-content: center; }
  .hero-deco { display: none; }
}

/* ===== 首页内容区 ===== */
.home-prose {
  margin-bottom: 2rem;
}
.section-label-fig {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-num {
  font-family: var(--font-head);
  font-size: 3rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
}
.section-aside-nav {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 1.25rem;
}
.section-aside-nav h2 { font-size: 0.95rem; margin-bottom: 0.25rem; }
.section-aside-nav .subtitle { font-size: 0.78rem; color: var(--ink-light); margin-bottom: 0.75rem; }
.section-aside-nav ul { display: flex; flex-direction: column; gap: 0.4rem; }
.section-aside-nav ul li a {
  font-size: 0.85rem;
  color: var(--ink-mid);
  display: block;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.4;
}
.section-aside-nav ul li:last-child a { border-bottom: none; }

/* ===== 卡片区 ===== */
.cards-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}
.cards-section > h2 { margin-bottom: 0.35rem; }
.cards-section > .subtitle { margin-bottom: 1.5rem; }
.cards-section { display: block; }
.cards-section > article { display: inline; }

/* 重置为 grid 容器 */
.cards-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
.cards-section > h2,
.cards-section > .subtitle {
  grid-column: 1 / -1;
}
@media (min-width: 600px) {
  .cards-section { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .cards-section { grid-template-columns: repeat(3, 1fr); }
}
.cards-row2 { grid-template-columns: 1fr; }
@media (min-width: 600px) {
  .cards-row2 { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 玻璃拟态卡片 ===== */
.glass-card {
  background: rgba(253, 251, 247, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(216, 212, 204, 0.6);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.glass-card:hover { border-color: var(--border); }
.card-fig { margin: 0; overflow: hidden; }
.card-fig img { width: 100%; height: 180px; object-fit: cover; }
.card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.card-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-light);
  text-transform: uppercase;
  font-family: var(--font-head);
}
.card-body h3 { font-size: 0.95rem; line-height: 1.35; }
.card-body h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-body p { font-size: 0.83rem; color: var(--ink-mid); line-height: 1.55; flex: 1; }
.card-date { font-size: 0.75rem; color: var(--ink-light); }
.rank-card, .compare-card { background: rgba(245, 245, 245, 0.8); }

/* ===== 榜单列表 ===== */
.ranking-list-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}
.ranking-list-section > h2 { margin-bottom: 0.35rem; }
.ranking-list-section > .subtitle { margin-bottom: 1.5rem; }
.rank-item {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-light);
}
.rank-item:last-child { border-bottom: none; }
.rank-num {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  flex-shrink: 0;
  min-width: 2.5rem;
}
.rank-info { flex: 1; }
.rank-info h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.rank-info h3 a:hover { text-decoration: underline; }
.rank-info p { font-size: 0.85rem; color: var(--ink-mid); line-height: 1.55; }

/* ===== FAQ ===== */
.faq-prose details {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-prose summary {
  padding: 0.9rem 1rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
}
.faq-prose summary::after { content: '＋'; font-size: 1.1rem; color: var(--ink-light); }
.faq-prose details[open] summary::after { content: '－'; }
.faq-prose details > section, .faq-prose details > p {
  padding: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.7;
}

/* ===== 页脚 ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 4rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem var(--gap);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-logo a {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.footer-nav { flex: 1; min-width: 0; overflow-x: auto; }
.footer-nav > p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  align-items: center;
}
.footer-nav > p > a {
  font-size: 0.8rem;
  color: var(--ink-mid);
  white-space: nowrap;
  padding: 0.25rem 0;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.footer-nav > p > a:hover { color: var(--ink); }
.footer-copy p {
  font-size: 0.75rem;
  color: var(--ink-light);
  white-space: nowrap;
  margin: 0;
}

/* ===== 响应式补充 ===== */
@media (max-width: 767px) {
  .header-brand-row { padding: 0.6rem 1rem; }
  .main-content { padding: 1.25rem 1rem 2rem; }
  .hero-section { min-height: 55vh; padding: 1.5rem 0; margin-bottom: 2rem; }
  .hero-text h1 { font-size: 1.6rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 1rem; }
  .footer-nav > p { gap: 0.25rem 0.5rem; }
  .prose-body { max-width: 100%; }
  .ranking-list-section { margin-top: 2rem; }
  .cards-section { gap: 1rem; }
}
@media (max-width: 400px) {
  html { font-size: 16px; }
  .main-nav > p > a { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
}

/* ===== prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===== 微交互（仅 CSS，非 reduced-motion 时生效）===== */
@media (prefers-reduced-motion: no-preference) {
  .glass-card { transition: box-shadow 0.15s, border-color 0.15s; }
  .glass-card:hover { box-shadow: 0 4px 24px rgba(26,26,26,0.08); }
  .main-nav > p > a { transition: background 0.12s, color 0.12s, border-color 0.12s; }
  .btn-pill { transition: background 0.12s, color 0.12s; }
}
