/* =============================================
   作品集展示网站 - 主样式
   ============================================= */

:root {
  --primary: #6C63FF;
  --primary-light: #8B85FF;
  --primary-dark: #5A52E0;
  --secondary: #FF6584;
  --accent: #43CBFF;
  --bg: #0D0D1A;
  --bg-card: #16162A;
  --bg-surface: #1E1E35;
  --text: #EAEAF5;
  --text-muted: #8888AA;
  --text-dim: #555577;
  --border: rgba(108,99,255,0.2);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --transition: 0.3s ease;
  --font: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 亮色主题 */
[data-theme="light"] {
  --bg: #F8F8FF;
  --bg-card: #FFFFFF;
  --bg-surface: #F0F0FA;
  --text: #1A1A2E;
  --text-muted: #6666AA;
  --text-dim: #AAAACC;
  --border: rgba(108,99,255,0.15);
  --shadow: 0 4px 20px rgba(108,99,255,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===================== 滚动条 ===================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ===================== 通用 ===================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(108,99,255,0.5); }
.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.btn-block { width: 100%; justify-content: center; }

.section-header { text-align: center; margin-bottom: 48px; }
.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  background: linear-gradient(135deg, var(--text), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.section-desc { color: var(--text-muted); font-size: 16px; }

.tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(108,99,255,0.15);
  color: var(--primary-light);
  border: 1px solid rgba(108,99,255,0.3);
}

/* ===================== 导航栏 ===================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition);
}
.navbar.scrolled {
  background: rgba(13,13,26,0.92);
  backdrop-filter: blur(20px);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .navbar.scrolled { background: rgba(248,248,255,0.92); }

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo .logo-text {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-menu { display: flex; list-style: none; gap: 8px; align-items: center; }
.nav-link {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(108,99,255,0.15); }
.nav-admin {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff !important;
  font-size: 13px;
}
.nav-admin:hover { opacity: 0.9; transform: translateY(-1px); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===================== Hero ===================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 100px 24px 60px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(108,99,255,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(67,203,255,0.1) 0%, transparent 50%),
              radial-gradient(ellipse at 60% 80%, rgba(255,101,132,0.08) 0%, transparent 50%);
  animation: bgMove 8s ease-in-out infinite alternate;
  transition: background-image 0.6s ease;
}
/* 自定义背景图时的样式 */
.hero-bg.has-custom-bg {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  animation: none;
}
/* 渐变遮罩：中心稍亮、四周加深，比纯色遮罩更自然且不会太闷 */
.hero-bg.has-custom-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0.38) 0%, rgba(0,0,0,0.65) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.55) 100%);
  z-index: 0;
}
/* 有自定义背景图时：文字颜色强制白色系，确保在任何图片背景下都清晰可见 */
.hero:has(.hero-bg.has-custom-bg) .hero-subtitle {
  color: rgba(255,255,255,0.95);
}
.hero:has(.hero-bg.has-custom-bg) .hero-desc {
  color: rgba(255,255,255,0.82);
}
.hero:has(.hero-bg.has-custom-bg) .hero-stats .stat-num {
  color: #fff;
}
.hero:has(.hero-bg.has-custom-bg) .hero-stats .stat-label {
  color: rgba(255,255,255,0.7);
}
.hero:has(.hero-bg.has-custom-bg) .hero-scroll-hint {
  color: rgba(255,255,255,0.5);
}

@keyframes bgMove {
  0% { transform: scale(1) translate(0,0); }
  100% { transform: scale(1.05) translate(-10px,-10px); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
}
.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 24px;
  border: 3px solid var(--primary);
  padding: 3px;
  background: var(--bg-card);
  box-shadow: 0 0 40px rgba(108,99,255,0.3);
  overflow: hidden;
}
.hero-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.hero-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, var(--primary-light) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 16px;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.55));
}
[data-theme="light"] .hero-title {
  background: linear-gradient(135deg, #1A1A2E 0%, var(--primary) 60%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(16px, 2.5vw, 22px);
  color: var(--primary-light);
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 1px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}
.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.8;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-num {
  display: block;
  font-size: 32px;
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1;
}
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.hero-scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12px;
  animation: bounce 2s ease-in-out infinite;
}
.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ===================== 作品区 ===================== */
.works-section { padding: 100px 0; }

.filter-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.filter-btn {
  padding: 8px 22px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: var(--transition);
}
.filter-btn:hover { color: var(--primary); border-color: var(--primary); }
.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.work-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  animation: fadeInUp 0.5s ease both;
}
.work-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}
.work-card.hidden { display: none; }

.work-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg-surface);
}
.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.work-card:hover .work-thumb img { transform: scale(1.08); }
.work-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,13,26,0.8) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.work-card:hover .work-thumb-overlay { opacity: 1; }
.work-view-btn {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.3);
  transform: translateY(10px);
  transition: var(--transition);
}
.work-card:hover .work-view-btn { transform: translateY(0); }

.work-info { padding: 20px; }
.work-category {
  font-size: 12px;
  color: var(--primary-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.work-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.work-desc {
  font-size: 14px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.work-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.work-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.work-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(108,99,255,0.1);
  color: var(--text-muted);
}
.work-year { font-size: 12px; color: var(--text-dim); }

.works-more { text-align: center; margin-top: 48px; }

/* 空状态 */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 60px; margin-bottom: 16px; }

/* ===================== 关于我 ===================== */
.about-section {
  padding: 100px 0;
  background: var(--bg-surface);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: center;
}

.about-img-wrapper {
  position: relative;
  display: inline-block;
}
.about-img-wrapper img {
  width: 100%;
  max-width: 380px;
  border-radius: var(--radius-lg);
  display: block;
}
.about-img-decoration {
  position: absolute;
  top: -20px;
  left: -20px;
  right: 20px;
  bottom: 20px;
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0.4;
}

.about-text {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 20px;
  line-height: 1.8;
}

.skills-list { margin: 28px 0; }
.skill-item { margin-bottom: 16px; }
.skill-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.skill-name { font-size: 14px; font-weight: 600; color: var(--text); }
.skill-percent { font-size: 13px; color: var(--primary-light); font-weight: 600; }
.skill-bar {
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline { margin-top: 28px; }
.timeline-item {
  display: flex;
  gap: 16px;
  padding-bottom: 24px;
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 0 0 4px rgba(108,99,255,0.2);
}
.timeline-content { flex: 1; }
.timeline-year {
  font-size: 12px;
  color: var(--primary-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.timeline-content h4 { font-size: 15px; font-weight: 700; margin: 4px 0; }
.timeline-content p { font-size: 13px; color: var(--text-muted); }

/* ===================== 联系区 ===================== */
.contact-section { padding: 100px 0; }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 80px;
  align-items: start;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  transition: var(--transition);
}
.contact-item:hover { border-color: var(--primary); transform: translateX(4px); }
.contact-icon { font-size: 28px; flex-shrink: 0; }
.contact-item h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.contact-item p { font-size: 15px; font-weight: 600; color: var(--text); }

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.social-link svg { fill: var(--text-muted); transition: var(--transition); }
.social-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-3px);
}
.social-link:hover svg { fill: #fff; }

/* 表单 */
.contact-form {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1px solid var(--border);
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.required { color: var(--secondary); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
.form-group textarea { resize: vertical; }
.form-tip { text-align: center; margin-top: 12px; font-size: 14px; color: var(--text-muted); min-height: 20px; }
.form-tip.success { color: #4CAF50; }
.form-tip.error { color: var(--secondary); }

/* ===================== 页脚 ===================== */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}
.footer-copy { font-size: 14px; color: var(--text-muted); }
.footer-sub { font-size: 12px; color: var(--text-dim); margin-top: 8px; }


/* ===================== 作品详情灯箱（花瓣风格） ===================== */
.work-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  background: rgba(8, 8, 18, 0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow: hidden;
}
.work-detail-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* 关闭按钮 */
.wd-close {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 2100;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
  backdrop-filter: blur(6px);
}
.wd-close:hover { background: var(--secondary); border-color: var(--secondary); }

/* 左侧图片区 */
.wd-image-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #080812;
  overflow: hidden;
}

/* 主图容器 */
.wd-main-img-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  user-select: none;
}
.wd-main-img-wrap.zoomed { cursor: grab; }
.wd-main-img-wrap.zoomed:active { cursor: grabbing; }
.wd-main-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transform-origin: center center;
  transition: transform 0.25s ease;
  pointer-events: none;
  border-radius: 4px;
}

/* 缩放控制条 */
.wd-zoom-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 6px 14px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.wd-image-area:hover .wd-zoom-bar { opacity: 1; }
.wd-zoom-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: 0.15s;
  line-height: 1;
}
.wd-zoom-btn:hover { background: var(--primary); }
.wd-zoom-level { font-size: 12px; color: rgba(255,255,255,0.7); min-width: 40px; text-align: center; }

/* 左右切图箭头 */
.wd-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
  opacity: 0;
}
.work-detail-overlay:hover .wd-arrow { opacity: 1; }
.wd-arrow:hover { background: var(--primary); }
.wd-arrow.hidden { display: none; }
.wd-arrow-left { left: 16px; }
.wd-arrow-right { right: 336px; } /* 侧栏宽320+间隔 */

/* 缩略图导航条 */
.wd-thumb-bar {
  height: 80px;
  background: rgba(0,0,0,0.6);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  flex-shrink: 0;
}
.wd-thumb-bar.hidden { display: none; }
.wd-thumb-arrow {
  width: 28px;
  flex-shrink: 0;
  height: 48px;
  border-radius: 6px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
}
.wd-thumb-arrow:hover { background: var(--primary); color: #fff; }
.wd-thumb-track {
  flex: 1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 0;
}
.wd-thumb-track::-webkit-scrollbar { height: 3px; }
.wd-thumb-track::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 2px; }
.wd-thumb {
  width: 64px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.2s ease;
  opacity: 0.55;
}
.wd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.wd-thumb:hover { opacity: 0.85; border-color: rgba(108,99,255,0.5); }
.wd-thumb.active { border-color: var(--primary); opacity: 1; }

/* 右侧信息侧栏 */
.wd-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateX(40px);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.wd-sidebar::-webkit-scrollbar { width: 4px; }
.wd-sidebar::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 2px; }
.work-detail-overlay.active .wd-sidebar {
  transform: translateX(0);
  opacity: 1;
}
.wd-sidebar-inner {
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}
.wd-category {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary-light);
  background: rgba(108,99,255,0.12);
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  align-self: flex-start;
}
.wd-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text);
  margin: 0;
}
.wd-desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-muted);
  margin: 0;
}
.wd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wd-tags .tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(108,99,255,0.1);
  color: var(--primary-light);
  border: 1px solid rgba(108,99,255,0.2);
}
.wd-meta {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wd-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wd-meta-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.wd-meta-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.wd-link {
  color: var(--primary-light) !important;
  text-decoration: none;
}
.wd-link:hover { text-decoration: underline; }
.wd-img-counter {
  font-size: 12px;
  color: var(--text-dim);
  text-align: right;
}
.wd-actions {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.wd-nav-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s ease;
  font-family: var(--font);
}
.wd-nav-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.wd-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 亮色主题适配 */
[data-theme="light"] .work-detail-overlay {
  background: rgba(240,240,250,0.97);
}
[data-theme="light"] .wd-image-area { background: #e8e8f4; }
[data-theme="light"] .wd-close { background: rgba(0,0,0,0.1); border-color: rgba(0,0,0,0.15); color: #333; }
[data-theme="light"] .wd-arrow { background: rgba(255,255,255,0.8); color: #333; }
[data-theme="light"] .wd-arrow-right { right: 336px; }
[data-theme="light"] .wd-thumb-bar { background: rgba(255,255,255,0.7); border-color: var(--border); }
[data-theme="light"] .wd-zoom-bar { background: rgba(0,0,0,0.4); }

/* 响应式 */
@media (max-width: 768px) {
  .work-detail-overlay { flex-direction: column; }
  .wd-sidebar {
    width: 100%;
    max-height: 45vh;
    border-left: none;
    border-top: 1px solid var(--border);
    transform: translateY(30px);
  }
  .work-detail-overlay.active .wd-sidebar { transform: translateY(0); }
  .wd-arrow-right { right: 16px; }
  .wd-sidebar-inner { padding: 20px 18px; gap: 10px; }
  .wd-title { font-size: 18px; }
  .wd-actions { flex-direction: row; }
  .wd-thumb-bar { height: 68px; }
}



/* ===================== 回到顶部 ===================== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  z-index: 999;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
.back-to-top:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(108,99,255,0.5); }

/* ===================== 动画 ===================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===================== 响应式 ===================== */
@media (max-width: 900px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-image { text-align: center; }
  .about-img-wrapper img { max-width: 280px; }
  .contact-grid { gap: 40px; }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 260px;
    background: var(--bg-card);
    flex-direction: column;
    padding: 80px 24px 40px;
    transition: right 0.3s ease;
    box-shadow: -10px 0 40px rgba(0,0,0,0.3);
    gap: 4px;
  }
  .nav-menu.open { right: 0; }
  .nav-toggle { display: flex; }
  .nav-link { padding: 12px 16px; border-radius: var(--radius-sm); width: 100%; }

  .hero-stats { gap: 24px; }
  .works-grid { grid-template-columns: 1fr; }
  .contact-form { padding: 24px; }
}

@media (max-width: 480px) {
  .hero { padding: 80px 20px 60px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .works-section, .about-section, .contact-section { padding: 60px 0; }
}
