/* ========================================
   沉浸式主题画廊样式
   ======================================== */

/* === 导航栏 === */
.themed-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(168, 230, 207, 0.3);
}

.themed-nav .nav-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--coral), var(--peach));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
}

.theme-tabs {
  display: flex;
  gap: 8px;
}

.theme-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 50px;
  border: 2px solid var(--mint);
  background: white;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(168, 230, 207, 0.4);
}

.theme-tab.active {
  background: linear-gradient(135deg, var(--coral), var(--peach));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
}

.theme-tab .tab-icon {
  font-size: 1.1rem;
}

.themed-nav .nav-link {
  color: var(--charcoal);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.themed-nav .nav-link:hover {
  background: rgba(168, 230, 207, 0.2);
}

/* === 主题画廊主容器 === */
.themed-gallery {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  transition: opacity 0.3s ease;
}

/* === 主题背景 === */
.theme-background {
  position: absolute;
  inset: 0;
  transition: all 0.5s ease;
  overflow: hidden;
}

/* 各主题背景图案 */
.theme-baby .theme-background {
  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 183, 178, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 218, 185, 0.3) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(255, 228, 225, 0.5) 0%, transparent 60%),
    linear-gradient(135deg, #FFF8F8 0%, #FFE4E1 30%, #FFD1DC 70%, #FFB7B2 100%);
}

.theme-baby .theme-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle, rgba(255, 182, 193, 0.3) 2px, transparent 2px),
    radial-gradient(circle, rgba(255, 218, 185, 0.2) 1.5px, transparent 1.5px);
  background-size: 60px 60px, 40px 40px;
  background-position: 0 0, 30px 30px;
  opacity: 0.6;
}

.theme-play .theme-background {
  background: 
    radial-gradient(circle at 15% 25%, rgba(168, 230, 207, 0.5) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(152, 216, 200, 0.4) 0%, transparent 40%),
    radial-gradient(circle at 60% 40%, rgba(127, 205, 205, 0.3) 0%, transparent 50%),
    linear-gradient(135deg, #E8F8F5 0%, #A8E6CF 40%, #7FCDCD 80%, #98D8C8 100%);
}

.theme-play .theme-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,0.1) 35px, rgba(255,255,255,0.1) 70px),
    repeating-linear-gradient(-45deg, transparent, transparent 50px, rgba(168,230,207,0.15) 50px, rgba(168,230,207,0.15) 100px);
}

.theme-art .theme-background {
  background: 
    radial-gradient(ellipse at 30% 20%, rgba(221, 160, 221, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(230, 230, 250, 0.5) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(216, 191, 216, 0.3) 0%, transparent 60%),
    linear-gradient(135deg, #F8F0FF 0%, #E6E6FA 35%, #DDA0DD 75%, #D8BFD8 100%);
}

.theme-art .theme-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    conic-gradient(from 0deg at 20% 30%, transparent 0deg, rgba(221,160,221,0.1) 60deg, transparent 120deg),
    conic-gradient(from 180deg at 80% 70%, transparent 0deg, rgba(230,230,250,0.1) 90deg, transparent 180deg);
}

.theme-nature .theme-background {
  background: 
    radial-gradient(circle at 25% 30%, rgba(144, 238, 144, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 75% 60%, rgba(152, 251, 152, 0.35) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 80%, rgba(124, 252, 0, 0.2) 0%, transparent 40%),
    linear-gradient(135deg, #F0FFF0 0%, #98FB98 30%, #90EE90 70%, #7CFC00 100%);
}

.theme-nature .theme-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(ellipse 8px 12px at 10% 20%, rgba(34,139,34,0.15) 50%, transparent 50%),
    radial-gradient(ellipse 6px 10px at 30% 60%, rgba(34,139,34,0.12) 50%, transparent 50%),
    radial-gradient(ellipse 10px 15px at 70% 30%, rgba(34,139,34,0.1) 50%, transparent 50%),
    radial-gradient(ellipse 7px 11px at 90% 80%, rgba(34,139,34,0.13) 50%, transparent 50%);
  background-size: 200px 200px, 150px 180px, 220px 160px, 180px 200px;
}

.theme-gallery .theme-background {
  background: 
    radial-gradient(circle at 20% 30%, rgba(240, 240, 240, 0.8) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(232, 232, 232, 0.6) 0%, transparent 40%),
    linear-gradient(135deg, #FFFFFF 0%, #F8F8F8 40%, #F0F0F0 70%, #E8E8E8 100%);
}

.theme-gallery .theme-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(90deg, rgba(200,200,200,0.1) 1px, transparent 1px),
    linear-gradient(rgba(200,200,200,0.1) 1px, transparent 1px);
  background-size: 80px 80px;
}

.theme-space .theme-background {
  background: 
    radial-gradient(ellipse at 30% 20%, rgba(65, 105, 225, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(138, 43, 226, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(25, 25, 112, 0.4) 0%, transparent 30%),
    linear-gradient(135deg, #0a0a2e 0%, #1a1a4e 40%, #2d1b69 70%, #191970 100%);
}

.theme-space .theme-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, white, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, white, transparent),
    radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 230px 80px, white, transparent),
    radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 400px 60px, white, transparent),
    radial-gradient(2px 2px at 500px 180px, rgba(255,255,255,0.8), transparent);
  background-size: 550px 200px;
  animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 0.4; }
}

.theme-mature .theme-background {
  background: 
    radial-gradient(circle at 25% 25%, rgba(255, 215, 0, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(255, 165, 0, 0.2) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 228, 181, 0.3) 0%, transparent 60%),
    linear-gradient(135deg, #FFFAF0 0%, #FFF5E6 35%, #FFE4B5 70%, #FFD700 100%);
}

.theme-mature .theme-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(45deg, transparent 48%, rgba(218,165,32,0.05) 49%, rgba(218,165,32,0.05) 51%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, rgba(218,165,32,0.05) 49%, rgba(218,165,32,0.05) 51%, transparent 52%);
  background-size: 60px 60px;
}

/* 装饰元素容器 */
.bg-decorations {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* 浮动装饰 */
.bg-emoji {
  position: absolute;
  animation: floatDecor 8s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
  opacity: 0.7;
}

/* 不同位置的动画延迟和路径 */
.bg-emoji:nth-child(1) { animation-duration: 7s; animation-delay: 0s; }
.bg-emoji:nth-child(2) { animation-duration: 9s; animation-delay: 0.5s; }
.bg-emoji:nth-child(3) { animation-duration: 8s; animation-delay: 1s; }
.bg-emoji:nth-child(4) { animation-duration: 10s; animation-delay: 1.5s; }
.bg-emoji:nth-child(5) { animation-duration: 7.5s; animation-delay: 2s; }
.bg-emoji:nth-child(6) { animation-duration: 9s; animation-delay: 2.5s; }

@keyframes floatDecor {
  0%, 100% { 
    transform: translateY(0) translateX(0) rotate(-8deg) scale(1); 
    opacity: 0.6;
  }
  25% { 
    transform: translateY(-20px) translateX(15px) rotate(5deg) scale(1.05); 
    opacity: 0.8;
  }
  50% { 
    transform: translateY(-10px) translateX(-10px) rotate(-3deg) scale(0.95); 
    opacity: 0.7;
  }
  75% { 
    transform: translateY(-25px) translateX(5px) rotate(8deg) scale(1.02); 
    opacity: 0.85;
  }
}

/* === 主题内容区 === */
.theme-content {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  box-sizing: border-box;
}

/* === 主题标题 === */
.theme-header {
  text-align: center;
  margin-bottom: 40px;
}

.theme-header h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--charcoal);
  margin-bottom: 12px;
  text-shadow: 0 2px 20px rgba(255,255,255,0.8);
}

.theme-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.9);
  padding: 10px 24px;
  border-radius: 50px;
  display: inline-block;
  backdrop-filter: blur(10px);
}

/* 深色主题 */
.dark-theme .theme-header h1 {
  color: white;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.dark-theme .theme-header p {
  background: rgba(0,0,0,0.5);
  color: rgba(255,255,255,0.9);
}

/* === 画作展示区 === */
.artwork-showcase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  max-width: 1400px;
  width: 100%;
}

/* === 画框样式 === */
.showcase-frame {
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.showcase-frame:hover {
  transform: translateY(-10px) scale(1.02);
}

.frame-container {
  background: white;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 
    0 20px 60px rgba(0,0,0,0.15),
    0 0 0 4px rgba(255,255,255,0.8);
  max-width: 320px;
  width: 100%;
}

/* 不同主题的画框样式 */
.baby-frame .frame-container {
  background: linear-gradient(135deg, #FFF5F5 0%, #FFE4E1 100%);
  border: 4px solid #FFB7B2;
  box-shadow: 
    0 20px 60px rgba(255, 183, 178, 0.3),
    0 0 0 4px rgba(255,255,255,0.9),
    inset 0 0 30px rgba(255, 183, 178, 0.1);
}

.play-frame .frame-container {
  background: linear-gradient(135deg, #F0FFF4 0%, #E8F8F5 100%);
  border: 4px solid #A8E6CF;
  box-shadow: 
    0 20px 60px rgba(168, 230, 207, 0.3),
    0 0 0 4px rgba(255,255,255,0.9),
    inset 0 0 30px rgba(168, 230, 207, 0.1);
}

.art-frame .frame-container {
  background: linear-gradient(135deg, #FAF5FF 0%, #F3E5F5 100%);
  border: 4px solid #DDA0DD;
  box-shadow: 
    0 20px 60px rgba(221, 160, 221, 0.3),
    0 0 0 4px rgba(255,255,255,0.9),
    inset 0 0 30px rgba(221, 160, 221, 0.1);
}

.nature-frame .frame-container {
  background: linear-gradient(135deg, #F0FFF0 0%, #E8F5E9 100%);
  border: 4px solid #90EE90;
  box-shadow: 
    0 20px 60px rgba(144, 238, 144, 0.3),
    0 0 0 4px rgba(255,255,255,0.9),
    inset 0 0 30px rgba(144, 238, 144, 0.1);
}

.gallery-frame .frame-container {
  background: linear-gradient(135deg, #FFFFFF 0%, #F8F8F8 100%);
  border: 4px solid #DDD;
  box-shadow: 
    0 20px 60px rgba(0,0,0,0.1),
    0 0 0 4px rgba(255,255,255,0.9),
    inset 0 0 30px rgba(0,0,0,0.02);
}

.space-frame .frame-container {
  background: linear-gradient(135deg, #1a1a3e 0%, #0a0a2e 100%);
  border: 4px solid #4169E1;
  box-shadow: 
    0 20px 60px rgba(65, 105, 225, 0.4),
    0 0 0 4px rgba(255,255,255,0.1),
    inset 0 0 30px rgba(65, 105, 225, 0.2);
}

.space-frame .frame-info h3,
.space-frame .frame-info p {
  color: white;
}

.mature-frame .frame-container {
  background: linear-gradient(135deg, #FFFAF0 0%, #FFF5E6 100%);
  border: 4px solid #FFD700;
  box-shadow: 
    0 20px 60px rgba(255, 215, 0, 0.3),
    0 0 0 4px rgba(255,255,255,0.9),
    inset 0 0 30px rgba(255, 215, 0, 0.1);
}

/* 画框图片区域 */
.frame-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  cursor: pointer;
}

.frame-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.frame-image-wrap:hover img {
  transform: scale(1.05);
}

.frame-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

/* 画框信息 */
.frame-info {
  padding: 16px 8px 8px;
  text-align: center;
}

.frame-info h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 画框导航 */
.frame-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.space-frame .frame-nav {
  border-top-color: rgba(255,255,255,0.2);
}

.nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--coral), var(--peach));
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.frame-counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 50px;
  text-align: center;
}

.space-frame .frame-counter {
  color: rgba(255,255,255,0.8);
}

/* 画框位置 - 错落有致 */
.frame-1 {
  transform: translateY(-20px);
}

.frame-2 {
  transform: translateY(10px);
}

.frame-3 {
  transform: translateY(-10px);
}

.showcase-frame:hover {
  transform: translateY(-30px) scale(1.03);
}

/* === 画廊统计 === */
.gallery-stats {
  margin-top: 30px;
  padding: 12px 24px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.gallery-stats span {
  font-weight: 700;
  color: var(--coral);
}

.dark-theme .gallery-stats {
  background: rgba(0,0,0,0.5);
  color: rgba(255,255,255,0.8);
}

/* === 作品弹窗 === */
.artwork-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.artwork-modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  background: white;
  border-radius: 32px;
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.3);
  animation: modalIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.1);
  border: none;
  font-size: 1.8rem;
  color: var(--charcoal);
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--coral);
  color: white;
  transform: rotate(90deg);
}

.modal-image {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.modal-image img {
  max-width: 100%;
  max-height: 50vh;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-details {
  padding: 32px;
}

.modal-details h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--charcoal);
  margin-bottom: 16px;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.meta-tag {
  background: linear-gradient(135deg, rgba(168, 230, 207, 0.2), rgba(255, 183, 178, 0.2));
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.modal-details p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

/* === 响应式 === */
@media (max-width: 1200px) {
  .artwork-showcase {
    gap: 30px;
  }
  
  .frame-container {
    max-width: 280px;
  }
}

@media (max-width: 900px) {
  .themed-nav {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }
  
  .theme-tabs {
    order: 3;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  
  .theme-tab {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  .theme-tab .tab-text {
    display: none;
  }
  
  .themed-gallery {
    top: 100px;
  }
  
  .theme-header h1 {
    font-size: 1.8rem;
  }
  
  .artwork-showcase {
    flex-direction: column;
    gap: 24px;
  }
  
  .showcase-frame {
    transform: none !important;
  }
  
  .frame-container {
    max-width: 320px;
  }
  
  .modal-card {
    max-height: 90vh;
  }
  
  .modal-image {
    padding: 20px;
  }
  
  .modal-details {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .theme-header h1 {
    font-size: 1.4rem;
  }
  
  .theme-header p {
    font-size: 0.9rem;
    padding: 8px 16px;
  }
  
  .frame-container {
    padding: 16px;
  }
  
  .frame-info h3 {
    font-size: 1rem;
  }
}
