/* RM视觉学习手册 - 精致 UI 样式 */

/* === 全局 === */
.md-grid {
  max-width: 1400px;
}

/* === 首页英雄区 === */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hero-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.35);
}

/* === 代码块 === */
.md-typeset pre > code {
  font-size: 0.82rem;
  line-height: 1.6;
  border-radius: 6px;
}
.md-typeset code {
  font-size: 0.82rem;
}

/* 代码块标题栏 */
.md-typeset pre {
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* === 标注框样式 === */
/* note - 蓝色（逐行解读） */
.md-typeset .admonition.note,
.md-typeset details.note {
  border-color: #1976d2;
  border-radius: 8px;
}
.md-typeset .admonition.note > .admonition-title,
.md-typeset details.note > summary {
  background-color: #e3f2fd;
  border-radius: 8px 8px 0 0;
  font-weight: 600;
}

/* tip - 绿色 */
.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: #388e3c;
  border-radius: 8px;
}
.md-typeset .admonition.tip > .admonition-title,
.md-typeset details.tip > summary {
  background-color: #e8f5e9;
  border-radius: 8px 8px 0 0;
  font-weight: 600;
}

/* warning - 红/橙色 */
.md-typeset .admonition.warning,
.md-typeset details.warning {
  border-color: #d32f2f;
  border-radius: 8px;
}
.md-typeset .admonition.warning > .admonition-title,
.md-typeset details.warning > summary {
  background-color: #ffebee;
  border-radius: 8px 8px 0 0;
  font-weight: 600;
}

/* question - 橙色 */
.md-typeset .admonition.question,
.md-typeset details.question {
  border-color: #ff9800;
  border-radius: 8px;
}
.md-typeset .admonition.question > .admonition-title,
.md-typeset details.question > summary {
  background-color: #fff3e0;
  border-radius: 8px 8px 0 0;
  font-weight: 600;
}

/* abstract / summary - 紫色 */
.md-typeset .admonition.abstract,
.md-typeset details.abstract {
  border-color: #7b1fa2;
  border-radius: 8px;
}
.md-typeset .admonition.abstract > .admonition-title,
.md-typeset details.abstract > summary {
  background-color: #f3e5f5;
  border-radius: 8px 8px 0 0;
  font-weight: 600;
}

/* example - 青色 */
.md-typeset .admonition.example,
.md-typeset details.example {
  border-color: #00796b;
  border-radius: 8px;
}
.md-typeset .admonition.example > .admonition-title,
.md-typeset details.example > summary {
  background-color: #e0f2f1;
  border-radius: 8px 8px 0 0;
  font-weight: 600;
}

/* === 表格 === */
.md-typeset table {
  width: 100%;
  font-size: 0.85rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.md-typeset table th {
  background-color: #e8eaf6;
  font-weight: 600;
  padding: 12px 16px;
}
.md-typeset table td {
  padding: 10px 16px;
}
.md-typeset table tr:nth-child(even) {
  background-color: #f8f9fa;
}
.md-typeset table tr:hover {
  background-color: #e8eaf6;
  transition: background-color 0.2s ease;
}

/* === Mermaid 图 === */
.mermaid {
  text-align: center;
  margin: 1.5rem 0;
  padding: 1rem;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}

/* === 章节导航 === */
.md-typeset .md-nav--footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e8eaf6;
}

/* === 标题样式 === */
.md-typeset h1 {
  font-weight: 700;
  color: #1a237e;
}
.md-typeset h2 {
  font-weight: 600;
  color: #283593;
  border-bottom: 2px solid #e8eaf6;
  padding-bottom: 0.5rem;
  margin-top: 2.5rem;
}
.md-typeset h3 {
  font-weight: 600;
  color: #3949ab;
}

/* === 链接样式 === */
.md-typeset a {
  color: #5c6bc0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}
.md-typeset a:hover {
  color: #3949ab;
  border-bottom-color: #3949ab;
}

/* === 侧边栏当前章节高亮 === */
.md-nav__link--active {
  font-weight: 600;
  color: #3f51b5 !important;
}

/* === 标签页 === */
.md-typeset .tabbed-labels label {
  border-radius: 6px 6px 0 0;
  font-size: 0.85rem;
  padding: 8px 16px;
}
.md-typeset .tabbed-labels label.tabbed-active {
  background-color: #e8eaf6;
  font-weight: 600;
}

/* === 任务列表 === */
.md-typeset .task-list-item input[type="checkbox"] {
  border-radius: 3px;
}

/* === 内联代码 === */
.md-typeset code {
  background-color: #f5f5f5;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.82rem;
}

/* === 数学公式 === */
.MathJax {
  font-size: 1.05em;
}

/* === 页脚 === */
.md-footer {
  background-color: #263238;
}
.md-footer__link {
  color: #b0bec5;
}
.md-footer__link:hover {
  color: #ffffff;
}

/* === 响应式 === */
@media screen and (max-width: 76.1875em) {
  .md-typeset pre > code {
    font-size: 0.78rem;
  }
  .hero-section {
    padding: 1.5rem 1rem;
  }
  .hero-section h3 {
    font-size: 1.3rem;
  }
}

/* 返回按钮样式 */
.return-banner {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border-left: 4px solid #1565c0;
  padding: 0.8rem 1.2rem;
  margin-bottom: 1.5rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(21, 101, 192, 0.1);
  transition: all 0.2s ease;
}
.return-banner:hover {
  box-shadow: 0 4px 12px rgba(21, 101, 192, 0.2);
  transform: translateX(4px);
}
.return-link {
  color: #1565c0 !important;
  text-decoration: none !important;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.return-link::before {
  content: "📖";
  font-size: 1.2rem;
}
