@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

/* ─── 变量 ─── */
:root {
  --c-primary: #56228b;
  --c-primary-light: #7b44b8;
  --c-primary-dark: #3a1660;
  --c-accent: #8b4513;
  --c-accent-light: #b05e24;
  --c-ink: #1f1726;
  --c-bg: #f5f0fb;
  --c-bg-card: #ffffff;
  --c-text: #2d2438;
  --c-text-muted: #6b5e7a;
  --c-border: #ddd4ec;
  --c-hero-bg: #3a1660;
  --radius-card: 10px;
  --radius-btn: 999px;
  --radius-lg: 20px;
  --shadow-soft: 0 4px 24px rgba(86,34,139,0.10);
  --shadow-card: 0 2px 12px rgba(86,34,139,0.08);
  --font: 'Roboto', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --max-w: 1140px;
  --nav-h: 64px;
}

/* ─── 重置 ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.7;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-light); text-decoration: underline; }
ul { list-style: none; }

/* ─── 顶部导航 ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-ink);
  box-shadow: 0 2px 16px rgba(31,23,38,0.4);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.brand:hover { color: #d8b4fe; text-decoration: none; }

/* 药丸胶囊按钮组导航 */
.site-header nav {
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-header nav::-webkit-scrollbar { display: none; }
.site-header nav > p {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  padding: 0.25rem 0;
  align-items: center;
}
.site-header nav > p > a {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-btn);
  font-size: 0.85rem;
  font-weight: 500;
  color: #d8c8ef;
  background: rgba(255,255,255,0.07);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  min-height: 40px;
  line-height: 1.3;
  display: flex;
  align-items: center;
}
.site-header nav > p > a:hover,
.site-header nav > p > a[aria-current="page"] {
  background: var(--c-primary);
  color: #fff;
  text-decoration: none;
}
.nav-contact {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-btn);
  background: var(--c-accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 40px;
  transition: background 0.2s;
  white-space: nowrap;
}
.nav-contact:hover { background: var(--c-accent-light); color: #fff; text-decoration: none; }

/* ─── Hero ─── */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary) 60%, #7b3fa0 100%);
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(139,69,19,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 4.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  width: 100%;
}
.hero-text { flex: 1; }
.hero-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #d8b4fe;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-btn);
  padding: 0.25rem 0.85rem;
  margin-bottom: 0.85rem;
  text-transform: uppercase;
}
.hero-text h1 {
  font-size: clamp(1.55rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.28;
  margin-bottom: 0.75rem;
  text-align: left;
}
.hero-sub {
  font-size: 1.05rem;
  color: #d8c8ef;
  margin-bottom: 1.5rem;
  max-width: 560px;
  line-height: 1.65;
}
.hero-date {
  font-size: 0.82rem;
  color: #b89fd8;
  margin-top: 0.5rem;
}
.hero-media { flex-shrink: 0; max-width: 340px; }
.hero-img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  object-fit: cover;
}
/* 圆弧底边 */
.hero-arc {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  line-height: 0;
  pointer-events: none;
}
.hero-arc svg { width: 100%; height: 80px; }

.hero--compact { min-height: 36vh; }
.hero--ranking { min-height: 30vh; background: linear-gradient(135deg, #2a0d50 0%, var(--c-primary) 100%); }
.hero--review { min-height: 30vh; background: linear-gradient(135deg, var(--c-primary-dark) 0%, #6d3098 100%); }
.hero--about { min-height: 28vh; background: linear-gradient(135deg, #1f1726 0%, var(--c-primary-dark) 100%); }
.hero--plain { min-height: 24vh; background: linear-gradient(135deg, #1f1726 0%, #3a1660 100%); }

/* ─── 按钮 ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-btn);
  background: var(--c-accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  transition: background 0.2s, transform 0.15s;
  min-height: 48px;
}
.btn-primary:hover { background: var(--c-accent-light); color: #fff; text-decoration: none; transform: translateY(-2px); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-btn);
  border: 2px solid var(--c-primary);
  color: var(--c-primary);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
  min-height: 44px;
  margin-top: 0.75rem;
  width: 100%;
  text-align: center;
}
.btn-outline:hover { background: var(--c-primary); color: #fff; text-decoration: none; }

/* ─── 主内容区 ─── */
#main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

/* content-section: main > div > figure/aside 交错 */
.content-section {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  padding: 2.5rem 0;
  align-items: start;
}
.content-section--narrow {
  grid-template-columns: 1fr 240px;
}

.main-figure {
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2rem 2.25rem;
  min-width: 0;
}
.main-figure--full { grid-column: 1; }

/* ─── 正文排版 ─── */
.page-content { font-size: 1rem; line-height: 1.8; color: var(--c-text); }
.page-content h2 { font-size: 1.35rem; font-weight: 700; color: var(--c-primary-dark); margin: 1.75rem 0 0.75rem; }
.page-content h3 { font-size: 1.1rem; font-weight: 600; margin: 1.4rem 0 0.6rem; color: var(--c-ink); }
.page-content p { margin-bottom: 1rem; }
.page-content ul, .page-content ol { padding-left: 1.5rem; margin-bottom: 1rem; list-style: revert; }
.page-content li { margin-bottom: 0.4rem; }
.page-content table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.94rem; }
.page-content th { background: var(--c-primary); color: #fff; padding: 0.6rem 0.9rem; text-align: left; }
.page-content td { border: 1px solid var(--c-border); padding: 0.55rem 0.9rem; }
.page-content tr:nth-child(even) td { background: var(--c-bg); }
.page-content a { color: var(--c-primary); border-bottom: 1px solid var(--c-border); }
.page-content a:hover { border-bottom-color: var(--c-primary); }
.page-content blockquote { border-left: 4px solid var(--c-primary); background: #ede8f8; padding: 0.85rem 1.25rem; border-radius: 0 var(--radius-card) var(--radius-card) 0; margin: 1.25rem 0; color: var(--c-text-muted); }
.page-content time { color: var(--c-accent); font-size: 0.88rem; font-weight: 500; }

/* ─── 侧边栏 ─── */
.sidebar {
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.25rem;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}
.sidebar .eyebrow { margin-bottom: 0.25rem; }
.sidebar h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 0.75rem;
  margin-top: 0.15rem;
}
.sidebar-links { margin-bottom: 1.25rem; }
.sidebar-links li { border-bottom: 1px solid var(--c-border); }
.sidebar-links li:last-child { border-bottom: none; }
.sidebar-links a {
  display: block;
  padding: 0.55rem 0.25rem;
  font-size: 0.88rem;
  color: var(--c-text-muted);
  transition: color 0.18s;
  line-height: 1.45;
}
.sidebar-links a:hover { color: var(--c-primary); text-decoration: none; }

/* ─── Eyebrow 小标签 ─── */
.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-accent);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

/* ─── 卡片区 ─── */
.cards-section { padding: 2rem 0 1rem; }
.cards-section + .cards-section { border-top: 1px solid var(--c-border); }
.cards-section > .eyebrow { display: block; margin-bottom: 0.25rem; }
.cards-section > h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--c-primary-dark);
  margin-bottom: 1.25rem;
}
.cards-section--alt { background: rgba(86,34,139,0.04); border-radius: var(--radius-lg); padding: 2rem 1.5rem; margin: 0 -1.5rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.card-grid--2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card-grid--3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.card {
  background: var(--c-bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.4rem 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(86,34,139,0.14); }
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.6rem; line-height: 1.4; }
.card h3 a { color: var(--c-ink); }
.card h3 a:hover { color: var(--c-primary); text-decoration: none; }
.card-desc { font-size: 0.88rem; color: var(--c-text-muted); line-height: 1.55; flex: 1; margin-bottom: 0.5rem; }
.card-date { font-size: 0.78rem; color: var(--c-accent); margin-top: auto; }
.card-date time { color: inherit; }

/* ul > li > section 子页列表 */
.card-grid > li { display: flex; }
.card-grid > li > section { width: 100%; }

/* ─── 页脚 ─── */
.site-footer {
  background: var(--c-ink);
  color: #c9b8e0;
  margin-top: 3rem;
  padding: 0;
}
/* footer > div×n */
.site-footer > div {
  padding: 2rem 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
}
.footer-brand {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 1.5rem !important;
}
.footer-brand strong {
  display: block;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.5rem;
}
.footer-brand p { font-size: 0.88rem; line-height: 1.6; color: #9a84b8; }
.footer-links { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.footer-links .eyebrow { color: #9a84b8; margin-bottom: 0.5rem; }
.footer-links ul { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.footer-links a { font-size: 0.88rem; color: #b89fd8; min-height: 40px; display: inline-flex; align-items: center; }
.footer-links a:hover { color: #fff; text-decoration: none; }
.footer-copy {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.25rem !important;
  padding-bottom: 1.5rem !important;
  text-align: center;
}
.footer-copy p { font-size: 0.82rem; color: #7a6490; }
.footer-copy a { color: #9a84b8; }
.footer-copy a:hover { color: #fff; }

/* 两栏页脚在大屏切换 */
@media (min-width: 700px) {
  .site-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .footer-brand { grid-column: 1; grid-row: 1; border-bottom: none; border-right: 1px solid rgba(255,255,255,0.08); }
  .footer-links { grid-column: 2; grid-row: 1; }
  .footer-copy { grid-column: 1 / -1; grid-row: 2; border-top: 1px solid rgba(255,255,255,0.08); }
}

/* ─── Reveal 动效 ─── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ─── Parallax ─── */
.hero { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero { will-change: auto; }
  .card { transition: none; }
  .btn-primary { transition: none; }
}

/* ─── 响应式 ─── */
@media (max-width: 900px) {
  .content-section {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    order: -1;
  }
  .hero-media { display: none; }
}

@media (max-width: 640px) {
  .hero-inner { padding: 2rem 1rem 3.5rem; }
  .hero-text h1 { font-size: 1.4rem; }
  .hero-sub { font-size: 0.95rem; }
  .header-inner { gap: 0.5rem; padding: 0 0.75rem; }
  .brand { font-size: 0.95rem; }
  .site-header nav > p > a { padding: 0.4rem 0.65rem; font-size: 0.78rem; }
  .nav-contact { padding: 0.4rem 0.75rem; font-size: 0.78rem; }
  .main-figure { padding: 1.25rem 1rem; }
  .cards-section--alt { margin: 0 -0.75rem; padding: 1.5rem 1rem; }
  .card-grid { grid-template-columns: 1fr; }
  .card-grid--2 { grid-template-columns: 1fr; }
  .card-grid--3 { grid-template-columns: 1fr; }
  #main-content { padding: 0 0.75rem 2rem; }
  .site-footer > div { padding: 1.25rem 1rem; }
}

@media (max-width: 480px) {
  .hero { min-height: 42vh; }
}

/* ─── 无横向溢出保险 ─── */
body, .site-header, .hero, #main-content, .site-footer { max-width: 100vw; overflow-x: hidden; }
