/* ============================================================
 *  style.css —— 简洁现代 · 响应式（移动优先）
 * ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --text-soft: #5b6270;
  --muted: #8b93a1;
  --line: #e6e8ec;
  --accent: #3b5bfd;
  --accent-soft: rgba(59, 91, 253, .1);
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 18, 27, .06), 0 4px 16px rgba(16, 18, 27, .05);
  --shadow-md: 0 10px 30px rgba(16, 18, 27, .09);
  --maxw: 1120px;
  --header-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0e1014;
  --bg-alt: #14171d;
  --surface: #171b22;
  --text: #eef1f6;
  --text-soft: #a9b2c0;
  --muted: #7a8494;
  --line: #262b34;
  --accent: #6a8cff;
  --accent-soft: rgba(106, 140, 255, .14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .3);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
body.nav-open { overflow: hidden; }
img { max-width: 100%; display: block; border-radius: 12px; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.icon { width: 1.05em; height: 1.05em; fill: currentColor; flex: none; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 800;
}
.brand-text { font-size: 16px; letter-spacing: -.01em; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative; padding: 8px 14px; border-radius: 999px;
  font-size: 15px; color: var(--text-soft); transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--text); background: var(--accent-soft); }
.nav-link.is-active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle, .nav-toggle {
  width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); cursor: pointer;
  display: grid; place-items: center; transition: border-color .2s, transform .2s;
}
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--accent); }
.theme-icon { font-size: 15px; line-height: 1; }

.nav-toggle { display: none; flex-direction: column; gap: 4px; }
.nav-toggle span { width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s, opacity .2s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------------- Hero ---------------- */
.hero { padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 7vw, 80px); }
.hero-inner {
  display: grid; grid-template-columns: 1.35fr .9fr; gap: clamp(28px, 5vw, 56px); align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
  font-size: 13px; color: var(--accent); background: var(--accent-soft);
  padding: 5px 12px; border-radius: 999px; font-weight: 600;
}
.eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}
.hero-title { font-size: clamp(30px, 5.4vw, 52px); font-weight: 800; }
.hero-title .accent { color: var(--accent); }
.hero-role { margin: 12px 0 0; font-size: clamp(16px, 2.4vw, 20px); color: var(--text-soft); font-weight: 600; }
.hero-tagline { margin-top: 10px; font-size: 16px; color: var(--text-soft); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 20px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--muted); }
.hero-meta li { display: flex; align-items: center; gap: 6px; }
.hero-meta a:hover { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 11px 20px; border-radius: 999px; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-visual { display: flex; justify-content: center; }
.avatar-card { position: relative; width: min(300px, 76vw); }
.avatar-card img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 26px;
  box-shadow: var(--shadow-md); background: var(--bg-alt);
}
.avatar-badge {
  position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  white-space: nowrap; box-shadow: var(--shadow-sm);
}

/* ---------------- Sections ---------------- */
.section { padding: clamp(52px, 8vw, 96px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 62ch; margin-bottom: clamp(28px, 4vw, 44px); }
.section-kicker {
  margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
}
.section-title { font-size: clamp(24px, 3.6vw, 34px); font-weight: 800; }
.section-desc { margin-top: 12px; color: var(--text-soft); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm);
}
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }

/* Video */
.video-wrap {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.video-wrap video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-placeholder { position: relative; }
.video-placeholder img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 0; opacity: .5; }
.video-hint {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
  text-align: center; padding: 20px; color: var(--text);
}
.video-play {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 20px; margin-bottom: 14px;
  box-shadow: var(--shadow-md);
}
.video-hint p { margin: 0 0 4px; font-size: 14.5px; color: var(--text-soft); }
.video-hint code {
  background: var(--accent-soft); color: var(--accent); padding: 1px 6px;
  border-radius: 6px; font-size: 13px; font-family: ui-monospace, Consolas, monospace;
}

/* About */
.about-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
.about-copy p { color: var(--text-soft); }
.about-copy .lead { font-size: 17px; color: var(--text); }
.about-side { display: grid; gap: 16px; }
.fact-list li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 15px;
}
.fact-list li:last-child { border-bottom: 0; }
.fact-k { color: var(--muted); }
.fact-v { font-weight: 600; text-align: right; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  display: inline-block; font-size: 12.5px; color: var(--text-soft);
  background: var(--bg-alt); border: 1px solid var(--line);
  padding: 4px 11px; border-radius: 999px;
}
[data-theme="dark"] .tag { background: rgba(255, 255, 255, .04); }

.skills {
  margin-top: clamp(28px, 4vw, 44px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px;
}
.skill-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.skill-bar { height: 6px; border-radius: 99px; background: var(--bg-alt); border: 1px solid var(--line); overflow: hidden; }
.skill-bar i { display: block; height: 100%; width: var(--v); border-radius: 99px; background: var(--accent); }
.skill-tags { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* Projects */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.filter-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text-soft);
  padding: 7px 15px; border-radius: 999px; font-size: 14px; cursor: pointer;
  transition: all .2s; font-family: inherit;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.project-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s;
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.project-cover { display: block; background: var(--bg-alt); }
.project-cover img { border-radius: 0; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.project-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.project-title { font-size: 17px; font-weight: 700; }
.project-year { font-size: 13px; color: var(--muted); flex: none; }
.project-desc { color: var(--text-soft); font-size: 14.5px; margin: 0; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project-links { display: flex; gap: 16px; margin-top: auto; padding-top: 6px; font-size: 14px; font-weight: 600; }
.project-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.project-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Posts */
.post-list { display: grid; gap: 12px; }
.post {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 18px; align-items: center;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); transition: border-color .2s, transform .2s, box-shadow .2s;
}
.post:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.post-date { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.post-title { font-size: 16.5px; font-weight: 700; }
.post-summary { margin: 6px 0 0; font-size: 14px; color: var(--text-soft); }
.post-cat { font-size: 12.5px; color: var(--accent); background: var(--accent-soft); padding: 4px 11px; border-radius: 999px; white-space: nowrap; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; align-items: start; }
.contact-note { color: var(--text-soft); font-size: 15px; }
.contact-mail {
  display: inline-block; font-size: clamp(18px, 2.6vw, 24px); font-weight: 700;
  color: var(--accent); margin: 6px 0 20px; word-break: break-all;
}
.contact-mail:hover { text-decoration: underline; text-underline-offset: 4px; }
.social-list { display: grid; gap: 6px; }
.social-list a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--text-soft); font-size: 15px; transition: background .2s, color .2s;
}
.social-list a:hover { background: var(--accent-soft); color: var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0; background: var(--bg); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; font-size: 14px; color: var(--muted); }
.footer-nav { display: flex; gap: 18px; font-size: 14px; color: var(--muted); }
.footer-nav a:hover { color: var(--accent); }

.empty-hint { color: var(--muted); font-size: 14px; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .hero-visual { order: -1; justify-content: flex-start; }
  .avatar-card { width: min(190px, 46vw); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 14px 20px 22px; transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
    box-shadow: var(--shadow-md);
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-link { padding: 12px 14px; font-size: 16px; border-radius: 12px; }
  .hero-meta { font-size: 13.5px; }
  .project-grid { grid-template-columns: 1fr; }
  .post { grid-template-columns: 1fr; gap: 8px; }
  .post-cat { justify-self: start; }
  .post-date { order: -1; }
}

@media (max-width: 420px) {
  .container { padding: 0 16px; }
  .brand-text { display: none; }
  .hero-actions .btn { flex: 1 1 auto; }
}
