/* ============================================
   知汇铺 v2.0 - 正式版样式
   设计风格：暖色调 · 浅蓝 · 知识友好
   ============================================ */

/* === CSS 变量 === */
:root {
  --primary: #7bb0d4;
  --primary-light: #96c4e2;
  --primary-pale: #e5eff7;
  --primary-dark: #5d92b8;
  --secondary: #e8c9a6;
  --secondary-light: #f0dcc0;
  --accent-blue: #7bb0d4;
  --accent-green: #63b396;
  --text-primary: #3a3530;
  --text-secondary: #6b6560;
  --text-muted: #9e968f;
  --text-white: #ffffff;
  --bg-body: #faf7f2;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --border-light: #e5ddd6;
  --border-medium: #d6c8b8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.07);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.1);
  --shadow-primary: 0 4px 20px rgba(123,176,212,0.25);
  --radius-sm: 9999px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --max-width: 1200px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select, textarea { font-family: inherit; outline: none; }

/* === 导航栏 === */
.navbar {
  background: rgba(250,247,242,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; z-index: 100;
}
.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.nav-logo span { color: var(--primary); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
  position: relative;
  transition: color var(--transition-fast);
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: width var(--transition-normal);
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }
.nav-search {
  flex: 1; max-width: 380px;
  display: flex; align-items: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: 9999px;
  padding: 0 4px 0 16px;
  height: 38px;
  transition: all var(--transition-normal);
}
.nav-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(123,176,212,0.15);
  background: #fff;
}
.nav-search input {
  flex: 1; border: none; background: transparent;
  font-size: 14px; color: var(--text-primary);
}
.nav-search input::placeholder { color: var(--text-muted); }
.search-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 9999px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition-fast);
}
.search-btn:hover { background: var(--primary-light); }
.nav-right { display: flex; align-items: center; gap: 12px; }

/* 导航按钮 */
.btn-login, .btn-register {
  padding: 7px 20px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-normal);
}
.btn-login {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-login:hover {
  background: var(--primary-pale);
  transform: translateY(-1px);
}
.btn-register {
  background: var(--primary);
  border: 1.5px solid var(--primary);
  color: white;
}
.btn-register:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-primary);
}
.btn-logout {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  border-radius: 9999px;
  padding: 6px 16px;
  font-size: 13px;
  transition: all var(--transition-fast);
}
.btn-logout:hover {
  border-color: #E74C3C;
  color: #E74C3C;
  background: #FFF5F5;
}
.nav-link {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}
.nav-link:hover { color: var(--primary); }

/* === Hero / 横幅 === */
.hero-banner {
  background: linear-gradient(135deg, #faf7f2 0%, #f5ede4 50%, #f0e8dc 100%);
  color: var(--text-primary);
  padding: 48px 32px;
  border-radius: var(--radius-xl);
  margin-bottom: 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(123,176,212,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -40%; left: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(232,201,166,0.1) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
  letter-spacing: -0.5px;
}
.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}
.hero-tags {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid rgba(229,221,214,0.5);
}

/* === 统计条 === */
.stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}
.stat-item {
  flex: 1;
  padding: 18px 16px;
  border-radius: var(--radius-md);
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
}
.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-item:nth-child(1) { border-left: 3px solid var(--primary); }
.stat-item:nth-child(2) { border-left: 3px solid var(--accent-green); }
.stat-item:nth-child(3) { border-left: 3px solid var(--secondary); }
.stat-number {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}
.stat-item:nth-child(1) .stat-number { color: var(--primary); }
.stat-item:nth-child(2) .stat-number { color: var(--accent-green); }
.stat-item:nth-child(3) .stat-number { color: #b8956e; }
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* === 区块标题 === */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}
.section-more {
  font-size: 14px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}
.section-more:hover { color: var(--primary); }

/* === 分类网格 === */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 12px;
  margin-bottom: 36px;
}
.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-normal);
}
.category-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.category-icon {
  font-size: 30px;
  margin-bottom: 6px;
  line-height: 1;
}
.category-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* === 课程卡片 === */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}
.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-slow);
  text-decoration: none;
  color: var(--text-primary);
  display: block;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.course-cover {
  height: 150px;
  background: linear-gradient(135deg, #e5eff7 0%, #d4e6f5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  position: relative;
}
.course-cover .tag {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
}
.course-body {
  padding: 16px;
}
.course-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.course-price {
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
}
.course-price .original {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 6px;
  font-weight: 400;
}
.course-info {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: all var(--transition-normal);
  line-height: 1.4;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--secondary);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--secondary-light); transform: translateY(-1px); }
.btn-success { background: var(--accent-green); color: white; }
.btn-success:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-danger { background: #E74C3C; color: white; }
.btn-danger:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary-pale);
  transform: translateY(-1px);
}
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 9999px; }
.btn-lg { padding: 14px 36px; font-size: 16px; border-radius: 9999px; }

/* === 模态框 === */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-xl);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: 9999px;
  font-size: 14px;
  transition: all var(--transition-fast);
  background: var(--bg-body);
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(123,176,212,0.15);
  background: white;
}
.form-actions { display: flex; gap: 10px; margin-top: 24px; }
.form-actions .btn { flex: 1; }
.form-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.form-switch a {
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
}
.form-switch a:hover { color: var(--primary-light); }

/* === 标签 === */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: #e8f5ee; color: var(--accent-green); }
.badge-warning { background: #faf0e0; color: #b8956e; }
.badge-danger { background: #FDEEEE; color: #E74C3C; }
.badge-primary { background: var(--primary-pale); color: var(--primary-dark); }

/* === Toast 提示 === */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 200px;
  border-left: 4px solid;
}
.toast-success { background: #e8f5ee; color: var(--accent-green); border-left-color: var(--accent-green); }
.toast-error { background: #FDEEEE; color: #E74C3C; border-left-color: #E74C3C; }
.toast-info { background: var(--primary-pale); color: var(--primary-dark); border-left-color: var(--primary); }
@keyframes toastIn {
  from { transform: translateX(100%) scale(0.9); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

/* === 空状态 === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 52px; margin-bottom: 16px; }
.empty-state .text { font-size: 14px; }

/* === 分页 === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.pagination .btn { min-width: 40px; padding: 8px 14px; font-size: 13px; font-weight: 500; border-radius: 9999px; }
.pagination .btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.pagination .btn:not(.active) {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.pagination .btn:not(.active):hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* === 内容区 === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
}

/* === 卡片通用 === */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal);
}
.card:hover { box-shadow: var(--shadow-md); }

/* === 页脚 === */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-light);
  margin-top: 60px;
  background: #f0ece6;
  line-height: 2;
}
.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.site-footer a:hover { color: var(--primary); }
.site-footer .sep {
  margin: 0 8px;
  color: var(--border-medium);
}

/* === 加载动画 === */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0ece6 25%, #e8e2da 50%, #f0ece6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* === 滚动渐入动画 === */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === 工具类 === */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* === 响应式 === */
@media (max-width: 768px) {
  .nav-container { padding: 0 16px; }
  .nav-search { max-width: 160px; margin: 0 8px; }
  .nav-links a { font-size: 14px; }
  .nav-links a:not(:first-child) { display: none; }
  .course-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .container { padding: 16px; }
  .hero-title { font-size: 24px; }
  .hero-banner { padding: 36px 20px; border-radius: var(--radius-md); }
  .hero-tags { flex-wrap: wrap; gap: 10px; }
  .hero-tag { font-size: 12px; padding: 6px 14px; }
  .stat-item { padding: 14px 12px; }
  .stat-number { font-size: 20px; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; }
  .category-item { padding: 14px 6px 10px; }
  .section-title { font-size: 18px; }
}

@media (max-width: 480px) {
  .course-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stats-bar { flex-direction: column; gap: 10px; }
  .category-grid { grid-template-columns: repeat(4, 1fr); }
}
/* @@ADMIN_END@@ */
/* === Admin布局 === */
.admin-body { background: #f5f0ea; }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: var(--text-primary); color: #fff; padding: 24px 0; flex-shrink: 0; min-height: 100vh; }
.admin-sidebar .logo { padding: 0 20px 24px; font-size: 20px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 16px; }
.admin-sidebar .nav-item { padding: 12px 20px; cursor: pointer; transition: all 0.2s; font-size: 14px; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 10px; }
.admin-sidebar .nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.admin-sidebar .nav-item.active { background: var(--primary); color: #fff; border-radius: 0 20px 20px 0; margin-right: 12px; }
.admin-main { flex: 1; padding: 24px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-header h2 { font-size: 22px; font-weight: 700; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.admin-table th { background: #f5f0ea; padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--text-secondary); text-align: left; border-bottom: 2px solid #e5ddd6; }
.admin-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid #e5ddd6; }
.admin-table tr:hover td { background: var(--primary-pale); }
.admin-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); margin-bottom: 20px; }
.admin-form label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; padding: 10px 14px; border: 1.5px solid #d6c8b8; border-radius: 9999px; font-size: 14px; margin-bottom: 16px; transition: border-color 0.2s; box-sizing: border-box; }
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { border-color: var(--primary); outline: none; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.admin-stat-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.admin-stat-card .num { font-size: 28px; font-weight: 800; color: var(--primary); }
.admin-stat-card .label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
