/* ══════════════════════════════════════════════════════════
   配色 —— 想换颜色，只改这一段
   ══════════════════════════════════════════════════════════ */
:root {
  --bg:      #f7f5f1;                /* 页面底色 */
  --bg-2:    #efebe4;                /* 图片加载前的底色 */
  --ink:     #1b1815;                /* 主文字 */
  --muted:   #6f675d;                /* 次要文字 */
  --faint:   #a29788;                /* 编号、脚注 */
  --line:    rgba(27, 24, 21, .10);  /* 分隔线 */
  --accent:  #b4552d;                /* 主色：按钮、链接、焦点框 */
  --glow:    rgba(180, 85, 45, .16); /* 顶部那抹光 */
  --radius:  18px;
  --shadow:  0 1px 2px rgba(27, 24, 21, .05), 0 14px 34px rgba(27, 24, 21, .07);
}

/* 手机开了深色模式会自动切换（不想要可以整段删掉） */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #0e0d0c;
    --bg-2:   #171513;
    --ink:    #f3eee6;
    --muted:  #a89c8d;
    --faint:  #6f655a;
    --line:   rgba(243, 238, 230, .10);
    --accent: #e08a5e;
    --glow:   rgba(224, 138, 94, .13);
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 18px 44px rgba(0, 0, 0, .38);
  }
}

/* ── 基础 ─────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Noto Sans SC", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 顶部一抹很淡的暖光，固定在视口上，不随滚动跑掉 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 42% at 50% -8%, var(--glow), transparent 70%),
    radial-gradient(40% 28% at 92% 2%, var(--glow), transparent 72%);
}

img { max-width: 100%; }

::selection { background: var(--accent); color: #fff; }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ── 版面容器 ─────────────────────────────────────── */

.shell {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 30px 24px 64px;
}

/* ── 顶部细条 ─────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
}

.topmail {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color .2s ease, border-color .2s ease;
}

.topmail:hover { color: var(--ink); border-color: var(--ink); }

/* ── 头部 ─────────────────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 0 60px;
}

.avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
}

.name {
  margin: 26px 0 0;
  font-size: clamp(42px, 10vw, 68px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.035em;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); }

@media (prefers-color-scheme: dark) {
  .btn-primary { color: #141210; }
}

/* ── 分节 ─────────────────────────────────────────── */

.block {
  padding: 44px 0;
  border-top: 1px solid var(--line);
}

.block-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}

/* 标题右边拖一条细线，让分节更像杂志排版 */
.block-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  align-self: center;
}

.num {
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.block-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--muted);
}

/* 关于我：一句话做成大字 */
.statement {
  margin: 0;
  font-size: clamp(22px, 4.6vw, 30px);
  line-height: 1.55;
  font-weight: 300;
  letter-spacing: .01em;
}

/* ── 照片 ─────────────────────────────────────────── */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.photo {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line);
  transition: transform .28s ease, box-shadow .28s ease;
}

/* 每 3 张一组：第 1 张占满整行，后两张并排，形成大小节奏 */
.photo:nth-child(3n + 1) {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}

.photo:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}

.photo:hover img { transform: scale(1.03); }

/* 图片找不到时的提示 */
.photo-broken {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  word-break: break-all;
}

/* ── 联系方式 ─────────────────────────────────────── */

.mail {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(20px, 4.2vw, 28px);
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease;
}

.mail::after {
  content: "↗";
  font-size: .6em;
  color: var(--faint);
  transform: translateY(-.2em);
}

.mail:hover { color: var(--accent); border-color: var(--accent); }

/* ── 页脚 ─────────────────────────────────────────── */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--faint);
}

.totop {
  color: var(--faint);
  text-decoration: none;
  transition: color .2s ease;
}

.totop:hover { color: var(--ink); }

/* ── 进场动画（不喜欢可以整段删掉） ───────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.topbar, .hero, .block {
  animation: rise .6s cubic-bezier(.2, .8, .2, 1) both;
}

#about   { animation-delay: .06s; }
#photos  { animation-delay: .12s; }
#contact { animation-delay: .18s; }

/* ── 小屏适配 ─────────────────────────────────────── */

@media (max-width: 520px) {
  .shell  { padding: 22px 18px 56px; }
  .hero   { padding: 40px 0 44px; }
  .block  { padding: 34px 0; }

  .gallery { grid-template-columns: 1fr; gap: 8px; }
  .photo:nth-child(3n + 1) { aspect-ratio: 4 / 3; }

  .footer { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 380px) {
  .topmail { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .topbar, .hero, .block { animation: none; }
  .photo, .photo img, .btn { transition: none; }
}
