/* ===== 全局搜索（题干/选项） ===== */
.edu-gsearch {
  max-width: 920px;
  margin: 20px auto 0;
}
/* —— 搜索框 —— */
.gsearch-box { position: relative; display: flex; align-items: center; }
.gsearch-box .search-ico {
  position: absolute; left: 15px; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #9aa7b5; pointer-events: none; z-index: 1;
}
.gsearch-box .search-ico::after {
  content: ""; position: absolute; width: 2px; height: 6px; border-radius: 2px;
  background: #9aa7b5; transform: rotate(45deg); top: 10px; left: 10px;
}
.gsearch-input {
  width: 100%;
  font-size: .95rem;
  padding: .68rem 1rem .68rem 2.5rem;
  border: 1.5px solid; border-radius: .9rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
html[data-theme="light"] .gsearch-input {
  background: rgba(255,255,255,.8); border-color: rgba(90,64,40,.18); color: #2c3e50;
  box-shadow: 0 2px 10px rgba(0,0,0,.03);
}
html[data-theme="dark"] .gsearch-input {
  background: rgba(34,31,29,.78); border-color: rgba(255,245,235,.16); color: #ecf0f1;
}
.gsearch-input:focus {
  border-color: #e67e22; box-shadow: 0 0 0 3px rgba(230,126,34,.16); outline: none;
}
.gsearch-input::placeholder { color: #9aa7b5; }
.gsearch-go {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  padding: 6px 16px; border: none; border-radius: .6rem;
  font-size: .82rem; font-weight: 700; cursor: pointer; font-family: inherit;
  color: #fff; background: #e67e22;
  transition: background .18s, box-shadow .18s;
}
.gsearch-go:hover { background: #c9681a; box-shadow: 0 2px 8px rgba(230,126,34,.35); }
html[data-theme="dark"] .gsearch-go { background: #f59e0b; }
html[data-theme="dark"] .gsearch-go:hover { background: #d97706; }
.gsearch-input { padding-right: 4.2rem; }
.edu-gsearch-hint {
  margin: 8px 6px 0; font-size: .76rem; color: #9aa7b5; line-height: 1.5;
}

/* —— 结果面板 —— */
.gsearch-panel { margin-top: 14px; }
.gsearch-results { display: flex; flex-direction: column; gap: 12px; }
.gsearch-item {
  display: block; text-align: left; cursor: pointer; text-decoration: none;
  border: 1px solid; border-radius: 1rem; padding: 16px 18px;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.gsearch-item:hover { transform: translateY(-1px); }
html[data-theme="light"] .gsearch-item {
  background: #fff; border-color: rgba(230,126,34,.22); color: #2c3e50;
  box-shadow: 0 1px 3px rgba(0,0,0,.03);
}
html[data-theme="light"] .gsearch-item:hover { border-color: #e67e22; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
html[data-theme="dark"] .gsearch-item {
  background: #24201d; border-color: rgba(230,126,34,.2); color: #ecf0f1;
}
html[data-theme="dark"] .gsearch-item:hover { border-color: #e67e22; }

.gsearch-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gsearch-idx { font-size: .78rem; font-weight: 700; color: #e67e22; letter-spacing: .2px; }
/* 科目标签：311 不显示；333 / 333样卷 用紫色区分（与首页 333 卡片同色系） */
.gsearch-paper {
  font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  letter-spacing: .3px; white-space: nowrap;
}
html[data-theme="light"] .gsearch-paper { background: #f3e8ff; color: #6d28d9; border: 1px solid rgba(124,58,237,.22); }
html[data-theme="dark"]  .gsearch-paper { background: rgba(124,58,237,.22); color: #ddd6fe; border: 1px solid rgba(167,139,250,.3); }
.gsearch-type {
  font-size: .7rem; font-weight: 600; padding: 2px 9px; border-radius: 999px;
}
html[data-theme="light"] .gsearch-type { background: #eff6ff; color: #1d4ed8; }
html[data-theme="dark"] .gsearch-type { background: #1e293b; color: #93c5fd; }

.gsearch-text { font-size: .98rem; line-height: 1.75; color: inherit; overflow-wrap: anywhere; }
.gsearch-text mark {
  background: rgba(255,159,67,.32); color: inherit; padding: 0 1px; border-radius: 2px;
  font-weight: 600;
}
/* 题库强调样式：绿框=重点(粗)，蓝框=易错/斜体 */
.gsearch-text .green-box, .gsearch-text .blue-box {
  display: inline-block; border-radius: 6px; line-height: 1.6; margin: 0 3px;
  border: 2px solid #16a34a; padding: 0 6px; font-weight: 700;
  color: #15803d; background: #f0fdf4; white-space: normal;
}
.gsearch-text .blue-box { border-color: #2563eb; color: #1d4ed8; background: #eff6ff; font-style: italic; }
html[data-theme="dark"] .gsearch-text .green-box { color: #4ade80; border-color: #16a34a; background: rgba(22,101,52,.18); }
html[data-theme="dark"] .gsearch-text .blue-box { color: #60a5fa; border-color: #2563eb; background: rgba(30,64,175,.18); font-style: italic; }
.gsearch-text img { max-width: 100%; border-radius: 6px; }

.gsearch-opts {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.gsearch-opt {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .85rem; line-height: 1.4; color: #475569;
  border: 1px solid; border-radius: 8px; padding: 4px 10px 4px 5px;
}
html[data-theme="light"] .gsearch-opt { border-color: #e2e8f0; background: #f8fafc; color: #475569; }
html[data-theme="dark"] .gsearch-opt { border-color: #334155; background: #1e293b; color: #cbd5e1; }
.gsearch-let {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 5px;
  font-size: .72rem; font-weight: 700;
}
html[data-theme="light"] .gsearch-let { background: #eef2f7; color: #64748b; }
html[data-theme="dark"] .gsearch-let { background: #0f172a; color: #94a3b8; }

.gsearch-loading, .gsearch-none {
  font-size: .85rem; color: #9aa7b5; padding: 22px 6px; text-align: center;
}

/* ===== 时间轴（年份命中分布） ===== */
.gsearch-timeline {
  margin: 2px 2px 12px; padding: 14px 14px 12px;
  border: 1px solid; border-radius: 1rem;
}
html[data-theme="light"] .gsearch-timeline { border-color: rgba(230,126,34,.18); background: rgba(255,255,255,.55); }
html[data-theme="dark"] .gsearch-timeline { border-color: rgba(230,126,34,.15); background: rgba(34,31,29,.4); }
.gsearch-tl-title { font-size: .85rem; color: #64748b; margin-bottom: 12px; }
html[data-theme="dark"] .gsearch-tl-title { color: #94a3b8; }
.gsearch-tl-axis {
  display: grid;
  grid-template-columns: repeat(20, 1fr);       /* 恰好 20 年，等分对齐 */
  position: relative;
  padding-bottom: 4px;
}
/* 轴线（只画在点的高度中线，穿过所有圆点中心左侧到右侧） */
.gsearch-tl-axis::before {
  content: ""; position: absolute;
  left: 0; right: 0; top: 15px; height: 2px;
  border-radius: 2px; z-index: 0;
  background: linear-gradient(90deg, #cbd5e1, #94a3b8);
}
html[data-theme="dark"] .gsearch-tl-axis::before { background: linear-gradient(90deg, #334155, #475569); }

/* 每格：圆点 + 年份垂直堆叠，各自居中于格子 → 严格对齐 */
.tl-cell {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  position: relative; z-index: 1; cursor: pointer;
  text-decoration: none;
  transition: transform .15s;
}
.tl-cell:hover { transform: translateY(-3px); }
.tl-dot {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: .72rem; font-weight: 800;
  color: #fff; line-height: 1;
  border: 2px solid #94a3b8;
  transition: box-shadow .15s, transform .15s;
}
html[data-theme="dark"] .tl-dot { box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.tl-cell:hover .tl-dot { transform: scale(1.12); }
/* 命中颜色（淡红/紫红/渐变/灰） */
.tl-choice { background: #fca5a5; border-color: #ef4444; color: #7f1d1d; }      /* 淡红 */
.tl-subj   { background: #c084fc; border-color: #a855f7; color: #3b0764; }      /* 紫红 */
.tl-both   { background: linear-gradient(135deg,#fca5a5 50%,#c084fc 50%); border-color: #a855f7; color: #fff; }
.tl-empty  { background: #e2e8f0; border-color: #cbd5e1; color: #64748b; }
html[data-theme="dark"] .tl-choice { background: #7f1d1d; border-color: #f87171; color: #fecaca; }
html[data-theme="dark"] .tl-subj   { background: #581c87; border-color: #c084fc; color: #f3e8ff; }
html[data-theme="dark"] .tl-both   { background: linear-gradient(135deg,#7f1d1d 50%,#581c87 50%); border-color: #c084fc; color: #fff; }
html[data-theme="dark"] .tl-empty  { background: #1e293b; border-color: #334155; color: #64748b; }

.tl-year { font-size: .65rem; font-weight: 600; color: #94a3b8; font-variant-numeric: tabular-nums; }
html[data-theme="dark"] .tl-year { color: #64748b; }

.gsearch-tl-legend {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed #e2e8f0;
  font-size: .72rem; color: #64748b;
}
html[data-theme="dark"] .gsearch-tl-legend { color: #94a3b8; border-top-color: #334155; }
.gsearch-tl-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; }
.lg-choice { background: #fca5a5; border: 1px solid #ef4444; }
.lg-subj   { background: #c084fc; border: 1px solid #a855f7; }
.lg-both   { background: linear-gradient(135deg,#fca5a5 50%,#c084fc 50%); border: 1px solid #a855f7; }
.lg-none   { background: #e2e8f0; border: 1px solid #cbd5e1; }
html[data-theme="dark"] .lg-choice { background: #7f1d1d; border-color: #f87171; }
html[data-theme="dark"] .lg-subj   { background: #581c87; border-color: #c084fc; }
html[data-theme="dark"] .lg-both   { background: linear-gradient(135deg,#7f1d1d 50%,#581c87 50%); border-color: #c084fc; }
html[data-theme="dark"] .lg-none   { background: #1e293b; border-color: #334155; }

.gsearch-tl-divider { height: 2px; margin: 4px 0 6px; border-radius: 2px; background: linear-gradient(90deg,transparent,rgba(230,126,34,.25),transparent); }
.gsearch-hm-divider { height: 2px; margin: 2px 0 12px; border-radius: 2px; background: linear-gradient(90deg,transparent,rgba(168,85,247,.3),transparent); }

/* ===== 热力图（年份 × 题型） ===== */
.gsearch-heatmap {
  margin: 2px 2px 12px; padding: 14px;
  border: 1px solid; border-radius: 1rem;
}
html[data-theme="light"] .gsearch-heatmap { border-color: rgba(168,85,247,.18); background: rgba(250,245,255,.5); }
html[data-theme="dark"] .gsearch-heatmap { border-color: rgba(168,85,247,.16); background: rgba(34,31,29,.4); }
.gsearch-heat-title { font-size: .85rem; color: #64748b; margin-bottom: 12px; }
html[data-theme="dark"] .gsearch-heat-title { color: #94a3b8; }
.heat-scroll { overflow-x: auto; }
.heat-row {
  display: grid;
  grid-template-columns: 52px repeat(20, minmax(22px, 1fr));
  align-items: center; gap: 2px; margin-bottom: 3px;
}
.heat-head { margin-bottom: 6px; }
.heat-type {
  font-size: .72rem; font-weight: 700; color: #7c5a99; padding-right: 6px;
  text-align: right; white-space: nowrap;
}
html[data-theme="dark"] .heat-type { color: #c4a7e3; }
.heat-hy {
  font-size: .62rem; color: #94a3b8; text-align: center;
  font-variant-numeric: tabular-nums;
}
html[data-theme="dark"] .heat-hy { color: #64748b; }
.heat-cell {
  height: 26px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700; color: rgba(0,0,0,.55);
  border: 1px solid rgba(168,85,247,.1);
  cursor: default;
  transition: transform .12s, box-shadow .12s;
}
.heat-cell:hover { transform: scale(1.1); box-shadow: 0 0 0 2px rgba(168,85,247,.35); z-index: 2; }
html[data-theme="dark"] .heat-cell { color: #fff; }
.heat-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed #e2e8f0; font-size: .72rem; color: #64748b; }
html[data-theme="dark"] .heat-legend { color: #94a3b8; border-top-color: #334155; }
.hl { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0,0,0,.08); }
.hl0 { background: transparent; }
.hl1 { background: #e5dcf5; }
.hl2 { background: #86198f; }

@media (max-width: 640px) {
  .gsearch-heatmap { min-width: 0; overflow: hidden; }
  .heat-scroll { overflow-x: visible; min-width: 0; }
  .heat-row { grid-template-columns: 38px repeat(20, minmax(0, 1fr)); min-width: 0; }
  .heat-type { font-size: .58rem; min-width: 0; overflow: hidden; }
  .heat-cell { height: 16px; font-size: 7px; min-width: 0; overflow: hidden; }
  .heat-hy { font-size: 6px; letter-spacing: -0.5px; min-width: 0; overflow: hidden; white-space: nowrap; }
}

@media (max-width: 640px) {
  .gsearch-timeline { padding: 10px 8px 10px; min-width: 0; }
  .tl-cell { min-width: 0; overflow: hidden; }
  .tl-dot { width: 20px; height: 20px; font-size: .62rem; flex-shrink: 0; }
  .tl-year { font-size: .5rem; overflow: hidden; white-space: nowrap; max-width: 100%; }
}

@media (max-width: 640px) {
  .gsearch-opt { font-size: .8rem; }
  .gsearch-item { padding: 13px 14px; }
}

/* ===== MD-TIMELINE-MOBILE v1 (2026-09-28) =====
   「命中分布」时间轴是 20 格 grid。桌面端 1fr 够用，但在 375px 手机上出问题：
   grid 的 1fr 隐含 min-content 下限（每格至少一个「2026」那么宽 ≈21px），
   20 格合计 ≈420px 会撑破 layout viewport；移动端一旦横向溢出就 shrink-to-fit，
   把整页缩小 —— 用户看到的就是「搜完之后整页变小、布局错位」。
   这里改成固定列宽 + 容器自己横滑，与下方热度矩阵的交互保持一致。
   注意 ::before 那条轴线要跟着内容宽（480 = 20 × 24），否则滑出去就断了。 */
@media (max-width: 640px) {
  .gsearch-tl-axis {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px 4px;
    justify-content: start;
    overflow-x: visible;
    padding-bottom: 4px;
  }
  .gsearch-tl-axis::before { display: none; }
}
/* 题型筛选（客观/主观） */
.gsearch-filters{display:flex;gap:8px;margin:10px 0 0;flex-wrap:wrap}
.gsearch-filters button{border:1px solid #cbd5e1;border-radius:999px;padding:6px 14px;background:#fff;color:#334155;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;transition:all .15s}
.gsearch-filters button:hover{border-color:#2563eb;color:#2563eb;background:#f8faff}
.gsearch-filters button.is-active{border-color:#2563eb;background:#2563eb;color:#fff}
@media (prefers-color-scheme:dark){.gsearch-filters button{background:#0f172a;color:#e2e8f0;border-color:#334155}.gsearch-filters button:hover{border-color:#60a5fa;color:#60a5fa;background:#1e293b}.gsearch-filters button.is-active{border-color:#60a5fa;background:#60a5fa;color:#0f172a}}
