:root {
  --bg-primary: #0a0c10;
  --bg-secondary: #12151d;
  --bg-card: rgba(24, 28, 38, 0.7);
  --bg-card-hover: rgba(32, 38, 52, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 99, 64, 0.4);
  --accent-color: #ff5e3a;
  --accent-gradient: linear-gradient(135deg, #ff5e3a 0%, #ff8a48 100%);
  --accent-badge: rgba(255, 94, 58, 0.15);
  --text-primary: #f5f5f7;
  --text-secondary: #9aa0a6;
  --text-muted: #6b7280;
  --badge-bg: rgba(255, 255, 255, 0.06);
  --badge-text: #e2e8f0;
  --success-color: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --container-max: 1040px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: #ffffff;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(255, 94, 58, 0.5);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --badge-bg: rgba(0, 0, 0, 0.05);
  --badge-text: #334155;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.68;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(ellipse at 50% -10%, rgba(255, 94, 58, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 90% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 40%);
  background-repeat: no-repeat;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.85;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Nav */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 12, 16, 0.75);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s;
}

[data-theme="light"] header.site-header {
  background: rgba(248, 250, 252, 0.8);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--accent-badge);
  color: var(--accent-color);
  border: 1px solid rgba(255, 94, 58, 0.2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-control {
  background: var(--badge-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-control:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Page Hero */
.page-hero {
  padding: 56px 0 36px;
  border-bottom: 1px solid var(--border-color);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-badge);
  color: var(--accent-color);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 94, 58, 0.25);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-meta {
  color: var(--text-secondary);
  font-size: 0.94rem;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Highlights Grid */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 32px 0 24px;
}

.highlight-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.highlight-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 94, 58, 0.3);
}

.highlight-icon {
  font-size: 1.5rem;
  margin-bottom: 10px;
  display: inline-block;
}

.highlight-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.highlight-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Legal Content Body */
.legal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  padding: 44px 0 80px;
}

.toc-sidebar {
  position: sticky;
  top: 96px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 12px;
}

.toc-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.toc-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-nav a {
  display: block;
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}

.toc-nav a:hover,
.toc-nav a.active {
  color: var(--text-primary);
  background: var(--badge-bg);
  border-left-color: var(--accent-color);
}

.legal-article {
  max-width: 100%;
}

.legal-section {
  margin-bottom: 48px;
  scroll-margin-top: 96px;
}

.legal-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text-primary);
}

.legal-section p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.legal-section ul,
.legal-section ol {
  margin: 0 0 20px 24px;
  color: var(--text-secondary);
}

.legal-section li {
  margin-bottom: 8px;
}

/* Callout Box */
.callout-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-color);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 22px 0;
}

.callout-box.success {
  border-left-color: var(--success-color);
  background: var(--success-bg);
}

.callout-title {
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 6px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout-box p {
  margin-bottom: 0;
  font-size: 0.92rem;
}

/* Table Style */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

table.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

table.legal-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

table.legal-table td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

table.legal-table tr:last-child td {
  border-bottom: none;
}

/* Contact Card */
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-label {
  font-weight: 600;
  color: var(--text-primary);
  width: 110px;
  flex-shrink: 0;
}

/* Landing specific */
.hero-home {
  padding: 80px 0 50px;
  text-align: center;
}

.hero-home .hero-title {
  font-size: 3.2rem;
  letter-spacing: -0.035em;
  max-width: 780px;
  margin: 0 auto 18px;
}

.hero-home .hero-desc {
  font-size: 1.22rem;
  color: var(--text-secondary);
  max-width: 660px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(255, 94, 58, 0.35);
  border: none;
  cursor: pointer;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 40px 0 80px;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.2s;
}

.feature-box:hover {
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.feature-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Footer */
footer.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 40px 0 32px;
  background: var(--bg-secondary);
}

.footer-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  margin-top: 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Language display toggle */
[data-lang-content] {
  display: none;
}

body.lang-zh [data-lang-content="zh"] {
  display: block;
}

body.lang-zh span[data-lang-content="zh"],
body.lang-zh strong[data-lang-content="zh"],
body.lang-zh em[data-lang-content="zh"] {
  display: inline;
}

body.lang-en [data-lang-content="en"] {
  display: block;
}

body.lang-en span[data-lang-content="en"],
body.lang-en strong[data-lang-content="en"],
body.lang-en em[data-lang-content="en"] {
  display: inline;
}

/* Responsive */
@media (max-width: 860px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .toc-sidebar {
    display: none;
  }
  .hero-title {
    font-size: 2rem;
  }
  .hero-home .hero-title {
    font-size: 2.2rem;
  }
  .nav-links {
    display: none;
  }
}

@media print {
  header.site-header,
  footer.site-footer,
  .toc-sidebar,
  .nav-actions {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .legal-layout {
    grid-template-columns: 1fr;
    padding: 0;
  }
  .legal-section {
    page-break-inside: avoid;
  }
}
