/* ── 设计变量 ─────────────────────────────────────────── */
:root {
  --bg:       #f5f4f0;
  --surface:  #ffffff;
  --surface2: #f0ede6;
  --border:   #e2ddd4;
  --border2:  #ccc8be;
  --text:     #1a1916;
  --text2:    #6b6760;
  --text3:    #9e9b94;
  --easy:     #2d6a4f;
  --easy-bg:  #d8f3dc;
  --mid:      #b5451b;
  --mid-bg:   #fde8d8;
  --hard:     #6b21a8;
  --hard-bg:  #ede9fe;
  --radius:   6px;
}

/* ── Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo { display: flex; align-items: baseline; gap: 8px; }
.logo-text { font-size: 16px; font-weight: 600; color: var(--text); }
.logo-sub  { font-size: 12px; color: var(--text3); }
.header-stats { margin-left: auto; }
.stat-item { font-size: 13px; color: var(--text2); }

/* ── Layout ───────────────────────────────────────────── */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 200px 1fr 320px;
  gap: 16px;
  align-items: start;
}

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 0;
  position: sticky;
  top: 68px;
}
.sidebar-section { padding: 0 12px 12px; }
.sidebar-section + .sidebar-section { border-top: 1px solid var(--border); padding-top: 12px; }
.sidebar-title { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.filter-list { display: flex; flex-direction: column; gap: 2px; }
.filter-btn {
  background: none;
  border: none;
  text-align: left;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.filter-btn:hover { background: var(--surface2); color: var(--text); }
.filter-btn.active { background: var(--surface2); color: var(--text); font-weight: 500; }
.filter-count { font-size: 11px; color: var(--text3); }

/* ── Toolbar ──────────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.difficulty-tabs { display: flex; gap: 4px; }
.tab {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text2);
}
.tab:hover { border-color: var(--border2); color: var(--text); }
.tab.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.search-wrap { flex: 1; min-width: 180px; }
.search-input {
  width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.search-input:focus { border-color: var(--border2); }

.result-info { font-size: 12px; color: var(--text3); margin-bottom: 10px; }

/* ── Question Cards ───────────────────────────────────── */
.question-list { display: flex; flex-direction: column; gap: 8px; }
.q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s;
}
.q-card:hover { border-color: var(--border2); }
.q-card.active { border-color: var(--text); }
.q-card-top { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.q-index { font-size: 11px; color: var(--text3); min-width: 28px; padding-top: 2px; }
.q-title {
  font-family: "Noto Serif SC", serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
}
.q-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding-left: 28px; }
.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
}
.badge-easy   { background: var(--easy-bg);  color: var(--easy); }
.badge-mid    { background: var(--mid-bg);   color: var(--mid); }
.badge-hard   { background: var(--hard-bg);  color: var(--hard); }
.badge-company { background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
.badge-topic   { background: var(--surface2); color: var(--text2); }

/* 卡片箭头提示 */
.q-arrow {
  font-size: 16px;
  color: var(--text3);
  margin-left: auto;
  flex-shrink: 0;
  transition: color .15s, transform .15s;
}
.q-card:hover .q-arrow { color: var(--text2); transform: translateX(2px); }

/* ── Detail Panel ─────────────────────────────────────── */
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
}
.detail-placeholder { color: var(--text3); font-size: 13px; padding: 40px 0; text-align: center; }

/* Detail 内容 */
.detail-q {
  font-family: "Noto Serif SC", serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.detail-section { margin-bottom: 16px; }
.detail-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.answer-points { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.answer-points li {
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.6;
  border-left: 2px solid var(--border2);
}
.traps { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.traps li {
  padding: 6px 10px;
  background: #fff8f5;
  border-radius: 4px;
  font-size: 13px;
  color: var(--mid);
  border-left: 2px solid var(--mid-bg);
}
.summary-box {
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: 4px;
  font-size: 13px;
  font-style: italic;
  color: var(--text2);
  border-left: 3px solid var(--border2);
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 2px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 12px;
  color: var(--text2);
}

/* Detail 图片 */
.detail-img-wrap { margin-top: 8px; }
.detail-img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
  Claude Code: zoom-in;
}

/* 关键词内链 */
.kw-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(0,0,0,0.3);
  transition: border-color .15s;
}
.kw-link:hover { border-bottom: 1px solid rgba(0,0,0,0.7); }

/* 相关题目 */
.related-list { display: flex; flex-direction: column; gap: 6px; }
.related-item {
  font-size: 12px;
  color: var(--text2);
  padding: 6px 8px;
  background: var(--surface2);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  border: 1px solid transparent;
}
.related-item:hover { border-color: var(--border); color: var(--text); }

/* ── Lightbox ─────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-bg { position: absolute; inset: 0; background: rgba(0,0,0,.7); }
.lightbox-img {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
}

/* ── Empty State ──────────────────────────────────────── */
.empty { padding: 60px 0; text-align: center; color: var(--text3); font-size: 14px; }

/* ── Pagination ───────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 0 8px;
  flex-wrap: wrap;
}
.page-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--border2); color: var(--text); }
.page-btn.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.page-btn:disabled { opacity: .35; cursor: default; }
.page-ellipsis { font-size: 13px; color: var(--text3); padding: 0 4px; }
.page-info { font-size: 12px; color: var(--text3); margin-left: 6px; }

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 180px 1fr; }
  .detail-panel { display: none; }
}
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; padding: 12px; }
  .sidebar { display: none; }
}
