/* ===== 全局重置 & 变量 ===== */
:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  --accent: #06b6d4;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 30px rgba(0,0,0,0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 70px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding-top: var(--nav-height);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 导航栏 ===== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow var(--transition);
}

#navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--primary-dark);
}

.logo i {
  font-size: 1.7rem;
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 12px;
}

.nav-item {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 30px;
  transition: var(--transition);
  font-size: 0.95rem;
}

.nav-item:hover,
.nav-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: var(--transition);
}

.hamburger:hover {
  background: var(--border);
}

/* ===== 主内容区 ===== */
#main-content {
  min-height: calc(100vh - var(--nav-height) - 80px);
  padding: 32px 0;
}

/* ===== 页脚 ===== */
#footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-inner p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-social a {
  color: var(--text-muted);
  font-size: 1.3rem;
  margin-left: 16px;
  transition: var(--transition);
}

.footer-social a:hover {
  color: var(--primary);
  transform: scale(1.1);
}

/* ===== 首页英雄区 ===== */
.hero {
  text-align: center;
  padding: 40px 0 30px;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 28px;
}

.hero .search-box {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  background: white;
  border-radius: 60px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.hero .search-box:focus-within {
  box-shadow: 0 0 0 4px rgba(79,70,229,0.15);
  border-color: var(--primary-light);
}

.hero .search-box input {
  flex: 1;
  border: none;
  padding: 16px 24px;
  font-size: 1rem;
  outline: none;
  background: transparent;
  font-family: inherit;
}

.hero .search-box button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 32px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero .search-box button:hover {
  background: var(--primary-dark);
}

/* ===== 分类tabs ===== */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 32px;
}

.category-tab {
  padding: 8px 20px;
  border-radius: 30px;
  background: white;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.category-tab:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: #f0f0ff;
}

.category-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79,70,229,0.25);
}

/* ===== 卡片网格 ===== */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 8px;
}

.exam-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.exam-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}

.exam-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.exam-card:hover::before {
  opacity: 1;
}

.exam-card .card-badge {
  display: inline-block;
  background: #eef2ff;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 30px;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.exam-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.exam-card .exam-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.exam-card .exam-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.exam-card .exam-meta i {
  margin-right: 4px;
  color: var(--primary-light);
}

.exam-card .exam-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.exam-card .exam-date {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.95rem;
}

.exam-card .btn-detail {
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 18px;
  border-radius: 30px;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.exam-card .btn-detail:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(79,70,229,0.2);
}

/* ===== 考试列表页 ===== */
.page-header {
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.page-header p {
  color: var(--text-secondary);
}

.list-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-group select,
.filter-group input {
  padding: 10px 18px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: white;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  min-width: 140px;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

/* ===== 关于页 ===== */
.about-section {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.about-section h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--primary-dark);
}

.about-section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.about-section .stats {
  display: flex;
  gap: 30px;
  margin: 30px 0 10px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  flex: 1;
  min-width: 120px;
}

.stat-item .num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-item .label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 20px 24px;
    gap: 8px;
    box-shadow: var(--shadow-md);
    transform: translateY(-120%);
    transition: transform 0.35s ease;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .hamburger {
    display: block;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

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

  .list-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-direction: column;
  }

  .filter-group select,
  .filter-group input {
    width: 100%;
  }

  .about-section {
    padding: 24px;
  }

  .stats {
    flex-direction: column;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero .search-box {
    flex-direction: column;
    border-radius: 30px;
  }

  .hero .search-box button {
    padding: 14px;
    justify-content: center;
  }

  .hero h1 {
    font-size: 1.7rem;
  }
}