/* =========================================================
 *  极简 · 浅色留白 · 高端 主题
 *  想改全局配色，只改下面 :root 里的变量即可（一处生效）
 * ========================================================= */
:root {
  --bg: #FAFAF8;          /* 页面底色：暖白 */
  --surface: #FFFFFF;     /* 卡片 / 面板底色 */
  --fg: #1A1A1A;          /* 主文字 */
  --muted: #6B6B66;       /* 次要文字 */
  --line: #E6E4DF;        /* 分割线 / 边框 */
  --accent: #1A2B4A;      /* 强调色：墨蓝（克制的点睛色） */
  --maxw: 1080px;         /* 主页内容最大宽度 */
  --readw: 680px;         /* 文章阅读宽度（类似公众号） */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 30px rgba(0,0,0,.06);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system,
          BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 250, 248, .8);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-weight: 600; letter-spacing: .02em; }
.nav__links { display: flex; gap: 28px; }
.nav__links a { color: var(--muted); font-size: 15px; transition: color .2s; }
.nav__links a:hover { color: var(--fg); }

/* ---------- 通用布局 ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 96px 24px; }
.eyebrow {
  font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 18px;
}

/* ---------- 简介 / Hero ---------- */
.hero { text-align: center; padding-top: 120px; padding-bottom: 80px; }
.hero__name {
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.05; font-weight: 600; letter-spacing: -.01em;
  margin: 0;
}
.hero__role { margin: 18px 0 0; color: var(--muted); font-size: clamp(16px, 2.4vw, 20px); }
.hero__tagline { margin: 28px auto 0; max-width: 560px; font-size: 19px; color: var(--fg); }
.intro {
  list-style: none; padding: 0; margin: 44px auto 0; max-width: 600px;
  display: flex; flex-direction: column; gap: 14px;
}
.intro li { color: var(--muted); font-size: 17px; }
.contacts { margin-top: 40px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.contact {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 15px; color: var(--fg); transition: border-color .2s, color .2s;
}
.contact:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 项目网格 ---------- */
.projects__heading { font-size: clamp(28px, 4vw, 40px); font-weight: 600; margin: 0; }
.projects__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px; margin-top: 48px;
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; text-align: left; padding: 0; font: inherit; color: inherit;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card__media {
  aspect-ratio: 4 / 3; background: linear-gradient(135deg, #f0efea, #e7e5df);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.card__title { font-size: 20px; font-weight: 600; margin: 0; }
.card__meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 12px; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 3px 10px; border-radius: 999px;
}
.card__summary { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- 占位 / 缺失提示（图片未就位时的优雅降级） ---------- */
.media__ph {
  display: flex; align-items: center; justify-content: center; text-align: center;
  width: 100%; height: 100%; padding: 20px;
  color: var(--muted); font-size: 14px;
  border: 1px dashed var(--line); border-radius: 12px; background: var(--surface);
}
.media__ph small { color: var(--muted); opacity: .8; }

/* ---------- 入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 项目详情弹层 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: none; }
.modal.open { display: block; }
.modal__backdrop {
  position: absolute; inset: 0; background: rgba(20, 20, 18, .45);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .3s ease;
}
.modal.open .modal__backdrop { opacity: 1; }
.modal__panel {
  position: absolute; top: 0; right: 0; height: 100%;
  width: min(720px, 100%);
  background: var(--bg); overflow-y: auto;
  transform: translateX(30px); opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
  box-shadow: -20px 0 60px rgba(0,0,0,.12);
}
.modal.open .modal__panel { transform: none; opacity: 1; }
.modal__close {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: .2s;
}
.modal__close:hover { color: var(--fg); border-color: var(--accent); }
.modal__inner { padding: 56px 36px 80px; }
.modal__title { font-size: clamp(28px, 5vw, 40px); font-weight: 600; margin: 0 0 14px; line-height: 1.1; }
.modal__meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; flex-wrap: wrap; }

/* ---------- 公众号式文章排版 ---------- */
.article { max-width: var(--readw); margin: 32px auto 0; font-size: 17px; line-height: 1.85; }
.article p { margin: 0 0 22px; }
.article h3 { font-size: 22px; font-weight: 600; margin: 36px 0 14px; }
.article .media { margin: 32px 0; }
.article .media img { width: 100%; border-radius: 12px; background: #eee; }
.article figcaption { margin-top: 10px; color: var(--muted); font-size: 14px; text-align: center; }
.modal__link {
  display: inline-flex; margin-top: 40px; padding: 12px 24px;
  background: var(--accent); color: #fff; border-radius: 999px; font-size: 15px; transition: opacity .2s;
}
.modal__link:hover { opacity: .9; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line); padding: 40px 24px;
  text-align: center; color: var(--muted); font-size: 14px;
}

/* ---------- 移动端 ---------- */
@media (max-width: 600px) {
  .section { padding: 64px 20px; }
  .hero { padding-top: 80px; }
  .modal__inner { padding: 56px 20px 64px; }
}
