/* ============================================================
   董思言 · 视觉作品集 — 暗色版设计系统
   灵感: #0C0C0C 底 / 渐变标题 / Kanit + Noto Sans SC
   原则: 信息传达与交互反馈优先，品牌风格其次
   ============================================================ */

:root {
  --bg: #0c0c0c;
  --panel: #111214;
  --ink: #d7e2ea;
  --gray: #8a929b;
  --hairline: rgba(215, 226, 234, 0.14);
  --gold: #bbccd7;
  --serif: 'Kanit', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --sans: 'Kanit', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --maxw: 1280px;
  --pad: 40px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: rgba(187, 204, 215, .25); }

:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ---------- 渐变标题 ---------- */
.hero-heading {
  background: linear-gradient(180deg, #646973 0%, #bbccd7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- 小标签：中文为主，英文作备注 ---------- */
.label {
  font-size: 13px;
  letter-spacing: .18em;
  color: var(--ink);
  font-weight: 500;
}
.label .num {
  background: linear-gradient(180deg, #646973 0%, #bbccd7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
  margin-right: 12px;
}
.label .en {
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gray);
  font-weight: 400;
}

/* ---------- 滚动淡入 ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .8s ease, transform .8s ease;
}
.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   顶部书签栏（常驻）
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(12, 12, 12, .82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .22em;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
/* 画廊页回退按钮 */
.nav-back {
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--gray);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  transition: color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.nav-back:hover { color: var(--ink); border-color: rgba(215, 226, 234, .45); }
.nav-menu {
  margin-left: auto;
  display: flex;
  align-items: center;
}
.nav-menu a {
  position: relative;
  margin-left: 32px;
  padding-bottom: 4px;
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--gray);
  text-decoration: none;
  transition: color .2s ease;
}
.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, #b600a8, #be4c00);
  transition: right .3s ease;
}
.nav-menu a:hover,
.nav-menu a.active { color: var(--ink); }
.nav-menu a:hover::after,
.nav-menu a.active::after { right: 0; }

.nav-toggle { display: none; }
.nav-burger { display: none; }

body.menu-open { overflow: hidden; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}
.hero-badge {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid rgba(215, 226, 234, .35);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(12, 12, 12, .35);
  font-size: 12px;
  letter-spacing: .1em;
  margin-bottom: 22px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 900;
  color: transparent;
  white-space: nowrap;
  font-size: clamp(3.5rem, 11vw, 10rem);
  line-height: .95;
  letter-spacing: -.01em;
}
.hero-sub {
  margin-top: 14px;
  color: var(--gray);
  font-size: clamp(.8rem, 1.4vw, 1rem);
  letter-spacing: .4em;
}
.hero-main {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 40px;
}
.hero-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
  padding-bottom: 6px;
}
.hero-avatar { flex-shrink: 0; line-height: 0; }
.hero-avatar img {
  display: block;
  width: min(30vw, 400px);
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, .45));
}
.hero-tagline {
  max-width: 340px;
  font-size: clamp(.78rem, 1.3vw, 1rem);
  font-weight: 300;
  line-height: 1.9;
  letter-spacing: .04em;
  color: var(--ink);
}

/* ---------- 渐变 CTA（有真实动作 + 按压反馈） ---------- */
.btn-gradient {
  display: inline-block;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 14px 42px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .14em;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(123deg, #18011f 7%, #b600a8 37%, #7621b0 72%, #be4c00 100%);
  box-shadow: 0 4px 4px rgba(181, 1, 167, .25), 4px 4px 12px #7721b1 inset;
  outline: 2px solid #ffffff;
  outline-offset: -3px;
  transition: transform .2s ease, filter .2s ease;
  white-space: nowrap;
}
.btn-gradient:hover { transform: translateY(-2px); filter: brightness(1.12); }
.btn-gradient:active { transform: translateY(0) scale(.97); }

/* ============================================================
   滚动 Marquee（双行反向）
   ============================================================ */
.marquee-section {
  background: var(--bg);
  padding-top: 96px;
  padding-bottom: 40px;
  overflow-x: clip;
}
@media (min-width: 640px) { .marquee-section { padding-top: 128px; } }
@media (min-width: 768px) { .marquee-section { padding-top: 160px; } }
.marquee-rows { display: flex; flex-direction: column; gap: 12px; }
.marquee-row {
  display: flex;
  gap: 12px;
  will-change: transform;
}
.marquee-row img {
  height: 270px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--hairline);
}

/* ============================================================
   通用区块
   ============================================================ */
.section { padding: 120px 0; }
.section-light {
  background: #ffffff;
  color: #0c0c0c;
  border-radius: 40px 40px 0 0;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}
@media (min-width: 640px) { .section-light { border-radius: 50px 50px 0 0; } }
@media (min-width: 768px) { .section-light { border-radius: 60px 60px 0 0; } }

.sec-head { margin-bottom: 64px; text-align: center; }
.sec-head .label { display: block; margin-bottom: 14px; }
/* 章节标题回归信息层级：标题是标题，不是海报 */
.sec-title {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .02em;
  font-size: clamp(1.8rem, 3.6vw, 44px);
  color: var(--ink);
}
.section-light .sec-title { color: #0c0c0c; }

/* ---------- 关于 ---------- */
.about-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 48px;
}
.char-reveal {
  max-width: 720px;
  margin: 0 auto;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: 400;
  line-height: 2.1;
  color: var(--ink);
}
.char-reveal .ch { display: inline-block; opacity: .2; will-change: opacity; }
.about-tools {
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--gray);
  line-height: 2.4;
  max-width: 720px;
}
.usecases {
  list-style: none;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.usecases li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 20px 4px;
  border-top: 1px solid var(--hairline);
}
.usecases li:last-child { border-bottom: 1px solid var(--hairline); }
.uc-name { font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: .06em; }
.uc-desc { font-size: 11px; letter-spacing: .14em; color: var(--gray); white-space: nowrap; }

/* ---------- 作品板块入口 ---------- */
.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px 44px;
}
.work-card {
  text-decoration: none;
  display: block;
  border: 1px solid var(--hairline);
  border-radius: 32px;
  padding: 18px;
  background: var(--panel);
  transition: border-color .4s ease, transform .4s ease;
}
.work-card:hover { border-color: rgba(215, 226, 234, .4); transform: translateY(-4px); }
.work-card .img-wrap {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #16181b;
  border-radius: 20px;
}
.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.work-card:hover img { transform: scale(1.03); }
.work-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 6px 4px;
}
.work-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .03em;
}
.work-name .idx {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .1em;
  margin-right: 10px;
  font-family: var(--sans);
  background: linear-gradient(180deg, #646973 0%, #bbccd7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.work-desc { font-size: 12px; color: var(--gray); margin-top: 8px; letter-spacing: .06em; }
.work-link {
  display: inline-block;
  margin: 12px 6px 6px;
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--ink);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 4px;
  transition: opacity .3s ease;
}
.work-card:hover .work-link { opacity: .7; }

/* ---------- 简历（白色区块） ---------- */
.resume-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 64px;
  text-align: left;
  max-width: 960px;
  margin: 0 auto;
}
.resume-block h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: #0c0c0c;
  letter-spacing: .1em;
  padding-top: 16px;
  border-top: 2px solid #0c0c0c;
  margin-bottom: 22px;
}
.resume-item { margin-bottom: 24px; }
.resume-item .ri-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.resume-item h4 { font-size: 15px; font-weight: 600; color: #0c0c0c; letter-spacing: .03em; }
.resume-item time { font-size: 12px; color: rgba(12, 12, 12, .55); flex-shrink: 0; }
.resume-item p { font-size: 13px; color: rgba(12, 12, 12, .72); margin-top: 8px; line-height: 1.95; }
.resume-cta { margin-top: 64px; text-align: center; }
.btn-dark {
  display: inline-block;
  background: #0c0c0c;
  color: #fff;
  border-radius: 999px;
  padding: 15px 46px;
  font-size: 14px;
  letter-spacing: .14em;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease;
}
.btn-dark:hover { transform: translateY(-2px); background: #2a2d33; }
.btn-dark:active { transform: scale(.97); }

/* ---------- 联系 ---------- */
.contact { text-align: center; }
.contact-line {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: .03em;
  line-height: 1.5;
  max-width: 820px;
  margin: 0 auto;
}
.contact-sub { color: var(--gray); font-size: 13px; margin: 22px 0 36px; letter-spacing: .06em; }
.contact-list {
  display: flex;
  justify-content: center;
  gap: 56px;
  flex-wrap: wrap;
}
.contact-item { font-size: 13px; color: var(--gray); letter-spacing: .1em; }
.contact-item .v {
  display: block;
  margin-top: 10px;
  font-size: 17px;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: .04em;
}
.contact-item .v a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  transition: opacity .3s ease;
}
.contact-item .v a:hover { opacity: .7; }
.contact-cta { margin-top: 44px; }
.back-top {
  display: inline-block;
  margin-top: 56px;
  font-size: 12px;
  letter-spacing: .12em;
  text-decoration: none;
  color: var(--gray);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 4px;
  transition: color .3s ease;
  cursor: pointer;
}
.back-top:hover { color: var(--ink); }

/* ============================================================
   画廊页
   ============================================================ */
.gallery-head { padding: 176px 0 56px; text-align: center; }
.gallery-head .label { display: block; margin-bottom: 18px; }
.gallery-title {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2.1rem, 5.5vw, 4.2rem);
  line-height: 1.1;
  letter-spacing: .01em;
}
.gallery-desc {
  margin: 22px auto 0;
  color: var(--gray);
  font-size: 14px;
  max-width: 640px;
}

.subnav {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 16px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 36px;
}
.subnav a {
  font-size: 12px;
  letter-spacing: .14em;
  text-decoration: none;
  color: var(--gray);
  transition: color .3s ease;
}
.subnav a:hover { color: var(--ink); }
.subnav a .dot {
  background: linear-gradient(180deg, #646973 0%, #bbccd7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-right: 8px;
  font-weight: 700;
}

.gallery-section { padding: 72px 0 8px; }
.gs-head { margin-bottom: 40px; display: flex; align-items: baseline; justify-content: center; gap: 20px; flex-wrap: wrap; }
.gs-title { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: .06em; }
.gs-count { font-size: 11px; letter-spacing: .14em; color: var(--gray); }

/* 瀑布流 */
.masonry { column-count: 3; column-gap: 32px; }
.masonry figure {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 40px;
}
.img-wrap { overflow: hidden; background: #16181b; border-radius: 16px; }
.masonry img {
  width: 100%;
  height: auto;
  transition: transform .6s ease;
}
.masonry figure:hover img { transform: scale(1.03); }
figcaption { padding-top: 14px; }
.cap-title { font-family: var(--serif); font-size: 15px; font-weight: 500; letter-spacing: .04em; }
.cap-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray);
  letter-spacing: .06em;
}

/* 页尾翻页 */
.pager {
  margin-top: 88px;
  padding: 28px 0;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.pager a {
  font-size: 12px;
  letter-spacing: .14em;
  text-decoration: none;
  color: var(--gray);
  transition: color .3s ease;
}
.pager a:hover { color: var(--ink); }

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 110px;
  padding: 60px var(--pad) 48px;
  text-align: center;
}
.foot-brand { font-size: 12px; font-weight: 600; letter-spacing: .22em; }
.foot-note { margin-top: 16px; font-size: 12px; color: var(--gray); letter-spacing: .08em; }
.foot-contact { margin-top: 10px; font-size: 12px; color: var(--gray); letter-spacing: .08em; }
.foot-contact a { text-decoration: none; border-bottom: 1px solid var(--hairline); transition: opacity .3s ease; }
.foot-contact a:hover { opacity: .7; }
.foot-fine { margin-top: 26px; font-size: 11px; color: #565d64; letter-spacing: .06em; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
  .masonry { column-count: 2; column-gap: 28px; }
}

@media (max-width: 820px) {
  :root { --pad: 22px; }

  .nav-burger {
    display: block;
    position: relative;
    z-index: 210;
    width: 40px;
    height: 40px;
    margin-right: -10px;
    cursor: pointer;
  }
  .nav-burger span,
  .nav-burger span::before,
  .nav-burger span::after {
    content: "";
    position: absolute;
    left: 9px;
    width: 22px;
    height: 1.5px;
    background: var(--ink);
    transition: transform .35s ease, background .35s ease, top .35s ease;
  }
  .nav-burger span { top: 19px; }
  .nav-burger span::before { top: -7px; }
  .nav-burger span::after { top: 7px; }

  .nav-menu {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(12, 12, 12, .97);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .45s ease, visibility .45s ease;
  }
  .nav-menu a {
    margin: 14px 0;
    font-family: var(--serif);
    font-size: 22px;
    letter-spacing: .12em;
    color: var(--ink);
  }
  .nav-toggle:checked ~ .nav-burger span { background: transparent; }
  .nav-toggle:checked ~ .nav-burger span::before { top: 0; transform: rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span::after { top: 0; transform: rotate(-45deg); }
  .nav-toggle:checked ~ .nav-menu { opacity: 1; visibility: visible; }

  .hero { min-height: 560px; height: auto; padding-bottom: 24px; }
  .hero-main {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 8px;
    padding-bottom: 0;
  }
  .hero-avatar { order: -1; }
  .hero-avatar img { width: min(52vw, 300px); }
  .hero-left { align-items: center; text-align: center; gap: 20px; }
  .hero-tagline { max-width: 320px; }
  .btn-gradient { padding: 12px 30px; font-size: 13px; }

  .section { padding: 88px 0; }
  .work-grid { grid-template-columns: 1fr; gap: 40px; }
  .resume-grid { grid-template-columns: 1fr; gap: 40px; }
  .gallery-head { padding: 140px 0 44px; }
  .usecases li { flex-direction: column; gap: 6px; }
  .marquee-row img { height: 192px; }
}

@media (max-width: 640px) {
  .masonry { column-count: 1; }
  .masonry figure { margin-bottom: 36px; }
  .contact-list { flex-direction: column; gap: 26px; }
  .nav-back { display: none; }
}

/* 动效克制：尊重系统减少动态偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transition: none; opacity: 1; transform: none; }
  .work-card img, .masonry img { transition: none; }
}

/* ============================================================
   点击看大图（Lightbox）
   ============================================================ */
.masonry .img-wrap { cursor: zoom-in; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(8, 8, 8, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
  cursor: zoom-out;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
  transform: scale(.985);
  transition: transform .35s ease;
}
.lightbox.open img { transform: scale(1); }
