/* ========== 全局重置与基础变量 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 主色调 */
  --primary: #5B7CF3;
  --primary-dark: #3E5DE0;
  --primary-light: #8BA3F8;
  --secondary: #FF7B54;
  --accent: #FFB347;

  /* 背景色 */
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-light: #F7F8FC;
  --bg-white: #FFFFFF;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.6);

  /* 文字颜色 */
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-light: #9CA3AF;
  --text-white: #FFFFFF;

  /* 边框 */
  --border-light: #E5E7EB;
  --border-glass: rgba(255, 255, 255, 0.3);

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.15);
  --shadow-primary: 0 8px 24px rgba(91, 124, 243, 0.35);

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* 渐变 */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-warm: linear-gradient(135deg, #FFB347 0%, #FF7B54 100%);
  --gradient-cool: linear-gradient(135deg, #5B7CF3 0%, #8BA3F8 100%);
  --gradient-pink: linear-gradient(135deg, #FF6B9D 0%, #C06CFC 100%);
  --gradient-green: linear-gradient(135deg, #43E97B 0%, #38F9D7 100%);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

ul, ol {
  list-style: none;
}

/* ========== 通用容器 ========== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding-bottom: 100px;
}

/* ========== 顶部导航栏 ========== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-white);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 var(--space-lg);
  max-width: 1280px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.logo-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.nav-menu {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

.nav-menu a {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  position: relative;
}

.nav-menu a:hover {
  background: var(--bg-light);
  color: var(--primary);
}

.nav-menu a.active {
  background: var(--gradient-primary);
  color: var(--text-white);
  box-shadow: var(--shadow-primary);
}

.nav-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(91, 124, 243, 0.45);
  color: var(--text-white);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-white);
}

.btn-warm {
  background: var(--gradient-warm);
  color: var(--text-white);
  box-shadow: 0 8px 24px rgba(255, 123, 84, 0.35);
}

.btn-warm:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 123, 84, 0.45);
  color: var(--text-white);
}

.btn-ghost {
  background: var(--bg-light);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* ========== 通用Section ========== */
.section {
  padding: var(--space-3xl) 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  position: relative;
  padding-left: 16px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: var(--gradient-warm);
  border-radius: 4px;
}

.section-title .emoji {
  font-size: 1.5rem;
}

.section-more {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.section-more:hover {
  color: var(--primary);
}

/* ========== 卡片 ========== */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

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

.card-glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
}

.card-flat {
  box-shadow: none;
  border: 1px solid var(--border-light);
}

.card-flat:hover {
  border-color: var(--primary-light);
}

/* ========== 网格布局 ========== */
.grid {
  display: grid;
  gap: var(--space-lg);
}

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

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ========== 标签 ========== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-light);
  color: var(--text-secondary);
}

.tag-primary {
  background: rgba(91, 124, 243, 0.1);
  color: var(--primary);
}

.tag-warm {
  background: rgba(255, 123, 84, 0.1);
  color: var(--secondary);
}

.tag-success {
  background: rgba(67, 233, 123, 0.1);
  color: #16A34A;
}

.tag-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #EF4444;
}

/* ========== 头像 ========== */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: var(--text-white);
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
}

.avatar-md {
  width: 56px;
  height: 56px;
  font-size: 1.1rem;
}

.avatar-lg {
  width: 80px;
  height: 80px;
  font-size: 1.5rem;
}

/* ========== 底部导航 ========== */
.footer {
  background: #1F2937;
  color: #D1D5DB;
  padding: var(--space-3xl) 0 var(--space-lg);
  margin-top: var(--space-3xl);
}

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

.footer-brand h3 {
  color: var(--text-white);
  margin-bottom: var(--space-md);
  font-size: 1.25rem;
}

.footer-brand p {
  color: #9CA3AF;
  line-height: 1.8;
}

.footer-col h4 {
  color: var(--text-white);
  margin-bottom: var(--space-md);
  font-size: 1rem;
}

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

.footer-col a {
  color: #9CA3AF;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--text-white);
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: var(--space-lg);
  text-align: center;
  color: #6B7280;
  font-size: 0.85rem;
}

.footer-bottom p {
  margin-bottom: var(--space-sm);
}

.footer-bottom p:last-child {
  margin-bottom: 0;
}

.footer-beian {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: 4px;
}

.footer-beian a {
  color: #9CA3AF;
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  font-size: 0.8rem;
  border: 1px solid transparent;
}

.footer-beian a:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  text-decoration: none;
}

.footer-beian svg {
  color: #FF7B54;
  flex-shrink: 0;
}

.footer-beian a:hover svg {
  color: #FFB347;
}

.footer-beian-divider {
  color: #4B5563;
  margin: 0 var(--space-xs);
}

.footer-copyright {
  color: #9CA3AF;
  font-size: 0.8rem;
  padding: 4px 12px;
}

@media (max-width: 480px) {
  .footer-beian {
    flex-direction: column;
    gap: var(--space-xs);
  }
  .footer-beian-divider {
    display: none;
  }
}

/* ========== 面包屑 ========== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  color: var(--text-light);
}

/* ========== 渐变图标容器 ========== */
.icon-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.icon-gradient:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.icon-gradient svg {
  width: 60%;
  height: 60%;
}

/* 圆形渐变图标 */
.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.icon-circle svg {
  width: 50%;
  height: 50%;
}

/* 小尺寸图标(用于课程卡、商品卡等) */
.icon-gradient-sm {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.icon-gradient-sm svg {
  width: 60%;
  height: 60%;
}

/* ========== 通用动画 ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.slide-up {
  animation: slideUp 0.6s ease-out forwards;
}

.scale-in {
  animation: scaleIn 0.4s ease-out forwards;
}

/* ========== 移动端响应 ========== */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .top-nav-inner {
    height: 60px;
    padding: 0 var(--space-md);
  }
  .nav-menu {
    display: none;
  }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  .section {
    padding: var(--space-2xl) 0;
  }
  .section-title {
    font-size: 1.4rem;
  }
  .container {
    padding: 0 var(--space-md);
  }
}

@media (max-width: 480px) {
  .nav-actions .btn-ghost {
    display: none;
  }
  .logo-text {
    font-size: 1rem;
  }
}
