/* ============================================
   黄色仓库 - 全局基础样式
   包含重置、排版、导航、页脚、通用组件
   ============================================ */

/* === 重置与基础 === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: var(--player-height);
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--secondary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

/* === 容器 === */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* === 骨架屏加载动画 === */
.skeleton {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  100% { left: 100%; }
}

/* === 顶部导航栏 === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  transition: background var(--transition-normal);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}

.navbar__logo img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}

.navbar__logo span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.navbar__link {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.navbar__link:hover,
.navbar__link--active {
  color: var(--text);
  background: rgba(156, 39, 176, 0.1);
}

.navbar__link--active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 1px;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.navbar__search-btn,
.navbar__cart-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  position: relative;
}

.navbar__search-btn:hover,
.navbar__cart-btn:hover {
  color: var(--text);
  background: rgba(156, 39, 176, 0.2);
}

.navbar__cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.navbar__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--gradient-primary);
  color: white;
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-glow);
}

.navbar__cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow-strong);
  color: white;
}

/* 移动端菜单按钮 */
.navbar__mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text);
  font-size: 1.5rem;
}

/* === 页脚 === */
.footer {
  background: #080810;
  border-top: 1px solid var(--border-color);
  padding: var(--space-4xl) 0 var(--space-xl);
  margin-top: var(--space-4xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.footer__brand p {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-top: var(--space-md);
  max-width: 300px;
}

.footer__social {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.footer__social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.footer__social a:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.footer__col h4 {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-lg);
  color: var(--text);
}

.footer__col ul li {
  margin-bottom: var(--space-sm);
}

.footer__col ul li a {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  transition: color var(--transition-fast);
}

.footer__col ul li a:hover {
  color: var(--secondary);
}

.footer__bottom {
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer__copyright {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.footer__legal {
  display: flex;
  gap: var(--space-lg);
}

.footer__legal a {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

/* === 通用按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-strong);
  color: white;
}

.btn--secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn--secondary:hover {
  background: rgba(156, 39, 176, 0.1);
  border-color: var(--secondary);
  color: var(--secondary);
}

.btn--ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid var(--border-color);
}

.btn--ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--accent);
}

.btn--lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--fs-base);
}

.btn--sm {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--fs-xs);
}

/* === 标签 === */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(156, 39, 176, 0.15);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 500;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag:hover {
  background: rgba(156, 39, 176, 0.3);
  color: var(--secondary);
}

.tag--bpm {
  background: rgba(0, 230, 118, 0.1);
  color: var(--success);
}

.tag--key {
  background: rgba(255, 234, 0, 0.1);
  color: var(--warning);
}

/* === 区块标题 === */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
}

.section-header__title {
  font-size: var(--fs-2xl);
  font-weight: 800;
}

.section-header__title span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-header__link {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.section-header__link:hover {
  color: var(--secondary);
}

/* === Cookie同意弹窗 === */
.cookie-banner {
  position: fixed;
  bottom: calc(var(--player-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  z-index: var(--z-toast);
  max-width: 600px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-lg);
  display: none;
}

.cookie-banner.active {
  display: flex;
}

.cookie-banner__text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.cookie-banner__actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* === 回到顶部 === */
.back-to-top {
  position: fixed;
  bottom: calc(var(--player-height) + 20px);
  right: 20px;
  width: 44px;
  height: 44px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: var(--z-dropdown);
  cursor: pointer;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* === 响应式 === */
@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: var(--player-height-mobile);
    padding-top: 70px;
  }

  .navbar__nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(13, 13, 13, 0.98);
    flex-direction: column;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-color);
  }

  .navbar__nav.active {
    display: flex;
  }

  .navbar__mobile-toggle {
    display: flex;
  }

  .navbar__cta {
    display: none;
  }

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

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .container {
    padding: 0 var(--space-md);
  }
}
