/* ============================================================
 * 个人网站 —— 样式
 * 设计：简洁留白 / 蓝紫渐变 / 明暗双主题 / 移动优先
 * ============================================================ */
:root {
  --bg: #faf9f7;
  --bg-alt: #f2f0ec;
  --card: #ffffff;
  --text: #1b1b21;
  --muted: #6b6b7a;
  --line: #e8e4dc;
  --primary: #5b5bd6;
  --primary-2: #a855f7;
  --primary-soft: #ecebff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(27, 27, 33, .07);
  --shadow-lg: 0 20px 50px rgba(27, 27, 33, .12);
  --container: 1080px;
  --t: .25s ease;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
[data-theme="dark"] {
  --bg: #0e0e13;
  --bg-alt: #14141b;
  --card: #181820;
  --text: #f1f1f6;
  --muted: #9a9aa8;
  --line: #26262f;
  --primary-soft: #221f3a;
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font-family: var(--font); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
.container { width: min(100% - 44px, var(--container)); margin-inline: auto; }

/* 导航 */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), box-shadow var(--t);
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 8px 26px rgba(0,0,0,.06); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.01em; }
.brand-mark {
  width: 24px; height: 24px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 4px 12px rgba(91, 91, 214, .35);
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 7px 12px; border-radius: 999px; font-size: 14px; color: var(--muted);
  transition: color var(--t), background var(--t);
}
.nav-links a:hover { color: var(--text); background: var(--bg-alt); }
.nav-links a.active { color: var(--primary); background: var(--primary-soft); }
.nav-links .admin-link { color: var(--muted); border: 1px solid var(--line); margin-left: 6px; }
.nav-links .admin-link:hover { border-color: var(--primary); color: var(--primary); background: transparent; }
.menu-toggle, .theme-toggle {
  display: none; border: 1px solid var(--line); background: var(--card); color: var(--text);
  width: 40px; height: 40px; border-radius: 11px; cursor: pointer; font-size: 16px;
}
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 40px;
  padding: clamp(56px, 8vw, 96px) 0 clamp(48px, 7vw, 84px);
}
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); }
.hero h1 {
  font-size: clamp(40px, 7vw, 72px); line-height: 1.05; margin: 12px 0 10px;
  letter-spacing: -.03em; font-weight: 800;
}
.role { font-size: clamp(16px, 2vw, 20px); color: var(--muted); font-weight: 600; }
.tagline { margin-top: 16px; font-size: 16px; color: var(--muted); max-width: 34em; }
.actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: 999px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; transition: var(--t);
}
.btn.primary {
  color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 28px rgba(91, 91, 214, .34);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(91, 91, 214, .42); }
.btn.ghost { color: var(--text); background: var(--card); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.social {
  font-size: 13px; color: var(--muted); padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); transition: var(--t);
}
.social:hover { color: var(--primary); border-color: var(--primary); }

.hero-avatar { position: relative; display: grid; place-items: center; }
.avatar-ring {
  width: clamp(200px, 26vw, 300px); aspect-ratio: 1/1; border-radius: 50%;
  padding: 5px; background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: var(--shadow-lg);
}
.avatar-ring img { width: 100%; height: 100%; border-radius: 50%; display: block; background: var(--card); }
.glow {
  position: absolute; width: 120%; aspect-ratio: 1/1; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(168, 85, 247, .22), transparent 65%);
  filter: blur(16px);
}

/* 区块 */
.section { padding: clamp(52px, 7vw, 84px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 28px; }
.section-no {
  font-size: 13px; font-weight: 800; color: var(--primary);
  background: var(--primary-soft); padding: 3px 9px; border-radius: 8px;
}
.section-head h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.02em; }

.about-grid { display: grid; grid-template-columns: 1.6fr .9fr; gap: 32px; align-items: start; }
.bio { font-size: 16px; color: var(--muted); line-height: 1.9; }
.facts { display: grid; gap: 10px; }
.facts li {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 12px 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 14px;
}
.fact-k { color: var(--muted); }
.facts a { color: var(--primary); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 9px 16px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); font-size: 14px; font-weight: 600;
  transition: var(--t); cursor: default;
}
.chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  font-size: 11.5px; color: var(--primary); background: var(--primary-soft);
  padding: 3px 9px; border-radius: 999px;
}
.card-link { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--primary); }
.card-link:hover { text-decoration: underline; }

.timeline { position: relative; padding-left: 26px; display: grid; gap: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2)); opacity: .35; border-radius: 2px;
}
.tl-item { position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 7px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--card); border: 3px solid var(--primary);
}
.tl-period { font-size: 12.5px; font-weight: 700; color: var(--primary); }
.tl-role { font-size: 16px; font-weight: 700; margin-top: 2px; }
.tl-org { font-size: 13.5px; color: var(--muted); }
.tl-desc { font-size: 14px; color: var(--muted); margin-top: 6px; }

.contact-card {
  background: linear-gradient(135deg, rgba(91, 91, 214, .10), rgba(168, 85, 247, .10));
  border: 1px solid var(--line); border-radius: 26px; padding: clamp(28px, 5vw, 52px);
  text-align: center; box-shadow: var(--shadow);
}
.contact-card h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
.contact-card p { color: var(--muted); margin-top: 8px; }
.contact-actions { display: flex; gap: 12px; justify-content: center; margin: 22px 0 8px; flex-wrap: wrap; }
.contact-card .socials { justify-content: center; margin-top: 16px; }

.site-footer { border-top: 1px solid var(--line); padding: 22px 0; font-size: 12.5px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-inner a:hover { color: var(--primary); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px);
  background: rgba(20, 20, 26, .94); color: #fff; font-size: 13.5px;
  padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: var(--t); z-index: 200; max-width: calc(100% - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 入场动画 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.section-head, .bio, .facts, .chips > *, .cards > *, .timeline > *, .contact-card {
  animation: fadeUp .55s ease both;
}
.cards > :nth-child(2) { animation-delay: .06s; }
.cards > :nth-child(3) { animation-delay: .12s; }
.cards > :nth-child(4) { animation-delay: .18s; }

/* 响应式 */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 34px; text-align: center; }
  .hero-text { order: 2; }
  .hero-avatar { order: 1; }
  .actions, .socials { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .container { width: min(100% - 32px, var(--container)); }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute; left: 16px; right: 16px; top: 74px;
    flex-direction: column; align-items: stretch; padding: 10px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 14px; }
  .nav-links .admin-link { margin-left: 0; text-align: center; }
  .actions .btn, .contact-actions .btn { flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
section[id] { scroll-margin-top: 84px; }
