/* 学习平台主样式文件 */

/* 导入其他样式文件 */
@import url("main.css");
@import url("components.css");

/* 
 * 内容显示修复 - 确保页面内容在JavaScript失效时也能显示
 * Content Display Fix - Ensure content shows even when JavaScript fails
 */
.chapter-content:not(.hidden),
.tab-content:not(.hidden) {
  display: block !important;
}

/* 当页面没有JavaScript支持时显示所有内容 */
.no-js .chapter-content,
.no-js .tab-content {
  display: block !important;
}

/* CSS Variables for Theme System */
:root {
  /* Light Theme Colors */
  --primary-color: #3498db;
  --primary-hover: #2980b9;
  --secondary-color: #2c3e50;
  --secondary-hover: #34495e;
  --accent-color: #e74c3c;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --info-color: #3498db;

  /* Background Colors */
  --bg-primary: #000000;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --bg-modal: rgba(0, 0, 0, 0.5);

  /* Text Colors */
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #6b7280;
  --text-inverse: #ffffff;

  /* Border Colors */
  --border-light: #e0e0e0;
  --border-medium: #ddd;
  --border-dark: #ccc;

  /* Shadow Colors */
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.15);
  --shadow-dark: rgba(0, 0, 0, 0.2);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Dark Theme Colors */
[data-theme="dark"] {
  --primary-color: #4fa8e0;
  --primary-hover: #3498db;
  --secondary-color: #2c3e50;
  --secondary-hover: #34495e;
  --accent-color: #e74c3c;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --info-color: #3498db;

  /* Background Colors */
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #3d3d3d;
  --bg-modal: rgba(0, 0, 0, 0.8);

  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #999999;
  --text-inverse: #333333;

  /* Border Colors */
  --border-light: #4a4a4a;
  --border-medium: #555555;
  --border-dark: #666666;

  /* Shadow Colors */
  --shadow-light: rgba(0, 0, 0, 0.3);
  --shadow-medium: rgba(0, 0, 0, 0.4);
  --shadow-dark: rgba(0, 0, 0, 0.5);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #4a4a4a 0%, #2d2d2d 100%);
  --gradient-secondary: linear-gradient(135deg, #3d3d3d 0%, #2d2d2d 100%);
  --gradient-hero: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

/* High Contrast Theme Colors */
[data-theme="high-contrast"] {
  --primary-color: #0066cc;
  --primary-hover: #0052a3;
  --secondary-color: #000000;
  --secondary-hover: #333333;
  --accent-color: #ff0000;
  --success-color: #00cc00;
  --warning-color: #ff9900;
  --info-color: #0066cc;

  /* Background Colors */
  --bg-primary: #000000;
  --bg-secondary: #f0f0f0;
  --bg-tertiary: #e0e0e0;
  --bg-modal: rgba(0, 0, 0, 0.8);

  /* Text Colors */
  --text-primary: #000000;
  --text-secondary: #333333;
  --text-muted: #666666;
  --text-inverse: #ffffff;

  /* Border Colors */
  --border-light: #cccccc;
  --border-medium: #999999;
  --border-dark: #666666;

  /* Shadow Colors */
  --shadow-light: rgba(0, 0, 0, 0.2);
  --shadow-medium: rgba(0, 0, 0, 0.3);
  --shadow-dark: rgba(0, 0, 0, 0.4);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
  --gradient-secondary: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
  --gradient-hero: linear-gradient(135deg, #000000 0%, #333333 100%);
}

/* 面包屑导航样式 */
.breadcrumb {
  background: var(--bg-secondary);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.breadcrumb-item:not(:last-child)::after {
  content: "›";
  margin: 0 0.5rem;
  color: var(--text-muted);
}

.breadcrumb-item.active {
  color: var(--primary-color);
  font-weight: 500;
}

.breadcrumb-item a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* 课程导航样式 */
.course-navigation {
  background: var(--bg-tertiary);
  padding: 1rem 0;
  margin: 1rem 0;
  border-radius: 8px;
}

.course-navigation h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.course-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.course-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.2s;
  font-size: 0.9rem;
}

.course-nav-item:hover {
  background: var(--primary-color);
  color: var(--text-inverse);
  transform: translateY(-1px);
}

.course-nav-item.active {
  background: var(--primary-color);
  color: var(--text-inverse);
  font-weight: 500;
}

.course-icon {
  font-size: 1.1rem;
}

.course-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 快速链接样式 */
.quick-links {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
}

.quick-link-btn {
  background: var(--primary-color);
  color: var(--text-inverse);
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
  box-shadow: 0 2px 5px var(--shadow-light);
}

.quick-link-btn:hover {
  background: var(--primary-hover);
  transform: translateX(-3px);
  box-shadow: 0 3px 8px var(--shadow-medium);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .course-nav-grid {
    grid-template-columns: 1fr;
    max-height: 150px;
  }

  .course-nav-item {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  .quick-links {
    right: 10px;
  }

  .quick-link-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
  }

  .breadcrumb-item {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .course-navigation {
    margin: 0.5rem 0;
    padding: 0.5rem;
  }

  .course-nav-grid {
    gap: 0.3rem;
    max-height: 120px;
  }

  .quick-links {
    right: 5px;
    gap: 0.3rem;
  }

  .breadcrumb {
    padding: 0.3rem 0;
  }

  .breadcrumb-item {
    font-size: 0.75rem;
  }
}

/* Dark + High Contrast Theme */
[data-theme="dark-high-contrast"] {
  --primary-color: #66b3ff;
  --primary-hover: #4da6ff;
  --secondary-color: #000000;
  --secondary-hover: #1a1a1a;
  --accent-color: #ff4444;
  --success-color: #44ff44;
  --warning-color: #ffaa00;
  --info-color: #66b3ff;

  /* Background Colors */
  --bg-primary: #000000;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2d2d2d;
  --bg-modal: rgba(0, 0, 0, 0.9);

  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #999999;
  --text-inverse: #000000;

  /* Border Colors */
  --border-light: #ffffff;
  --border-medium: #cccccc;
  --border-dark: #999999;

  /* Shadow Colors */
  --shadow-light: rgba(255, 255, 255, 0.1);
  --shadow-medium: rgba(255, 255, 255, 0.2);
  --shadow-dark: rgba(255, 255, 255, 0.3);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #66b3ff 0%, #4da6ff 100%);
  --gradient-secondary: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  --gradient-hero: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
}

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

html {
  font-size: 16px;
  /* 设置HTML根元素字体大小，确保rem单位正确 */
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    "Oxygen", "Ubuntu", "Cantarell", "Noto Sans SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  /* 设置基础字体大小 */
  line-height: 1.75;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  font-variant-ligatures: common-ligatures;
}

.container {
  max-width: 1400px;
  /* 增加容器最大宽度 */
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: var(--secondary-color);
  color: var(--text-inverse);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px var(--shadow-medium);
  transition: background-color 0.3s ease;
}

.navbar {
  padding: 1rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  /* 增加导航栏最大宽度 */
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-menu a {
  color: var(--text-inverse);
  text-decoration: none;
  transition: color 0.3s;
}

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

.nav-menu a.active {
  color: var(--primary-color);
}

/* Theme Controls */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle,
.contrast-toggle {
  background: none;
  border: none;
  color: var(--text-inverse);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover,
.contrast-toggle:hover {
  background: var(--primary-color);
  transform: scale(1.1);
}

.theme-toggle:active,
.contrast-toggle:active {
  transform: scale(0.95);
}

.theme-icon,
.contrast-icon {
  transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-icon {
  transform: rotate(180deg);
}

[data-theme="high-contrast"] .contrast-icon,
[data-theme="dark-high-contrast"] .contrast-icon {
  transform: scale(1.2);
  filter: brightness(1.5);
}

/* Hero Section */
.hero {
  background: var(--gradient-hero);
  color: var(--text-inverse);
  padding: 120px 0 80px;
  text-align: center;
  margin-top: 70px;
  transition: background 0.3s ease;
}

.hero-content h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease-out;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.3s both;
}

.cta-button {
  background: #e74c3c;
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 5px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.3s;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.cta-button:hover {
  background: #c0392b;
}

/* Courses Section */
.courses {
  padding: 80px 0;
  background: var(--bg-primary);
  transition: background-color 0.3s ease;
}

.courses h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

.learning-modules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.module-card {
  background: var(--card-bg);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
}

.module-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.module-icon {
  font-size: 3rem;
  text-align: center;
  padding: 2rem 0 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  margin-bottom: 0;
}

.module-content {
  padding: 1.5rem 2rem;
}

.module-content h3 {
  color: #2c3e50;
  margin-bottom: 0.8rem;
  font-size: 1.4rem;
  font-weight: 600;
}

.module-content p {
  color: #666;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: #f8f9fa;
  color: #495057;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #dee2e6;
}

.module-footer {
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.difficulty {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.difficulty.easy {
  background: #28a745;
}

.difficulty.medium {
  background: #ffc107;
  color: #212529;
}

.difficulty.hard {
  background: #dc3545;
}

.module-btn {
  background: #007bff;
  color: white;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.module-btn:hover {
  background: #0056b3;
  transform: scale(1.05);
}

.course-card {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.course-card h3 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.course-card p {
  color: #666;
  margin-bottom: 1.5rem;
}

.course-button {
  background: #3498db;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.course-button:hover {
  background: #2980b9;
}

/* Resources Section */
.resources {
  padding: 80px 0;
  background: #000000;
}

.resources h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: #2c3e50;
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.resource-item {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.resource-item h3 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.resource-item p {
  color: #666;
}

/* About Section */
.about {
  padding: 80px 0;
  background: var(--bg-primary);
  text-align: center;
}

.about h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

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

/* Footer */
footer {
  background: #2c3e50;
  color: white;
  text-align: center;
  padding: 2rem 0;
}

/* 备案信息样式 */
.footer-links {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #34495e;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-link-left,
.footer-link-right {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

.footer-links label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.footer-links a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #3498db;
}

.footer-links img {
  vertical-align: middle;
}

@media (max-width: 768px) {
  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Assets课程专用样式 */
.asset-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.asset-type {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #3498db;
}

.asset-type h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.asset-type p {
  margin-bottom: 1rem;
  color: #666;
}

.asset-type ul {
  list-style: none;
  padding: 0;
}

.asset-type li {
  padding: 0.3rem 0;
  color: #555;
}

.asset-type li:before {
  content: "→";
  color: #3498db;
  margin-right: 0.5rem;
}

.importance-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.point {
  background: #e8f5e8;
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
}

.point h4 {
  margin-bottom: 0.5rem;
  color: #27ae60;
}

.image-formats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.format-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-top: 3px solid #e74c3c;
}

.format-card h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.format-card p {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.optimization-tips {
  margin: 2rem 0;
}

.tip {
  background: #f0f8ff;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
  border-left: 4px solid #3498db;
}

.tip h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.naming-convention {
  background: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: 6px;
  margin: 2rem 0;
}

.naming-convention h4 {
  margin-bottom: 1rem;
  color: #b8860b;
}

.css-structure {
  margin: 2rem 0;
}

.css-modules {
  margin: 2rem 0;
}

.module-example {
  background: #f5f5f5;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
}

.module-example h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.css-optimization {
  margin: 2rem 0;
}

.optimization-method {
  background: #f9f9f9;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
  border-left: 4px solid #9b59b6;
}

.js-structure {
  margin: 2rem 0;
}

.js-modules {
  margin: 2rem 0;
}

.js-optimization {
  margin: 2rem 0;
}

.optimization-tip {
  background: #f0f8ff;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
  border-left: 4px solid #3498db;
}

.optimization-tip h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.font-management {
  margin: 2rem 0;
}

.font-type {
  background: #fafafa;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
}

.font-type h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.icon-systems {
  margin: 2rem 0;
}

.icon-method {
  background: #f8f9fa;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
  border-left: 4px solid #e67e22;
}

.icon-method h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.font-optimization {
  margin: 2rem 0;
}

.optimization-technique {
  background: #f0f8ff;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
}

.optimization-technique h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.project-structure {
  margin: 2rem 0;
}

.naming-conventions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.convention {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 6px;
}

.convention h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.version-control {
  margin: 2rem 0;
}

.config-file {
  background: #f5f5f5;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
}

.config-file h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.documentation {
  margin: 2rem 0;
}

.doc-type {
  background: #f9f9f9;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
}

.doc-type h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.loading-strategies {
  margin: 2rem 0;
}

.strategy {
  background: #f8f9fa;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
  border-left: 4px solid #2ecc71;
}

.strategy h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.http2-optimization {
  margin: 2rem 0;
}

.compression-techniques {
  margin: 2rem 0;
}

.technique {
  background: #f5f5f5;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
}

.technique h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.bundling-strategies {
  margin: 2rem 0;
}

.cache-mechanisms {
  margin: 2rem 0;
}

.mechanism {
  background: #f8f9fa;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
  border-left: 4px solid #f39c12;
}

.mechanism h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.cache-strategies {
  margin: 2rem 0;
}

.cache-rules {
  margin: 1rem 0;
}

.rule {
  background: #f0f8ff;
  padding: 1rem;
  margin: 0.5rem 0;
  border-radius: 4px;
}

.rule h5 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.service-worker {
  margin: 2rem 0;
}

.sw-strategy {
  background: #f5f5f5;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
}

.sw-strategy h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.cdn-optimization {
  margin: 2rem 0;
}

.cdn-strategy {
  background: #f8f9fa;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
}

.cdn-strategy h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.cdn-basics {
  margin: 2rem 0;
}

.cdn-concept {
  background: #f0f8ff;
  padding: 1.5rem;
  border-radius: 6px;
}

.cdn-concept h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.cdn-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.benefit {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 4px;
  text-align: center;
}

.benefit h5 {
  margin-bottom: 0.5rem;
  color: #3498db;
}

.cdn-providers {
  margin: 2rem 0;
}

.provider {
  background: #f8f9fa;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
}

.provider h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.provider-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.provider-item {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 4px;
}

.provider-item h5 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.deployment-process {
  margin: 2rem 0;
}

.deployment-step {
  background: #f5f5f5;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
  border-left: 4px solid #e74c3c;
}

.deployment-step h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.automation {
  margin: 2rem 0;
}

.automation-tool {
  background: #f8f9fa;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
}

.automation-tool h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.domain-ssl {
  margin: 2rem 0;
}

.config-item {
  background: #f0f8ff;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
}

.config-item h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.performance-metrics {
  margin: 2rem 0;
}

.metric {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 6px;
}

.metric h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.vitals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.vital {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 4px;
  border-left: 4px solid #27ae60;
}

.vital h5 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.vital ul {
  list-style: none;
  padding: 0;
}

.vital li {
  padding: 0.2rem 0;
  font-size: 0.9rem;
}

.monitoring-tools {
  margin: 2rem 0;
}

.tool {
  background: #f5f5f5;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
}

.tool h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.tool-features ul {
  list-style: none;
  padding: 0;
}

.tool-features li {
  padding: 0.3rem 0;
  color: #555;
}

.tool-features li:before {
  content: "✓";
  color: #27ae60;
  margin-right: 0.5rem;
}

.online-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.online-tool {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: 4px;
  text-align: center;
}

.online-tool h5 {
  margin-bottom: 0.5rem;
  color: #3498db;
}

.monitoring-code {
  margin: 2rem 0;
}

.optimization-suggestions {
  margin: 2rem 0;
}

.suggestion {
  background: #f8f9fa;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 6px;
  border-left: 4px solid #e67e22;
}

.suggestion h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.suggestion ul {
  list-style: none;
  padding: 0;
}

.suggestion li {
  padding: 0.3rem 0;
  color: #555;
}

.suggestion li:before {
  content: "→";
  color: #e67e22;
  margin-right: 0.5rem;
}

.performance-budget {
  margin: 2rem 0;
}

.budget-example {
  background: #f0f8ff;
  padding: 1.5rem;
  border-radius: 6px;
}

.budget-example h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .asset-types {
    grid-template-columns: 1fr;
  }

  .importance-points {
    grid-template-columns: 1fr;
  }

  .image-formats {
    grid-template-columns: 1fr;
  }

  .naming-conventions {
    grid-template-columns: 1fr;
  }

  .cdn-benefits {
    grid-template-columns: 1fr;
  }

  .provider-list {
    grid-template-columns: 1fr;
  }

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

  .online-tools {
    grid-template-columns: 1fr;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* Loading animation for module cards */
.module-card:nth-child(1) {
  animation-delay: 0.1s;
}

.module-card:nth-child(2) {
  animation-delay: 0.2s;
}

.module-card:nth-child(3) {
  animation-delay: 0.3s;
}

.module-card:nth-child(4) {
  animation-delay: 0.4s;
}

.module-card:nth-child(5) {
  animation-delay: 0.5s;
}

.module-card:nth-child(6) {
  animation-delay: 0.6s;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #3498db;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2980b9;
}

/* Selection styling */
::selection {
  background: #3498db;
  color: white;
}

/* Focus outline improvements */
.module-btn:focus,
.course-button:focus,
.cta-button:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

/* Active state improvements */
.module-btn:active {
  transform: scale(0.95);
}

.cta-button:active {
  transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .hero-content h2 {
    font-size: 2rem;
  }

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

  .learning-modules {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .module-card {
    margin: 0 1rem;
  }

  .module-footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .resource-list {
    grid-template-columns: 1fr;
  }

  .courses h2,
  .resources h2,
  .about h2 {
    font-size: 2rem;
  }

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

/* Learning Path Styles */
.learning-path {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 3rem;
}

.learning-path h3 {
  text-align: center;
  margin-bottom: 2rem;
  color: #2c3e50;
}

.path-steps {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.step {
  padding: 10px 20px;
  background: #e9ecef;
  border-radius: 25px;
  font-weight: 500;
  color: #6c757d;
  transition: all 0.3s;
}

.step.active {
  background: #3498db;
  color: white;
}

/* Enhanced Course Cards */
.course-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.course-header h3 {
  margin: 0;
  color: #2c3e50;
}

.difficulty {
  background: #e74c3c;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.duration {
  background: #95a5a6;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.course-content {
  margin-bottom: 1.5rem;
}

.course-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.topic {
  background: #ecf0f1;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #2c3e50;
}

.progress-bar {
  background: #e9ecef;
  height: 8px;
  border-radius: 4px;
  margin: 1rem 0;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: #3498db;
  transition: width 0.3s ease;
}

.course-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #666;
}

/* Resource Tabs */
.resource-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.tab-button {
  padding: 10px 20px;
  border: none;
  background: #ecf0f1;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-button.active {
  background: #3498db;
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active,
.tab-content:first-child {
  display: block;
}

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

.resource-card {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.3s;
}

.resource-card:hover {
  transform: translateY(-5px);
}

.resource-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}

.link {
  background: #3498db;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
}

.resource-btn,
.practice-btn,
.community-btn {
  background: #2ecc71;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.resource-btn:hover,
.practice-btn:hover,
.community-btn:hover {
  background: #27ae60;
}

/* Practice Section */
.practice-section h3 {
  color: #2c3e50;
  margin-bottom: 2rem;
}

.practice-item {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.practice-item h4 {
  color: #2c3e50;
  margin-bottom: 1rem;
}

.practice-meta {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}

.difficulty-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: white;
}

.difficulty-badge.easy {
  background: #2ecc71;
}

.difficulty-badge.medium {
  background: #f39c12;
}

.difficulty-badge.hard {
  background: #e74c3c;
}

.time {
  color: #666;
  font-size: 0.9rem;
}

/* Community Section */
.community-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.community-card {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.community-stats {
  display: flex;
  justify-content: space-around;
  margin: 1rem 0;
  font-size: 0.9rem;
  color: #666;
}

/* Practice Zone */
.practice-zone {
  padding: 80px 0;
  background: #f8f9fa;
}

.practice-editor {
  background: var(--bg-primary);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.editor-tabs {
  display: flex;
  background: #34495e;
}

.editor-tab {
  padding: 12px 24px;
  border: none;
  background: #34495e;
  color: white;
  cursor: pointer;
  transition: background 0.3s;
}

.editor-tab.active {
  background: #2c3e50;
}

.editor-container {
  display: flex;
  height: 400px;
}

.code-editor {
  flex: 1;
  border-right: 1px solid #ddd;
}

.code-editor textarea {
  width: 100%;
  height: 100%;
  border: none;
  padding: 20px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  resize: none;
  outline: none;
  background: #f8f9fa;
}

.preview-panel {
  flex: 1;
  padding: 20px;
}

.preview-panel h3 {
  margin-bottom: 10px;
  color: #2c3e50;
}

.preview-panel iframe {
  width: 100%;
  height: calc(100% - 40px);
  border: 1px solid #ddd;
  border-radius: 5px;
}

.editor-controls {
  display: flex;
  gap: 10px;
  padding: 20px;
  background: #f8f9fa;
  border-top: 1px solid #ddd;
}

.control-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.control-btn:first-child {
  background: #3498db;
  color: white;
}

.control-btn:first-child:hover {
  background: #2980b9;
}

.control-btn:not(:first-child) {
  background: #95a5a6;
  color: white;
}

.control-btn:not(:first-child):hover {
  background: #7f8c8d;
}

/* Enhanced About Section */
.about-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.about-content p {
  font-size: 1.1rem;
  margin-bottom: 3rem;
  color: var(--text-secondary);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature {
  text-align: center;
  padding: 2rem;
  background: #0f0f0f;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.feature:hover {
  transform: translateY(-5px);
}

.feature h4 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.feature p {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 0;
}

.stats {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.stat-item {
  text-align: center;
  padding: 2rem;
  background: #3498db;
  color: white;
  border-radius: 10px;
}

.stat-item h3 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 480px) {
  .hero {
    padding: 100px 0 60px;
  }

  .courses,
  .resources,
  .about {
    padding: 60px 0;
  }

  .course-card,
  .resource-item {
    padding: 1.5rem;
  }

  .path-steps {
    flex-direction: column;
    align-items: center;
  }

  .course-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .editor-container {
    flex-direction: column;
    height: 600px;
  }

  .code-editor {
    border-right: none;
    border-bottom: 1px solid #ddd;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .stats {
    flex-direction: row;
    justify-content: space-around;
  }
}

/* 课程内容增强样式 */
.tip-box {
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f9ff 100%);
  border: 1px solid #d1e7dd;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tip-box h4 {
  color: #155724;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.tip-box ul {
  margin: 10px 0;
  padding-left: 20px;
}

.tip-box li {
  margin: 5px 0;
  color: #495057;
}

.code-example {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.code-example h4 {
  color: #495057;
  margin-bottom: 15px;
  font-size: 1.1em;
  border-bottom: 2px solid #007bff;
  padding-bottom: 5px;
}

.code-example pre {
  background: #2d3748;
  color: #e2e8f0;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 400px;
  max-width: 100%;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.9em;
  /* 减小代码块字体大小 */
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

.code-example code {
  color: #e2e8f0;
}

/* 表格样式 */
.table-container {
  background: var(--bg-primary);
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
}

.table-container th,
.table-container td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
  border-right: 1px solid #e9ecef;
  font-size: 0.95rem;
  /* 减小表格字体大小 */
}

.table-container th:last-child,
.table-container td:last-child {
  border-right: none;
}

.table-container th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-weight: bold;
  color: white;
  border-bottom: 2px solid #5a6fd8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.table-container tr:hover {
  background: #f8f9fa;
}

.table-container tr:last-child td {
  border-bottom: none;
}

/* 通用表格样式 - 为所有表格添加边框 */
table {
  border-collapse: collapse;
  border: 1px solid var(--border-medium, #ddd);
  border-radius: 6px;
  overflow: hidden;
}

table th,
table td {
  border: 1px solid var(--border-light, #e9ecef);
  padding: 8px 12px;
}

table th {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  font-weight: 600;
  color: var(--text-primary, #333);
  border-bottom: 2px solid var(--border-medium, #ddd);
}

table tr:hover {
  background: var(--bg-secondary, #f8f9fa);
}

table tr:last-child td {
  border-bottom: none;
}

table th:last-child,
table td:last-child {
  border-right: none;
}

/* 表单样式增强 */
.form-container {
  background: var(--bg-primary);
  border-radius: 10px;
  padding: 30px;
  margin: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group small {
  color: #6c757d;
  font-size: 12px;
}

/* 媒体元素样式 */
.media-container {
  background: var(--bg-primary);
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.media-container video,
.media-container audio {
  width: 100%;
  border-radius: 5px;
}

.media-container iframe {
  width: 100%;
  height: 300px;
  border: none;
  border-radius: 5px;
}

/* ============================================
   课程页面专用样式优化
   ============================================ */

/* 课程头部样式 */
.course-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 120px 0 80px;
  margin-top: 70px;
  position: relative;
  overflow: hidden;
}

.course-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.course-hero .container {
  position: relative;
  z-index: 2;
}

.course-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.course-header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.course-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.course-meta span {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.course-description {
  font-size: 1.3rem;
  line-height: 1.6;
  opacity: 0.95;
  margin-bottom: 2rem;
}

.course-progress {
  max-width: 400px;
  margin: 0 auto;
}

.progress-text {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* 课程内容布局 */
.course-content {
  background: #f8f9fa;
  min-height: calc(100vh - 200px);
  padding: 0;
}

.course-layout {
  display: flex;
  max-width: 1800px;
  /* 进一步增加页面最大宽度，让div容器更宽 */
  margin: 0 auto;
  background: var(--bg-primary);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* 课程侧边栏 */
.course-sidebar {
  width: 260px;
  /* 再次减小侧边栏宽度，为主内容区域腾出更多空间 */
  min-width: 260px;
  background: #2c3e50;
  color: white;
  padding: 0;
  overflow-y: auto;
  height: calc(100vh - 70px);
  position: sticky;
  top: 70px;
}

.course-sidebar h3 {
  padding: 2rem 2rem 1rem;
  margin: 0;
  font-size: 1.3rem;
  border-bottom: 2px solid #34495e;
  background: #233240;
}

.chapter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chapter-item {
  border-bottom: 1px solid #34495e;
  transition: all 0.3s ease;
}

.chapter-item:hover {
  background: #34495e;
}

.chapter-item.active {
  background: #3498db;
  border-left: 4px solid #2980b9;
}

.chapter-item a {
  display: block;
  color: #ecf0f1;
  text-decoration: none;
  padding: 1.2rem 2rem;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chapter-item.active a {
  color: white;
  font-weight: 600;
}

.chapter-duration {
  font-size: 0.8rem;
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 12px;
}

.chapter-item.active .chapter-duration {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

/* 主要内容区域 */
.course-main {
  flex: 1;
  padding: 0;
  background: var(--bg-primary);
  overflow-y: auto;
  height: calc(100vh - 70px);
}

.chapter-content {
  display: none;
  padding: 3rem 5rem;
  /* 进一步增加内边距，让div容器更宽敞 */
  max-width: none;
  margin: 0;
  line-height: 1.7;
}

.chapter-content.active,
.chapter-content:first-child {
  display: block;
}

.chapter-content h2 {
  color: #2c3e50;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid #3498db;
  position: relative;
}

.chapter-content h3 {
  color: #34495e;
  font-size: 1.8rem;
  margin: 2.5rem 0 1.5rem;
  position: relative;
  padding-left: 1rem;
}

.chapter-content h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: linear-gradient(135deg, #3498db, #2980b9);
  border-radius: 2px;
}

.chapter-content h4 {
  color: #495057;
  font-size: 1.3rem;
  margin: 2rem 0 1rem;
}

.chapter-content p {
  color: #555;
  font-size: 1rem;
  /* 减小段落字体大小 */
  margin-bottom: 1.5rem;
  text-align: justify;
}

.chapter-content ul,
.chapter-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.chapter-content li {
  font-size: 0.95rem;
  /* 减小列表项字体大小 */
  line-height: 1.6;
  margin-bottom: 0.5rem;
  color: #555;
}

.chapter-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  /* 减小表格字体大小 */
}

.chapter-content th,
.chapter-content td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.chapter-content th {
  background: #f8f9fa;
  font-weight: bold;
  color: #495057;
}

/* 为不同屏幕尺寸优化字体大小 */
@media (min-width: 1200px) {
  .chapter-content {
    padding: 4rem 6rem;
    /* 大屏幕内边距进一步增加，让div容器更宽敞 */
  }

  .chapter-content h2 {
    font-size: 2.5rem;
    /* 减小标题字体 */
  }

  .chapter-content h3 {
    font-size: 1.8rem;
    /* 减小子标题字体 */
  }

  .chapter-content h4 {
    font-size: 1.3rem;
    /* 减小四级标题字体 */
  }

  .chapter-content p {
    font-size: 1.05rem;
    /* 减小段落字体 */
  }

  .chapter-content li {
    font-size: 1rem;
    /* 减小列表字体 */
  }
}

@media (max-width: 768px) {
  .chapter-content {
    padding: 2rem 3rem;
    /* 小屏幕内边距也适当增加，保持div容器宽敞 */
  }

  .chapter-content h2 {
    font-size: 1.8rem;
    /* 减小标题字体 */
  }

  .chapter-content h3 {
    font-size: 1.4rem;
    /* 减小子标题字体 */
  }

  .chapter-content h4 {
    font-size: 1.1rem;
    /* 减小四级标题字体 */
  }

  .chapter-content p {
    font-size: 0.95rem;
    /* 减小段落字体 */
  }

  .chapter-content li {
    font-size: 0.9rem;
    /* 减小列表字体 */
  }
}

/* 课程导航按钮 */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 3rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  margin-top: 3rem;
}

.nav-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.nav-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.nav-btn:active:not(:disabled) {
  transform: translateY(0);
}

.nav-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.nav-btn.prev {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.nav-btn.prev:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

/* 练习区域样式 */
.practice-exercise {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #3498db;
  border-radius: 15px;
  padding: 2rem;
  margin: 3rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.practice-exercise::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3498db, #2ecc71, #f39c12, #e74c3c);
}

.practice-exercise h4 {
  color: #2c3e50;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.practice-exercise h4::before {
  content: "🎯";
  font-size: 1.2em;
}

.practice-exercise p {
  color: #555;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.practice-exercise ol,
.practice-exercise ul {
  text-align: left;
  max-width: 600px;
  margin: 1rem auto;
  color: #555;
}

.practice-exercise li {
  margin: 0.8rem 0;
  line-height: 1.6;
}

.practice-btn {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.practice-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.practice-btn:active {
  transform: translateY(-1px);
}

/* 代码示例增强 */
.code-example {
  background: var(--bg-primary);
  border: 1px solid #e1e8ed;
  border-radius: 12px;
  margin: 2rem 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.code-example:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.code-example h4 {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #495057;
  margin: 0;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 2px solid #3498db;
  position: relative;
}

.code-example h4::before {
  content: "💻";
  margin-right: 0.5rem;
}

.code-example pre {
  background: #1e1e1e;
  color: #d4d4d4;
  margin: 0;
  padding: 1.5rem;
  overflow-x: auto;
  font-family: "Fira Code", "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.9rem;
  /* 减小代码块字体大小 */
  line-height: 1.6;
  position: relative;
}

.code-example pre::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #007acc, #00d4aa, #ffd700);
}

/* 代码高亮色彩 */
.code-example code {
  color: #d4d4d4;
}

/* 提示框增强 */
.tip-box {
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f9ff 100%);
  border: none;
  border-left: 5px solid #2ecc71;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.tip-box::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle,
      rgba(46, 204, 113, 0.1) 0%,
      transparent 70%);
  border-radius: 50%;
  transform: translate(30px, -30px);
}

.tip-box h4 {
  color: #27ae60;
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tip-box ul {
  margin: 0;
  padding-left: 1.5rem;
}

.tip-box li {
  color: #2c3e50;
  margin: 0.8rem 0;
  line-height: 1.6;
  position: relative;
}

.tip-box li::marker {
  color: #27ae60;
}

/* 响应式设计优化 */
@media (max-width: 1200px) {
  .course-layout {
    flex-direction: column;
  }

  .course-sidebar {
    width: 100%;
    min-width: auto;
    height: auto;
    position: static;
    order: 2;
  }

  .course-main {
    height: auto;
    order: 1;
  }

  .chapter-list {
    display: flex;
    overflow-x: auto;
    padding: 0 1rem;
    gap: 0.5rem;
  }

  .chapter-item {
    min-width: 200px;
    border-bottom: none;
    border-radius: 8px;
    margin: 0.5rem 0;
  }

  .chapter-item a {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .course-header h1 {
    font-size: 2rem;
  }

  .course-meta {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .chapter-content {
    padding: 1.5rem;
  }

  .chapter-content h2 {
    font-size: 1.8rem;
  }

  .chapter-content h3 {
    font-size: 1.4rem;
  }

  .chapter-nav {
    padding: 1.5rem;
    flex-direction: column;
    gap: 1rem;
  }

  .nav-btn {
    width: 100%;
    max-width: 200px;
  }

  .practice-exercise {
    padding: 1.5rem;
    margin: 2rem 0;
  }
}

@media (max-width: 480px) {
  .course-hero {
    padding: 100px 0 60px;
  }

  .chapter-content {
    padding: 0.5rem;
    /* 极小屏幕内边距调整为0.5rem */
  }

  .code-example pre {
    padding: 1rem;
    font-size: 0.85rem;
    /* 减小小屏幕上代码块字体大小 */
  }

  .tip-box {
    padding: 1rem 1.5rem;
  }
}

/* 滚动条优化 */
.course-sidebar::-webkit-scrollbar,
.course-main::-webkit-scrollbar {
  width: 6px;
}

.course-sidebar::-webkit-scrollbar-track {
  background: #34495e;
}

.course-sidebar::-webkit-scrollbar-thumb {
  background: #3498db;
  border-radius: 3px;
}

.course-sidebar::-webkit-scrollbar-thumb:hover {
  background: #2980b9;
}

.course-main::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.course-main::-webkit-scrollbar-thumb {
  background: #bdc3c7;
  border-radius: 3px;
}

.course-main::-webkit-scrollbar-thumb:hover {
  background: #95a5a6;
}

/* 动画效果 */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.chapter-content {
  animation: fadeInRight 0.5s ease-out;
}

.chapter-item {
  animation: fadeInLeft 0.3s ease-out;
}

.chapter-item:nth-child(1) {
  animation-delay: 0.1s;
}

.chapter-item:nth-child(2) {
  animation-delay: 0.2s;
}

.chapter-item:nth-child(3) {
  animation-delay: 0.3s;
}

.chapter-item:nth-child(4) {
  animation-delay: 0.4s;
}

.chapter-item:nth-child(5) {
  animation-delay: 0.5s;
}

/* 打印样式 */
@media print {

  .course-sidebar,
  .chapter-nav,
  .practice-btn {
    display: none;
  }

  .course-layout {
    flex-direction: column;
  }

  .course-main {
    height: auto;
  }

  .chapter-content {
    padding: 0.5rem;
    /* 打印时内边距调整为0.5rem */
  }

  .code-example pre {
    background: #f8f9fa;
    color: #2c3e50;
    border: 1px solid #dee2e6;
  }
}

/* Community Section */
.community {
  padding: 80px 0;
  background: var(--bg-secondary);
  transition: background-color 0.3s ease;
}

.community-content {
  max-width: 1200px;
  margin: 0 auto;
}

.community-tabs {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 12px 24px;
  background: var(--bg-primary);
  border: 2px solid var(--border-light);
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
  color: var(--text-secondary);
}

.tab-btn.active {
  background: var(--primary-color);
  color: var(--text-inverse);
  border-color: var(--primary-color);
}

.tab-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.tab-btn.active:hover {
  background: var(--primary-hover);
  color: var(--text-inverse);
}

.community-tabs-content {
  background: var(--bg-primary);
  border-radius: 15px;
  padding: 40px;
  box-shadow: 0 5px 15px var(--shadow-light);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.tab-content {
  display: none;
}

.tab-content.active,
.tab-content:first-child {
  display: block;
}

/* Discussion Section */
.discussion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.discussion-header h3 {
  color: var(--text-primary);
  margin: 0;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--text-inverse);
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.discussion-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.discussion-item {
  display: flex;
  gap: 15px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border-left: 4px solid var(--primary-color);
  transition: transform 0.3s, background-color 0.3s;
}

.discussion-item:hover {
  transform: translateX(5px);
  background: var(--bg-tertiary);
}

.discussion-avatar {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border-radius: 50%;
  border: 2px solid var(--border-light);
}

.discussion-content h4 {
  margin: 0 0 10px 0;
  color: var(--text-primary);
}

.discussion-content p {
  margin: 0 0 15px 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.discussion-meta {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Achievements Section */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.achievement-card {
  background: var(--bg-primary);
  border-radius: 10px;
  padding: 25px;
  text-align: center;
  border: 2px solid #e0e0e0;
  transition: all 0.3s;
}

.achievement-card:hover {
  border-color: #3498db;
  transform: translateY(-5px);
}

.achievement-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.achievement-card h4 {
  margin: 0 0 10px 0;
  color: #2c3e50;
}

.achievement-card p {
  color: #666;
  margin-bottom: 20px;
}

.achievement-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #3498db;
  transition: width 0.3s;
}

.achievement-progress span {
  font-size: 0.9rem;
  color: #666;
}

/* Study Groups Section */
.study-groups-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.study-groups-header h3 {
  color: #2c3e50;
  margin: 0;
}

.study-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.study-group-card {
  background: var(--bg-primary);
  border-radius: 10px;
  padding: 25px;
  border: 2px solid #e0e0e0;
  transition: all 0.3s;
}

.study-group-card:hover {
  border-color: #3498db;
  transform: translateY(-5px);
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.group-header h4 {
  margin: 0;
  color: #2c3e50;
}

.group-members {
  background: #3498db;
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
}

.study-group-card p {
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}

.group-activity {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.group-activity span {
  font-size: 0.9rem;
  color: #888;
}

.btn-join {
  background: #2ecc71;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s;
}

.btn-join:hover {
  background: #27ae60;
}

/* Leaderboard Section */
.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
}

.leaderboard-tab {
  padding: 8px 16px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.leaderboard-tab.active {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--bg-primary);
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  transition: all 0.3s;
}

.leaderboard-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.leaderboard-item.rank-1 {
  border-color: #f1c40f;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--card-bg));
}

.leaderboard-item.rank-2 {
  border-color: #95a5a6;
  background: linear-gradient(135deg, var(--bg-secondary), var(--card-bg));
}

.leaderboard-item.rank-3 {
  border-color: #e67e22;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--card-bg));
}

.rank-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c3e50;
  min-width: 30px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.user-avatar {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border-radius: 50%;
  border: 2px solid #e0e0e0;
}

.user-details h4 {
  margin: 0 0 5px 0;
  color: #2c3e50;
}

.user-details p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.user-score {
  font-size: 1.2rem;
  font-weight: bold;
  color: #3498db;
}

/* Touch-friendly button enhancements */
.btn-primary,
.btn-join,
.module-btn,
.course-button,
.cta-button,
.back-to-top,
.tab-btn,
.leaderboard-tab {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
  user-select: none;
}

/* Enhanced mobile navigation */
.nav-container {
  position: relative;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 10px;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

/* Mobile-friendly search */
.search-container input {
  min-height: 44px;
  font-size: 16px;
  /* Prevent zoom on iOS */
  border-radius: 22px;
  padding: 12px 20px;
}

/* Touch-friendly module cards */
.module-card,
.course-card,
.discussion-item,
.achievement-card,
.study-group-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.module-card:active,
.course-card:active,
.discussion-item:active,
.achievement-card:active,
.study-group-card:active,
.module-card.touched,
.course-card.touched,
.discussion-item.touched,
.achievement-card.touched,
.study-group-card.touched {
  transform: scale(0.98);
}

.module-card.zoomed,
.course-card.zoomed,
.code-example.zoomed {
  transform: scale(1.1);
  transition: transform 0.3s ease;
  z-index: 10;
}

/* Swipe indicators */
.swipe-container {
  position: relative;
  overflow: hidden;
}

.swipe-content {
  display: flex;
  transition: transform 0.3s ease;
}

.swipe-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.swipe-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e0e0e0;
  cursor: pointer;
  transition: background 0.3s;
}

.swipe-indicator.active {
  background: #3498db;
}

/* Enhanced mobile forms */
@media (max-width: 768px) {

  input,
  select,
  textarea,
  button {
    font-size: 16px;
    /* Prevent zoom on iOS */
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    min-height: 44px;
    border-radius: 8px;
    padding: 12px 16px;
  }
}

/* Mobile responsive enhancements for community */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-controls {
    gap: 0.5rem;
  }

  .theme-controls {
    gap: 0.25rem;
  }

  .theme-toggle,
  .contrast-toggle {
    min-width: 36px;
    min-height: 36px;
    font-size: 1rem;
    padding: 0.25rem;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: #2c3e50;
    flex-direction: column;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 999;
  }

  .nav-menu.active {
    max-height: 300px;
  }

  .nav-menu li {
    margin: 0;
    border-top: 1px solid #34495e;
  }

  .nav-menu a {
    display: block;
    padding: 16px 20px;
    color: white;
    text-decoration: none;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .community-tabs {
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 10px;
  }

  .tab-btn {
    min-width: calc(50% - 5px);
    margin-bottom: 10px;
    padding: 16px 12px;
  }

  .discussion-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .achievements-grid,
  .study-groups-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .leaderboard-item {
    flex-direction: column;
    text-align: center;
    gap: 10px;
    padding: 20px 15px;
  }

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

  .group-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .group-activity {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .discussion-item {
    padding: 16px;
    margin-bottom: 12px;
  }

  .discussion-avatar {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .achievement-card,
  .study-group-card {
    padding: 20px;
  }

  .hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }

  .hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }

  .cta-button {
    padding: 16px 32px;
    font-size: 1.1rem;
  }

  .learning-modules {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .module-card {
    padding: 20px;
  }

  .module-icon {
    font-size: 2.5rem;
  }

  .community-tabs-content {
    padding: 20px;
    margin: 0 10px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .hero {
    padding: 100px 0 60px;
  }

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

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

  .container {
    padding: 0 15px;
  }

  .community-tabs-content {
    padding: 15px;
    margin: 0 5px;
  }

  .tab-btn {
    min-width: 100%;
    margin-bottom: 8px;
  }

  .discussion-item {
    padding: 12px;
  }

  .achievement-card,
  .study-group-card {
    padding: 15px;
  }

  .leaderboard-item {
    padding: 15px;
  }

  .user-score {
    font-size: 1rem;
  }

  .rank-number {
    font-size: 1.2rem;
  }

  .theme-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    flex-direction: column;
    background: var(--bg-primary);
    padding: 8px;
    border-radius: 25px;
    box-shadow: 0 4px 12px var(--shadow-medium);
    z-index: 1000;
  }

  .theme-toggle,
  .contrast-toggle {
    min-width: 44px;
    min-height: 44px;
    margin-bottom: 4px;
  }

  .theme-toggle:last-child,
  .contrast-toggle:last-child {
    margin-bottom: 0;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

  .module-icon,
  .achievement-icon,
  .discussion-avatar,
  .user-avatar {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding: 80px 0 40px;
  }

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

  .community-tabs-content {
    max-height: 60vh;
    overflow-y: auto;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .community-tabs-content {
    background: #2c3e50;
    color: white;
  }

  .discussion-item {
    background: #34495e;
    color: white;
  }

  .achievement-card,
  .study-group-card {
    background: #34495e;
    color: white;
    border-color: #4a5f7a;
  }

  .leaderboard-item {
    background: #34495e;
    color: white;
    border-color: #4a5f7a;
  }
}

/* Accessibility enhancements */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus indicators for keyboard navigation */
.tab-btn:focus,
.btn-primary:focus,
.btn-join:focus,
.module-btn:focus,
.discussion-item:focus,
.achievement-card:focus,
.study-group-card:focus {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {

  .tab-btn,
  .btn-primary,
  .btn-join {
    border: 2px solid;
  }

  .discussion-item,
  .achievement-card,
  .study-group-card,
  .leaderboard-item {
    border-width: 2px;
  }
}

/* =================== Python课程页面样式 =================== */

/* 课程头部样式 */
.course-header {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
  margin-bottom: 0;
}

.course-header h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.course-description {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

.course-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
  color: #ffd700;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* 课程内容区域 */
.course-content {
  padding: 40px 0;
}

.course-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 章节列表样式 */
.chapter-list {
  background: var(--bg-primary);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 5px 15px var(--shadow-light);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.chapter-list h3 {
  color: var(--text-primary);
  margin-bottom: 20px;
  font-size: 1.3rem;
  text-align: center;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-light);
}

.chapter-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chapter-item {
  margin-bottom: 8px;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.chapter-item:hover {
  transform: translateX(5px);
  box-shadow: 0 2px 8px var(--shadow-light);
}

.chapter-item a {
  display: block;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.chapter-item:hover a {
  color: var(--primary-color);
  background: var(--bg-secondary);
  border-left-color: var(--primary-color);
}

.chapter-item.active a {
  background: var(--primary-color);
  color: white;
  border-left-color: var(--primary-hover);
  font-weight: 600;
}

.chapter-duration {
  float: right;
  font-size: 0.8rem;
  opacity: 0.7;
  color: var(--text-muted);
}

/* 章节内容样式 */
.chapter-content {
  background: var(--bg-primary);
  border-radius: 15px;
  padding: 40px;
  box-shadow: 0 5px 15px var(--shadow-light);
  line-height: 1.7;
}

.chapter-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid var(--border-light);
}

.chapter-header h2 {
  color: var(--text-primary);
  font-size: 2.2rem;
  margin-bottom: 15px;
  font-weight: 700;
}

.chapter-description {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.chapter-main h3 {
  color: var(--primary-color);
  font-size: 1.5rem;
  margin: 30px 0 20px 0;
  padding-left: 20px;
  border-left: 4px solid var(--primary-color);
  font-weight: 600;
}

.chapter-main p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 1rem;
}

.chapter-main ul,
.chapter-main ol {
  color: var(--text-secondary);
  margin-bottom: 20px;
  padding-left: 30px;
}

.chapter-main li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* 代码块样式 */
.code-block {
  background: #2d3748;
  border-radius: 12px;
  padding: 20px;
  margin: 25px 0;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 400px;
  border: 1px solid #4a5568;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.code-block pre {
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  font-family: "Fira Code", "Consolas", "Monaco", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.code-block code {
  color: #e2e8f0;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}

/* 代码高亮 */
.code-block .comment {
  color: #718096;
}

.code-block .keyword {
  color: #4299e1;
  font-weight: bold;
}

.code-block .string {
  color: #48bb78;
}

.code-block .number {
  color: #ed8936;
}

.code-block .function {
  color: #9f7aea;
}

.code-block .operator {
  color: #f56565;
}

/* 提示框样式 */
.tip-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 12px;
  margin: 30px 0;
  border-left: 5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.tip-box h4 {
  margin: 0 0 15px 0;
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tip-box h4::before {
  content: "💡";
  font-size: 1.5rem;
}

.tip-box ul {
  margin: 0;
  padding-left: 20px;
}

.tip-box li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* 练习题样式 */
.practice-exercise {
  background: var(--bg-secondary);
  border: 2px solid var(--success-color);
  border-radius: 12px;
  padding: 25px;
  margin: 30px 0;
  text-align: center;
}

.practice-exercise h4 {
  color: var(--success-color);
  margin: 0 0 15px 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.practice-exercise p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.practice-btn {
  background: var(--success-color);
  color: white;
  padding: 12px 30px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.practice-btn:hover {
  background: #27ae60;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

/* 章节导航样式 */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding: 20px 0;
  border-top: 2px solid var(--border-light);
}

.nav-btn {
  background: var(--primary-color);
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.nav-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.nav-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 课程总结样式 */
.chapter-summary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 40px;
  border-radius: 15px;
  margin: 40px 0;
  text-align: center;
}

.chapter-summary h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  font-weight: 700;
  border: none;
  padding: 0;
}

.chapter-summary p {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.9);
}

.chapter-summary ul {
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
  padding: 0;
}

.chapter-summary li {
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  list-style: none;
  position: relative;
}

.chapter-summary li::before {
  content: "✓";
  color: #4ade80;
  font-weight: bold;
  margin-right: 10px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .course-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .chapter-list {
    position: static;
    margin-bottom: 30px;
  }

  .chapter-list ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .chapter-item {
    flex: 1;
    min-width: 200px;
  }
}

@media (max-width: 768px) {
  .course-header h1 {
    font-size: 2rem;
  }

  .course-description {
    font-size: 1rem;
  }

  .course-stats {
    gap: 20px;
  }

  .chapter-content {
    padding: 20px;
  }

  .chapter-header h2 {
    font-size: 1.8rem;
  }

  .code-block {
    padding: 15px;
    margin: 20px 0;
  }

  .code-block pre {
    font-size: 0.8rem;
  }

  .tip-box,
  .practice-exercise {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .course-header {
    padding: 40px 0;
  }

  .course-header h1 {
    font-size: 1.6rem;
  }

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

  .chapter-list ul {
    flex-direction: column;
  }

  .chapter-item {
    min-width: auto;
  }

  .chapter-nav {
    flex-direction: column;
    gap: 15px;
  }

  .nav-btn {
    width: 100%;
  }

  .code-block,
  .code-example pre {
    max-height: 250px;
    font-size: 0.8rem;
  }
}

/* ===============================
   C语言课程专用样式
   =============================== */

/* 学习目标样式 */
.learning-objectives {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border: 2px solid #2196f3;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.1);
}

.learning-objectives h4 {
  color: #1976d2;
  margin-bottom: 15px;
  font-size: 1.2rem;
  font-weight: 700;
}

.learning-objectives ul {
  list-style: none;
  padding: 0;
}

.learning-objectives li {
  margin: 10px 0;
  padding-left: 25px;
  position: relative;
  color: #424242;
  line-height: 1.6;
}

.learning-objectives li::before {
  content: "🎯";
  position: absolute;
  left: 0;
  top: 0;
}

/* 知识点区域样式 */
.knowledge-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px var(--shadow-light);
}

.knowledge-section h4 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.3rem;
  font-weight: 700;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
}

.knowledge-section h5 {
  color: var(--secondary-color);
  margin: 20px 0 10px 0;
  font-size: 1.1rem;
  font-weight: 600;
}

/* 数据类型表格样式 */
.data-type-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: var(--bg-primary);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px var(--shadow-light);
  border: 2px solid var(--border-medium);
}

.data-type-table th,
.data-type-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}

.data-type-table th:last-child,
.data-type-table td:last-child {
  border-right: none;
}

.data-type-table th {
  background: linear-gradient(135deg,
      var(--primary-color) 0%,
      var(--primary-hover) 100%);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--primary-hover);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.data-type-table tr:hover {
  background: var(--bg-secondary);
}

.data-type-table tr:last-child td {
  border-bottom: none;
}

.data-type-table code {
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  color: #e74c3c;
}

/* 代码示例样式 */
.code-example {
  background: #2d3748;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  position: relative;
  overflow-x: auto;
}

.code-example::before {
  content: "💻 代码示例";
  position: absolute;
  top: -10px;
  left: 15px;
  background: #4a5568;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.code-example pre {
  margin: 0;
  color: #e2e8f0;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.code-example h4 {
  color: #e2e8f0;
  margin-bottom: 15px;
  font-size: 1rem;
  font-weight: 600;
}

/* 信息框样式 */
.info-box {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border-left: 4px solid #2196f3;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  position: relative;
  box-shadow: 0 2px 10px rgba(33, 150, 243, 0.1);
}

.info-box::before {
  content: "💡";
  position: absolute;
  top: 15px;
  left: -2px;
  background: #2196f3;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.info-box h5 {
  color: #1976d2;
  margin-bottom: 10px;
  font-weight: 600;
}

/* 提示框样式 */
.tip-box {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-left: 4px solid #ff9800;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  position: relative;
  box-shadow: 0 2px 10px rgba(255, 152, 0, 0.1);
}

.tip-box::before {
  content: "💡";
  position: absolute;
  top: 15px;
  left: -2px;
  background: #ff9800;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.tip-box h4,
.tip-box h5 {
  color: #f57c00;
  margin-bottom: 10px;
  font-weight: 600;
}

/* 成功框样式 */
.success-box {
  background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
  border-left: 4px solid #4caf50;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  position: relative;
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.1);
}

.success-box::before {
  content: "✅";
  position: absolute;
  top: 15px;
  left: -2px;
  background: #4caf50;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.success-box h5 {
  color: #388e3c;
  margin-bottom: 10px;
  font-weight: 600;
}

/* 警告框样式 */
.warning-box {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-left: 4px solid #ff5722;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  position: relative;
  box-shadow: 0 2px 10px rgba(255, 87, 34, 0.1);
}

.warning-box::before {
  content: "⚠️";
  position: absolute;
  top: 15px;
  left: -2px;
  background: #ff5722;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.warning-box h5 {
  color: #d84315;
  margin-bottom: 10px;
  font-weight: 600;
}

/* 实践练习框样式 */
.practice-box {
  background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
  border: 2px solid #9c27b0;
  border-radius: 12px;
  padding: 25px;
  margin: 30px 0;
  position: relative;
  box-shadow: 0 4px 15px rgba(156, 39, 176, 0.1);
}

.practice-box::before {
  content: "🎯 实践练习";
  position: absolute;
  top: -12px;
  left: 20px;
  background: #9c27b0;
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.practice-box h4,
.practice-box h5 {
  color: #7b1fa2;
  margin-bottom: 15px;
  font-weight: 600;
}

.practice-box .code-example {
  margin: 20px 0;
}

/* 练习按钮样式 */
.practice-btn {
  background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(156, 39, 176, 0.2);
}

.practice-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(156, 39, 176, 0.3);
}

/* 章节导航样式增强 */
.chapter-nav {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 15px 20px;
  margin: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background: var(--primary-color);
  color: white;
}

.nav-link i {
  margin: 0 5px;
}

/* 章节页面样式 */
.chapter-page {
  max-width: 1400px;
  /* 增加最大宽度，让HTML课程章节内容更宽敞 */
  margin: 0 auto;
  padding: 3rem 4rem;
  /* 增加内边距，提供更多水平空间 */
}

.chapter-header {
  background: linear-gradient(135deg, #00599c 0%, #003366 100%);
  color: white;
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 30px;
  text-align: center;
}

.chapter-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.chapter-header p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin: 0;
}

/* 章节导航按钮样式 */
.chapter-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.nav-button {
  background: var(--primary-color);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .chapter-header h1 {
    font-size: 2rem;
  }

  .chapter-header p {
    font-size: 1rem;
  }

  .data-type-table {
    font-size: 0.8rem;
  }

  .data-type-table th,
  .data-type-table td {
    padding: 8px 10px;
  }

  .code-example {
    padding: 15px;
  }

  .code-example pre {
    font-size: 0.8rem;
  }

  .practice-box,
  .info-box,
  .tip-box,
  .success-box,
  .warning-box {
    padding: 15px;
    margin: 15px 0;
  }

  .chapter-navigation {
    flex-direction: column;
    gap: 15px;
  }

  .nav-button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .chapter-page {
    padding: 2rem 2.5rem;
    /* 小屏幕下适当减少内边距但仍保持宽敞 */
  }
}

@media (max-width: 480px) {
  .chapter-page {
    padding: 1.5rem 2rem;
    /* 超小屏幕下进一步调整内边距 */
  }

  .chapter-header {
    padding: 20px;
  }

  .chapter-header h1 {
    font-size: 1.8rem;
  }

  .learning-objectives,
  .knowledge-section {
    padding: 15px;
  }

  .data-type-table th,
  .data-type-table td {
    padding: 6px 8px;
    font-size: 0.7rem;
  }
}

/* Card Styles */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 4px 6px var(--shadow-light), 0 1px 3px var(--shadow-medium);
  margin: 20px 0;
  padding: 0;
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 8px 15px var(--shadow-medium), 0 3px 6px var(--shadow-dark);
  transform: translateY(-2px);
}

.card .content-section {
  padding: 24px;
  margin: 0;
}

.card .section-title {
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--text-primary);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}

/* Dark theme adjustments for cards */
[data-theme="dark"] .card {
  background: var(--bg-secondary);
  border-color: var(--border-medium);
}

[data-theme="dark"] .card:hover {
  background: var(--bg-tertiary);
}

/* High contrast theme adjustments for cards */
[data-theme="high-contrast"] .card {
  border: 2px solid var(--border-dark);
  background: var(--bg-primary);
}

[data-theme="high-contrast"] .card:hover {
  border-color: var(--primary-color);
}

[data-theme="high-contrast"] .card:hover {
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.3);
}

/* 学习路径样式 */
.learning-paths {
  padding: 80px 0;
  background: var(--bg-secondary);
}

.paths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.path-card {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 20px var(--shadow-light);
  transition: all 0.3s ease;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.path-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.path-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px var(--shadow-medium);
}

.path-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.path-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
}

.path-badge {
  background: var(--accent-color);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.path-content h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.path-content p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.path-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.path-stats .stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.path-modules h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.path-modules .module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.path-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.path-difficulty {
  display: flex;
  align-items: center;
  gap: 12px;
}

.path-duration {
  font-size: 14px;
  color: var(--text-muted);
}

.path-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.path-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* 学习统计样式 */
.learning-stats {
  padding: 80px 0;
  background: var(--bg-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 20px var(--shadow-light);
  transition: all 0.3s ease;
  border: 1px solid var(--border-light);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px var(--shadow-medium);
}

.stat-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: white;
  font-size: 32px;
}

.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.stat-trend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  color: var(--success-color);
}

.stat-trend i {
  font-size: 12px;
}

/* 成就展示样式 */
.achievements-showcase {
  margin-top: 60px;
}

.achievements-showcase h3 {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 40px;
  color: var(--text-primary);
}

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

.achievement-showcase-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 4px 15px var(--shadow-light);
  transition: all 0.3s ease;
  border: 1px solid var(--border-light);
}

.achievement-showcase-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px var(--shadow-medium);
}

.achievement-showcase-card .achievement-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.achievement-showcase-card h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.achievement-showcase-card p {
  color: var(--text-secondary);
  margin-bottom: 15px;
  line-height: 1.5;
}

.achievement-user {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
}

/* 路径详情模态框样式 */
.path-detail-modal {
  background: var(--bg-primary);
  border-radius: 16px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.path-detail-modal .modal-header {
  padding: 25px 30px 20px;
  border-bottom: 1px solid var(--border-light);
}

.path-detail-modal .modal-header h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.path-detail-modal .modal-body {
  padding: 30px;
}

.path-overview {
  margin-bottom: 30px;
}

.path-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.path-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.info-item i {
  color: var(--primary-color);
  font-size: 16px;
}

.path-modules-detail {
  margin-bottom: 30px;
}

.path-modules-detail h4 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.modules-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.module-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-light);
}

.module-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.module-info h5 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.module-meta {
  display: flex;
  gap: 15px;
  font-size: 14px;
}

.module-meta .duration {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.module-meta .level {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.module-meta .level.easy {
  background: #d4edda;
  color: #155724;
}

.module-meta .level.medium {
  background: var(--bg-tertiary);
  color: #856404;
}

.module-meta .level.hard {
  background: #f8d7da;
  color: #721c24;
}

.career-prospects {
  margin-bottom: 30px;
}

.career-prospects h4 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.career-prospects p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.path-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.path-actions .btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.path-actions .btn-primary {
  background: var(--primary-color);
  color: white;
  border: none;
}

.path-actions .btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

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

.path-actions .btn-outline:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .paths-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .path-card {
    padding: 20px;
  }

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

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

  .stat-card {
    padding: 20px;
  }

  .stat-number {
    font-size: 28px;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .path-detail-modal {
    width: 95%;
    margin: 20px;
  }

  .path-detail-modal .modal-body {
    padding: 20px;
  }

  .path-info {
    grid-template-columns: 1fr;
  }

  .path-actions {
    flex-direction: column;
  }

  .module-meta {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-icon {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }

  .stat-number {
    font-size: 24px;
  }

  .path-card {
    padding: 15px;
  }

  .path-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .path-footer {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .path-btn {
    justify-content: center;
  }
}

/* =====================================================
   强制深绿色主题覆盖样式 - 确保整个主页使用深绿色主题
   ===================================================== */

/* 全局背景和文字 */
body,
html {
  background-color: #0d1117 !important;
  color: #20c997 !important;
}

* {
  color: #20c997 !important;
}

/* 标题和重要文字 */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: #40e0d0 !important;
}

strong,
b {
  color: #40e0d0 !important;
}

/* 链接样式 */
a {
  color: #28fa45 !important;
}

a:hover {
  color: #34ce57 !important;
}

/* Hero区域深绿色主题 */
.hero-section {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #21262d 100%) !important;
}

.hero-content h1 {
  color: #40e0d0 !important;
}

.hero-content p {
  color: #20c997 !important;
}

.hero-cta .btn {
  background-color: #28a745 !important;
  color: #0d1117 !important;
  border-color: #28a745 !important;
}

.hero-cta .btn:hover {
  background-color: #34ce57 !important;
  border-color: #34ce57 !important;
}

/* 功能特性区域 */
.features-section,
.section {
  background-color: #161b22 !important;
}

.features-grid .feature-card,
.feature-card {
  background-color: #161b22 !important;
  border: 1px solid #30363d !important;
}

.feature-icon {
  color: #28a745 !important;
}

.feature-title {
  color: #40e0d0 !important;
}

.feature-description {
  color: #20c997 !important;
}

/* 课程卡片 */
.course-grid .course-card,
.course-card {
  background-color: #161b22 !important;
  border: 1px solid #30363d !important;
}

.course-title {
  color: #40e0d0 !important;
}

.course-description {
  color: #20c997 !important;
}

.course-meta {
  color: #17a2b8 !important;
}

.difficulty,
.duration,
.topic {
  background-color: #21262d !important;
  color: #20c997 !important;
  border: 1px solid #30363d !important;
}

/* 统计数据区域 */
.stats-section {
  background-color: #161b22 !important;
}

.stat-number {
  color: #40e0d0 !important;
}

.stat-label {
  color: #20c997 !important;
}

/* 页脚 */
footer {
  background-color: #0d1117 !important;
  border-top: 1px solid #30363d !important;
}

.footer-links a {
  color: #20c997 !important;
}

.footer-links a:hover {
  color: #34ce57 !important;
}

/* 进度条深绿色主题 */
.progress-bar {
  background-color: #21262d !important;
}

.progress {
  background-color: #28a745 !important;
}

/* 学习路径卡片 */
.path-card {
  background-color: #161b22 !important;
  border: 1px solid #30363d !important;
}

.path-title {
  color: #40e0d0 !important;
}

.path-description {
  color: #20c997 !important;
}

/* 代码块深绿色主题 */
.code-example {
  background-color: #161b22 !important;
  border: 1px solid #30363d !important;
}

.code-example h4 {
  color: #40e0d0 !important;
  border-bottom-color: #28a745 !important;
}

.code-example pre {
  background-color: #0d1117 !important;
  color: #20c997 !important;
}

/* 表格深绿色主题 */
.table-container {
  background-color: #161b22 !important;
  border: 1px solid #30363d !important;
}

/* 通用容器和组件 */
.container,
.section,
.card {
  background-color: #161b22 !important;
}

/* 导航栏确保深色 */
.navbar {
  background-color: rgba(13, 17, 23, 0.95) !important;
  border-bottom: 1px solid #30363d !important;
}

/* 按钮深绿色主题 */
.btn,
button {
  background-color: #28a745 !important;
  color: #0d1117 !important;
  border-color: #28a745 !important;
}

.btn:hover,
button:hover {
  background-color: #34ce57 !important;
  border-color: #34ce57 !important;
}

.btn-secondary {
  background-color: #20c997 !important;
  border-color: #20c997 !important;
}

.btn-secondary:hover {
  background-color: #40e0d0 !important;
  border-color: #40e0d0 !important;
}

/* 输入框和表单 */
input,
textarea,
select {
  background-color: #21262d !important;
  border-color: #30363d !important;
  color: #20c997 !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #28a745 !important;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* ==========================================
   COMPREHENSIVE MOBILE OPTIMIZATION
   ========================================== */

/* Mobile First Base Styles */
@media (max-width: 768px) {
  
  /* General Mobile Layout */
  body {
    font-size: 16px; /* Prevents iOS zoom */
    line-height: 1.5;
  }
  
  .container {
    padding: 0 1rem;
    max-width: 100%;
  }
  
  /* Navigation Improvements */
  .navbar {
    padding: 0.5rem 1rem;
  }
  
  .nav-menu {
    position: fixed;
    top: 60px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 60px);
    background: var(--bg-primary, #ffffff);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 2rem 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 999;
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .nav-menu li {
    margin: 0.5rem 0;
  }
  
  .nav-menu a {
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 8px;
    display: block;
    text-align: center;
  }
  
  /* Mobile Menu Toggle */
  .mobile-menu-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    width: 30px;
    height: 30px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
  }
  
  .mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-primary, #333);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
  }
  
  /* Course Content Mobile Optimization */
  .chapter-content,
  .course-content {
    padding: 1rem;
    margin: 0;
  }
  
  .chapter-header {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .chapter-header h1 {
    font-size: 1.8rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
  }
  
  .chapter-header p {
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  /* Sidebar Mobile Optimization */
  .sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary, #f8f9fa);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
  }
  
  .sidebar.active {
    left: 0;
  }
  
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
  }
  
  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  /* Mobile Navigation Toggle Button */
  .mobile-nav-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary-color, #3498db);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1001;
  }
  
  .mobile-nav-toggle:hover {
    background: var(--primary-hover, #2980b9);
    transform: scale(1.05);
  }
  
  /* Content Spacing for Mobile Nav */
  .main-content,
  .chapter-page,
  .course-page {
    margin-left: 0;
    padding-top: 80px;
  }
  
  /* Tables Mobile Optimization */
  .data-type-table,
  .responsive-table {
    font-size: 0.8rem;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    border: 1px solid #ddd;
    border-radius: 8px;
  }
  
  .data-type-table th,
  .data-type-table td {
    padding: 8px 12px;
    min-width: 120px;
  }
  
  /* Code Blocks Mobile Optimization */
  pre,
  .code-example,
  .code-block {
    font-size: 0.85rem;
    overflow-x: auto;
    padding: 1rem;
    border-radius: 8px;
    line-height: 1.4;
  }
  
  /* Button Optimization */
  .btn,
  .button,
  .nav-link-btn {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 8px;
    margin: 0.25rem 0;
  }
  
  /* Form Elements */
  input,
  textarea,
  select {
    font-size: 16px; /* Prevents iOS zoom */
    min-height: 44px;
    padding: 12px 16px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Cards and Content Boxes */
  .knowledge-section,
  .practice-box,
  .tip-box,
  .warning-box,
  .info-box {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
  }
  
  .feature-grid,
  .path-steps,
  .course-categories,
  .relationships-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Learning Progress & Stats */
  .course-stats {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .stat-item {
    flex: none;
    margin: 0.5rem 0;
  }
  
  /* Chapter Navigation */
  .chapter-nav {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    text-align: center;
  }
  
  .chapter-nav .nav-link {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
  }
  
  /* Breadcrumbs */
  .breadcrumb {
    flex-wrap: wrap;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }
  
  .breadcrumb-item {
    margin: 0.25rem 0;
  }
  
  /* Modal Improvements */
  .modal-content {
    margin: 1rem;
    width: calc(100% - 2rem);
    max-height: 90vh;
    overflow-y: auto;
  }
  
  /* Touch Improvements */
  .course-item,
  .chapter-link,
  .nav-link,
  .clickable {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 12px;
  }
  
  /* Image Optimization */
  img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
  }
  
  /* Video Responsive */
  video,
  iframe {
    max-width: 100%;
    height: auto;
  }
  
  /* Footer Mobile */
  .footer-links {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
  .chapter-content,
  .course-content {
    padding: 0.75rem;
  }
  
  .chapter-header h1 {
    font-size: 1.6rem;
  }
  
  .sidebar {
    width: 100%;
    left: -100%;
  }
  
  .mobile-nav-toggle {
    top: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
  }
  
  .data-type-table,
  .responsive-table {
    font-size: 0.75rem;
  }
  
  pre,
  .code-example {
    font-size: 0.8rem;
    padding: 0.75rem;
  }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .main-content {
    padding-top: 60px;
  }
  
  .sidebar {
    width: 250px;
  }
  
  .chapter-header h1 {
    font-size: 1.6rem;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .hover-effect:hover {
    transform: none;
  }
  
  .btn:hover,
  .button:hover {
    transform: none;
  }
  
  /* Larger touch targets */
  .nav-link,
  .sidebar a,
  .course-item {
    min-height: 48px;
    padding: 12px 16px;
  }
}

/* High DPI Screen Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  .icons,
  .logos {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}
