/* 哲学考研学习助手 - 清新学习风样式（桌面+平板自适应） */
:root {
  --bg: #f4f7f6;
  --card: #ffffff;
  --primary: #0d9488;
  --primary-light: #ccfbf1;
  --blue: #3b82f6;
  --amber: #f59e0b;
  --red: #dc2626;
  --text: #1f2937;
  --text2: #6b7280;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(13, 148, 136, 0.08);
  --zhong: #d97706;
  --xifang: #2563eb;
  --maxi: #dc2626;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
#app { display: flex; flex-direction: column; min-height: 100vh; }

/* 顶部栏 */
#topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
}
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.badge-chip {
  background: rgba(255,255,255,0.18);
  border-radius: 20px; padding: 4px 12px; font-size: 13px;
  display: flex; align-items: center; gap: 4px;
}
.icon-btn {
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  font-size: 20px; width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,0.3); }

/* 侧边栏 */
.sidebar {
  position: fixed; top: 0; left: 0; z-index: 90;
  width: 230px; height: 100%;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 80px 12px 16px;
  overflow-y: auto;
  transition: transform 0.25s ease;
  box-shadow: 2px 0 12px rgba(0,0,0,0.05);
}
.nav-group { margin-bottom: 14px; }
.nav-title { font-size: 12px; color: var(--text2); padding: 4px 12px 6px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 2px;
  color: var(--text); text-decoration: none;
  border-radius: 10px; font-size: 14px;
  transition: background 0.15s;
}
.nav-item:hover { background: #f0fdfa; }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-foot { padding-top: 10px; border-top: 1px solid var(--border); }
.tip-text { font-size: 12px; color: var(--text2); text-align: center; margin-top: 8px; }

/* 主内容 */
#main {
  margin-left: 230px;
  flex: 1;
  padding: 22px 24px 40px;
  max-width: 1200px;
  min-width: 0;
}
#view { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 通用组件 */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-title .sub { font-size: 12px; color: var(--text2); font-weight: 400; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-desc { color: var(--text2); font-size: 13px; margin-bottom: 18px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2,1fr);} .grid-3 { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 10px; padding: 9px 18px;
  font-size: 14px; cursor: pointer; transition: all 0.15s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #0f766e; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-danger { background: #fee2e2; color: var(--red); }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.chip {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; background: #f3f4f6; color: var(--text2); margin-right: 6px;
}
.chip-zhong { background: #fef3c7; color: var(--zhong); }
.chip-xifang { background: #dbeafe; color: var(--xifang); }
.chip-maxi { background: #fee2e2; color: var(--maxi); }
.chip-qita { background: #ede9fe; color: #7c3aed; }
.chip-type { background: #f0fdfa; color: var(--primary); }

input, textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; font-family: inherit;
  background: #fff; color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary-light); border-color: var(--primary); }
textarea { min-height: 90px; resize: vertical; }
label.field { display: block; font-size: 13px; color: var(--text2); margin: 10px 0 4px; }

/* 统计卡 */
.stat-card { text-align: center; padding: 18px 10px; }
.stat-num { font-size: 30px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text2); margin-top: 4px; }
.stat-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* 选项卡 */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 7px 18px; border-radius: 20px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 14px; color: var(--text2);
}
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 章节树 */
.tree-node { margin-bottom: 6px; }
.tree-title {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: #f9fafb; border-radius: 10px;
  cursor: pointer; font-weight: 500;
}
.tree-title:hover { background: #f0fdfa; }
.tree-children { padding-left: 18px; }
.tree-arrow { font-size: 11px; transition: transform 0.2s; color: var(--text2); }
.tree-arrow.open { transform: rotate(90deg); }

/* 概念卡 */
.concept-card { cursor: pointer; transition: all 0.15s; border-left: 4px solid var(--primary); }
.concept-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.concept-name { font-size: 16px; font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.concept-def { font-size: 13.5px; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* 哲学家卡 */
.phil-card { cursor: pointer; border-top: 4px solid var(--blue); }
.phil-name { font-size: 17px; font-weight: 700; }
.phil-era { font-size: 12px; color: var(--text2); margin: 2px 0 6px; }
.phil-school { font-size: 12px; }

/* 名句卡 */
.quote-card { cursor: pointer; transition: all 0.15s; }
.quote-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

/* 时间线 */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.tl-item { position: relative; margin-bottom: 16px; }
.tl-item::before {
  content: ''; position: absolute; left: -24px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--primary);
  border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary);
}
.tl-zhong::before { background: var(--zhong); box-shadow: 0 0 0 2px var(--zhong); }
.tl-xifang::before { background: var(--xifang); box-shadow: 0 0 0 2px var(--xifang); }
.tl-maxi::before { background: var(--maxi); box-shadow: 0 0 0 2px var(--maxi); }
.tl-year { font-weight: 700; color: var(--primary); }
.tl-title { font-weight: 600; }
.tl-desc { font-size: 13px; color: var(--text2); }

/* 记忆卡片 */
.flashcard { perspective: 1000px; max-width: 560px; margin: 0 auto 16px; cursor: pointer; }
.flashcard-inner {
  position: relative; width: 100%; min-height: 220px;
  transition: transform 0.5s; transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: var(--radius); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 30px;
  text-align: center; box-shadow: var(--shadow);
}
.fc-front { background: #fff; border: 2px solid var(--primary-light); }
.fc-back { background: var(--primary); color: #fff; transform: rotateY(180deg); }
.fc-front .fc-label { color: var(--primary); font-size: 12px; margin-bottom: 10px; }
.fc-front .fc-text { font-size: 20px; font-weight: 600; }
.fc-back .fc-text { font-size: 15px; line-height: 1.7; }
.fc-hint { margin-top: 14px; font-size: 12px; opacity: 0.6; }

/* 刷题 */
.q-type-tag { font-size: 12px; padding: 2px 10px; border-radius: 6px; background: #eef2ff; color: #4338ca; }
.q-content { font-size: 16px; font-weight: 500; margin: 10px 0 14px; }
.option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; cursor: pointer; transition: all 0.15s;
}
.option:hover { border-color: var(--primary); background: #f0fdfa; }
.option.selected { border-color: var(--primary); background: var(--primary-light); }
.option .opt-letter { font-weight: 700; color: var(--primary); }
.answer-box { border-radius: 10px; padding: 14px; background: #f0fdfa; border: 1px solid #99f6e4; margin-top: 12px; }
.answer-box.correct { background: #ecfdf5; border-color: #6ee7b7; }
.answer-box.wrong { background: #fef2f2; border-color: #fca5a5; }
.answer-box h4 { font-size: 14px; margin-bottom: 6px; }
.answer-box p { font-size: 13.5px; white-space: pre-wrap; }
.kp-chip { display: inline-block; background: #fff; border: 1px solid #99f6e4; color: var(--primary); border-radius: 6px; padding: 2px 8px; margin: 3px 3px 0 0; font-size: 12px; }

/* 模拟考试 */
.exam-timer {
  position: sticky; top: 56px; z-index: 50;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; box-shadow: var(--shadow);
}
.exam-timer .time { font-size: 18px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.exam-q-item { margin-bottom: 18px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.exam-q-item textarea { margin-top: 8px; }

/* 辨析 */
.cmp-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.cmp-table th, .cmp-table td { border: 1px solid var(--border); padding: 10px 12px; font-size: 13.5px; text-align: left; }
.cmp-table th { background: #f0fdfa; color: var(--primary); }

/* 考频 */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-label { width: 90px; font-size: 13px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; background: #f3f4f6; border-radius: 8px; height: 20px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #0d9488, #14b8a6); border-radius: 8px; transition: width 0.6s; }
.bar-num { width: 40px; font-size: 13px; color: var(--text2); }

/* 计划打卡 */
.plan-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.plan-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.plan-check.done { background: var(--primary); border-color: var(--primary); color: #fff; }
.plan-text { flex: 1; }
.plan-text.done { text-decoration: line-through; color: var(--text2); }
.week-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dot { width: 34px; height: 34px; border-radius: 50%; background: #f3f4f6; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text2); }
.dot.checked { background: var(--primary); color: #fff; }

/* 详情弹层 */
.detail-panel { background: #fff; border-radius: var(--radius); padding: 18px; margin-top: 10px; box-shadow: var(--shadow); }
.detail-panel h3 { color: var(--primary); margin-bottom: 8px; }
.detail-panel .sec { margin: 10px 0; }
.detail-panel .sec-label { font-size: 12px; color: var(--text2); font-weight: 600; margin-bottom: 3px; }

/* 居中放大详情弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-box {
  background: #fff; border-radius: 18px;
  max-width: 720px; width: 100%;
  max-height: 86vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: modalPop 0.22s ease;
}
.modal-box::-webkit-scrollbar { width: 6px; }
.modal-box::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.modal-close {
  position: sticky; top: 12px; left: 100%;
  transform: translateX(calc(-100% - 14px));
  display: block; width: 32px; height: 32px;
  background: #f3f4f6; border: none; border-radius: 50%;
  font-size: 15px; cursor: pointer; color: var(--text2);
  z-index: 2; box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.modal-close:hover { background: #e5e7eb; color: var(--text); }
.modal-body { padding: 2px 22px 22px; }
.modal-detail h3 { color: var(--primary); margin-bottom: 8px; font-size: 20px; line-height: 1.5; }
.modal-detail .sec { margin: 13px 0; }
.modal-detail .sec-label { font-size: 12px; color: var(--text2); font-weight: 600; margin-bottom: 4px; }
@keyframes modalPop { from { transform: scale(0.92) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.essay-step { display: flex; gap: 10px; margin-bottom: 10px; }
.essay-step .step-tag { background: var(--primary-light); color: var(--primary); border-radius: 8px; padding: 2px 10px; font-size: 12px; font-weight: 600; height: fit-content; flex-shrink: 0; }

/* 通用工具 */
.search-bar { position: relative; margin-bottom: 16px; }
.search-bar input { padding-left: 36px; }
.search-bar::before { content: '🔍'; position: absolute; left: 12px; top: 10px; font-size: 14px; }
.empty { text-align: center; color: var(--text2); padding: 40px 0; }
.empty .big { font-size: 40px; margin-bottom: 10px; }
.mt10 { margin-top: 10px; } .mt16 { margin-top: 16px; } .mb10 { margin-bottom: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.text2 { color: var(--text2); }
.small { font-size: 12px; }
.center { text-align: center; }

/* 遮罩与toast */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 85;
  display: none;
}
.overlay.show { display: block; }
.resume-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 200; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  border-radius: 12px; padding: 10px 16px; display: flex; align-items: center; gap: 12px;
  border-left: 4px solid var(--primary); max-width: 90vw;
}
.resume-toast span { font-size: 13px; }

/* 网站备案号 */
.site-footer {
  text-align: center; padding: 12px 10px 20px; font-size: 12px; color: #9ca3af;
}
.site-footer a { color: #9ca3af; text-decoration: none; }
.site-footer a:hover { color: var(--primary); }

/* 移动端 */
#menuBtn { display: none; }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 250px; }
  .sidebar.open { transform: translateX(0); }
  #main { margin-left: 0; padding: 14px 12px 30px; }
  #menuBtn { display: inline-flex; }
  .brand-name { font-size: 15px; }
}

/* 平板优化 */
@media (min-width: 769px) and (max-width: 1024px) {
  #main { padding: 18px 18px 36px; }
}

/* ========== 教材书架 ========== */
.bs-header { padding: 20px 0 10px; }
.bs-header h2 { margin: 0 0 4px; font-size: 24px; }
.bs-group-title { margin: 24px 0 12px; font-size: 18px; color: #374151; border-left: 4px solid #10b981; padding-left: 10px; }
.bs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 20px; }
.bs-book-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); cursor: pointer; transition: transform .2s, box-shadow .2s; border: 1px solid #f0f0f0; }
.bs-book-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.bs-book-cover { height: 140px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 16px; text-align: center; color: #fff; }
.bs-cover-zhongxi { background: linear-gradient(135deg, #059669, #10b981); }
.bs-cover-xifang { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.bs-cover-maxi { background: linear-gradient(135deg, #dc2626, #ef4444); }
.bs-cover-exam { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.bs-book-title { font-size: 15px; font-weight: 700; line-height: 1.4; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bs-book-author { font-size: 12px; opacity: .9; }
.bs-book-info { padding: 12px; }
.bs-book-meta { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.bs-progress-bar { height: 6px; background: #f3f4f6; border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.bs-progress-fill { height: 100%; background: linear-gradient(90deg, #10b981, #34d399); border-radius: 3px; transition: width .3s; }
.bs-book-progress { font-size: 11px; color: #6b7280; }
.bs-resume { font-size: 11px; color: #059669; margin-top: 6px; font-weight: 600; }

/* ========== 阅读器 ========== */
.reader-layout { display: flex; height: calc(100vh - 60px); }
.reader-sidebar { width: 240px; background: #f9fafb; border-right: 1px solid #e5e7eb; display: flex; flex-direction: column; transition: margin-left .3s; }
.reader-sidebar.collapsed { margin-left: -240px; }
.reader-sidebar-header { padding: 10px; border-bottom: 1px solid #e5e7eb; }
.reader-toc { flex: 1; overflow-y: auto; padding: 8px 0; }
.toc-item { padding: 8px 16px; font-size: 13px; color: #374151; cursor: pointer; border-left: 3px solid transparent; transition: background .15s; }
.toc-item:hover { background: #ecfdf5; }
.toc-item.active { background: #d1fae5; border-left-color: #10b981; font-weight: 600; }
.toc-sub { padding-left: 28px; font-size: 12px; color: #6b7280; }
.toc-page { float: right; color: #9ca3af; font-size: 11px; }
.reader-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.reader-toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid #e5e7eb; flex-wrap: wrap; }
.reader-book-title { font-weight: 700; font-size: 15px; color: #111827; flex: 1; min-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-nav { display: flex; align-items: center; gap: 8px; }
.reader-page-info { font-size: 13px; color: #6b7280; white-space: nowrap; }
.reader-content-wrap { flex: 1; overflow-y: auto; padding: 24px 32px; background: #fafaf9; }
.reader-content { max-width: 800px; margin: 0 auto; background: #fff; padding: 32px 40px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); font-size: 16px; line-height: 1.9; color: #1f2937; min-height: 400px; }
.reader-footer { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 10px; background: #fff; border-top: 1px solid #e5e7eb; }

/* 标记 */
.bs-mark-highlight { cursor: pointer; border-radius: 2px; }
.bs-mark-underline { text-decoration: underline; text-decoration-color: #3b82f6; text-decoration-thickness: 2px; cursor: pointer; }
.bs-mark-highlight:hover, .bs-mark-underline:hover { outline: 1px dashed #6b7280; }

/* 选中工具条 */
.bs-selection-toolbar { position: absolute; z-index: 1000; display: flex; align-items: center; gap: 6px; background: #1f2937; color: #fff; padding: 6px 10px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.bs-sel-colors { display: flex; gap: 4px; margin-right: 4px; }
.bs-color-dot { width: 18px; height: 18px; border-radius: 50%; cursor: pointer; border: 2px solid rgba(255,255,255,0.5); transition: transform .15s; }
.bs-color-dot:hover { transform: scale(1.2); }
.bs-selection-toolbar .btn { background: rgba(255,255,255,0.15); color: #fff; border: none; padding: 4px 8px; font-size: 12px; }
.bs-selection-toolbar .btn:hover { background: rgba(255,255,255,0.25); }
.bs-selection-toolbar .btn-primary { background: #10b981; }
.bs-selection-toolbar .btn-primary:hover { background: #059669; }

/* 弹窗 */
.bs-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.bs-modal { background: #fff; border-radius: 12px; width: 90%; max-width: 600px; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; }
.bs-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid #e5e7eb; font-weight: 700; }
.bs-modal-body { padding: 20px; overflow-y: auto; }
.bs-concept-card { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; transition: background .15s; }
.bs-concept-card:hover { background: #ecfdf5; border-color: #10b981; }
.bs-concept-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.bs-concept-def { font-size: 13px; color: #4b5563; line-height: 1.6; }
.bs-concept-tips { font-size: 12px; color: #059669; margin-top: 6px; }

/* 响应式 */
@media (max-width: 768px) {
  .reader-sidebar { position: absolute; z-index: 100; height: 100%; }
  .reader-content-wrap { padding: 12px; }
  .reader-content { padding: 20px; font-size: 15px; }
  .bs-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ========== 阅读器升级（触屏/字号/滑动） ========== */
.reader-toolbar { flex-direction: column; gap: 6px; padding: 8px 12px; }
.reader-toolbar-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.reader-settings-row { flex-wrap: wrap; justify-content: center; border-top: 1px solid #f0f0f0; padding-top: 6px; }
.font-size-label { font-size: 12px; color: #6b7280; min-width: 36px; text-align: center; }
.reader-select { padding: 3px 6px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 12px; background: #fff; color: #374151; }
.reader-page-info input { width: 48px; text-align: center; border: 1px solid #d1d5db; border-radius: 4px; padding: 2px; font-size: 12px; }
.reader-footer { padding: 8px; gap: 12px; }
.reader-swipe-hint { position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.7); color: #fff; padding: 6px 16px; border-radius: 20px; font-size: 12px; white-space: nowrap; z-index: 100; transition: opacity 0.5s; pointer-events: none; }
.reader-content { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; word-break: break-word; }
.reader-content-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* 工具条 fixed 定位 */
.bs-selection-toolbar { position: fixed !important; z-index: 9999 !important; flex-wrap: wrap; max-width: 90vw; gap: 4px; padding: 6px 8px; }
.bs-selection-toolbar .btn { padding: 4px 6px; font-size: 11px; min-height: 28px; }
.bs-color-dot { width: 20px; height: 20px; }
/* 触屏优化：按钮更大 */
@media (hover: none) and (pointer: coarse) {
  .reader-toolbar .btn { min-height: 36px; min-width: 36px; padding: 6px 10px; font-size: 14px; }
  .reader-settings-row .btn-xs { min-height: 32px; min-width: 32px; }
  .reader-content { padding: 20px 16px; line-height: 2; }
  .toc-item { padding: 12px 16px; font-size: 14px; }
  .bs-modal { width: 95vw; max-height: 85vh; }
  .reader-book-title { font-size: 13px; }
}
/* 平板优化 */
@media (min-width: 768px) and (max-width: 1024px) {
  .reader-sidebar { width: 200px; }
  .reader-content { padding: 28px 32px; font-size: 17px; }
}
