/* style.css - 全局样式表 */

/* CSS变量，统一主题 */
:root {
  --primary: #2d6cc9;
  --primary-dark: #1a4f9e;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-light: #64748b;
  --bg-light: #fdfdfd;
  --card-bg: #f4f4f4;
  --border-color: #e2e8f0;
  --icon-bg: #e9eff9;
  --shadow-sm: 0 12px 30px rgba(0, 0, 0, 0.05), 0 4px 10px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 24px 40px rgba(45, 108, 201, 0.08), 0 8px 20px rgba(0, 0, 0, 0.05);
  --border-radius-card: 28px;
  --border-radius-element: 20px;
  --border-radius-button: 40px;
}

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 主容器，保证内容居中且留白舒适 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* 头部导航 */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.logo i {
  color: var(--primary);
  font-size: 2rem;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s;
  font-size: 1rem;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links .btn-outline {
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius-button);
  padding: 8px 20px;
  color: var(--text-primary);
}

.nav-links .btn-outline:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* 主欢迎区域（仅首页使用，但保留全局） */
.hero {
  text-align: center;
  margin-bottom: 48px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(145deg, var(--text-primary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
}

/* 卡片网格（首页） */
.course-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin: 32px 0 60px;
}

/* 卡片样式（通用卡片，可用于任何页面） */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-card);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(226, 232, 240, 0.6);
  height: 100%;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #b9d3f0;
}

/* 图标圆形背景（用于卡片头部） */
.icon-wrapper {
  width: 70px;
  height: 70px;
  background: var(--icon-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--primary);
  font-size: 32px;
  transition: background 0.2s;
}

.card:hover .icon-wrapper {
  background: #d9e6ff;
}

.card h2 {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.2;
  color: #0f172a;
}

.card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 1rem;
  line-height: 1.6;
  flex-grow: 1;
}

/* 主要按钮样式 */
.card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--border-radius-button);
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.1s;
  width: fit-content;
  margin-top: auto;
  box-shadow: 0 6px 14px rgba(45, 108, 201, 0.25);
  cursor: pointer;
}

.card-btn i {
  font-size: 0.9rem;
  transition: transform 0.2s;
}

.card-btn:hover {
  background-color: var(--primary-dark);
}

.card-btn:hover i {
  transform: translateX(4px);
}

/* 次要按钮（线框样式） */
.btn-outline-primary {
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: var(--border-radius-button);
  padding: 10px 24px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: white;
}

/* 常用链接区域（首页） */
.useful-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 100px;
  margin: 40px 0 30px;
  flex-wrap: wrap;
}

.link-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-secondary);
  transition: color 0.2s;
  gap: 8px;
}

.link-item:hover {
  color: var(--primary);
}

.link-item i {
  font-size: 3.2rem;
  transition: transform 0.2s;
}

.link-item:hover i {
  transform: translateY(-3px);
}

.link-item span {
  font-size: 1rem;
  font-weight: 500;
}

@media (max-width: 600px) {
  .useful-links {
    gap: 20px;
  }
  .link-item i {
    font-size: 1.8rem;
  }
}

/* 底部页脚 */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 16px 0;
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-light);

}

.footer-links {
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}

.footer-links a,
.wechat-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.wechat-item {
  cursor: default;
}

/* 二维码弹出框 */
.wechat-item .qrcode-popup {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 10px;
  background-color: #fff;
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 100;
  white-space: nowrap;
}

.wechat-item .qrcode-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
}

.wechat-item .qrcode-popup img {
  width: 140px;
  height: auto;
  display: block;
}

.wechat-item:hover .qrcode-popup {
  display: block;
}

/* ===== 可复用模块样式 ===== */
/* 特性卡片（用于展示要点，如关于页面） */
.feature-card {
  background: var(--icon-bg);
  border-radius: var(--border-radius-element);
  padding: 24px 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px rgba(45, 108, 201, 0.1);
}

.feature-card h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1.3rem;
  font-weight: 600;
}

.feature-card p {
  color: var(--text-secondary);
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* 高亮区块 */
.highlight-block {
  background: var(--icon-bg);
  padding: 20px;
  border-radius: var(--border-radius-element);
  border-left: 4px solid var(--primary);
  margin: 30px 0;
  color: #0f172a;
  font-weight: 500;
}

/* 通用二级标题（带左边框） */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
  margin: 30px 0 15px 0;
  border-left: 4px solid var(--primary);
  padding-left: 15px;
}

/* 列表样式（与正文协调） */
ul, ol {
  margin: 10px 0 20px 25px;
  color: var(--text-secondary);
}

li {
  margin-bottom: 6px;
}

/* 最后更新日期样式 */
.last-updated {
  margin-top: 30px;
  font-style: italic;
  color: var(--text-light);
  text-align: right;
}

/* 加载中提示 */
.loading {
  text-align: center;
  padding: 50px;
  color: var(--text-light);
  font-size: 1.2rem;
}

/* 响应式微调 */
@media (max-width: 700px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .card h2 {
    font-size: 1.7rem;
  }
}

@media (max-width: 400px) {
  .container {
    padding: 0 16px;
  }
  .card {
    padding: 24px 20px;
  }
}

/* 将 .nav-links 改为 flex 容器，并重置列表样式 */
.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 32px; /* 保持与原有导航链接的间距一致 */
  align-items: center;
}

/* 每个导航项作为相对定位容器 */
.nav-item {
  position: relative;
}

/* 导航链接样式（继承原有，并确保无下划线等） */
.nav-item > a {
  display: block;
  color: #475569; /* 与原有 .nav-links a 一致 */
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 8px 0;
  transition: color 0.2s;
}

.nav-item > a:hover {
  color: #2d6cc9;
}

/* 下拉按钮中的图标旋转（可保留） */
.dropdown .dropbtn i {
  font-size: 0.8rem;
  transition: transform 0.2s;
}

.dropdown:hover .dropbtn i {
  transform: rotate(180deg);
}

/* 下拉菜单容器 */
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  z-index: 100;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

/* 下拉菜单项链接 */
.dropdown-content a {
  color: #1e293b;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.95rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s;
}

.dropdown-content a:last-child {
  border-bottom: none;
}

.dropdown-content a:hover {
  background-color: #f1f5f9;
  color: #2d6cc9;
}

/* 悬停显示下拉菜单 */
.dropdown:hover .dropdown-content {
  display: block;
}

/* 移动端适配 */
@media (max-width: 700px) {
  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 8px;
  }
  .dropdown-content {
    position: static;
    box-shadow: none;
    border: 1px solid #e2e8f0;
    margin-top: 5px;
  }
  .dropdown:hover .dropdown-content {
    display: block;
  }
}