/* IPedia — design tokens + layout (dark / light via html[data-theme]) */

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050810;
  --bg-elevated: #0d111d;
  --gradient-1: rgba(125, 211, 252, 0.15);
  --gradient-2: rgba(167, 139, 250, 0.12);
  --panel: rgba(255, 255, 255, 0.04);
  --panel-2: rgba(255, 255, 255, 0.07);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --faint: #64748b;
  --border: rgba(255, 255, 255, 0.08);
  --header-bg: rgba(5, 8, 16, 0.8);
  --footer-bg: rgba(0, 0, 0, 0.2);
  --brand: #38bdf8;
  --brand-2: #818cf8;
  --nav-hover-bg: rgba(255, 255, 255, 0.05);
  --nav-strong-border: rgba(56, 189, 248, 0.3);
  --nav-strong-bg: rgba(56, 189, 248, 0.1);
  --button-ghost: var(--muted);
  --pill-bg: rgba(255, 255, 255, 0.03);
  --tag-bg: rgba(255, 255, 255, 0.03);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  --skip-bg: #0f172a;
  --chrome-bg: rgba(255, 255, 255, 0.03);
  --chrome-border: rgba(255, 255, 255, 0.1);
  --radius: 16px;
  --max: 1120px;
  --good: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --gradient-1: rgba(56, 189, 248, 0.08);
  --gradient-2: rgba(139, 92, 246, 0.05);
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --faint: #94a3b8;
  --border: rgba(15, 23, 42, 0.08);
  --header-bg: rgba(255, 255, 255, 0.85);
  --footer-bg: #f1f5f9;
  --brand: #0ea5e9;
  --brand-2: #6366f1;
  --nav-hover-bg: rgba(14, 165, 233, 0.06);
  --nav-strong-border: rgba(14, 165, 233, 0.25);
  --nav-strong-bg: rgba(14, 165, 233, 0.08);
  --button-ghost: var(--muted);
  --pill-bg: rgba(15, 23, 42, 0.03);
  --tag-bg: rgba(15, 23, 42, 0.04);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  --skip-bg: #ffffff;
  --chrome-bg: #f1f5f9;
  --chrome-border: rgba(0, 0, 0, 0.05);
  --radius: 16px;
  --max: 1120px;
  --good: #059669;
  --warn: #d97706;
  --bad: #dc2626;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family:
    "Inter",
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Sans SC",
    Arial,
    sans-serif;
  background:
    radial-gradient(1200px 900px at 20% -10%, var(--gradient-1), transparent 55%),
    radial-gradient(900px 700px at 95% 10%, var(--gradient-2), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

code,
pre,
kbd,
samp {
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  font-size: 0.88em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  text-decoration: none;
  color: var(--brand);
}

.container {
  width: min(100% - 40px, var(--max));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--brand);
  color: var(--brand);
  font-weight: 600;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  left: 20px;
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 20px;
  flex-wrap: nowrap;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: fit-content;
  flex-shrink: 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
}

.brand-mark {
  color: var(--brand);
  font-weight: 800;
}

.brand-name {
  color: var(--text);
  font-size: 1.1rem;
}

.brand-subtitle {
  margin-top: -1px;
  margin-left: 40px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--faint);
  line-height: 1.2;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

@media (max-width: 1100px) {
  .brand-subtitle {
    display: none;
  }
}

.site-nav {
  display: flex;
  gap: 2px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
}

.site-nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--nav-hover-bg);
}

.nav-strong {
  color: var(--brand) !important;
  background: var(--nav-strong-bg) !important;
  font-weight: 600 !important;
}

.header-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lang-pill {
  display: flex;
  padding: 2px;
  gap: 1px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--chrome-bg);
}

.lang-btn {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--faint);
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.lang-btn[aria-pressed="true"] {
  background: var(--bg-elevated);
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--chrome-bg);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.hero {
  padding: 80px 0 40px;
  text-align: center;
}

.hero-inner h1 {
  margin: 0 auto;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  max-width: 20ch;
}

.hero-lead {
  margin: 24px auto 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.hero-cta {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.button:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.button.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

html[data-theme="light"] .button.primary {
  color: #fff;
}

.button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}

.button.ghost:hover {
  background: var(--nav-hover-bg);
  color: var(--text);
}

.hero-meta {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section {
  padding: 40px 0;
}

.section-head {
  margin-bottom: 24px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.grid {
  display: grid;
  gap: 20px;
}

.card,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.card:hover,
.panel:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  flex-grow: 1;
}

.card-meta {
  margin-top: 20px;
  display: flex;
  gap: 8px;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--faint);
  background: var(--tag-bg);
}

.panel-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.list li {
  margin-bottom: 10px;
  padding-left: 20px;
  position: relative;
  font-size: 14.5px;
}

.list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: bold;
}

.site-footer {
  margin-top: 60px;
  padding: 60px 0;
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.footer-brand {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.footer-note {
  margin-top: 12px;
  color: var(--faint);
  font-size: 14px;
  max-width: 40ch;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.footer-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

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

@media (max-width: 900px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .site-nav {
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .header-chrome {
    width: 100%;
    justify-content: space-between;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 32px;
  }

  .footer-links {
    align-items: center;
  }
}

