/* ============================================================
   个人作品集网站 · style.css
   基调：浅色留白 · 一主色(靛蓝) + 一辅助色(珊瑚) + 中性灰
   契约：类名与 index.html / app.js 严格对应，勿改名
   ============================================================ */

:root {
  --bg: #FBFBFD;
  --surface: #FFFFFF;
  --text: #23262E;
  --muted: #6B7280;
  --border: #E7E9F0;
  --primary: #4653E8;
  --primary-deep: #3A45D4;
  --primary-soft: #EEF0FE;
  --accent: #FF6B5B;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(35, 38, 46, 0.06);
  --shadow-hover: 0 16px 40px rgba(35, 38, 46, 0.10);
  --font-sans: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }

a:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 253, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { font-weight: 700; font-size: 17px; color: var(--text); letter-spacing: 0.5px; }
.brand:hover { color: var(--primary); }

.nav-links { display: flex; gap: 4px; list-style: none; }

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--primary); background: var(--primary-soft); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }

/* ---------- 首屏 Hero ---------- */
.hero { padding: 96px 0 72px; }

.hero-inner { display: grid; grid-template-columns: 260px 1fr; gap: 56px; align-items: center; text-align: left; padding-top: 72px; padding-bottom: 56px; }

.hero-media { display: flex; justify-content: center; }

.hero-avatar { width: 240px; height: 240px; border-radius: 24px; object-fit: cover; box-shadow: var(--shadow); background: var(--primary-soft); }

.hero-copy { max-width: 560px; }

.hero-name { font-size: 40px; line-height: 1.25; letter-spacing: 0.5px; }
.hero-tagline { margin-top: 10px; font-size: 18px; color: var(--primary); font-weight: 600; }
.hero-bio { margin-top: 14px; color: var(--muted); font-size: 16px; }

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

.hero-hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 48px; letter-spacing: 1px; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(70, 83, 232, 0.28); }
.btn-primary:hover { background: var(--primary-deep); box-shadow: 0 12px 26px rgba(70, 83, 232, 0.34); }

.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 区块通用 ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-title { font-size: 28px; letter-spacing: 0.5px; }
.section-sub { margin-top: 6px; font-size: 13px; letter-spacing: 3px; color: var(--muted); text-transform: uppercase; }

/* ---------- 作品卡片 ---------- */
.project-grid { margin-top: 36px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.project-cover {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  background: var(--primary-soft);
}

.project-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.project-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }

.project-title { font-size: 18px; line-height: 1.4; }
.project-title a { color: var(--text); }
.project-title a:hover { color: var(--primary); }

.project-summary { font-size: 14px; color: var(--muted); flex: 1; }

.project-role { font-size: 13px; color: var(--primary); font-weight: 600; }
.project-outcome { font-size: 13px; color: var(--accent); font-weight: 600; }
.project-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; color: var(--primary); background: var(--primary-soft); padding: 3px 10px; border-radius: 999px; }

.project-link { margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--primary); }
.project-link:hover { text-decoration: underline; }

/* ---------- 文章列表 ---------- */
.article-list { margin-top: 28px; display: grid; gap: 14px; }

.article-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 18px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.article-item:hover { border-color: var(--primary); transform: translateX(4px); }

.article-date { font-size: 13px; color: var(--muted); }

.article-title { font-size: 17px; }
.article-summary { font-size: 14px; color: var(--muted); margin-top: 4px; }

.article-tags { display: flex; gap: 6px; margin-top: 8px; }

.article-arrow { color: var(--primary); font-size: 18px; font-weight: 700; }

/* ---------- 动态卡片 ---------- */
.moment-list { margin-top: 28px; display: grid; gap: 14px; }

.moment-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; transition: border-color 0.2s, transform 0.2s; }
.moment-card:hover { border-color: var(--primary); transform: translateX(4px); }
.moment-card.flash { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.moment-date { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.moment-content { font-size: 15px; white-space: pre-line; }
.moment-tags { display: flex; gap: 6px; margin-top: 10px; }

/* ---------- 封面占位 ---------- */
.cover-placeholder { aspect-ratio: 16 / 10; width: 100%; background: linear-gradient(135deg, var(--primary-soft), #F3F4FA); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; letter-spacing: 1px; }

/* ---------- 关于与技能 ---------- */
.about-grid { margin-top: 36px; display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: start; }

.about-bio .section-title { margin-bottom: 14px; }
.about-text { color: var(--muted); white-space: pre-line; }

.skills-groups { display: grid; gap: 28px; }

.skill-group-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.skill-group-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--primary);
}

.skill-item { margin-bottom: 10px; }
.skill-head { display: flex; justify-content: space-between; font-size: 14px; }
.skill-level { color: var(--muted); }

.skill-bar { margin-top: 6px; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.skill-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #7C84F5);
  width: 0;
  transition: width 0.8s ease;
}

/* ---------- 联系 ---------- */
.contact-hint { color: var(--muted); margin: 12px 0 18px; }

.contact-email { font-size: 18px; font-weight: 600; }
.contact-email:hover { text-decoration: underline; }

.social-links { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  background: var(--surface);
  transition: border-color 0.2s, color 0.2s;
}
.social-link:hover { border-color: var(--primary); color: var(--primary); }
.social-link svg { width: 16px; height: 16px; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--muted);
  font-size: 13px;
  background: var(--bg);
}
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- 文章弹层 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }

.modal-backdrop { position: absolute; inset: 0; background: rgba(35, 38, 46, 0.45); }

.modal-body {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: var(--shadow-hover);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 15px;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.modal-close:hover { color: var(--primary); border-color: var(--primary); }

.modal-title { font-size: 22px; margin-bottom: 8px; padding-right: 40px; }
.modal-meta { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.modal-content { font-size: 15px; white-space: pre-line; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-inner { grid-template-columns: 200px 1fr; gap: 32px; }
}

@media (max-width: 640px) {
  .nav-link { padding: 6px 8px; font-size: 14px; }
  .hero { padding: 64px 0 48px; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-media { justify-content: center; }
  .hero-avatar { width: 160px; height: 160px; }
  .hero-copy { max-width: none; }
  .hero-name { font-size: 30px; }
  .hero-actions { justify-content: center; }
  .section { padding: 56px 0; }
  .project-grid { grid-template-columns: 1fr; }
  .article-item { grid-template-columns: 1fr; gap: 6px; }
  .article-arrow { display: none; }
  .site-footer .container { flex-direction: column; }
}

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