/* ============================================================
   高一数学 · 函数精解  —  学术蓝 + 米白 + 橙红
   禁用紫/靛蓝；字体加粗
   ============================================================ */

:root {
  --blue-900: #0d47a1;
  --blue-700: #1a5fb4;
  --blue-500: #3584e4;
  --blue-100: #e3edf9;
  --blue-50:  #f0f6fd;
  --bg:       #fdfaf3;
  --bg-card:  #f8f4e8;
  --bg-soft:  #f3ecda;
  --accent:   #e64a19;
  --accent-2: #ff7043;
  --accent-soft: #fde8e0;
  --text:     #1a2332;
  --text-2:   #4a5568;
  --border:   #d9cfb8;
  --shadow:   0 4px 18px rgba(13,71,161,.10);
  --shadow-lg:0 10px 32px rgba(13,71,161,.16);
  --radius:   12px;
}

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

html, body {
  font-family: "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

b, strong, .bold { font-weight: 900; }

h1, h2, h3, h4, h5 { font-weight: 900; color: var(--blue-900); line-height: 1.35; }

a { color: var(--blue-700); text-decoration: none; font-weight: 700; }

/* ========== 顶部导航（毛玻璃） ========== */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(253, 250, 243, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .25s ease;
}
.topnav.scrolled { box-shadow: var(--shadow); }
.topnav-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px;
}
.logo { display: flex; align-items: center; gap: 8px; color: var(--blue-900); }
.logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-500));
  color: #fff; font-size: 20px; font-weight: 900;
}
.logo-text { font-size: 17px; font-weight: 900; white-space: nowrap; }

.chapter-nav { display: flex; gap: 6px; overflow-x: auto; flex: 1; }
.chapter-nav::-webkit-scrollbar { display: none; }
.chapter-nav a {
  padding: 6px 12px; border-radius: 8px; font-size: 13px;
  color: var(--text-2); white-space: nowrap;
  transition: all .2s;
}
.chapter-nav a:hover, .chapter-nav a.active {
  background: var(--blue-100); color: var(--blue-900);
}

.search-box { position: relative; min-width: 220px; }
.search-box input {
  width: 100%; padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff; font-size: 13px; font-weight: 700;
  outline: none; transition: all .2s;
}
.search-box input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(53,132,228,.18);
}
.search-hint {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--text-2);
}

.menu-toggle {
  display: none; background: none; border: none;
  font-size: 22px; cursor: pointer; color: var(--blue-900);
  font-weight: 900;
}

/* ========== 左侧边栏 ========== */
.sidebar {
  position: fixed; top: 64px; left: 0; bottom: 72px; width: 260px;
  overflow-y: auto; padding: 20px 16px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  z-index: 90;
  transition: transform .3s ease;
}
.sidebar-title {
  font-size: 14px; font-weight: 900; color: var(--blue-900);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--blue-100);
}
.toc-tree { list-style: none; }
.toc-tree li { margin: 2px 0; }
.toc-tree a {
  display: block; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; color: var(--text-2);
  transition: all .2s;
  border-left: 3px solid transparent;
}
.toc-tree a:hover { background: var(--blue-50); color: var(--blue-900); }
.toc-tree a.active {
  background: var(--blue-100); color: var(--blue-900);
  border-left-color: var(--accent);
  font-weight: 900;
}
.toc-tree .count {
  float: right; font-size: 11px; color: var(--text-2);
  background: var(--bg-soft); padding: 1px 7px; border-radius: 999px;
}

.sidebar-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 85;
}

/* ========== 主内容区 ========== */
.main {
  margin-left: 260px; margin-top: 64px; margin-bottom: 72px;
  padding: 28px 32px;
  min-height: calc(100vh - 136px);
}
.container { max-width: 1100px; margin: 0 auto; }

.section-banner {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
  color: #fff; padding: 24px 28px; border-radius: var(--radius);
  margin-bottom: 24px; box-shadow: var(--shadow);
}
.section-banner h2 { color: #fff; font-size: 22px; }
.section-meta { opacity: .85; font-size: 13px; margin-top: 6px; font-weight: 700; }

/* ========== 题目卡片 ========== */
.question-list { display: flex; flex-direction: column; gap: 22px; }

.q-card {
  background: #fff; border-radius: var(--radius);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0; transform: translateY(18px);
  transition: opacity .5s ease, transform .5s ease, box-shadow .25s;
}
.q-card.visible { opacity: 1; transform: translateY(0); }
.q-card:hover { box-shadow: var(--shadow-lg); }

.q-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 20px 10px;
}
.q-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 900;
  background: var(--blue-900); color: #fff;
}
.q-badge.qtype {
  background: var(--accent-soft); color: var(--accent);
}
.q-page-tag {
  font-size: 12px; color: var(--text-2);
  background: var(--bg-soft); padding: 3px 10px; border-radius: 999px;
}

.q-stem {
  padding: 14px 20px; margin: 0 20px;
  background: var(--blue-50); border-left: 4px solid var(--blue-700);
  border-radius: 0 8px 8px 0;
  font-size: 15px;
}

.q-analysis {
  padding: 12px 20px; margin: 12px 20px 0;
  background: #fff8e6; border-left: 4px solid #f0b400;
  border-radius: 0 8px 8px 0;
  font-size: 14px; color: #6b5400;
}

/* 三解标签 */
.solution-tabs {
  margin: 16px 20px 0;
  border-radius: 10px; overflow: hidden;
  border: 1.5px solid var(--border);
}
.tab-headers {
  display: flex; background: var(--bg-card);
  border-bottom: 1.5px solid var(--border);
  position: relative;
}
.tab-header {
  flex: 1; padding: 11px 14px; cursor: pointer;
  text-align: center; font-size: 13px; font-weight: 900;
  color: var(--text-2); background: none; border: none;
  transition: color .2s; position: relative; z-index: 1;
}
.tab-header.active { color: var(--blue-900); }
.tab-indicator {
  position: absolute; bottom: 0; height: 3px;
  background: var(--accent); transition: all .3s ease;
  border-radius: 2px;
}
.tab-panels { position: relative; }
.tab-panel {
  display: none; padding: 16px 20px;
  animation: fadeIn .3s ease;
}
.tab-panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 方法卡片侧栏 */
.method-row {
  display: grid; grid-template-columns: 1fr 220px; gap: 14px;
  margin: 0 20px;
}
.method-col {
  background: var(--bg-card); border-radius: 10px;
  padding: 14px; border: 1px dashed var(--border);
}
.method-col-title {
  font-size: 12px; font-weight: 900; color: var(--blue-900);
  margin-bottom: 8px;
}
.method-card {
  font-size: 12.5px; padding: 8px 10px; margin-bottom: 6px;
  background: #fff; border-radius: 6px;
  border-left: 3px solid var(--accent-2);
  line-height: 1.55;
}

/* 验证折叠 */
.verify-block {
  margin: 14px 20px 0;
  border: 1.5px solid var(--border); border-radius: 10px;
  overflow: hidden;
}
.verify-toggle {
  width: 100%; padding: 12px 16px;
  background: var(--blue-50); border: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 900; color: var(--blue-900);
  transition: background .2s;
}
.verify-toggle:hover { background: var(--blue-100); }
.verify-toggle .arrow { transition: transform .3s; }
.verify-block.open .verify-toggle .arrow { transform: rotate(180deg); }
.verify-content {
  max-height: 0; overflow: hidden;
  transition: max-height .4s ease;
  background: #fff;
}
.verify-block.open .verify-content { max-height: 1200px; }
.verify-content ol { padding: 14px 24px 14px 36px; }
.verify-content li { font-size: 13.5px; margin: 6px 0; color: var(--text-2); }

/* 答案 */
.answer-box {
  margin: 14px 20px 20px; padding: 12px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-radius: 10px;
  font-size: 15px; font-weight: 900;
  box-shadow: 0 4px 12px rgba(230,74,25,.25);
}

/* 函数图象展示 */
.q-figure {
  margin: 14px auto 0;
  max-width: 680px;
  text-align: center;
  animation: fadeIn .5s ease;
}
.q-figure img {
  max-width: 100%; height: auto;
  border-radius: 8px;
  border: 1.5px solid #1a5fb4;
  box-shadow: 0 4px 14px rgba(26,95,180,.18);
  background: #fff;
}
.q-figure figcaption {
  margin-top: 6px;
  font-size: 12px; color: var(--text-2);
}

/* 缺图提示 */
.img-placeholder {
  margin: 10px 20px; padding: 14px;
  background: repeating-linear-gradient(45deg, #fff, #fff 10px, var(--bg-soft) 10px, var(--bg-soft) 20px);
  border: 2px dashed var(--border); border-radius: 10px;
  text-align: center; font-size: 12.5px; color: var(--text-2);
}

/* ========== 搜索高亮 ========== */
mark {
  background: #ffd54f; color: var(--text);
  padding: 0 3px; border-radius: 3px; font-weight: 900;
}

/* ========== 分页器 ========== */
.pager {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(253, 250, 243, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1.5px solid var(--border);
  padding: 12px 24px;
}
.pager-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.pager-info {
  text-align: center; font-size: 14px;
}
.pager-info b { color: var(--accent); font-size: 16px; }
.pager-jump { margin-top: 4px; font-size: 12px; color: var(--text-2); }
.pager-jump input {
  width: 60px; padding: 4px 8px; border: 1.5px solid var(--border);
  border-radius: 6px; text-align: center; font-weight: 900;
}

.btn {
  padding: 8px 18px; border-radius: 8px; border: none; cursor: pointer;
  font-weight: 900; font-size: 13px;
  background: var(--blue-900); color: #fff;
  transition: all .2s;
}
.btn:hover { background: var(--blue-700); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-nav { min-width: 110px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ========== 空状态 ========== */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-2); font-size: 16px;
}
.empty-state .btn { margin-top: 14px; }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
  .method-row { grid-template-columns: 1fr; }
  .chapter-nav { display: none; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask.show { display: block; }
  .menu-toggle { display: block; }
  .main { margin-left: 0; padding: 18px 14px; }
  .search-box { min-width: 140px; flex: 1; }
  .logo-text { display: none; }
  .pager-inner { flex-wrap: wrap; justify-content: center; }
  .btn-nav { min-width: 90px; padding: 8px 12px; }
  .q-stem, .q-analysis, .solution-tabs, .verify-block, .answer-box, .method-row, .img-placeholder { margin-left: 10px; margin-right: 10px; }
}

/* MathJax 微调 */
mjx-container { font-size: 100% !important; }
mjx-container[display="true"] { margin: .6em 0 !important; overflow-x: auto; }
