/* ==========
   全局 UI：字体/色板/圆角/阴影
   ========== */

.md-typeset {
  /* 系统字体优先：macOS 会使用 SF 系列 */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    "Helvetica Neue", Arial, sans-serif;
}

:root {
  --wiki-radius-xl: 18px;
  --wiki-radius-lg: 16px;
  --wiki-radius-md: 14px;
  --wiki-shadow-sm: 0 4px 18px rgba(20, 35, 90, 0.08);
  --wiki-shadow-md: 0 10px 30px rgba(20, 35, 90, 0.18);
  --wiki-border: 1px solid rgba(0, 0, 0, 0.08);

  /* Material 主题色微调（更“门户”一些） */
  --md-primary-fg-color: #1e5bff;
  --md-accent-fg-color: #5c7cff;
}

[data-md-color-scheme="slate"] {
  --wiki-border: 1px solid rgba(255, 255, 255, 0.10);
}

/* 顶部栏做成渐变，靠近截图风格 */
.md-header {
  background: linear-gradient(135deg, #1e5bff 0%, #243bcd 55%, #2b2bb7 100%);
  box-shadow: var(--wiki-shadow-sm);
}

.md-header__title,
.md-header__button,
.md-search__icon {
  color: #fff;
}

.md-search__form {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.md-search__input {
  color: #fff;
}

.md-search__input::placeholder {
  color: rgba(255, 255, 255, 0.78);
}

/* 修复：激活/聚焦搜索时，Material 会变成浅色背景，需把文字改回深色 */
.md-search__form:focus-within {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.md-search__form:focus-within .md-search__input {
  color: rgba(0, 0, 0, 0.82);
}

.md-search__form:focus-within .md-search__input::placeholder {
  color: rgba(0, 0, 0, 0.45);
}

.md-search__form:focus-within .md-search__icon {
  color: rgba(0, 0, 0, 0.65);
}

/* 搜索面板打开时也保持可读（不同版本 Material 使用不同状态类） */
.md-search--active .md-search__form,
[data-md-toggle="search"]:checked ~ .md-header .md-search__form {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.10);
}

.md-search--active .md-search__input,
[data-md-toggle="search"]:checked ~ .md-header .md-search__input {
  color: rgba(0, 0, 0, 0.82);
}

.md-search--active .md-search__input::placeholder,
[data-md-toggle="search"]:checked ~ .md-header .md-search__input::placeholder {
  color: rgba(0, 0, 0, 0.45);
}

.md-search--active .md-search__icon,
[data-md-toggle="search"]:checked ~ .md-header .md-search__icon {
  color: rgba(0, 0, 0, 0.65);
}

/* 内容区更“卡片化”一些 */
.md-main__inner {
  padding-top: 1rem;
}

.md-content__inner {
  padding-bottom: 2.2rem;
}

.md-typeset h1 {
  font-weight: 800;
  letter-spacing: 0.2px;
}

/* 侧边栏分隔与 hover */
.md-sidebar--primary .md-sidebar__scrollwrap {
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

[data-md-color-scheme="slate"] .md-sidebar--primary .md-sidebar__scrollwrap {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.md-nav__item .md-nav__link:hover {
  background: rgba(30, 91, 255, 0.08);
  border-radius: 10px;
}

.md-nav__link--active,
.md-nav__link--active:hover {
  font-weight: 800;
}

/* 提示块更圆润 */
.md-typeset .admonition,
.md-typeset details {
  border-radius: var(--wiki-radius-md);
}

.md-typeset pre > code {
  border-radius: var(--wiki-radius-md);
}

.md-typeset table:not([class]) {
  border-radius: var(--wiki-radius-md);
  overflow: hidden;
}

/* ==========
   首页组件
   ========== */

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 12px 0 18px 0;
}

@media (max-width: 760px) {
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .quick-grid {
    grid-template-columns: 1fr;
  }
}

/* 快速入口：整块可点击的“按钮卡” */
.quick-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 14px;
  border-radius: var(--wiki-radius-lg);
  border: var(--wiki-border);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--wiki-shadow-sm);
  text-decoration: none;
  color: rgba(0, 0, 0, 0.86);
  font-weight: 800;
  letter-spacing: 0.2px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease,
    background 120ms ease;
}

[data-md-color-scheme="slate"] .quick-btn {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  box-shadow: none;
}

.quick-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--wiki-shadow-md);
  border-color: rgba(30, 91, 255, 0.28);
}

[data-md-color-scheme="slate"] .quick-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(30, 91, 255, 0.35);
}

.quick-btn:active {
  transform: translateY(0);
}

.quick-badge {
  position: absolute;
  top: -9px;
  right: -9px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #ff4d4f;
  color: #fff;
  box-shadow: 0 10px 18px rgba(255, 77, 79, 0.22);
}

/* 热门问题：标题行（左说明 + 右“查看全部”） */
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 10px 0;
}

.section-row__left {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.62);
}

[data-md-color-scheme="slate"] .section-row__left {
  color: rgba(255, 255, 255, 0.62);
}

.section-row__right {
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

/* 热门问题列表（可点击条目） */
.hot-qa {
  display: grid;
  gap: 10px;
  margin: 0 0 18px 0;
}

.hot-qa__item {
  display: block;
  padding: 12px 14px;
  border-radius: var(--wiki-radius-md);
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.02);
  text-decoration: none;
  color: inherit;
}

.hot-qa__item:hover {
  border-color: rgba(30, 91, 255, 0.22);
  background: rgba(30, 91, 255, 0.06);
}

[data-md-color-scheme="slate"] .hot-qa__item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

[data-md-color-scheme="slate"] .hot-qa__item:hover {
  background: rgba(30, 91, 255, 0.12);
  border-color: rgba(30, 91, 255, 0.35);
}

/* 办事指南：类别卡片 */
.guide-hint {
  margin: 6px 0 12px 0;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.62);
}

[data-md-color-scheme="slate"] .guide-hint {
  color: rgba(255, 255, 255, 0.62);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 18px 0;
}

@media (max-width: 760px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

.guide-card {
  display: block;
  padding: 16px 16px;
  border-radius: var(--wiki-radius-lg);
  border: var(--wiki-border);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--wiki-shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease,
    background 120ms ease;
}

[data-md-color-scheme="slate"] .guide-card {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--wiki-shadow-md);
  border-color: rgba(30, 91, 255, 0.28);
}

.guide-card__title {
  font-weight: 900;
  font-size: 15px;
  margin-bottom: 6px;
}

.guide-card__desc {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.62);
}

[data-md-color-scheme="slate"] .guide-card__desc {
  color: rgba(255, 255, 255, 0.62);
}

.hero {
  border-radius: var(--wiki-radius-xl);
  padding: 28px 26px;
  margin: 0 0 18px 0;
  color: #fff;
  background: linear-gradient(135deg, #1e5bff 0%, #243bcd 55%, #2b2bb7 100%);
  box-shadow: var(--wiki-shadow-md);
}

.hero__inner {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hero__badge {
  width: 64px;
  height: 64px;
  border-radius: var(--wiki-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex: 0 0 auto;
}

.hero__badge-icon {
  font-size: 30px;
}

.hero__title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.5px;
}

.hero__subtitle {
  margin-top: 4px;
  font-size: 15px;
  opacity: 0.95;
}

.hero__tagline {
  margin-top: 10px;
  font-size: 15px;
  opacity: 0.92;
}

/* 主页“搜索框”（点击后打开 Material 搜索面板） */
.home-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--wiki-radius-md);
  border: var(--wiki-border);
  background: #fff;
  box-shadow: var(--wiki-shadow-sm);
  cursor: pointer;
  user-select: none;
  margin: 0 0 22px 0;
}

.home-search:active {
  transform: translateY(1px);
}

.home-search:hover {
  box-shadow: 0 8px 26px rgba(20, 35, 90, 0.12);
}

.home-search:focus {
  outline: 3px solid rgba(30, 91, 255, 0.25);
  outline-offset: 2px;
}

.home-search__icon {
  font-size: 16px;
  opacity: 0.8;
}

.home-search__text {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.7);
}

[data-md-color-scheme="slate"] .home-search {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

[data-md-color-scheme="slate"] .home-search:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-md-color-scheme="slate"] .home-search__text {
  color: rgba(255, 255, 255, 0.78);
}

/* “热门问题”列表更像卡片列表 */
.hot-list ol {
  padding-left: 1.2rem;
}

.hot-list li {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: var(--wiki-radius-md);
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-md-color-scheme="slate"] .hot-list li {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hot-list li a {
  text-decoration: none;
}

/* 快捷入口卡片微调 */
.md-typeset .grid.cards > ul > li {
  border-radius: var(--wiki-radius-lg);
  box-shadow: var(--wiki-shadow-sm);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.md-typeset .grid.cards > ul > li:hover {
  transform: translateY(-2px);
  box-shadow: var(--wiki-shadow-md);
}

.md-typeset .grid.cards .card-link {
  font-weight: 700;
}
