/* ============================================
   Candy Arcade — 糖果街机游戏平台样式系统
   温暖明亮 × 柔和现代 × 药丸圆角
   ============================================ */

/* ===== 全局重置 ===== */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* ===== Body ===== */
.candy-body {
  font-family: 'Nunito', 'Quicksand', -apple-system, sans-serif;
  background: #f8f7fc; color: #2d2a3d;
  line-height: 1.6; min-height: 100vh; overflow-x: hidden;
  position: relative;
}

/* ===== 装饰性几何图形 ===== */
.decorative-shapes {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; overflow: hidden;
}
.decorative-shapes::before,
.decorative-shapes::after {
  content: ''; position: absolute; border-radius: 50%; opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}
.decorative-shapes::before {
  width: 300px; height: 300px; background: radial-gradient(circle, rgba(255,107,107,0.1), transparent);
  top: -100px; right: -100px;
}
.decorative-shapes::after {
  width: 250px; height: 250px; background: radial-gradient(circle, rgba(78,205,196,0.1), transparent);
  bottom: -80px; left: -80px; animation-delay: -10s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* ===== 顶部粘性导航栏 ===== */
.candy-navbar {
  position: sticky; top: 0; z-index: 100; width: 100%; height: 68px;
  background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.navbar-inner {
  max-width: 1400px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; padding: 0 24px; gap: 28px;
}
.navbar-logo {
  font-family: 'Nunito', sans-serif;
  font-size: 22px; font-weight: 800;
  color: #2d2a3d; text-decoration: none;
  white-space: nowrap; flex-shrink: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.navbar-logo:hover { color: #ff6b6b; }

/* 主导航链接 */
.nav-links { display: flex; align-items: center; gap: 32px; margin-left: auto; }
.nav-link {
  color: #6e6b7b; text-decoration: none; font-size: 15px; font-weight: 600;
  position: relative; padding: 8px 0;
  transition: color 0.3s; white-space: nowrap;
}
.nav-link:hover { color: #ff6b6b; }
.nav-link-active { color: #ff6b6b; }
.nav-link-active::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; background: #ff6b6b; border-radius: 50%;
}

/* 搜索框 */
.navbar-search { position: relative; flex: 1; max-width: 360px; }
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  pointer-events: none;
}
.candy-search-input {
  width: 100%; padding: 12px 20px 12px 46px; height: 46px;
  background: #f2f0f8;
  border: none; border-radius: 23px;
  color: #2d2a3d; font-family: 'Nunito', sans-serif;
  font-size: 14px; outline: none; transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.candy-search-input::placeholder { color: #b9b7c7; }
.candy-search-input:focus {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15), 0 2px 12px rgba(0,0,0,0.06);
}

/* 汉堡菜单按钮（移动端） */
.mobile-menu-btn {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px; background: transparent;
  border: 1px solid #f0edf6; border-radius: 10px;
  cursor: pointer; padding: 8px; flex-shrink: 0;
}
.mobile-menu-btn span { display: block; width: 100%; height: 2px; background: #6e6b7b; border-radius: 1px; transition: all 0.3s; }
.mobile-menu-btn.active span:nth-child(1){transform:rotate(45deg) translate(5px,5px);}
.mobile-menu-btn.active span:nth-child(2){opacity:0;}
.mobile-menu-btn.active span:nth-child(3){transform:rotate(-45deg) translate(5px,-5px);}

/* 移动端导航面板 */
.mobile-nav-panel {
  display: none; background: rgba(255,255,255,0.98); backdrop-filter: blur(20px);
  border-bottom: 1px solid #f0edf6; overflow: hidden;
  max-height: 0; transition: max-height 0.4s;
}
.mobile-nav-panel.open { max-height: 360px; }
.mobile-nav-links { display: flex; flex-direction: column; padding: 12px 24px; gap: 4px; }
.mobile-nav-links .nav-link { padding: 12px 16px; border-radius: 12px; font-size: 15px; transition: all .2s; }
.mobile-nav-links .nav-link:hover { background: #fff5f5; color: #ff6b6b; }

/* ===== Hero 欢迎横幅 ===== */
.hero-section { padding: 24px 24px 0; max-width: 1400px; margin: 0 auto; }
.hero-banner {
  background: linear-gradient(135deg, #ffe9e3, #e3f0ff);
  border-radius: 32px; height: 280px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 48px 56px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
  position: relative; overflow: hidden;
}
.hero-banner::before {
  content: ''; position: absolute; top: -50%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,107,107,0.08), transparent);
  border-radius: 50%;
}
.hero-content { position: relative; z-index: 1; max-width: 480px; }
.hero-title {
  font-family: 'Nunito', sans-serif; font-size: 36px; font-weight: 800;
  color: #2d2a3d; line-height: 1.2; margin-bottom: 12px;
}
.hero-subtitle { font-size: 16px; color: #6e6b7b; margin-bottom: 24px; font-weight: 500; }
.hero-cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 32px; background: #ff6b6b;
  color: #ffffff; text-decoration: none; border-radius: 50px; font-weight: 700;
  font-size: 15px; transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 16px rgba(255,107,107,0.25);
}
.hero-cta:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 24px rgba(255,107,107,0.35); }
.hero-illustration { position: relative; z-index: 1; width: 200px; height: 160px; }

/* ===== 分类药丸导航 ===== */
.category-section { padding: 20px 24px; max-width: 1400px; margin: 0 auto; }
.category-scroll {
  display: flex; gap: 12px; overflow-x: auto;
  scrollbar-width: none; padding: 16px 0;
  -ms-overflow-style: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.category-pill {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  padding: 8px 20px; border-radius: 20px;
  background: color-mix(in srgb, var(--pill-color) 10%, white);
  text-decoration: none; transition: all .3s; position: relative;
  border: 1px solid color-mix(in srgb, var(--pill-color) 15%, transparent);
}
.category-pill-label {
  font-size: 14px; font-weight: 600;
  color: var(--pill-color); position: relative; z-index: 1;
}
.category-pill:hover {
  background: color-mix(in srgb, var(--pill-color) 20%, white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.category-pill:active {
  background: var(--pill-color);
  border-color: var(--pill-color);
}
.category-pill:active .category-pill-label { color: #ffffff; }

/* ===== 游戏分区 Section ===== */
.main-content { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: 0 0 40px; }
.games-section { padding: 28px 24px 0; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.section-title {
  font-family: 'Nunito', sans-serif; font-size: 22px; font-weight: 700;
  color: #2d2a3d; position: relative; display: inline-flex; align-items: center; gap: 12px; padding-left: 16px;
}
.section-title::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 24px; background: var(--accent-color, #ff6b6b); border-radius: 2px;
}
.section-more {
  color: #ff6b6b; text-decoration: none; font-size: 14px; font-weight: 600;
  transition: all 0.3s;
}
.section-more:hover { letter-spacing: 0.5px; }

/* ===== 游戏网格（响应式）===== */
.games-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 640px) { .games-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (min-width: 1024px) { .games-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; } }
@media (min-width: 1440px) { .games-grid { grid-template-columns: repeat(5, 1fr); } }

/* ===== 柔和悬浮游戏卡片 ===== */
.game-card {
  background: #ffffff; border-radius: 24px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.3s ease;
  position: relative;
}
.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.08), 0 0 0 1px rgba(255,107,107,0.1);
}
.game-card-link { display: block; text-decoration: none; color: inherit; }

/* 卡片图片区域 — 4:3 宽比例 */
.card-image { position: relative; aspect-ratio: 4/3; overflow: hidden; background: #f8f7fc; border-radius: 24px 24px 0 0; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.game-card:hover .card-image img { transform: scale(1.03); }
.card-image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.05), transparent 50%);
  pointer-events: none;
}

/* 徽章 左上角柔和标签 */
.card-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--badge-color, #4ecdc4); color: #ffffff;
  padding: 4px 12px; border-radius: 12px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; z-index: 3;
}

/* 卡片信息区 */
.card-info { padding: 12px 14px 16px; }
.card-title { font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 700; color: #2d2a3d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.3s; }
.game-card:hover .card-title { color: #ff6b6b; }

/* ===== 广告容器 清新卡片风格 ===== */
.ad-container { text-align: center; padding: 20px 24px; display: flex; flex-direction: column; align-items: center; max-width: 1400px; margin: 8px auto 0; background: #ffffff; border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); }
.ad-label { color: #b9b7c7; font-size: 12px; font-weight: 500; margin-bottom: 12px; }

/* ===== 详情页 ===== */
.detail-page { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 28px 24px 48px; }
.detail-back { margin-bottom: 24px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 6px; color: #6e6b7b;
  text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 12px 24px; border-radius: 14px;
  background: #ffffff; border: 1px solid #f0edf6;
  transition: all 0.3s; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.back-btn:hover { color: #ff6b6b; border-color: #ff6b6b; box-shadow: 0 4px 16px rgba(255,107,107,0.15); }

.detail-hero {
  display: flex; gap: 32px;
  background: #ffffff; border-radius: 24px; padding: 28px; margin-bottom: 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.detail-thumb { flex-shrink: 0; width: 340px; border-radius: 16px; overflow: hidden; position: relative; }
.detail-thumb img { width: 100%; height: auto; display: block; }
.detail-info { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.detail-title { font-family: 'Nunito', sans-serif; font-size: 28px; font-weight: 700; color: #2d2a3d; line-height: 1.2; }
.detail-desc { color: #6e6b7b; font-size: 15px; line-height: 1.7; }
.play-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 42px; background: #ff6b6b;
  color: #ffffff; border: none; border-radius: 50px; font-family: 'Nunito', sans-serif;
  font-size: 16px; font-weight: 700; cursor: pointer;
  width: fit-content; transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 16px rgba(255,107,107,0.25);
}
.play-btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 6px 24px rgba(255,107,107,0.35); }

.game-iframe-container {
  width: 100%; height: 650px; border-radius: 24px; overflow: hidden;
  margin-bottom: 28px; background: #ffffff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.game-iframe-container iframe { width: 100%; height: 100%; border: none; }

.related-section { margin-top: 48px; }
.related-games-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 768px) { .related-games-grid { grid-template-columns: repeat(4, 1fr); } }
.related-card .card-info { padding: 8px 10px 12px; }
.related-card .card-title { font-size: 13px; }

/* ===== 静态页面 ===== */
.static-page { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 28px 24px 48px; }
.static-back { margin-bottom: 24px; }
.static-title { font-family: 'Nunito', sans-serif; font-size: 28px; font-weight: 700; color: #2d2a3d; margin-bottom: 24px; }
.static-content {
  background: #ffffff; border-radius: 24px; padding: 36px;
  color: #6e6b7b; line-height: 1.85; font-size: 15px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.static-content p { margin-bottom: 16px; }
.static-content strong { color: #2d2a3d; }
.static-content ul { margin: 12px 0 12px 24px; }
.static-content li { margin-bottom: 8px; }

/* ===== 手机端底部导航栏 ===== */
.mobile-bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 101;
  height: 64px; background: rgba(255,255,255,0.95); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid #f0edf6; box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
.mobile-bottom-nav { display: none !important; }
.mobile-bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; text-decoration: none; color: #b9b7c7; font-size: 11px; font-weight: 600;
  transition: color 0.3s; padding: 8px 0;
}
.mobile-bottom-nav a.bottom-nav-active { color: #ff6b6b; }
.bottom-nav-icon { font-size: 20px; }

@media (max-width: 1024px) {
  .nav-links { display: none; }
  .navbar-search { display: none; }
  .mobile-menu-btn { display: flex; }
  .mobile-nav-panel { display: block; }
  .detail-hero { flex-direction: column; }
  .detail-thumb { width: 100%; max-width: 420px; }
}

@media (max-width: 640px) {
  .candy-navbar { height: 58px; }
  .navbar-logo { font-size: 18px; }
  .category-section { display: none; }
  .mobile-bottom-nav { display: flex !important; }
  .main-content { padding-bottom: 80px; }
  .detail-page { padding-bottom: 80px; }
  .static-page { padding-bottom: 80px; }
  .hero-section { padding: 16px 16px 0; }
  .hero-banner { height: auto; min-height: 220px; flex-direction: column; text-align: center; padding: 32px 24px; border-radius: 24px; }
  .hero-title { font-size: 26px; }
  .hero-subtitle { font-size: 14px; }
  .hero-illustration { display: none; }
  .games-section { padding: 20px 16px 0; }
  .section-title { font-size: 18px; }
  .game-card { border-radius: 16px; }
  .card-image { border-radius: 16px 16px 0 0; }
  .detail-page { padding: 16px; }
  .detail-hero { padding: 16px; border-radius: 20px; }
  .detail-title { font-size: 22px; }
  .game-iframe-container { height: 450px; border-radius: 16px; }
  .static-page { padding: 16px; }
  .static-content { padding: 20px; border-radius: 16px; }
  .games-grid { gap: 12px; }
  .ad-container { border-radius: 16px; padding: 16px; }
}

/* ===== 自定义滚动条 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f8f7fc; }
::-webkit-scrollbar-thumb { background: #dcd9ee; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #c5c2db; }
::selection { background: rgba(255, 107, 107, 0.15); color: #2d2a3d; }
a { color: inherit; }
