/* ===== 全局样式 ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700;900&display=swap');

:root {
  --primary: #007BFF;
  --primary-dark: #0056b3;
  --secondary: #F8F9FA;
  --accent: #FFA500;
  --accent-dark: #e69500;
  --text-dark: #212529;
  --text-muted: #6c757d;
  --white: #ffffff;
  --border: #dee2e6;
  --shadow: 0 2px 15px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
  --radius: 12px;
  --transition: all 0.3s ease;
}

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

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

body {
  font-family: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-dark);
  background-color: var(--secondary);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* ===== 排版 ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.8em;
  color: var(--text-dark);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1em;
  line-height: 1.9;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

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

/* ===== 容器 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 60px 0;
}

.section-alt {
  background-color: var(--white);
}

/* ===== 导航栏（非sticky） ===== */
.navbar {
  background-color: var(--white);
  border-bottom: 2px solid var(--primary);
  padding: 15px 0;
  position: relative;
  z-index: 100;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand:hover {
  text-decoration: none;
  color: var(--primary-dark);
}

.navbar-brand img {
  width: 36px;
  height: 36px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 5px;
  flex-wrap: wrap;
}

.nav-links a {
  display: block;
  padding: 8px 16px;
  color: var(--text-dark);
  font-weight: 500;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  background-color: var(--primary);
  color: var(--white);
  text-decoration: none;
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  background: none;
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--primary);
}

/* ===== 面包屑导航 ===== */
.breadcrumb {
  padding: 15px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

.breadcrumb span {
  margin: 0 8px;
  color: var(--border);
}

/* ===== Hero区域 ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0056b3 100%);
  color: var(--white);
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  color: var(--white);
  font-size: 2.8rem;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto 30px;
}

.hero-btn {
  display: inline-block;
  background-color: var(--accent);
  color: var(--white);
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 700;
  transition: var(--transition);
}

.hero-btn:hover {
  background-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(255,165,0,0.4);
  text-decoration: none;
  color: var(--white);
}

/* ===== 模块标题 ===== */
.module-title {
  text-align: center;
  margin-bottom: 40px;
}

.module-title h2 {
  color: var(--primary);
  position: relative;
  display: inline-block;
  padding-bottom: 15px;
}

.module-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}

.module-title p {
  color: var(--text-muted);
  margin-top: 10px;
  font-size: 1.05rem;
}

/* ===== 学习路径 ===== */
.learning-path {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.path-stage {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  flex: 1;
  min-width: 280px;
  max-width: 360px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: var(--transition);
  border-top: 4px solid var(--primary);
  position: relative;
}

.path-stage:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.path-stage .stage-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary), #0056b3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
  color: var(--white);
}

.path-stage .stage-level {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.path-stage h3 {
  color: var(--primary);
  margin-bottom: 10px;
}

.path-stage p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.path-stage .path-btn {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 24px;
  background: var(--primary);
  color: var(--white);
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
}

.path-stage .path-btn:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

/* 进度条 */
.progress-bar-container {
  max-width: 600px;
  margin: 0 auto 40px;
  text-align: center;
}

.progress-bar {
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.8s ease;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.card-body {
  padding: 20px;
}

.card-body h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.card-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 5px;
}

.badge-beginner {
  background: #d4edda;
  color: #155724;
}

.badge-intermediate {
  background: #fff3cd;
  color: #856404;
}

.badge-advanced {
  background: #f8d7da;
  color: #721c24;
}

.card-link {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ===== 规则索引 ===== */
.rule-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.rule-item {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  background: var(--white);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  transition: var(--transition);
  box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

.rule-item:hover {
  background: #e3f2fd;
  transform: translateX(5px);
  text-decoration: none;
}

.rule-item .rule-num {
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-right: 12px;
  flex-shrink: 0;
}

.rule-item .rule-name {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
}

/* ===== 牌局分析 ===== */
.analysis-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.analysis-card:hover {
  box-shadow: var(--shadow-hover);
}

.analysis-card h3 {
  color: var(--primary);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.analysis-card .tile-display {
  background: #1a1a2e;
  color: var(--white);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  font-size: 2rem;
  margin: 15px 0;
  letter-spacing: 8px;
}

.analysis-card .think-box {
  background: #fff8e1;
  border-left: 4px solid var(--accent);
  padding: 15px 20px;
  border-radius: 0 8px 8px 0;
  margin: 15px 0;
}

.analysis-card .answer-box {
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
  padding: 15px 20px;
  border-radius: 0 8px 8px 0;
  margin: 15px 0;
}

/* ===== 视频列表 ===== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.video-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.video-thumb {
  position: relative;
  height: 200px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumb .play-icon {
  width: 60px;
  height: 60px;
  background: rgba(255,165,0,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--white);
  transition: var(--transition);
}

.video-card:hover .play-icon {
  transform: scale(1.1);
  background: var(--accent);
}

.video-thumb .duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: var(--white);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.video-info {
  padding: 18px;
}

.video-info h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

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

/* ===== 资源推荐 ===== */
.resource-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
}

.resource-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  transition: var(--transition);
  border-left: 4px solid var(--accent);
}

.resource-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}

.resource-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--white);
  flex-shrink: 0;
}

.resource-info h3 {
  font-size: 1.05rem;
  margin-bottom: 5px;
}

.resource-info p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ===== 页脚 ===== */
.footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 50px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-col h4 {
  color: var(--white);
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  color: #aaa;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-col ul li a:hover {
  color: var(--accent);
  text-decoration: none;
}

.footer-col p {
  font-size: 0.9rem;
  color: #aaa;
  line-height: 1.7;
}

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: #888;
}

.footer-bottom a {
  color: var(--accent);
}

.footer-disclaimer {
  background: #16213e;
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
  font-size: 0.85rem;
  color: #999;
  text-align: center;
  line-height: 1.6;
}

/* ===== 内页内容区 ===== */
.content-area {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.content-area h1 {
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 3px solid var(--primary);
}

.content-area h2 {
  color: var(--primary-dark);
  margin-top: 35px;
  margin-bottom: 15px;
}

.content-area h3 {
  color: var(--text-dark);
  margin-top: 25px;
}

.content-area ul, .content-area ol {
  margin: 15px 0;
  padding-left: 25px;
}

.content-area li {
  margin-bottom: 8px;
}

.content-area blockquote {
  background: #e3f2fd;
  border-left: 4px solid var(--primary);
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
}

.content-area table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.content-area table th {
  background: var(--primary);
  color: var(--white);
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
}

.content-area table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
}

.content-area table tr:hover td {
  background: #f0f7ff;
}

/* 知识点总结框 */
.summary-box {
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-radius: var(--radius);
  padding: 25px;
  margin: 25px 0;
}

.summary-box h4 {
  color: var(--primary);
  margin-bottom: 12px;
}

/* 练习题框 */
.exercise-box {
  background: #fff8e1;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 25px;
  margin: 25px 0;
}

.exercise-box h4 {
  color: var(--accent-dark);
  margin-bottom: 12px;
}

/* 相关术语链接 */
.related-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.related-terms a {
  display: inline-block;
  padding: 6px 16px;
  background: #e3f2fd;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--primary);
  transition: var(--transition);
}

.related-terms a:hover {
  background: var(--primary);
  color: var(--white);
  text-decoration: none;
}

/* ===== 动画 ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.float-hover {
  transition: var(--transition);
}

.float-hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

/* ===== APP下载页 ===== */
.app-download-hero {
  background: linear-gradient(135deg, var(--primary), #0056b3);
  color: var(--white);
  padding: 80px 0;
  text-align: center;
}

.app-download-hero h1 {
  color: var(--white);
}

.download-btns {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 30px;
  background: var(--white);
  color: var(--primary);
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: var(--transition);
}

.download-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  text-decoration: none;
  color: var(--primary);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  html { font-size: 14px; }

  .hero { padding: 50px 0; }
  .hero h1 { font-size: 2rem; }
  .section { padding: 40px 0; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 15px;
    box-shadow: var(--shadow);
    z-index: 99;
  }

  .nav-links.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

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

  .path-stage {
    max-width: 100%;
  }

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

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

  .rule-index {
    grid-template-columns: 1fr;
  }

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

  .resource-card {
    flex-direction: column;
  }

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

  .analysis-card .tile-display {
    font-size: 1.3rem;
    letter-spacing: 4px;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 15px; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }

  .download-btns {
    flex-direction: column;
    align-items: center;
  }
}

/* ===== 搜索框 ===== */
.search-box {
  max-width: 500px;
  margin: 0 auto 30px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 20px 12px 45px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--white);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
}

.search-box .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* ===== TOC 目录 ===== */
.toc {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 25px;
  margin: 20px 0 30px;
}

.toc h4 {
  color: var(--primary);
  margin-bottom: 12px;
  font-size: 1rem;
}

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

.toc ul li {
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
}

.toc ul li:last-child {
  border-bottom: none;
}

.toc ul li a {
  color: var(--text-dark);
  font-size: 0.95rem;
}

.toc ul li a:hover {
  color: var(--primary);
}

/* ===== 侧边导航（内页） ===== */
.page-layout {
  display: flex;
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

.page-sidebar {
  width: 280px;
  flex-shrink: 0;
}

.page-content {
  flex: 1;
  min-width: 0;
}

.sidebar-nav {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.sidebar-nav h4 {
  color: var(--primary);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

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

.sidebar-nav ul li a {
  display: block;
  padding: 8px 12px;
  color: var(--text-dark);
  border-radius: 6px;
  font-size: 0.9rem;
  transition: var(--transition);
}

.sidebar-nav ul li a:hover,
.sidebar-nav ul li a.active {
  background: #e3f2fd;
  color: var(--primary);
  text-decoration: none;
}

@media (max-width: 768px) {
  .page-layout {
    flex-direction: column;
  }
  .page-sidebar {
    width: 100%;
  }
}
