/* ==========================================================================
   个人作品集 · 样式
   颜色、间距都收在 :root 变量里，改主题只需要改这几个值。
   ========================================================================== */

:root {
  --bg: #f7f4ee;
  --surface: #fffdf9;
  --ink: #1a1815;
  --ink-soft: #3f3a33;
  --muted: #6b645a;
  --line: #e4dcd0;
  --accent: #0f766e;
  --accent-light: #8fd3c4;
  --rose: #d6336c;
  --wrap: 1120px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

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

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

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

img {
  max-width: 100%;
}

a {
  color: inherit;
}

::selection {
  background: rgba(15, 118, 110, 0.18);
}

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

.wrap {
  width: min(var(--wrap), calc(100% - 48px));
  margin-inline: auto;
}

/* 跳到主要内容（键盘用户可见） */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-200%);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ==========================================================================
   顶部导航
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 244, 238, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-name {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: rgba(26, 24, 21, 0.05);
}

.site-nav a.is-active {
  color: var(--ink);
  background: rgba(26, 24, 21, 0.06);
  font-weight: 600;
}

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

.lang-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang-btn {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
}

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

.lang-btn[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  place-items: center;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 15px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease;
}

body.nav-open .nav-toggle-bar:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

body.nav-open .nav-toggle-bar:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* ==========================================================================
   首屏
   ========================================================================== */

.hero {
  position: relative;
  padding: 80px 0 88px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -280px;
  right: -180px;
  width: 720px;
  height: 720px;
  background: radial-gradient(circle at center, rgba(214, 51, 108, 0.1), transparent 62%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -320px;
  left: -220px;
  width: 640px;
  height: 640px;
  background: radial-gradient(circle at center, rgba(15, 118, 110, 0.08), transparent 62%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 56px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 0 0 24px;
  font-size: clamp(2.8rem, 5.8vw, 4.9rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
  text-wrap: balance;
}

.hero-title .hl {
  background: linear-gradient(180deg, transparent 68%, rgba(15, 118, 110, 0.18) 68%);
  color: inherit;
  padding: 0 0.03em;
}

.hero-lead {
  margin: 0;
  max-width: 38em;
  font-size: 17.5px;
  line-height: 1.85;
  color: var(--muted);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn-primary:hover {
  background: #2b2823;
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 253, 249, 0.65);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--surface);
}

.btn-arrow {
  font-size: 15px;
  opacity: 0.75;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.7);
  font-size: 12.5px;
  color: var(--muted);
}

.chip-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #0c6b4f;
  border-color: rgba(12, 107, 79, 0.25);
  background: rgba(15, 118, 110, 0.07);
}

.chip-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #12a06f;
  box-shadow: 0 0 0 3px rgba(18, 160, 111, 0.12);
}

.hero-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  opacity: 0.85;
}

.focus-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 24px 60px -34px rgba(40, 30, 10, 0.25);
}

.focus-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.focus-list {
  margin: 0;
}

.focus-row {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.focus-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.focus-row dt {
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--muted);
}

.focus-row dd {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.6;
}

/* ==========================================================================
   区块通用
   ========================================================================== */

.section {
  padding: 88px 0;
}

.section-projects {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-about {
  background: var(--bg);
}

.section-head {
  max-width: 720px;
  margin-bottom: 44px;
}

.section-title {
  margin: 0 0 18px;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.section-intro {
  max-width: 60ch;
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}

/* ==========================================================================
   项目卡片
   ========================================================================== */

.project-list {
  display: grid;
  gap: 28px;
}

.project-card {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  overflow: hidden;
}

.project-media {
  position: relative;
  display: block;
  min-height: 360px;
  background: #f1ebe2;
  overflow: hidden;
}

.project-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* 横版截图（浏览器页面）用留白展示，避免裁掉标题文字 */
.project-media.is-wide img {
  object-fit: contain;
  object-position: center;
  padding: 22px;
}

.project-card:hover .project-media img {
  transform: scale(1.03);
}

.project-body {
  display: flex;
  flex-direction: column;
  padding: 36px 38px;
}

.project-kicker {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.project-index {
  margin-right: 6px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.project-title {
  margin: 0 0 14px;
  font-size: clamp(1.7rem, 2.4vw, 2.2rem);
  letter-spacing: -0.02em;
}

.project-summary {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tag-list li {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  color: var(--muted);
}

.project-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: auto;
  padding-top: 26px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-build {
  color: #0b6b4f;
  border-color: rgba(11, 107, 79, 0.28);
  background: rgba(15, 118, 110, 0.08);
}

.status-proto {
  color: #8a5a12;
  border-color: rgba(138, 90, 18, 0.28);
  background: rgba(196, 132, 30, 0.09);
}

.text-link {
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(26, 24, 21, 0.2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover {
  color: var(--accent);
  border-color: currentColor;
}

/* ==========================================================================
   项目案例详情
   ========================================================================== */

.case {
  scroll-margin-top: 84px;
  padding: 88px 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.case-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 36px;
}

.case-heading {
  max-width: 760px;
}

.case-title {
  margin: 0 0 10px;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  letter-spacing: -0.03em;
}

.case-sub {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 500;
}

.case-summary {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 40px;
}

.fact {
  padding: 18px 18px 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fact + .fact {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.fact dt {
  margin-bottom: 7px;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact dd {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.55;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 52px;
}

.shot {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.shot img {
  display: block;
  width: 100%;
  height: 400px;
  object-fit: cover;
  object-position: top center;
}

/* 横版截图按原始比例完整显示，不裁切 */
.shot-wide img {
  height: auto;
  object-fit: contain;
}

.shot figcaption {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  align-items: start;
}

.case-block {
  padding: 28px 30px 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.block-num {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.case-block h3 {
  margin: 0 0 12px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.case-block p {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--muted);
}

.case-block p:last-child {
  margin-bottom: 0;
}

.block-list {
  margin: 0;
  padding-left: 18px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--muted);
}

.block-list li {
  margin-bottom: 8px;
}

.block-list li:last-child {
  margin-bottom: 0;
}

.block-list li::marker {
  color: var(--card-accent, var(--accent));
}

/* ==========================================================================
   关于
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 56px;
  align-items: start;
  margin-bottom: 64px;
}

.about-head {
  position: sticky;
  top: 96px;
}

.about-copy p {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.95;
  color: var(--ink-soft);
}

.about-copy p:last-of-type {
  margin-bottom: 0;
}

.mini-title {
  margin: 30px 0 12px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.learning .tag-list li {
  background: transparent;
}

.skills-title {
  margin: 0 0 18px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.skill-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.skill-card h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.skill-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

/* ==========================================================================
   联系
   ========================================================================== */

.section-contact {
  padding: 32px 0 96px;
}

.contact-card {
  position: relative;
  overflow: hidden;
  padding: 56px clamp(24px, 5vw, 64px);
  border-radius: 28px;
  background: #1a1712;
  color: #f5f0e6;
}

.contact-card::after {
  content: "";
  position: absolute;
  top: -120px;
  right: -120px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.5), transparent 65%);
  pointer-events: none;
}

.contact-card .eyebrow {
  color: var(--accent-light);
}

.contact-title {
  max-width: 20ch;
  margin: 0 0 16px;
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.contact-desc {
  max-width: 54ch;
  margin: 0 0 30px;
  line-height: 1.8;
  color: rgba(245, 240, 230, 0.72);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-light {
  background: #f5f0e6;
  color: #1a1712;
}

.btn-light:hover {
  background: #fff;
}

.btn-outline-light {
  border-color: rgba(245, 240, 230, 0.28);
  color: #f5f0e6;
}

.btn-outline-light:hover {
  background: rgba(245, 240, 230, 0.08);
}

.contact-meta {
  position: relative;
  z-index: 1;
  margin: 26px 0 0;
  font-size: 13px;
  color: rgba(245, 240, 230, 0.6);
}

.contact-meta a {
  color: #f5f0e6;
  text-underline-offset: 3px;
}

/* ==========================================================================
   页脚 / 无脚本提示
   ========================================================================== */

.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-inner p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.footer-inner a {
  font-size: 12.5px;
  text-decoration: none;
}

.noscript-note {
  padding: 24px 0 40px;
  font-size: 14px;
  color: var(--muted);
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
    gap: 40px;
  }

  .facts {
    grid-template-columns: repeat(2, 1fr);
  }

  .fact {
    padding: 16px 0;
  }

  .fact + .fact {
    padding-left: 0;
    border-left: 0;
  }

  .fact:nth-child(even) {
    padding-left: 18px;
    border-left: 1px solid var(--line);
  }
}

@media (max-width: 900px) {
  .hero {
    padding: 56px 0 64px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .focus-card {
    max-width: 520px;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-media {
    min-height: 300px;
  }

  .project-body {
    padding: 28px 26px 32px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 48px;
  }

  .about-head {
    position: static;
  }

  .case-head {
    flex-direction: column;
  }

  .section {
    padding: 64px 0;
  }

  .case {
    padding: 64px 0;
  }
}

@media (max-width: 860px) {
  .site-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    display: none;
    padding: 10px 24px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }

  body.nav-open .site-nav {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 2px;
  }

  .site-nav a {
    display: block;
    padding: 12px 6px;
    border-radius: 10px;
    font-size: 16px;
  }

  .nav-toggle {
    display: grid;
  }

  .header-actions {
    margin-left: auto;
  }
}

@media (max-width: 760px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .hero-title {
    font-size: clamp(2.05rem, 8.2vw, 2.8rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
  }

  .hero-lead {
    font-size: 16px;
  }

  .project-media {
    min-height: 260px;
  }

  .case-grid {
    grid-template-columns: 1fr;
  }

  .gallery {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .shot {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }

  .shot img {
    height: 320px;
  }

  .shot-wide img {
    height: auto;
  }

  .skill-grid {
    grid-template-columns: 1fr;
  }

  .contact-card {
    padding: 40px 24px;
    border-radius: 22px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .header-inner {
    gap: 12px;
  }

  .project-body {
    padding: 24px 20px 28px;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .fact:nth-child(even) {
    padding-left: 0;
    border-left: 0;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

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

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