/* ============================================================
   TWEN Portfolio — 暗调质感风格
   ============================================================ */
:root {
  --bg: #0c0c0e;
  --bg-soft: #131316;
  --bg-card: #17171b;
  --line: rgba(255, 255, 255, 0.08);
  --txt: #e8e6e3;
  --txt-dim: #9a978f;
  --txt-faint: #6b6963;
  --accent: #d4a253;          /* 琥珀金 */
  --accent-soft: rgba(212, 162, 83, 0.14);
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #000; }


/* ---------- 导航 ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(24px, 5vw, 72px);
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--bg);
  padding-top: 14px; padding-bottom: 14px;
  border-bottom-color: var(--line);
}
.nav-logo {
  font-family: var(--serif); font-weight: 700; font-size: 22px;
  color: var(--txt); text-decoration: none; letter-spacing: 4px;
}
.nav-logo .dot { color: var(--accent); font-size: 12px; vertical-align: super; }
.nav-links { display: flex; gap: 36px; }
.nav-links a {
  color: var(--txt-dim); text-decoration: none; font-size: 13px;
  letter-spacing: 2px; position: relative; transition: color 0.3s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 1px; background: var(--accent); transition: width 0.35s var(--ease);
}
.nav-links a:hover { color: var(--txt); }
.nav-links a:hover::after { width: 100%; }
.nav-cta {
  font-family: var(--sans); font-size: 13px; letter-spacing: 1px;
  color: var(--bg); background: var(--accent);
  border: none; padding: 10px 20px; border-radius: 100px; cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212,162,83,0.3); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px clamp(24px, 6vw, 88px) 80px;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    linear-gradient(180deg, rgba(12,12,14,0.55) 0%, rgba(12,12,14,0.75) 55%, var(--bg) 100%),
    url("../assets/img/2026-09-05 030302.jpg") center 30% / cover no-repeat;
  filter: saturate(0.92);
  animation: heroZoom 18s var(--ease) forwards;
}
@keyframes heroZoom { from { transform: scale(1.12); } to { transform: scale(1); } }
.hero-content { position: relative; z-index: 1; max-width: 900px; }
.hero-kicker {
  font-size: 12px; letter-spacing: 6px; color: var(--accent);
  margin-bottom: 28px; font-weight: 500;
}
.hero-title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(46px, 8.5vw, 108px);
  line-height: 1.16; letter-spacing: 2px; margin-bottom: 30px;
  text-shadow: 0 2px 30px rgba(0,0,0,0.55);
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub { font-size: clamp(15px, 1.6vw, 18px); color: var(--txt-dim); margin-bottom: 44px; }
.hero-sub strong { color: var(--txt); font-weight: 500; }
.hero-actions { display: flex; gap: 18px; flex-wrap: wrap; }
.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-size: 14px; letter-spacing: 2px; padding: 14px 34px;
  border-radius: 100px; border: 1px solid transparent;
  background: transparent; font-family: var(--sans);
  transition: all 0.3s var(--ease);
}
.btn-solid { background: var(--accent); color: #0c0c0e; font-weight: 500; }
.btn-solid:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(212,162,83,0.28); }
.btn-ghost { border-color: rgba(255,255,255,0.25); color: var(--txt); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-meta {
  position: relative; z-index: 1;
  display: flex; gap: clamp(32px, 6vw, 88px);
  margin-top: clamp(48px, 8vh, 90px);
}
.meta-item span {
  font-family: var(--serif); font-size: clamp(26px, 3.4vw, 40px);
  color: var(--txt); display: block; line-height: 1.2;
}
.meta-item label { font-size: 11px; letter-spacing: 3px; color: var(--txt-faint); }

.scroll-hint {
  position: absolute; bottom: 34px; left: 50%; width: 1px; height: 56px;
  background: linear-gradient(180deg, transparent, var(--accent));
  animation: hint 2s ease-in-out infinite;
}
@keyframes hint { 0%,100% { opacity: 0.2; transform: translateY(0); } 50% { opacity: 1; transform: translateY(8px); } }

/* ---------- 通用 section ---------- */
.works, .about, .upload { padding: clamp(90px, 12vh, 150px) clamp(24px, 6vw, 88px); }
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-kicker { font-size: 11px; letter-spacing: 5px; color: var(--accent); font-weight: 500; margin-bottom: 16px; }
.section-title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(32px, 4.5vw, 54px); letter-spacing: 3px; line-height: 1.25;
}

/* ---------- 筛选 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 52px; }
.filter {
  background: transparent; border: 1px solid var(--line); color: var(--txt-dim);
  font-size: 13px; letter-spacing: 2px; padding: 10px 24px; border-radius: 100px;
  cursor: pointer; transition: all 0.3s var(--ease); font-family: var(--sans);
}
.filter:hover { border-color: rgba(255,255,255,0.3); color: var(--txt); }
.filter.active { background: var(--accent); border-color: var(--accent); color: #0c0c0e; font-weight: 500; }

/* ---------- 瀑布流画廊 ---------- */
.gallery { columns: 3; column-gap: 20px; max-width: 1440px; }
.gallery-item {
  break-inside: avoid; margin-bottom: 20px;
  position: relative; border-radius: 6px; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--line);
  cursor: pointer;
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.gallery-item.in { opacity: 1; transform: none; }
.gallery-item img, .gallery-item video {
  width: 100%; display: block;
  transition: transform 0.8s var(--ease), filter 0.8s var(--ease);
  filter: brightness(0.92) saturate(0.95);
}
.gallery-item:hover img, .gallery-item:hover video { transform: scale(1.045); filter: brightness(1) saturate(1.05); }
.gallery-item .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(8,8,10,0.88) 100%);
  opacity: 0; transition: opacity 0.45s var(--ease);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 22px;
}
.gallery-item:hover .overlay { opacity: 1; }
.overlay .o-cat { font-size: 10px; letter-spacing: 3px; color: var(--accent); margin-bottom: 6px; }
.overlay .o-title { font-family: var(--serif); font-size: 17px; letter-spacing: 1px; }
.gallery-item .badge-video {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  background: rgba(0,0,0,0.72);
  color: var(--txt); font-size: 11px; letter-spacing: 2px;
  padding: 5px 12px; border-radius: 100px; border: 1px solid var(--line);
}
.gallery-item .badge-del {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,0.55); border: 1px solid var(--line);
  color: var(--txt-dim); font-size: 14px; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  transition: all 0.25s;
}
.gallery-item:hover .badge-del { display: flex; }
.badge-del:hover { color: #ff6b6b; border-color: #ff6b6b; }
.gallery-empty { text-align: center; color: var(--txt-faint); padding: 60px 0; letter-spacing: 1px; }

/* ---------- 关于 ---------- */
.about { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-grid {
  display: grid; grid-template-columns: minmax(280px, 440px) 1fr;
  gap: clamp(40px, 6vw, 96px); align-items: center; max-width: 1440px;
}
.about-photo { position: relative; }
.about-photo img {
  width: 100%; border-radius: 6px; display: block;
  border: 1px solid var(--line); filter: saturate(0.95);
}
.about-photo figcaption {
  margin-top: 14px; font-size: 12px; letter-spacing: 2px; color: var(--txt-faint);
}
.about-text p { color: var(--txt-dim); margin-bottom: 20px; max-width: 560px; }
.about-text p strong { color: var(--txt); font-weight: 500; }
.about-text .section-title { margin-bottom: 28px; }
.skills { list-style: none; margin-top: 34px; border-top: 1px solid var(--line); }
.skills li {
  display: flex; gap: 22px; align-items: baseline;
  padding: 16px 4px; border-bottom: 1px solid var(--line);
  font-size: 15px; color: var(--txt-dim); transition: color 0.3s, padding-left 0.3s var(--ease);
}
.skills li:hover { color: var(--txt); padding-left: 12px; }
.skills li span { font-size: 11px; color: var(--accent); letter-spacing: 2px; }

/* ---------- 上传 ---------- */
.upload { max-width: 1440px; }
.upload-tip { color: var(--txt-dim); margin-top: 18px; max-width: 640px; }
.dropzone {
  border: 1.5px dashed rgba(255,255,255,0.18); border-radius: 12px;
  padding: clamp(44px, 7vw, 80px) 24px; text-align: center;
  cursor: pointer; transition: all 0.35s var(--ease);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  max-width: 860px;
}
.dropzone:hover, .dropzone.dragging {
  border-color: var(--accent); background: var(--accent-soft);
  transform: translateY(-2px);
}
.dz-icon { font-size: 34px; color: var(--accent); margin-bottom: 14px; }
.dz-main { font-size: 16px; color: var(--txt); }
.dz-main em { font-style: normal; color: var(--accent); }
.dz-sub { font-size: 12.5px; color: var(--txt-faint); margin-top: 8px; letter-spacing: 1px; }

.upload-queue {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px; margin-top: 28px; max-width: 960px;
}
.queue-card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; position: relative;
  animation: cardIn 0.4s var(--ease);
}
@keyframes cardIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.queue-card .qc-preview { height: 130px; background: #000 center/cover no-repeat; display: flex; align-items: center; justify-content: center; }
.queue-card .qc-preview img, .queue-card .qc-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.queue-card .qc-preview .qc-type { font-size: 24px; color: var(--txt-faint); }
.queue-card select, .queue-card input {
  width: 100%; background: var(--bg-soft); color: var(--txt);
  border: none; border-top: 1px solid var(--line);
  padding: 9px 12px; font-size: 12.5px; font-family: var(--sans); outline: none;
}
.queue-card input { border-top: none; }
.queue-card .qc-name {
  padding: 9px 12px 4px; font-size: 12px; color: var(--txt-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.queue-card .qc-remove {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  border-radius: 50%; border: 1px solid var(--line);
  background: rgba(0,0,0,0.6); color: var(--txt-dim); cursor: pointer; font-size: 13px;
}
.queue-card .qc-remove:hover { color: #ff6b6b; border-color: #ff6b6b; }
.upload-actions { display: flex; gap: 16px; margin-top: 30px; }
.upload-actions[hidden] { display: none; }
#galleryEmpty[hidden] { display: none; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 40px clamp(24px, 6vw, 88px);
  text-align: center; color: var(--txt-faint); font-size: 12.5px; letter-spacing: 2px;
}

/* ---------- 背景音乐播放器 ---------- */
.music-player {
  position: fixed; right: 22px; bottom: 22px; z-index: 1300;
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  font-family: var(--sans);
}
.mp-toggle {
  position: relative;
  width: 52px; height: 52px; flex: none;
  border-radius: 50%; border: 1px solid var(--line);
  background: rgba(19,19,22,0.9); color: var(--accent);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.mp-toggle:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212,162,83,.22); }
.mp-toggle svg { width: 23px; height: 23px; fill: currentColor; }
.music-player.playing .mp-toggle { border-color: rgba(212,162,83,.5); }
.music-player.playing .mp-toggle::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  border: 1px solid var(--accent); animation: mpPulse 2.4s ease-out infinite;
}
@keyframes mpPulse { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(1.55); opacity: 0; } }

.mp-panel {
  width: 268px; padding: 18px 20px;
  background: rgba(19,19,22,0.92); border: 1px solid var(--line); border-radius: 14px;
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(.98);
  transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s;
}
.music-player.open .mp-panel { opacity: 1; visibility: visible; transform: none; }
.mp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.mp-title { font-family: var(--serif); font-size: 16px; letter-spacing: 1px; color: var(--txt); }
.mp-artist { font-size: 11px; letter-spacing: 2px; color: var(--txt-faint); margin-top: 3px; }
.mp-play {
  width: 42px; height: 42px; flex: none; border-radius: 50%;
  border: none; background: var(--accent); color: #0c0c0e; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s var(--ease);
}
.mp-play:hover { transform: scale(1.06); }
.mp-play svg { width: 20px; height: 20px; fill: currentColor; }
.mp-play .ic-pause { display: none; }
.music-player.playing .mp-play .ic-play { display: none; }
.music-player.playing .mp-play .ic-pause { display: block; }
.mp-progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); cursor: pointer; }
.mp-bar { height: 100%; width: 0; border-radius: 4px; background: var(--accent); }
.mp-time { display: flex; justify-content: space-between; font-size: 11px; color: var(--txt-faint); margin-top: 8px; letter-spacing: 1px; }
.mp-vol { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.mp-vol svg { width: 18px; height: 18px; fill: var(--txt-dim); flex: none; }
.mp-vol input[type=range] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 3px;
  border-radius: 3px; background: rgba(255,255,255,.14); outline: none; cursor: pointer;
}
.mp-vol input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 13px; height: 13px;
  border-radius: 50%; background: var(--accent); border: none; cursor: pointer;
}
.mp-vol input[type=range]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%; background: var(--accent); border: none; cursor: pointer;
}
.mp-note { display: none; font-size: 11px; color: var(--txt-faint); line-height: 1.6; letter-spacing: .5px; margin-top: 14px; }
.mp-note b { color: var(--txt-dim); font-weight: 500; }
.music-player.nofile .mp-note { display: block; }
.music-player.nofile .mp-progress,
.music-player.nofile .mp-time,
.music-player.nofile .mp-vol { display: none; }

@media (max-width: 640px) {
  .music-player { right: 16px; bottom: 16px; }
  .mp-panel { width: 240px; }
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1500;
  background: #08080a;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-stage { max-width: 88vw; max-height: 84vh; display: flex; flex-direction: column; align-items: center; }
.lb-media img, .lb-media video {
  max-width: 88vw; max-height: 78vh; border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  animation: lbIn 0.4s var(--ease);
}
@keyframes lbIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.lb-caption { margin-top: 18px; text-align: center; }
.lb-caption .lb-title { font-family: var(--serif); font-size: 18px; letter-spacing: 1px; }
.lb-caption .lb-meta { font-size: 12px; color: var(--txt-faint); letter-spacing: 2px; margin-top: 6px; }
.lb-close, .lb-prev, .lb-next {
  position: fixed; background: transparent; border: none; color: var(--txt-dim);
  cursor: pointer; transition: color 0.25s, transform 0.25s; z-index: 1600;
  font-family: var(--sans);
}
.lb-close { top: 26px; right: 34px; font-size: 40px; line-height: 1; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 52px; padding: 20px; }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: var(--accent); }

/* ---------- 上传弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 1400; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.modal.open { opacity: 1; visibility: visible; }
.modal-mask { position: absolute; inset: 0; background: #08080a; }
.modal-panel {
  position: relative; width: min(560px, 92vw); max-height: 86vh; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px;
  padding: 34px; animation: cardIn 0.35s var(--ease);
}
.modal-panel h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin-bottom: 22px; letter-spacing: 2px; }
.modal-panel .dropzone.small { padding: 34px 20px; margin-bottom: 8px; }
.modal-close { position: absolute; top: 14px; right: 20px; font-size: 28px; color: var(--txt-dim); background: none; border: none; cursor: pointer; }
.modal-close:hover { color: var(--txt); }
.modal-panel .upload-actions .btn { padding: 12px 26px; font-size: 13px; }

/* ---------- 入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .gallery { columns: 2; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 480px; }
}
@media (max-width: 640px) {
  .gallery { columns: 1; }
  .nav-links { display: none; }
  .lb-prev, .lb-next { font-size: 36px; padding: 8px; }
  .hero-meta { gap: 32px; }
}

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