:root {
  /* 主题配色 - 星空蓝 + 樱花粉 */
  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --primary-dark: #6d28d9;
  --primary-hover: #7c3aed;
  --accent: #f472b6;
  --accent-light: #f9a8d4;
  --accent-dark: #ec4899;
  
  /* 背景色 */
  --bg: #0a0612;
  --bg-light: #130d1f;
  --bg-card: #1a1128;
  --bg-card-hover: #231738;
  
  /* 文字色 */
  --text: #e2d9f3;
  --text-muted: #a78bfa;
  --text-bright: #f5f3ff;
  --text-dim: #7c6fa0;
  
  /* 边框 */
  --border: #2d1f3d;
  --border-light: #3d2f4d;
  
  /* 圆角 */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  
  /* 光晕效果 */
  --glow: 0 0 20px rgba(139, 92, 246, 0.3);
  --glow-accent: 0 0 20px rgba(244, 114, 182, 0.3);
  --glow-strong: 0 0 30px rgba(139, 92, 246, 0.5);
  
  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* 随机背景 */
.random-bg {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: -2;
}

.random-bg.loaded {
  opacity: 0.35;
}

a { 
  color: var(--primary); 
  text-decoration: none; 
  transition: all 0.3s ease; 
}
a:hover { color: var(--accent); }

/* 樱花画布 */
#sakura-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.3;
}

/* 导航栏 */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(10, 6, 18, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-md);
  z-index: 100;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-bright);
  text-shadow: 0 0 15px rgba(139, 92, 246, 0.6);
}

.logo-icon {
  font-size: 1.6rem;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.nav-links { display: flex; gap: 2.5rem; }
.nav-links a {
  color: var(--text-dim);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

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

.nav-links a:hover, .nav-links a.active {
  color: var(--text-bright);
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}

/* Hero 区域 */
.hero {
  position: relative;
  text-align: center;
  padding: 6rem 2rem;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.75) 0%, rgba(124, 61, 237, 0.75) 15%, rgba(139, 92, 246, 0.75) 30%, rgba(168, 85, 247, 0.75) 50%, rgba(217, 70, 239, 0.75) 70%, rgba(236, 72, 153, 0.75) 85%, rgba(244, 114, 182, 0.75) 100%);
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(109, 40, 217, 0.3);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 15% 30%, rgba(255, 255, 255, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
}

.hero-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  animation: float 10s ease-in-out infinite;
}

.shape-1 {
  width: 100px;
  height: 100px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 140px;
  height: 140px;
  top: 60%;
  right: 12%;
  animation-delay: 3s;
}

.shape-3 {
  width: 80px;
  height: 80px;
  bottom: 18%;
  left: 18%;
  animation-delay: 6s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); opacity: 0.15; }
  50% { transform: translateY(-25px); opacity: 0.25; }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 1.2rem;
  color: #fff;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.5), 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  letter-spacing: 0.05em;
}

.title-icon {
  font-size: 2.2rem;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 2.5rem;
  font-size: 1.2rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.02em;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.2rem 2rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-width: 120px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.4rem;
  letter-spacing: 0.05em;
}

.hero-actions { 
  display: flex; 
  gap: 1.2rem; 
  justify-content: center; 
  flex-wrap: wrap; 
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn-primary { 
  background: linear-gradient(135deg, #fff, #f9a8d4, #f472b6); 
  color: #5b21b6;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}
.btn-primary:hover { 
  background: linear-gradient(135deg, #f9a8d4, #fff, #f472b6);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.4);
}

.btn-outline { 
  background: rgba(255, 255, 255, 0.05); 
  color: #fff; 
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.1);
}
.btn-outline:hover { 
  border-color: #fff;
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.25);
}

.btn-icon {
  font-size: 1.2rem;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.btn-sm { 
  padding: 0.65rem 1.3rem; 
  font-size: 0.85rem; 
  background: var(--bg-card); 
  color: var(--text); 
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.3s ease;
}
.btn-sm:hover { 
  background: var(--primary-dark);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.btn-icon-small {
  font-size: 0.9rem;
  display: inline-block;
}

/* 主容器 */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
  position: relative;
  z-index: 1;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 0.7rem 1.8rem;
  border-radius: 999px;
  background: rgba(26, 17, 40, 0.7);
  color: var(--text-dim);
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-btn:hover { 
  color: var(--text-bright);
  border-color: var(--primary);
  background: var(--bg-card-hover);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: var(--glow), var(--glow-accent);
  transform: translateY(-2px);
}

/* 图库 - 瀑布流 */
.gallery {
  columns: 4;
  column-gap: 1.5rem;
}

@media (max-width: 1280px) { .gallery { columns: 3; } }
@media (max-width: 960px) { .gallery { columns: 2; } }
@media (max-width: 640px) { .gallery { columns: 1; } }

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: rgba(26, 17, 40, 0.6);
  border: 2px solid transparent;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.gallery-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 2px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.gallery-item:hover::before {
  opacity: 1;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.35), 0 0 20px rgba(244, 114, 182, 0.2);
}

.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease;
  position: relative;
  z-index: 1;
}

.gallery-item:hover img { transform: scale(1.02); }

/* 图片占位符 */
.img-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-light));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  min-height: 140px;
}

.spinner-small {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

/* 遮罩层 */
.gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 30%, rgba(109, 40, 217, 0.85));
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
  z-index: 3;
}

.gallery-item:hover .overlay { opacity: 1; }
.overlay span { 
  color: #fff; 
  font-size: 0.95rem;
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 4rem;
  display: none;
}

.loading.show { display: block; }

.spinner-anime {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-radius: 50%;
}

.spinner-ring:nth-child(1) {
  border-top-color: var(--primary);
  animation: spin 1.2s linear infinite;
}

.spinner-ring:nth-child(2) {
  border-right-color: var(--accent);
  animation: spin 1.5s linear infinite reverse;
  inset: 6px;
}

.spinner-ring:nth-child(3) {
  border-bottom-color: var(--primary-light);
  animation: spin 1.8s linear infinite;
  inset: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  color: var(--text-muted);
  font-size: 1rem;
  animation: fadeInOut 1.5s ease-in-out infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* 加载更多按钮 */
.load-more-btn {
  display: none;
  margin: 3rem auto;
  padding: 1rem 3rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.4s ease;
  box-shadow: var(--glow);
  letter-spacing: 0.05em;
}

.load-more-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.5), var(--glow-accent);
}

.load-more-btn.show { display: block; }

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 18, 0.97);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.show { display: flex; }

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2.5rem;
  color: var(--text-bright);
  background: var(--bg-card);
  border: 2px solid var(--border);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
}

.lightbox-close:hover {
  background: var(--primary-dark);
  border-color: var(--primary);
  transform: rotate(90deg) scale(1.1);
  box-shadow: var(--glow);
}

.lightbox-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
}

#lightbox-img {
  max-width: 92vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius);
  display: none;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border-light);
}

.lightbox-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.8rem;
}

/* 页脚 */
.footer {
  text-align: center;
  padding: 4rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
  background: linear-gradient(to top, rgba(19, 13, 31, 0.8), transparent);
}

.footer-decoration {
  margin-bottom: 1.2rem;
}

.footer-icon {
  font-size: 2.2rem;
  opacity: 0.5;
}

.footer-text {
  margin-bottom: 0.6rem;
}

.footer-text a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-notice {
  font-size: 0.82rem;
  opacity: 0.7;
}

/* API 页面 */
.api-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.endpoint {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  margin-bottom: 1.8rem;
  transition: all 0.3s ease;
}

.endpoint:hover {
  border-color: var(--primary);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.endpoint h3 {
  margin-bottom: 0.8rem;
  color: var(--primary);
  font-size: 1.2rem;
}

.method {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 0.6rem;
  letter-spacing: 0.05em;
}

code {
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--accent);
}

pre {
  background: var(--bg);
  padding: 1.2rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1.2rem 0;
  border: 1px solid var(--border);
}

pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
}

.param-table th, .param-table td {
  padding: 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.param-table th { 
  color: var(--text-muted); 
  font-weight: 600; 
  background: var(--bg-card);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 6rem 2rem;
  grid-column: 1 / -1;
}

.empty-icon {
  font-size: 4.5rem;
  margin-bottom: 1.2rem;
  opacity: 0.4;
}

.empty-state p {
  font-size: 1.3rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.empty-hint {
  font-size: 0.95rem;
  color: var(--text-dim);
  opacity: 0.7;
}
