/* ========================================
   Justnail 美甲展示网站 — 全局样式
   ======================================== */

/* --- 基础重置与变量 --- */
:root {
  --color-primary: #e8a0bf;
  --color-primary-dark: #d4789e;
  --color-secondary: #f5e6cc;
  --color-accent: #c9a0dc;
  --color-bg: #fdf8f4;
  --color-bg-alt: #fff5ee;
  --color-text: #3d2c2c;
  --color-text-light: #7a6565;
  --color-white: #ffffff;
  --color-overlay: rgba(61, 44, 44, 0.6);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s ease;
  --max-width: 1200px;
  /* 字体体系 */
  --font-logo: "Cormorant Garamond", "LXGW WenKai", serif;
  --font-heading: "LXGW WenKai", "PingFang SC", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  font-weight: 400;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img,
video {
  max-width: 100%;
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* --- 导航栏 --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--font-logo);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 1px;
  font-style: italic;
}

.logo span {
  color: var(--color-primary-dark);
  font-style: normal;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text-light);
  transition: color var(--transition);
  position: relative;
  letter-spacing: 1px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition);
}

.nav-links a:hover {
  color: var(--color-primary-dark);
}

.nav-links a:hover::after {
  width: 100%;
}

/* 汉堡菜单 */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero 区域 — 多行无限滚动图片墙 --- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #1a0a12;
  overflow: hidden;
}

/* 滚动图片墙容器 */
.hero-marquee {
  position: absolute;
  inset: -10%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  transform: rotate(-8deg) scale(1.2);
}

/* 单行滚动条 */
.marquee-row {
  display: flex;
  gap: 12px;
  width: max-content;
  will-change: transform;
}

.marquee-row img {
  width: 200px;
  height: 260px;
  object-fit: cover;
  border-radius: 10px;
  opacity: 0.65;
  flex-shrink: 0;
  position: relative;
  transition: opacity 0.3s, transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

/* 鼠标悬停单行时，仅该行暂停，其他行不受影响 */
.marquee-row {
  pointer-events: auto;
}

.marquee-row:hover {
  animation-play-state: paused !important;
}

/* 悬停单张图片时放大突出展示 */
.marquee-row img:hover {
  opacity: 1;
  transform: scale(1.35);
  z-index: 10;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

/* 向左滚动 */
.marquee-left {
  animation: scrollLeft 60s linear infinite;
}

/* 向右滚动 */
.marquee-right {
  animation: scrollRight 55s linear infinite;
}

/* 速度变体 */
.marquee-slow {
  animation-duration: 80s;
}

.marquee-fast {
  animation-duration: 40s;
}

@keyframes scrollLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes scrollRight {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

/* 遮罩层 — 渐变蒙版（穿透鼠标事件，让悬停到达滚动行） */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(26, 10, 18, 0.4) 0%, rgba(26, 10, 18, 0.75) 100%);
  z-index: 1;
  pointer-events: none;
}

/* 文字内容 */
.hero-content {
  position: relative;
  z-index: 2;
}

/* 指甲油光泽标题 */
.nail-text {
  font-family: var(--font-heading);
  font-size: 3.6rem;
  font-weight: 700;
  letter-spacing: 8px;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* 每个字——指甲片造型 */
.nail-char {
  display: inline-block;
  padding: 8px 6px 14px;
  background: linear-gradient(
    160deg,
    #ffeef8 0%,
    #f8c4d8 15%,
    #e88fb5 30%,
    #d4789e 50%,
    #e88fb5 70%,
    #f8c4d8 85%,
    #ffeef8 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  animation: nailShimmer 4s ease-in-out infinite;
  filter: drop-shadow(0 2px 8px rgba(212, 120, 158, 0.5));
  transition: transform 0.3s, filter 0.3s;
}

/* 每个字动画延迟，形成波浪光泽 */
.nail-char:nth-child(1) { animation-delay: 0s; }
.nail-char:nth-child(2) { animation-delay: 0.15s; }
.nail-char:nth-child(3) { animation-delay: 0.3s; }
.nail-char:nth-child(4) { animation-delay: 0.45s; }
.nail-char:nth-child(5) { animation-delay: 0.6s; }
.nail-char:nth-child(6) { animation-delay: 0.75s; }
.nail-char:nth-child(7) { animation-delay: 0.9s; }
.nail-char:nth-child(8) { animation-delay: 1.05s; }
.nail-char:nth-child(9) { animation-delay: 1.2s; }

/* 指甲油波浪光泽动画 */
@keyframes nailShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* 副标题 */
.hero-sub {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 36px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  letter-spacing: 3px;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 2px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: var(--color-white);
  color: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* --- 通用 Section --- */
.section {
  padding: 80px 0;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--color-text);
  letter-spacing: 3px;
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-light);
  margin-bottom: 48px;
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 1px;
}

/* --- 分类筛选 --- */
.filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.filter-btn {
  padding: 10px 24px;
  border-radius: 50px;
  border: 2px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary-dark);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--color-primary);
  color: var(--color-white);
}

/* --- 加载更多 --- */
.load-more-wrap {
  text-align: center;
  margin-top: 40px;
}

.load-status {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--color-text-light);
}

/* --- 图片画廊 --- */
.gallery-section {
  background: var(--color-bg);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.gallery-item.hidden {
  display: none;
}

.gallery-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-size: 1rem;
  font-weight: 500;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.gallery-info {
  padding: 16px;
}

.gallery-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.gallery-info p {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* --- 视频展示 --- */
.videos-section {
  background: var(--color-bg-alt);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.video-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.video-placeholder {
  width: 100%;
  aspect-ratio: 9 / 16;
  background: linear-gradient(135deg, #2c1e3d, #4a2d5e);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  gap: 12px;
  position: relative;
}

.video-card video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.play-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--transition);
}

.video-card:hover .play-btn {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}

.video-info {
  padding: 16px;
}

.video-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.video-info p {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* --- 关于我们 --- */
.about-section {
  background: var(--color-bg);
}

.about-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.about-content p {
  font-size: 1.05rem;
  color: var(--color-text-light);
  margin-bottom: 16px;
  line-height: 1.8;
}

.about-signature {
  font-family: var(--font-logo);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--color-primary-dark);
  margin-top: 24px;
  letter-spacing: 2px;
}

/* --- 页脚 --- */
.footer {
  background: var(--color-text);
  color: rgba(255, 255, 255, 0.8);
  padding: 48px 0 24px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.footer-brand .logo {
  color: var(--color-white);
  margin-bottom: 8px;
  display: inline-block;
}

.footer-brand p {
  font-size: 0.9rem;
  opacity: 0.7;
}

.footer-links h4 {
  font-size: 1rem;
  color: var(--color-white);
  margin-bottom: 12px;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 0.9rem;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.footer-links a:hover {
  opacity: 1;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.5;
}

/* --- Lightbox 弹窗 --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 2.5rem;
  color: var(--color-white);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2001;
  line-height: 1;
  transition: var(--transition);
}

.lightbox-close:hover {
  transform: scale(1.2);
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-content video {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
}

/* --- 响应式布局 --- */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background: var(--color-white);
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    box-shadow: var(--shadow-md);
  }

  .nav-links.open {
    max-height: 300px;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

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

  .marquee-row img {
    width: 140px;
    height: 180px;
  }

  .hero-marquee {
    gap: 8px;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .footer-content {
    flex-direction: column;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }
}
