/* ============================================================
   个人网站 · 共享样式
   改配色：只需要改下面 :root 里的几个变量
   ============================================================ */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Georgia", "Songti SC", "SimSun", serif;

  --bg: #f6f7fb;
  --bg-soft: #eef1f8;
  --card: #ffffff;
  --text: #1c2130;
  --muted: #697086;
  --border: #e3e7f0;
  --accent: #6366f1;
  --accent-2: #a855f7;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --nav-bg: rgba(246, 247, 251, 0.78);
  --shadow-sm: 0 2px 10px rgba(28, 33, 48, 0.05);
  --shadow: 0 14px 40px rgba(28, 33, 48, 0.09);
  --shadow-lg: 0 26px 70px rgba(28, 33, 48, 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0c0f1a;
  --bg-soft: #121628;
  --card: #171c2e;
  --text: #eef1f9;
  --muted: #98a0b8;
  --border: #262c44;
  --accent: #818cf8;
  --accent-2: #c084fc;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --nav-bg: rgba(12, 15, 26, 0.72);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.6);
}

/* ---------- 基础 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.45s ease, color 0.45s ease;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

figure {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.02em;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* 背景光斑 */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-blobs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: drift 22s ease-in-out infinite alternate;
}

.bg-blobs span:nth-child(1) {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -120px;
  background: var(--accent);
  opacity: 0.22;
}

.bg-blobs span:nth-child(2) {
  width: 460px;
  height: 460px;
  top: 30%;
  right: -180px;
  background: var(--accent-2);
  opacity: 0.18;
  animation-delay: -7s;
  animation-duration: 26s;
}

.bg-blobs span:nth-child(3) {
  width: 400px;
  height: 400px;
  bottom: -180px;
  left: 30%;
  background: #22d3ee;
  opacity: 0.13;
  animation-delay: -14s;
  animation-duration: 30s;
}

[data-theme="dark"] .bg-blobs span {
  opacity: 0.3;
  filter: blur(110px);
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(40px, 50px, 0) scale(1.12); }
  100% { transform: translate3d(-30px, -40px, 0) scale(0.94); }
}

/* ---------- 布局 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

main {
  min-height: 60vh;
  padding-bottom: 90px;
}

/* ---------- 单页应用视图 ---------- */
.view {
  display: none;
  padding: 0;
}

.view.active {
  display: block;
  animation: view-fade 0.4s var(--ease);
}

@keyframes view-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

section {
  padding: 64px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 34px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.section-title {
  font-size: clamp(1.6rem, 3.2vw, 2.15rem);
  margin-bottom: 12px;
}

.section-desc {
  color: var(--muted);
  margin: 0;
}

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.4s;
}

.nav.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -6px var(--accent);
}

.brand small {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  position: relative;
  display: block;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-links a.active {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  transition: transform 0.15s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 18px -10px var(--accent);
}

.icon-btn:active {
  transform: scale(0.94);
}

.nav-toggle {
  display: none;
}

/* ---------- 按钮 / 标签 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.25s, background 0.25s,
    border-color 0.25s, color 0.25s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 26px -12px var(--accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -12px var(--accent);
}

.btn-ghost {
  color: var(--text);
  background: var(--card);
  border-color: var(--border);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}

.tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid transparent;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- 首页 Hero ---------- */
.hero {
  padding: 72px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 56px;
}

.hero-hi {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.hero-hi .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, 3.9rem);
  line-height: 1.1;
  margin-bottom: 18px;
}

.grad-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-role {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 700;
  color: var(--text);
  min-height: 1.6em;
  margin-bottom: 16px;
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: var(--accent);
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-desc {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 46ch;
  margin: 0 0 30px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}

.hero-social {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-social .sep {
  width: 26px;
  height: 1px;
  background: var(--border);
}

.social-links {
  display: flex;
  gap: 8px;
}

/* 头像卡片 */
.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
}

.avatar-card {
  position: relative;
  width: min(340px, 78vw);
  aspect-ratio: 4 / 4.4;
  border-radius: 26px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: grid;
  place-items: center;
  overflow: hidden;
  transform: rotate(2.5deg);
  transition: transform 0.5s var(--ease);
}

.avatar-card:hover {
  transform: rotate(0deg) scale(1.015);
}

.avatar-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 60%),
    radial-gradient(circle at 80% 90%, rgba(34, 211, 238, 0.16), transparent 55%);
}

.avatar-ring {
  position: relative;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  padding: 6px;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), #22d3ee, var(--accent));
  animation: spin 9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  font-size: 4.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  animation: spin 9s linear infinite reverse;
}

.avatar-badge {
  position: absolute;
  bottom: 26px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

/* 浮动小卡 */
.float-chip {
  position: absolute;
  z-index: 3;
  padding: 10px 15px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: bob 5s ease-in-out infinite;
}

.float-chip i {
  font-style: normal;
}

.float-chip.one { top: 8%; left: -6%; animation-delay: -1s; }
.float-chip.two { bottom: 14%; right: -5%; animation-delay: -2.6s; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ---------- 数据统计 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.stat-card {
  padding: 26px 24px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.stat-num {
  font-size: clamp(1.9rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ---------- 关于 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text p {
  color: var(--muted);
  margin: 0 0 16px;
}

.skill-list {
  display: grid;
  gap: 16px;
}

.skill {
  display: grid;
  gap: 7px;
}

.skill-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
}

.skill-top span:last-child {
  color: var(--muted);
  font-weight: 500;
}

.skill-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--bg-soft);
  overflow: hidden;
  border: 1px solid var(--border);
}

.skill-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.2s var(--ease);
}

/* ---------- 通用卡片网格 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.work-card {
  position: relative;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
}

.work-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.work-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.work-card:hover .work-thumb img {
  transform: scale(1.07);
}

.work-thumb .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 18, 32, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.work-thumb .overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, transparent 30%, rgba(12, 15, 26, 0.55));
  opacity: 0;
  transition: opacity 0.3s;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.work-card:hover .overlay {
  opacity: 1;
}

.work-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.work-body h3 {
  font-size: 1.05rem;
}

.work-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}

/* ---------- 作品集筛选 ---------- */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.filter-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.filter-btn.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px -10px var(--accent);
}

.work-card.hide {
  display: none;
}

.work-card.pop {
  animation: popIn 0.4s var(--ease);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 相册 ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 170px;
  grid-auto-flow: dense;
  gap: 14px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: zoom-in;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

/* 第一张图放大，作为视觉焦点 */
.gallery-item:nth-child(1) { grid-column: span 2; grid-row: span 2; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.3s;
}

.gallery-item:hover img {
  transform: scale(1.06);
  filter: brightness(0.82);
}

.gallery-item .cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 34px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(8, 10, 20, 0.78));
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s;
}

.gallery-item:hover .cap {
  opacity: 1;
  transform: none;
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(6, 8, 16, 0.9);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 4vh 4vw;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-figure {
  max-width: min(1000px, 92vw);
  text-align: center;
}

.lightbox-figure img {
  max-height: 76vh;
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.3s var(--ease);
}

.lightbox.open .lightbox-figure img {
  transform: scale(1);
}

.lightbox-figure figcaption {
  color: #d6dbeb;
  margin-top: 16px;
  font-size: 0.95rem;
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.2s;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-btn.prev { left: 3vw; }
.lightbox-btn.next { right: 3vw; }

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- 联系页 ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
  align-items: start;
}

.contact-list {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
}

.contact-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.contact-ico {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  background: var(--accent-soft);
}

.contact-item .meta {
  flex: 1;
  min-width: 0;
}

.contact-item .meta b {
  display: block;
  font-size: 0.92rem;
}

.contact-item .meta span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.form-card {
  padding: 30px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}

.field label {
  font-size: 0.86rem;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field input.invalid,
.field textarea.invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.err {
  color: #ef4444;
  font-size: 0.78rem;
  min-height: 1em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-ok {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 11px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #16a34a;
  font-size: 0.9rem;
  font-weight: 600;
}

.form-ok.show {
  display: block;
  animation: popIn 0.35s var(--ease);
}

/* ---------- 模态框 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 10, 20, 0.62);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s, visibility 0.28s;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.3s var(--ease);
}

.modal.open .modal-box {
  transform: none;
}

.modal-thumb {
  height: 240px;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  position: relative;
}

.modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-content {
  padding: 26px 28px 30px;
}

.modal-content h3 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.modal-content p {
  color: var(--muted);
  margin: 0 0 18px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 18, 32, 0.55);
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

/* ---------- 提示 Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  z-index: 400;
  padding: 12px 22px;
  border-radius: 12px;
  background: #111527;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  background: var(--bg-soft);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-inner a:hover {
  color: var(--accent);
}

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.28s;
}

.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- 进场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }

/* ---------- 页面头部 ---------- */
.page-head {
  /* 只设置上下内边距，左右沿用 .container 的 22px */
  padding-top: 64px;
  padding-bottom: 30px;
}

.page-head h1 {
  font-size: clamp(2rem, 4.4vw, 3rem);
  margin-bottom: 12px;
}

.page-head p {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 58ch;
  margin: 0;
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .hero-grid,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 48px;
  }

  .hero-visual {
    order: -1;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-item:nth-child(1) {
    grid-column: auto;
    grid-row: auto;
  }

  /* 单列布局时浮动小卡片会超出屏幕，直接隐藏 */
  .float-chip {
    display: none;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: grid;
  }

  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 18px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s var(--ease);
  }

  .nav-links.open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    padding: 12px 14px;
  }

  .nav-links a::after {
    display: none;
  }

  .nav-links a.active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 140px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .lightbox-btn {
    width: 40px;
    height: 40px;
  }

  .lightbox-btn.prev { left: 2vw; }
  .lightbox-btn.next { right: 2vw; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---------- 首页音乐卡片 ---------- */
.music-promo {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 26px;
  align-items: center;
  padding: 26px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(120deg, var(--accent-soft), rgba(34, 211, 238, 0.08) 60%, transparent);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.music-promo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 220px at 100% 0%, rgba(168, 85, 247, 0.16), transparent 60%);
  pointer-events: none;
}

.mp-covers {
  display: flex;
  position: relative;
}

.mp-covers img {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid var(--card);
  box-shadow: var(--shadow-sm);
  margin-left: -16px;
}

.mp-covers img:first-child {
  margin-left: 0;
}

.mp-text h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.mp-text p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 46ch;
}

.mp-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
}

@media (max-width: 820px) {
  .music-promo {
    grid-template-columns: 1fr;
    padding: 22px;
    gap: 18px;
  }

  .mp-actions {
    justify-content: flex-start;
  }
}

/* ---------- 导航滑动指示条 ---------- */
@media (min-width: 721px) {
  .nav-links {
    position: relative;
  }
}

.nav-links a::after {
  display: none;
}

.nav-indicator {
  position: absolute;
  left: 0;
  bottom: 3px;
  width: 0;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.32s var(--ease), width 0.32s var(--ease),
    opacity 0.2s;
}

/* ---------- 交互细节 ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button,
a,
.card {
  -webkit-tap-highlight-color: transparent;
}

button {
  touch-action: manipulation;
}

.view.active {
  animation-duration: 0.32s;
}

* {
  scrollbar-color: var(--border) transparent;
}

@media (max-width: 720px) {
  .nav-indicator {
    display: none;
  }
}

/* 修复：自定义 display 会覆盖 hidden 属性 */
[hidden] {
  display: none !important;
}

/* ---------- 首页小游戏入口 ---------- */
.game-promo {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 26px;
  align-items: center;
  padding: 24px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(
    120deg,
    rgba(250, 204, 21, 0.14),
    rgba(249, 115, 22, 0.08) 55%,
    transparent
  );
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.game-promo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(520px 200px at 0% 100%, rgba(250, 204, 21, 0.16), transparent 60%);
  pointer-events: none;
}

.gp-faces {
  display: flex;
  position: relative;
}

.gp-faces img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--card);
  box-shadow: var(--shadow-sm);
  margin-left: -18px;
}

.gp-faces img:first-child {
  margin-left: 0;
}

.gp-faces img:nth-child(2) {
  transform: translateY(-8px);
}

.gp-text h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.gp-text p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 46ch;
}

@media (max-width: 820px) {
  .game-promo {
    grid-template-columns: 1fr;
    padding: 22px;
    gap: 18px;
  }
}
