/* ============================================================
   个人主页样式
   配色 / 间距 / 字体集中在这里，改主题只需动 :root
   ============================================================ */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-alt: #f4f2ee;
  --ink: #17181a;
  --ink-soft: #3c3f45;
  --muted: #6d7178;
  --line: #e4e1db;
  --accent: #0f5c4e;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 92, 78, 0.08);

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(23, 24, 26, 0.05);
  --shadow-md: 0 10px 30px -12px rgba(23, 24, 26, 0.16);
  --shadow-lg: 0 26px 60px -24px rgba(23, 24, 26, 0.24);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
    sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Georgia, "Songti SC",
    "Noto Serif SC", "Source Han Serif SC", serif;

  --container: 1080px;
  --gutter: clamp(20px, 5vw, 48px);
  --section-y: clamp(72px, 10vw, 132px);
}

[data-theme="dark"] {
  --bg: #101112;
  --surface: #17191b;
  --surface-alt: #151719;
  --ink: #f1efea;
  --ink-soft: #d4d2cc;
  --muted: #9b9fa6;
  --line: #2a2d31;
  --accent: #5ed3b4;
  --accent-ink: #0b1a16;
  --accent-soft: rgba(94, 211, 180, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 26px 60px -24px rgba(0, 0, 0, 0.7);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s ease, color 0.35s ease;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
}

p {
  margin: 0;
}

ul,
dl,
dd {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- 布局工具 ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section-alt {
  background: var(--surface-alt);
  border-block: 1px solid var(--line);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

/* ---------- 顶部导航 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 14.5px;
  color: var(--muted);
}

.nav a {
  position: relative;
  padding-block: 4px;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

.nav a:hover::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

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

.icon-btn:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
}

.menu-btn .bar {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-btn[aria-expanded="true"] .bar:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] .bar:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 8px var(--gutter) 22px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.mobile-nav a {
  padding: 13px 0;
  font-size: 16px;
  border-bottom: 1px solid var(--line);
}

.mobile-nav a:last-child {
  border-bottom: 0;
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(56px, 9vw, 112px) clamp(60px, 9vw, 120px);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: min(620px, 70vw);
  aspect-ratio: 1;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-size: clamp(46px, 8.2vw, 86px);
  letter-spacing: -0.035em;
  margin-bottom: 12px;
}

.hero-role {
  font-size: clamp(17px, 2vw, 21px);
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 22px;
}

.hero-desc {
  max-width: 46ch;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.3, 1),
    background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}

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

.btn-lg {
  padding: 15px 28px;
  font-size: 16px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 34px;
  font-size: 13.5px;
  color: var(--muted);
}

.hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

.hero-visual {
  position: relative;
}

.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 20% 12%, rgba(255, 255, 255, 0.5), transparent 55%),
    linear-gradient(155deg, #dcd8cf 0%, #c3c0b6 45%, #a9b3ab 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .portrait {
  background:
    radial-gradient(120% 90% at 20% 12%, rgba(255, 255, 255, 0.07), transparent 55%),
    linear-gradient(155deg, #24282a 0%, #1c2022 50%, #232b28 100%);
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.16) 1px,
      transparent 1px
    ),
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 45%, black, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, black, transparent 72%);
  opacity: 0.5;
}

.portrait-initial {
  font-family: var(--font-display);
  font-size: clamp(64px, 9vw, 104px);
  color: rgba(23, 24, 26, 0.24);
  line-height: 1;
  z-index: 1;
}

[data-theme="dark"] .portrait-initial {
  color: rgba(241, 239, 234, 0.28);
}

.portrait-note {
  margin-top: 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------- 区块标题 ---------- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px;
  margin-bottom: clamp(34px, 5vw, 56px);
}

.section-index {
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.section-head h2 {
  font-size: clamp(28px, 4.2vw, 42px);
}

.section-desc {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 15.5px;
  margin-top: 2px;
}

/* ---------- 关于 ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: clamp(32px, 6vw, 76px);
}

.about-text p + p {
  margin-top: 18px;
}

.about-text {
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.9;
}

.about-text .lead {
  color: var(--ink);
  font-size: clamp(19px, 2.3vw, 23px);
  line-height: 1.65;
  font-family: var(--font-display);
  margin-bottom: 26px;
}

.facts {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.facts dl > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.facts dt {
  color: var(--muted);
  flex-shrink: 0;
}

.facts dd {
  text-align: right;
  font-weight: 500;
}

/* ---------- 作品 ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(276px, 1fr));
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1),
    box-shadow 0.35s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--line) 40%, var(--ink) 60%);
}

.card-link {
  display: block;
  height: 100%;
}

.card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card-thumb span {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: rgba(23, 24, 26, 0.34);
}

.thumb-a {
  background: linear-gradient(135deg, #dfd9cb, #b9c6bd);
}

.thumb-b {
  background: linear-gradient(135deg, #d8dde4, #bfc6d2);
}

.thumb-c {
  background: linear-gradient(135deg, #e7ddd2, #cdbca9);
}

[data-theme="dark"] .thumb-a {
  background: linear-gradient(135deg, #24282a, #1d2724);
}

[data-theme="dark"] .thumb-b {
  background: linear-gradient(135deg, #1f2226, #232830);
}

[data-theme="dark"] .thumb-c {
  background: linear-gradient(135deg, #26221d, #2a2419);
}

[data-theme="dark"] .card-thumb span {
  color: rgba(241, 239, 234, 0.34);
}

.card-body {
  padding: 22px 22px 24px;
}

.card-body h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.card-body p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.75;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.tags li {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

/* ---------- 技能 ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(26px, 4vw, 48px);
}

.skill-group h3 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.skill-group li {
  padding: 11px 0;
  font-size: 15.5px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

/* ---------- 联系 ---------- */

.section-contact {
  background: var(--ink);
  color: var(--bg);
}

[data-theme="dark"] .section-contact {
  background: var(--surface);
  color: var(--ink);
  border-block: 1px solid var(--line);
}

.section-contact .section-index {
  color: var(--bg);
  opacity: 0.55;
}

[data-theme="dark"] .section-contact .section-index {
  color: var(--ink);
  opacity: 0.5;
}

.contact-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(28px, 5vw, 64px);
  align-items: end;
}

.section-contact h2 {
  font-size: clamp(30px, 4.6vw, 48px);
  margin: 10px 0 16px;
}

.contact-desc {
  max-width: 44ch;
  opacity: 0.72;
  font-size: 16px;
  line-height: 1.8;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}

.section-contact .btn-primary {
  background: var(--bg);
  color: var(--ink);
}

[data-theme="dark"] .section-contact .btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.mail-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-contact .btn-ghost {
  border-color: rgba(255, 255, 255, 0.26);
  color: inherit;
  background: transparent;
}

.section-contact .btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .section-contact .btn-ghost {
  border-color: var(--line);
  color: var(--ink);
}

[data-theme="dark"] .section-contact .btn-ghost:hover {
  border-color: var(--ink-soft);
  background: var(--surface-alt);
}

.contact-phone {
  font-size: 14px;
  opacity: 0.68;
  letter-spacing: 0.01em;
}

.contact-phone a {
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.contact-phone a:hover {
  border-bottom-color: currentColor;
  opacity: 1;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
}

.socials a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0.68;
  transition: opacity 0.2s ease;
}

.socials a:hover {
  opacity: 1;
}

.socials svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.social-link span {
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.social-link:hover span {
  border-bottom-color: currentColor;
}

/* ---------- 页脚 ---------- */

.site-footer {
  padding-block: 30px;
  font-size: 13.5px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.footer-note {
  opacity: 0.8;
}

/* ---------- 滚动出现动画 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.3, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 响应式 ---------- */

@media (max-width: 880px) {
  .hero-inner,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
    max-width: 300px;
  }

  .contact-inner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .nav {
    display: none;
  }

  .menu-btn {
    display: flex;
  }

  .mobile-nav:not([hidden]) {
    display: flex;
  }
}

@media (max-width: 520px) {
  .brand-text {
    display: none;
  }

  .hero-meta {
    gap: 14px;
  }

  .btn {
    flex: 1 1 auto;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
