/* 杏吧官方平台 - 全局样式 */
:root {
  --primary: #e91e63;
  --primary-dark: #c2185b;
  --secondary: #ff9800;
  --bg-dark: #1a0b2e;
  --bg-card: #2d1b4e;
  --bg-light: #f8f5fc;
  --text: #333;
  --text-light: #666;
  --text-inverse: #f0e6ff;
  --border: #e0d4f0;
  --shadow: 0 4px 20px rgba(26, 11, 46, 0.12);
  --radius: 12px;
  --max-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg-light);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #2d1b4e 100%);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo-link { display: flex; align-items: center; gap: 10px; }
.logo-link img { width: 42px; height: 42px; border-radius: 10px; }
.logo-text { color: #fff; font-size: 1.25rem; font-weight: 700; letter-spacing: 1px; }
.logo-text span { color: var(--secondary); }

.main-nav ul { display: flex; list-style: none; gap: 6px; }
.main-nav a {
  color: var(--text-inverse);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active {
  background: rgba(233, 30, 99, 0.25);
  color: #fff;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #4a1942 50%, var(--primary-dark) 100%);
  color: #fff;
  padding: 60px 20px 50px;
  text-align: center;
}

.hero h1 { font-size: 2rem; margin-bottom: 16px; line-height: 1.3; }
.hero-desc { font-size: 1.05rem; opacity: 0.92; max-width: 720px; margin: 0 auto 28px; }
.hero-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hero-badge {
  background: rgba(255,255,255,0.15);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  backdrop-filter: blur(4px);
}

/* Sections */
section { padding: 50px 0; }
section:nth-child(even) { background: #fff; }

.section-title {
  font-size: 1.6rem;
  color: var(--bg-dark);
  margin-bottom: 8px;
  text-align: center;
}
.section-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 36px;
  font-size: 0.95rem;
}

.section-title::after {
  content: "";
  display: block;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  margin: 10px auto 0;
  border-radius: 2px;
}

/* Content blocks */
.content-block { max-width: 860px; margin: 0 auto; }
.content-block p { margin-bottom: 16px; text-align: justify; }
.content-block h2 { font-size: 1.35rem; color: var(--bg-dark); margin: 32px 0 14px; }
.content-block h3 { font-size: 1.15rem; color: var(--primary-dark); margin: 24px 0 10px; }
.content-block ul, .content-block ol { margin: 0 0 16px 24px; }
.content-block li { margin-bottom: 8px; }

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
  border: 1px solid var(--border);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(26,11,46,0.18); }

.feature-card img { width: 100%; aspect-ratio: 9/16; object-fit: cover; object-position: top; max-height: 420px; }
.feature-card-body { padding: 18px; }
.feature-card h3 { font-size: 1.05rem; color: var(--bg-dark); margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; color: var(--text-light); line-height: 1.6; }

/* Image showcase - horizontal scroll on mobile */
.showcase-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.showcase-item {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
}
.showcase-item img { width: 100%; aspect-ratio: 9/16; object-fit: cover; object-position: top; max-height: 500px; }
.showcase-caption { padding: 12px 14px; font-size: 0.85rem; color: var(--text-light); text-align: center; background: #fff; }

/* TOC */
.toc-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 36px;
  box-shadow: var(--shadow);
}
.toc-box h2 { font-size: 1.1rem; margin-bottom: 14px; color: var(--bg-dark); }
.toc-box ol { columns: 2; column-gap: 30px; }
.toc-box li { margin-bottom: 6px; font-size: 0.92rem; }

/* Internal links box */
.links-box {
  background: linear-gradient(135deg, #fdf2f8, #fff8f0);
  border-radius: var(--radius);
  padding: 24px;
  margin: 32px 0;
  border-left: 4px solid var(--primary);
}
.links-box h3 { margin-bottom: 12px; color: var(--bg-dark); }
.links-box ul { list-style: none; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.links-box li::before { content: "→ "; color: var(--primary); }

/* Page header for subpages */
.page-header {
  background: linear-gradient(135deg, var(--bg-dark), #4a1942);
  color: #fff;
  padding: 40px 20px;
  text-align: center;
}
.page-header h1 { font-size: 1.75rem; margin-bottom: 8px; }
.page-header p { opacity: 0.85; font-size: 0.95rem; }

.page-content { padding: 40px 0 60px; }
.page-content .content-block { padding: 0 20px; }

/* Error pages */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}
.error-code { font-size: 6rem; font-weight: 800; color: var(--primary); line-height: 1; }
.error-page h1 { font-size: 1.5rem; margin: 16px 0 12px; color: var(--bg-dark); }
.error-page p { color: var(--text-light); margin-bottom: 24px; }

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
}
.btn:hover { opacity: 0.9; color: #fff; transform: translateY(-1px); }

/* Footer */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-inverse);
  padding: 40px 20px 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  max-width: var(--max-width);
  margin: 0 auto 30px;
}
.footer-brand img { width: 48px; border-radius: 10px; margin-bottom: 12px; }
.footer-brand p { font-size: 0.88rem; opacity: 0.75; line-height: 1.6; }
.footer-col h4 { font-size: 0.95rem; margin-bottom: 14px; color: var(--secondary); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--text-inverse); opacity: 0.8; font-size: 0.88rem; }
.footer-col a:hover { opacity: 1; color: var(--secondary); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.82rem;
  opacity: 0.6;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Breadcrumb */
.breadcrumb {
  padding: 12px 0;
  font-size: 0.85rem;
  color: var(--text-light);
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }

/* Responsive */
@media (max-width: 900px) {
  .showcase-row { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .toc-box ol { columns: 1; }
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    padding: 12px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 0 16px; }
  .main-nav a { display: block; padding: 12px 16px; }

  .hero { padding: 40px 16px 36px; }
  .hero h1 { font-size: 1.5rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .showcase-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  section { padding: 36px 0; }
  .feature-card img { max-height: 360px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.3rem; }
  .section-title { font-size: 1.35rem; }
}
