/* ===== 主题变量 ===== */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --radius: 12px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 64px;
}

html[data-theme="dark"] {
  --canvas: #0a0a0a;
  --surface: #161616;
  --surface-2: #1f1f1f;
  --raised: #2a2a2a;
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.66);
  --text-3: rgba(255, 255, 255, 0.4);
  --border: rgba(255, 255, 255, 0.12);
  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --shape: #a9b2bd;
  --shape-active: #e6eaee;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

html[data-theme="light"] {
  --canvas: #ffffff;
  --surface: #f0f0f0;
  --surface-2: #e6e6e6;
  --raised: #d9d9d9;
  --text: #111111;
  --text-2: rgba(17, 17, 17, 0.66);
  --text-3: rgba(17, 17, 17, 0.4);
  --border: rgba(0, 0, 0, 0.12);
  --accent: #000000;
  --accent-soft: rgba(0, 0, 0, 0.06);
  --shape: #6b7280;
  --shape-active: #111111;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
}

/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--canvas);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* ===== 加载动效 ===== */
.loader {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  background: var(--canvas);
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-mark { font-size: 64px; font-weight: 800; letter-spacing: 0.02em; animation: loaderPulse 1.6s var(--ease) infinite; text-align: center; }
.loader-bar { width: 140px; height: 2px; margin: 20px auto 0; background: var(--border); border-radius: 2px; overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 40%; background: var(--accent); animation: loaderSlide 1.2s var(--ease) infinite; }
@keyframes loaderPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes loaderSlide { 0% { transform: translateX(-120%); } 100% { transform: translateX(360%); } }

/* ===== 顶部进度条 ===== */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--text-3));
  z-index: 300; transition: width 0.1s linear;
}

/* ===== 导航 ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  transition: background 0.4s var(--ease), border-bottom 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-brand { font-size: 24px; font-weight: 800; letter-spacing: 0.04em; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { font-size: 14.5px; color: var(--text-2); position: relative; transition: color 0.3s; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 100%; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 13px; color: var(--text-2); transition: all 0.3s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn .icon-sun, .icon-btn .icon-moon { display: none; }
html[data-theme="dark"] .icon-btn .icon-moon { display: block; }
html[data-theme="light"] .icon-btn .icon-sun { display: block; }
.lang-sep { opacity: 0.4; margin: 0 2px; }
.nav-toggle { display: none; }

/* ===== 左侧索引导航 ===== */
.side-nav {
  position: fixed; left: 22px; top: 50%; transform: translateY(-50%);
  z-index: 150; display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.side-dot {
  position: relative; width: 10px; height: 10px; border-radius: 999px;
  background: var(--border); transition: background 0.3s;
}
.side-dot span {
  position: absolute; left: 22px; top: 50%; transform: translateY(-50%) translateX(4px);
  font-size: 12px; color: var(--text-2); white-space: nowrap;
  opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none;
}
.side-dot:hover span { opacity: 1; transform: translateY(-50%) translateX(0); }
.side-indicator {
  position: absolute; top: 0; left: 0;
  width: 10px; height: 10px; border-radius: 999px;
  background: var(--accent);
  transition: transform 0.6s var(--ease), width 0.6s var(--ease), height 0.6s var(--ease), border-radius 0.6s var(--ease);
  will-change: transform, width, height;
}
.side-indicator.pill {
  width: 26px; height: 6px; border-radius: 999px;
}
@media (max-width: 960px) {
  .side-nav { display: none; }
}

/* ===== 通用区块 ===== */
.section { padding: 100px 0; }
.section.alt { background: var(--surface); }
.section.surface { background: var(--canvas); }
.section-head { margin-bottom: 48px; max-width: 720px; }
.section-kicker { font-size: 12px; letter-spacing: 0.3em; color: var(--text-3); text-transform: uppercase; margin-bottom: 14px; }
.section-title { font-size: clamp(30px, 4.5vw, 46px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.section-sub { margin-top: 14px; color: var(--text-2); font-size: 16px; line-height: 1.8; }

/* ===== 滚动浮现 ===== */
[data-reveal] { opacity: 0; transform: translateY(30px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* ===== Hero ===== */
.hero { min-height: 100vh; display: flex; align-items: center; padding: calc(var(--nav-h) + 32px) 0 64px; position: relative; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 50% at 20% 30%, var(--accent-soft), transparent 70%),
    radial-gradient(50% 40% at 85% 75%, var(--accent-soft), transparent 70%);
  opacity: 0.7;
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 420px 1fr; gap: 72px; align-items: center; }
.portrait-frame {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); aspect-ratio: 4 / 5; background: var(--surface-2);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.eyebrow { font-size: 13px; letter-spacing: 0.32em; color: var(--text-3); text-transform: uppercase; margin-bottom: 18px; }
.hero h1 { font-size: clamp(64px, 9vw, 110px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.tagline { min-height: 34px; margin-top: 22px; font-size: clamp(19px, 2.4vw, 26px); font-weight: 500; color: var(--text-2); }
.tagline .caret { display: inline-block; width: 2px; height: 1em; background: var(--accent); margin-left: 2px; vertical-align: -0.12em; animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.sub { margin-top: 20px; font-size: 17px; color: var(--text-2); line-height: 1.8; }
.hero-cta { margin-top: 36px; display: flex; gap: 16px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 30px; border-radius: 999px;
  font-size: 15px; font-weight: 600; transition: all 0.35s var(--ease);
}
.btn.primary { background: var(--text); color: var(--canvas); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,0.25); }
.btn.secondary { border: 1px solid var(--border); color: var(--text); }
.btn.secondary:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ===== 数据统计（关于里） ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 8px; }
.stat { background: var(--canvas); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 22px; transition: transform 0.4s var(--ease), border-color 0.4s; }
.stat:hover { transform: translateY(-4px); border-color: var(--accent); }
.stat .num { font-size: clamp(34px, 3.6vw, 46px); font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.stat .num .unit { font-size: 0.5em; font-weight: 600; color: var(--text-3); margin-left: 3px; }
.stat .label { margin-top: 10px; font-size: 14px; color: var(--text-2); }

/* ===== 数据与经历（合并折叠卡片） ===== */
.exp-accordion { display: flex; flex-direction: column; gap: 14px; }
.exp-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color 0.3s, box-shadow 0.3s;
}
.exp-card:hover, .exp-card.open { border-color: var(--accent); box-shadow: var(--shadow); }
.exp-head {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 22px 26px; text-align: left;
  transition: background 0.4s var(--ease);
}
.exp-card:hover .exp-head, .exp-card.open .exp-head { background: var(--accent-soft); }
.exp-title { flex: 1; font-size: 18px; font-weight: 700; }
.exp-badge {
  font-size: 12px; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--text-2); white-space: nowrap;
}
.exp-arrow {
  width: 26px; height: 26px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid var(--border); font-size: 16px; color: var(--text-2);
  transition: transform 0.4s var(--ease);
}
.exp-card.open .exp-arrow { transform: rotate(45deg); }
.exp-body {
  max-height: 0; overflow: hidden;
  opacity: 0; transform: translateY(-6px);
  transition: max-height 0.65s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.5s ease 0.12s, transform 0.55s cubic-bezier(0.33, 1, 0.68, 1) 0.08s;
}
.exp-card.open .exp-body { max-height: 420px; opacity: 1; transform: translateY(0); }
.exp-body p { padding: 0 26px 24px; font-size: 14.5px; color: var(--text-2); line-height: 1.9; }

/* ===== 画廊 ===== */
.gallery-wrap { position: relative; padding: 10px 0 4px; }
.gallery-track {
  display: flex; gap: 18px; overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 14px 2px;
  scrollbar-width: none; cursor: grab;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track.dragging { cursor: grabbing; scroll-snap-type: none; }
.gallery-item {
  flex: 0 0 auto; width: 280px; height: 280px;
  border-radius: var(--radius); overflow: hidden;
  scroll-snap-align: center; position: relative;
  background: var(--surface-2);
  transition: transform 0.4s var(--ease), box-shadow 0.4s;
}
.gallery-item:hover { transform: translateY(-5px) scale(1.02); box-shadow: var(--shadow); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 46px; height: 46px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px); border: 1px solid var(--border);
  font-size: 22px; color: var(--text); transition: all 0.3s;
}
.gallery-nav:hover { background: var(--raised); }
.gallery-nav.prev { left: 8px; }
.gallery-nav.next { right: 8px; }
.gallery-count { margin-top: 16px; text-align: center; font-size: 13px; color: var(--text-3); letter-spacing: 0.08em; }

/* ===== 作品 ===== */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.work-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s;
}
.work-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--shadow); }
.work-card .platform { font-size: 12px; letter-spacing: 0.12em; color: var(--text-3); text-transform: uppercase; }
.work-card h3 { margin-top: 10px; font-size: 20px; font-weight: 700; }
.work-card .desc { margin-top: 10px; font-size: 14px; color: var(--text-2); line-height: 1.7; }
.work-card .link { display: inline-block; margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--accent); transition: opacity 0.3s; }
.work-card .link:hover { opacity: 0.7; }

/* ===== 小铺 ===== */
.shop-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.shop-item {
  background: var(--canvas); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 20px; text-align: center; transition: all 0.4s var(--ease);
}
.shop-item:hover { transform: translateY(-5px); border-color: var(--accent); background: var(--surface-2); }
.shop-icon { font-size: 30px; margin-bottom: 12px; }
.shop-item h3 { font-size: 16px; font-weight: 700; }
.shop-item p { margin-top: 8px; font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* ===== 联系（居中） ===== */
.contact-panel {
  max-width: 680px; margin: 0 auto; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 64px 48px;
}
.contact-email {
  display: inline-block; margin: 30px auto 6px;
  font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: 0.01em;
  border-bottom: 1px solid var(--border); padding-bottom: 4px;
  transition: border-color 0.3s;
}
.contact-email:hover { border-color: var(--accent); }
.contact-social { margin-top: 28px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.social-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--border); font-size: 14px; color: var(--text-2);
  transition: all 0.3s;
}
.social-btn:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }
.contact-panel .hero-cta { justify-content: center; }

/* ===== 页脚 ===== */
.footer { border-top: 1px solid var(--border); padding: 40px 0 48px; text-align: center; }
.footer p { font-size: 13.5px; color: var(--text-3); }

/* ===== 灯箱 ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: all 0.4s var(--ease); padding: 40px;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-body { max-width: 900px; max-height: 88vh; text-align: center; }
.lightbox-body img { max-width: 100%; max-height: 74vh; border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0,0,0,0.6); margin: 0 auto; }
.lightbox-caption { margin-top: 18px; color: rgba(255,255,255,0.85); font-size: 16px; }
.lightbox-close { position: absolute; top: 24px; right: 28px; width: 48px; height: 48px; border-radius: 999px; background: rgba(255,255,255,0.1); color: #fff; font-size: 26px; transition: background 0.3s; }
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ===== 响应式 ===== */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; text-align: center; }
  .hero-portrait { max-width: 360px; margin: 0 auto; }
  .hero-cta { justify-content: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--canvas);
    border-bottom: 1px solid var(--border); padding: 12px 32px;
    transform: translateY(-130%); transition: transform 0.4s var(--ease);
  }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 14px 0; font-size: 16px; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 560px) {
  .section { padding: 76px 0; }
  .container { padding: 0 20px; }
  .stats-grid, .work-grid, .shop-grid { grid-template-columns: 1fr; }
  .gallery-item { width: 230px; height: 230px; }
  .contact-panel { padding: 44px 22px; }
  .exp-head { padding: 18px 18px; }
  .exp-body p { padding: 0 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
