/* ==========================================================================
   极简浅色主题 —— 想换整站配色，改 profile.js 里的 settings.accent 就够了
   ========================================================================== */

:root {
  --accent: #2563eb;              /* 由 profile.js 的 settings.accent 覆盖 */
  --accent-soft: rgba(37, 99, 235, .10);
  --bg: #ffffff;
  --fg: #18181b;
  --fg-2: #3f3f46;
  --muted: #71717a;
  --line: #e7e7ea;
  --line-strong: #d4d4d8;
  --chip-bg: #f4f4f5;
  --radius: 14px;
  --maxw: 880px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-soft); }

h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* 键盘焦点可见 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--accent); color: #fff; padding: 8px 14px;
  border-radius: 8px; font-size: 14px; transition: top .15s;
}
.skip-link:focus { top: 12px; }

/* ============================ 顶部导航 ============================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; gap: 18px;
}
.brand { font-weight: 700; letter-spacing: -.01em; white-space: nowrap; font-size: 15px; }
.brand:hover { color: var(--accent); }

.nav-links {
  display: flex; gap: 2px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  padding: 6px 10px; border-radius: 8px; font-size: 14px; color: var(--muted);
  white-space: nowrap; transition: background .15s, color .15s;
}
.nav-links a:hover { color: var(--fg); background: var(--chip-bg); }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); font-weight: 550; }

.lang-btn {
  flex: none; font: inherit; font-size: 13px; line-height: 1;
  padding: 7px 13px; border: 1px solid var(--line-strong); background: #fff;
  color: var(--fg-2); border-radius: 999px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ============================== 首页头部 ============================== */
.hero { display: flex; align-items: center; gap: 30px; padding: 64px 0 4px; }

.hero-avatar { flex: none; }
.hero-avatar img,
.hero-avatar .avatar-fallback {
  width: 104px; height: 104px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line);
}
.hero-avatar .avatar-fallback {
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #111));
  color: #fff; font-size: 36px; font-weight: 600; letter-spacing: .02em;
  border: none; user-select: none;
}

.hero-body { min-width: 0; }
.hero-name { font-size: clamp(28px, 5vw, 38px); font-weight: 700; letter-spacing: -.025em; }
.hero-role { margin-top: 6px; font-size: 16px; color: var(--fg-2); }
.hero-tagline { margin-top: 10px; font-size: 15px; color: var(--muted); max-width: 58ch; }

.hero-meta {
  margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px 16px; font-size: 14px; color: var(--muted);
}
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-item .ico { width: 15px; height: 15px; }

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 11px 3px 9px; border-radius: 999px;
  background: rgba(22, 163, 74, .09); color: #15803d;
  font-size: 13px; font-weight: 500;
}
.badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .16);
}

.hero-links { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 14px; color: var(--fg-2); background: #fff;
  transition: border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.btn:hover {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 4px 14px -8px var(--accent); transform: translateY(-1px);
}
.btn .ico { width: 16px; height: 16px; }

/* ============================== 版块通用 ============================== */
.sec { padding-top: 60px; scroll-margin-top: 76px; }

.sec-head {
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 12px; margin-bottom: 24px; border-bottom: 1px solid var(--line);
}
.sec-num { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--accent); letter-spacing: .06em; }
.sec-title { font-size: 20px; }

/* 关于我 */
.about-text { font-size: 15.5px; color: var(--fg-2); max-width: 68ch; }
.facts {
  margin-top: 22px; display: grid; gap: 14px 28px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.fact-k { font-size: 13px; color: var(--muted); }
.fact-v { font-size: 15px; color: var(--fg); font-weight: 500; margin-top: 2px; }

/* ============================== 时间线 ============================== */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 1px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 26px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -26px; top: 8px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
}
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tl-title { font-size: 16.5px; }
.tl-period { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.tl-sub { margin-top: 3px; font-size: 14.5px; color: var(--fg-2); }
.tl-score { margin-top: 4px; font-size: 14px; color: var(--accent); }
.tl-list { margin-top: 10px; }
.tl-list li {
  position: relative; padding-left: 18px; font-size: 14.5px;
  color: var(--fg-2); margin-bottom: 4px;
}
.tl-list li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 10px; height: 1px; background: var(--line-strong);
}

/* ============================== 技能标签 ============================== */
.skill-grid { display: grid; gap: 26px 40px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.skill-title { font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--chip-bg); color: var(--fg-2); font-size: 13.5px;
  border: 1px solid transparent; transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--line-strong); color: var(--fg); }
.chip.accent { background: var(--accent-soft); color: var(--accent); font-family: var(--mono); font-size: 12.5px; }

/* ============================== 项目卡片 ============================== */
.proj {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 20px; margin-bottom: 16px; background: #fff;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.proj:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 28px -18px rgba(24, 24, 27, .35);
  transform: translateY(-2px);
}
.proj-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.proj-name { font-size: 17px; }
.proj-period { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.proj-role { margin-top: 3px; font-size: 14px; color: var(--muted); }
.proj-desc { margin-top: 10px; font-size: 14.8px; color: var(--fg-2); }
.proj-points { margin-top: 11px; }
.proj-points li {
  position: relative; padding-left: 18px; font-size: 14.5px;
  color: var(--fg-2); margin-bottom: 5px;
}
.proj-points li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 10px; height: 1px; background: var(--line-strong);
}
.proj-foot { margin-top: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.proj-links { display: flex; flex-wrap: wrap; gap: 14px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; color: var(--accent); font-weight: 500;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn .ico { width: 15px; height: 15px; }

/* ============================== 竞赛与荣誉 ============================== */
.award {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.award:last-child { border-bottom: none; }
.award-title { font-size: 15.5px; font-weight: 500; }
.award-note { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.award-date { margin-left: auto; font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.award-details { flex-basis: 100%; margin-top: 7px; }
.award-details li {
  position: relative; padding-left: 18px; font-size: 14.5px;
  color: var(--fg-2); margin-bottom: 4px;
}
.award-details li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 10px; height: 1px; background: var(--line-strong);
}

/* ============================== 联系方式 ============================== */
.contact-intro { font-size: 15px; color: var(--muted); margin-bottom: 20px; max-width: 64ch; }
.contact-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.contact-item {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
a.contact-item:hover { border-color: var(--accent); box-shadow: 0 6px 20px -14px var(--accent); }
.contact-ico {
  flex: none; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; background: var(--chip-bg); color: var(--fg-2);
}
.contact-ico .ico { width: 17px; height: 17px; }
.contact-body { min-width: 0; }
.contact-label { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.contact-value {
  display: block; font-size: 14.5px; color: var(--fg); font-weight: 500;
  overflow-wrap: anywhere;
}
.copy-btn {
  margin-left: auto; flex: none; font: inherit; font-size: 12.5px;
  padding: 5px 10px; border: 1px solid var(--line); background: #fff;
  color: var(--muted); border-radius: 8px; cursor: pointer;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ============================== 页脚 ============================== */
.footer {
  margin-top: 80px; border-top: 1px solid var(--line);
  padding: 26px 0 44px; font-size: 13px; color: var(--muted);
}
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px 20px; flex-wrap: wrap;
}

/* ============================== 空状态提示 ============================== */
.empty-tip {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 26px; background: #fafafa; margin-top: 40px;
}
.empty-tip h2 { font-size: 17px; margin-bottom: 8px; }
.empty-tip p { font-size: 14.5px; color: var(--fg-2); }
.empty-tip code {
  font-family: var(--mono); font-size: 13px; background: #fff;
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px;
}

/* ============================== 响应式 ============================== */
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .container { padding: 0 18px; }
  .nav-inner { padding: 0 18px; gap: 12px; height: 56px; }
  .brand { font-size: 14px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 20px; padding-top: 40px; }
  .hero-avatar img, .hero-avatar .avatar-fallback { width: 82px; height: 82px; }
  .hero-avatar .avatar-fallback { font-size: 28px; }
  .sec { padding-top: 46px; }
  .proj { padding: 18px; }
  .tl-head, .proj-head { flex-direction: column; gap: 4px; }
  .award { flex-wrap: wrap; gap: 2px 12px; }
  .award-date { margin-left: 0; width: 100%; }
  .footer { margin-top: 60px; }
}

/* ============================== 打印（导出 PDF 简历） ============================== */
@media print {
  .nav, .skip-link, .copy-btn, .hero-links { display: none !important; }
  .sec { padding-top: 22px; page-break-inside: avoid; }
  .proj { box-shadow: none !important; transform: none !important; page-break-inside: avoid; }
  a { text-decoration: none; }
  body { font-size: 12pt; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
