:root {
  --bg: #ffffff;
  --surface: #f6f8fb;
  --border: #e3e8ef;
  --text: #17202e;
  --body-text: #3b4759;
  --muted: #5d6a7e;
  --accent: #15803d;
  --accent-soft: rgba(21, 128, 61, 0.09);
  --accent-contrast: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --media-bg: #f0f3f8;
  --code-bg: #f3f5f9;
  --code-text: #33415c;
  --radius: 14px;
  --maxw: 1040px;
}

html[data-theme="dark"] {
  --bg: #0b0e14;
  --surface: #11151f;
  --border: #1e2532;
  --text: #e8ecf4;
  --body-text: #c6cedd;
  --muted: #9aa4b5;
  --accent: #4ade80;
  --accent-soft: rgba(74, 222, 128, 0.14);
  --accent-contrast: #08130c;
  --nav-bg: rgba(11, 14, 20, 0.85);
  --media-bg: #0d1017;
  --code-bg: #0d1017;
  --code-text: #aeb9cc;
}

/* language visibility */
html[data-lang="zh"] .lang-en,
html:not([data-lang="zh"]) .lang-zh { display: none !important; }

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

html[data-lang="zh"] body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

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

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

/* nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; letter-spacing: 0.02em; color: var(--text); font-size: 1.05rem; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-right nav { display: flex; align-items: center; }
.nav-right nav a { color: var(--muted); margin-left: 22px; font-size: 0.92rem; }
.nav-right nav a:hover { color: var(--text); text-decoration: none; }

.lang-toggle, .icon-btn {
  appearance: none; cursor: pointer; font-family: inherit;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: 8px; font-size: 0.82rem;
  padding: 4px 10px; line-height: 1.7;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.lang-toggle:hover, .icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 5px 8px; }
.icon-btn svg { width: 15px; height: 15px; display: block; }

html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }
html:not([data-theme="dark"]) .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: block; }

/* hero */
.hero { padding: 96px 24px 72px; }
.eyebrow {
  color: var(--accent); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1.08; font-weight: 800; letter-spacing: -0.03em; }
.slogan { font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.45; font-weight: 600; letter-spacing: -0.01em; color: var(--text); margin-top: 14px; max-width: 760px; }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 640px; margin-top: 20px; }
.hero-links { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 10px 20px; border-radius: 10px;
  border: 1px solid var(--border); color: var(--text); font-size: 0.95rem;
  background: var(--surface); transition: border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }

/* sections */
section { padding: 40px 24px; }
section h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin-bottom: 6px; }
.section-sub { color: var(--muted); margin-bottom: 28px; }

/* cards */
.card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 32px;
}
.card.reverse .card-media { order: 2; }
.card-media { background: var(--media-bg); display: flex; align-items: center; justify-content: center; padding: 20px; }
.card-media img { width: 100%; height: auto; border-radius: 8px; }
.card-body { padding: 30px 32px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tags span {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--accent); background: var(--accent-soft);
  padding: 3px 10px; border-radius: 999px;
}
.card h3 { font-size: 1.18rem; line-height: 1.35; margin-bottom: 12px; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card ul { margin: 16px 0 0 18px; color: var(--muted); font-size: 0.92rem; }
.card li { margin-bottom: 7px; }
.card li strong { color: var(--text); }
.card-links { margin-top: 20px; font-weight: 600; font-size: 0.95rem; }

/* skills */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chips span {
  background: var(--surface); border: 1px solid var(--border);
  padding: 7px 14px; border-radius: 999px; font-size: 0.86rem; color: var(--text);
}
.skill-groups { display: grid; gap: 20px; margin-bottom: 28px; }
.skill-group .chips { margin-bottom: 0; }
.skill-label {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.education { color: var(--muted); font-size: 0.95rem; }

/* footer */
.footer { border-top: 1px solid var(--border); margin-top: 48px; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 26px; padding-bottom: 26px; color: var(--muted); font-size: 0.88rem;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }

@media (max-width: 760px) {
  .card { grid-template-columns: 1fr; }
  .card.reverse .card-media { order: 0; }
  .hero { padding-top: 64px; }
  .footer-inner { flex-direction: column; gap: 8px; }
  .nav-right nav { display: none; }
}

/* ---- research report pages ---- */
.article { max-width: 800px; margin: 0 auto; padding: 56px 24px 72px; }
.article .back { font-size: 0.9rem; color: var(--muted); }
.article h1 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); line-height: 1.25; letter-spacing: -0.015em; margin: 22px 0 10px; }
.article .subtitle { color: var(--muted); font-size: 1.02rem; margin-bottom: 22px; }
.article h2 { font-size: 1.28rem; margin: 48px 0 14px; padding-top: 26px; border-top: 1px solid var(--border); }
.article h3 { font-size: 1.05rem; margin: 26px 0 10px; }
.article p { color: var(--body-text); margin-bottom: 14px; }
.article ul, .article ol { color: var(--body-text); margin: 0 0 16px 22px; }
.article li { margin-bottom: 8px; }
.article strong { color: var(--text); }
.article a { color: var(--accent); }
html[data-lang="zh"] .article p, html[data-lang="zh"] .article li { line-height: 1.9; }
.article .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.article .meta span {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px;
}
.tldr {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 10px;
  padding: 18px 22px; margin: 26px 0 8px;
}
.tldr p:last-child, .tldr ul:last-child { margin-bottom: 0; }
.article table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: 0.9rem; }
.article th, .article td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.article th { background: var(--surface); color: var(--text); font-weight: 600; }
.article td { color: var(--body-text); }
.article pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; font-size: 0.83rem; line-height: 1.55;
  margin: 16px 0 22px; color: var(--code-text);
}
.article figure { margin: 22px 0; }
.article figure img { width: 100%; border-radius: 10px; border: 1px solid var(--border); background: var(--media-bg); }
.article figcaption { color: var(--muted); font-size: 0.82rem; margin-top: 8px; }
.article .divider-note { color: var(--muted); font-size: 0.85rem; }
