:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans TC", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --color-bg: #f8fafc;
  --color-card: #ffffff;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #eef2ff;
  --color-accent: #0284c7;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.05);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.2s;
}

.header-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

.brand-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  margin-left: 0.25rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: all 0.15s;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-text);
  background: #f1f5f9;
}

/* Language Switcher */
.lang-selector {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.2rem;
  gap: 0.2rem;
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.65rem;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.lang-btn:hover {
  color: var(--color-text);
}

.lang-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-portal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: #0f172a;
  color: #ffffff;
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: 9px;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.btn-portal:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

/* Main Container */
.main-wrapper {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  flex: 1;
  width: 100%;
}

/* Legal Header Hero */
.legal-hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.5rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: #475569;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 1.25rem;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  font-size: 0.8rem;
  color: #64748b;
  font-family: var(--font-mono);
}

/* Cards & Layout */
.legal-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.hub-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
}

.hub-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.hub-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.hub-card-icon.terms {
  background: #eef2ff;
  color: #4f46e5;
}

.hub-card-icon.privacy {
  background: #f0fdf4;
  color: #16a34a;
}

.hub-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #0f172a;
}

.hub-card-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.hub-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* Legal Content Typography */
.content-body {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.8;
}

.content-body h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content-body h2:first-of-type {
  margin-top: 0;
}

.content-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.content-body p {
  margin-bottom: 1rem;
}

.content-body ul, .content-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.content-body li {
  margin-bottom: 0.5rem;
}

.content-body strong {
  color: #0f172a;
  font-weight: 600;
}

.content-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: #f1f5f9;
  padding: 0.15rem 0.35rem;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

/* Callout Alert Box */
.legal-callout {
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
  border: 1px solid transparent;
}

.legal-callout.warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.legal-callout.info {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}

.legal-callout.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* Table of Contents */
.toc-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.toc-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.toc-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.5rem;
}

.toc-list li a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}

.toc-list li a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: #ffffff;
  padding: 2.5rem 1.5rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
}

.footer-links a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: #0f172a;
}

.footer-bottom {
  border-top: 1px solid #f1f5f9;
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: var(--font-mono);
}

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

body[data-active-lang="zh-tw"] [data-lang-content="zh-tw"],
body[data-active-lang="zh-cn"] [data-lang-content="zh-cn"],
body[data-active-lang="en"] [data-lang-content="en"] {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .legal-card {
    padding: 1.5rem;
  }
  .nav-links {
    display: none;
  }
}
