/* ============================================================
 * 修复样式 — 确保交互元素正常工作
 * ============================================================ */

/* 确保绝对定位的装饰元素不阻挡点击 */
.hero-bg,
.hero-overlay,
.hero-gradient-left,
.hero-scroll-hint {
  pointer-events: none !important;
}

/* 确保按钮可点击 */
button,
[role="button"],
[data-route] {
  cursor: pointer !important;
}

/* ----- 移动端导航动画（用 visibility+opacity 替代 display:none）----- */
.mobile-nav-overlay {
  display: block !important;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 95;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease, background 0.35s ease;
}

.mobile-nav-overlay.active {
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  opacity: 1;
}

/* ----- 移动端导航 —— 右侧抽屉（从右侧滑入），内容按分类分组 ----- */
#mobileNav {
  display: flex !important;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: min(324px, 88vw);
  max-width: none;
  height: 100%;
  flex-direction: column;
  background-color: var(--color-surface);
  background-image: none;
  z-index: 101;
  box-shadow: -16px 0 48px rgba(20, 30, 20, 0.22);
  border-left: 1px solid var(--color-border-light, rgba(0, 0, 0, 0.08));
  transform: translateX(102%);
  opacity: 1;
  overflow: hidden;
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.3s ease,
              pointer-events 0.3s;
}

#mobileNav.active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* 抽屉头部 */
.mn-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 14px 20px;
  border-bottom: 1px solid var(--color-border-light, rgba(0, 0, 0, 0.08));
}
.mn-brand { display: flex; align-items: center; gap: 10px; }
.mn-brand-name { font-family: var(--font-serif); font-weight: 700; font-size: 1.15rem; color: var(--color-deep, #1a2f1d); }
.mn-close {
  width: 34px; height: 34px; border: none; border-radius: 10px;
  background: var(--color-surface-sunken, rgba(0, 0, 0, 0.05));
  color: var(--color-text-muted, #8a8578);
  font-size: 1.05rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.mn-close:hover { background: rgba(90, 125, 92, 0.14); color: var(--color-primary); transform: rotate(90deg); }

/* 抽屉可滚动主体（min-height:0 允许在抽屉高度内收缩并滚动） */
.mn-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0 18px;
}

/* 首页入口 */
.mn-home {
  display: flex; align-items: center;
  margin: 8px 12px 4px; padding: 12px 16px;
  border-radius: 12px; font-weight: 600;
  color: var(--color-text, #2d2d2d); text-decoration: none;
  background: var(--color-surface-sunken, rgba(0, 0, 0, 0.04));
  transition: background 0.18s, color 0.18s;
}
.mn-home:hover, .mn-home.active { background: rgba(90, 125, 92, 0.14); color: var(--color-primary); }

/* 分类小节 */
.mn-section { padding: 12px 0 6px; }
.mn-section + .mn-section { margin-top: 2px; }
.mn-section-label {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--color-text-muted, #8a8578); padding: 0 20px 8px;
}
.mn-section a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px; color: var(--color-text, #2d2d2d);
  text-decoration: none; font-size: 0.95rem; font-weight: 500;
  border-left: 3px solid transparent;
  transition: background-color 0.18s, color 0.18s, border-left-color 0.18s;
}
.mn-section a:hover, .mn-section a.active {
  background: rgba(90, 125, 92, 0.12); color: var(--color-primary, #3a6b4a);
  border-left-color: var(--color-primary, #3a6b4a);
}
.mn-section a.mn-featured { font-weight: 600; }
.mn-section a.mn-featured.sag { color: var(--color-sage, #3a6b4a); }
.mn-section a.mn-featured.amber { color: var(--color-text-warm, #c4956a); }

/* 主题行（常驻底部） */
#mobileNav .theme-toggle-row {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0; padding: 14px 20px;
  border-top: 1px solid var(--color-border-light, rgba(0, 0, 0, 0.08));
  color: var(--color-text, #2d2d2d); font-size: 0.875rem;
}

/* 强制抽屉内链接可见（覆盖 layout.css 的 opacity:0 默认值） */
#mobileNav .mn-body a {
  opacity: 1 !important;
  transform: none !important;
  transition: background-color 0.18s, color 0.18s, border-left-color 0.18s;
}

/* page-content 有正确的 z-index */
#page-content {
  position: relative;
  z-index: 1;
}

/* header 不会阻挡下面的内容 */
.header {
  z-index: 100 !important;
}

/* loading 屏幕层级 */
.practice-loading-screen,
.exam-loading-screen {
  z-index: 999 !important;
}
