/* Douyin 抖阴官网 - 全局样式 */
:root {
  --bg-primary: #0f0e17;
  --bg-secondary: #1a1929;
  --bg-card: #1e1d2e;
  --accent: #ff2d55;
  --accent-hover: #ff4d6d;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b80;
  --border: #2a2940;
  --success: #00c853;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --max-width: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header */
.site-header {
  background: rgba(15, 14, 23, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.logo-link:hover {
  color: var(--text-primary);
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav-main {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-main a {
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.nav-main a:hover,
.nav-main a.active {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.nav-main a.active {
  color: var(--accent);
}

.btn-download {
  background: var(--accent);
  color: #fff !important;
  padding: 10px 24px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.2s;
  white-space: nowrap;
}

.btn-download:hover {
  background: var(--accent-hover);
  color: #fff !important;
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1a0a1e 0%, var(--bg-primary) 50%, #0a0a1e 100%);
  padding: 60px 20px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255, 45, 85, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.hero-logo {
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.3;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 14px 36px;
  border-radius: 28px;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 45, 85, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  padding: 14px 36px;
  border-radius: 28px;
  font-size: 1.1rem;
  font-weight: 600;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sections */
.section {
  padding: 60px 20px;
}

.section-alt {
  background: var(--bg-secondary);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

.section-desc {
  color: var(--text-secondary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 40px;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Screenshot Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s;
}

.gallery-item:hover {
  transform: scale(1.02);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  object-position: top;
}

.gallery-caption {
  padding: 16px;
}

.gallery-caption h4 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.gallery-caption p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Category Tags */
.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
}

.tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.tag:hover,
.tag.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Content Article */
.article-content {
  max-width: 800px;
  margin: 0 auto;
}

.article-content h2 {
  font-size: 1.5rem;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.article-content h3 {
  font-size: 1.2rem;
  margin: 28px 0 12px;
  color: var(--accent);
}

.article-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: justify;
}

.article-content ul,
.article-content ol {
  color: var(--text-secondary);
  margin: 0 0 16px 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Page Header */
.page-header {
  background: var(--bg-secondary);
  padding: 48px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: 12px;
}

.page-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--accent);
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
  margin: 40px 0;
}

.stat-item {
  text-align: center;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  display: block;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Download CTA */
.cta-section {
  background: linear-gradient(135deg, #2a0a1e, #1a0a2e);
  padding: 60px 20px;
  text-align: center;
}

.cta-section h2 {
  font-size: 1.75rem;
  margin-bottom: 16px;
}

.cta-section p {
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Footer */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 48px 20px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand .logo-link {
  margin-bottom: 12px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Error Pages */
.error-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.error-code {
  font-size: 6rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 16px;
}

.error-page h1 {
  font-size: 1.75rem;
  margin-bottom: 12px;
}

.error-page p {
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 400px;
}

/* Legal Pages */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.legal-content h2 {
  font-size: 1.3rem;
  margin: 32px 0 12px;
  color: var(--text-primary);
}

.legal-content p,
.legal-content li {
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.8;
}

.legal-content ul {
  margin-left: 24px;
  margin-bottom: 16px;
}

.legal-content .update-date {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* TOC */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}

.toc h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.toc ol {
  margin-left: 20px;
  color: var(--text-secondary);
}

.toc li {
  margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-main {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
  }

  .nav-main.open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .btn-download-header {
    display: none;
  }

  .hero {
    padding: 40px 20px 60px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}

/* Ads sticky bar */
.ads-sticky-bar {
  position: sticky;
  top: 64px;
  z-index: 900;
  background: rgba(15, 14, 23, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.ads-sticky-bar #ads {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  background: transparent;
}

.ads-sticky-bar #ads > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
  box-sizing: border-box;
}

.ads-sticky-bar #ads figure {
  margin: 0;
}

.ads-sticky-bar #ads img {
  width: 65px;
  height: 65px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transition: transform 180ms ease, box-shadow 180ms ease;
  display: block;
  border: none;
  cursor: pointer;
}

.ads-sticky-bar #ads a {
  display: inline-block;
  text-decoration: none;
  border-radius: 15px;
}

.ads-sticky-bar #ads img:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 10px 24px rgba(255, 45, 85, 0.35);
}

.ads-sticky-bar #ads .caption {
  height: 15px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
}
