/* 面试助手 · 移动优先样式 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #eef1f5; }
body {
  margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px; color: #222; line-height: 1.6;
  background: #eef1f5;
}
#topbar {
  position: sticky; top: 0; z-index: 10;
  background: #1a5fb4; color: #fff;
  padding: env(safe-area-inset-top) 0 0;
  box-shadow: 0 2px 8px rgba(26,95,180,.25);
}
.topbar-row {
  display: flex; align-items: center; gap: 8px;
  max-width: 680px; margin: 0 auto; padding: 10px 14px;
}
.topbar-row h1 { font-size: 18px; margin: 0; flex: 1; font-weight: 600; }
.back-btn {
  display: none; width: 34px; height: 34px; line-height: 32px; text-align: center;
  border: 1px solid rgba(255,255,255,.6); border-radius: 50%;
  color: #fff; text-decoration: none; font-size: 18px; flex: none; user-select: none;
}
.back-btn.show { display: block; }
.search-wrap { max-width: 680px; margin: 0 auto; padding: 0 14px 10px; }
#search {
  width: 100%; padding: 9px 14px; font-size: 15px;
  border: none; border-radius: 8px; outline: none;
  background: rgba(255,255,255,.95); color: #222;
}
#view, #foot { max-width: 680px; margin: 0 auto; padding: 12px 14px; }
#foot { color: #98a2b3; font-size: 12px; text-align: center; }
.loading { text-align: center; color: #888; padding: 60px 0; }

/* ---- 模块卡片 ---- */
.cat-card {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 12px; padding: 14px 16px;
  margin-bottom: 10px; cursor: pointer; text-decoration: none; color: inherit;
  box-shadow: 0 1px 3px rgba(16,24,40,.06);
  transition: transform .08s;
}
.cat-card:active { transform: scale(.985); }
.cat-main { flex: 1; min-width: 0; }
.cat-name { font-weight: 600; font-size: 16px; }
.cat-meta { color: #8a94a6; font-size: 13px; margin-top: 2px; }
.bar { height: 4px; background: #e6ebf2; border-radius: 2px; margin-top: 8px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: #1a5fb4; border-radius: 2px; transition: width .3s; }
.cat-count {
  flex: none; text-align: center; color: #1a5fb4; font-weight: 700;
  border: 1px solid #cfe0f5; background: #eef4fc; border-radius: 10px;
  padding: 4px 10px; font-size: 13px;
}
.cat-count small { display: block; font-weight: 400; color: #8a94a6; font-size: 11px; }
.summary-line { color: #8a94a6; font-size: 12px; margin: 4px 2px 12px; }

/* ---- 筛选 chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.chip {
  padding: 5px 12px; border-radius: 15px; font-size: 13px;
  border: 1px solid #d5dce6; background: #fff; color: #556; cursor: pointer; user-select: none;
}
.chip.on { background: #1a5fb4; border-color: #1a5fb4; color: #fff; }
.chip-toggle { margin-left: auto; color: #1a5fb4; }

/* ---- 题目手风琴 ---- */
details.q {
  background: #fff; border-radius: 12px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(16,24,40,.06); overflow: hidden;
}
details.q > summary {
  list-style: none; cursor: pointer; padding: 12px 14px;
  display: flex; align-items: flex-start; gap: 8px; user-select: none;
}
details.q > summary::-webkit-details-marker { display: none; }
.q-title { flex: 1; font-weight: 600; font-size: 15.5px; line-height: 1.5; word-break: break-word; }
.q-title mark { background: #ffe58f; padding: 0 1px; border-radius: 2px; }
.caret { flex: none; color: #aab2c0; font-size: 12px; transition: transform .2s; margin-top: 4px; }
details[open] .caret { transform: rotate(90deg); }
.tag {
  flex: none; font-size: 11px; font-weight: 400; border-radius: 4px;
  padding: 1px 6px; margin-top: 3px; white-space: nowrap;
}
.tag-hot  { color: #d4380d; background: #fff1eb; border: 1px solid #ffccc2; }
.tag-proj { color: #1a5fb4; background: #eef4fc; border: 1px solid #cfe0f5; }
.tag-ext  { color: #667085; background: #f2f4f7; border: 1px solid #e4e7ec; }
.tag-base { color: #039855; background: #ecfdf3; border: 1px solid #abefc6; }
.tag-multi{ color: #7a5af8; background: #f4f3ff; border: 1px solid #d9d6fe; }
.tag-open { color: #b54708; background: #fffaeb; border: 1px solid #fedf89; }
.tag-cat  { color: #556; background: #f2f4f7; border: 1px solid #e4e7ec; }

.master { flex: none; display: flex; align-items: center; gap: 4px; font-size: 12px; color: #8a94a6; margin-top: 3px; }
.master input { width: 17px; height: 17px; accent-color: #12b76a; cursor: pointer; }
.q.done .q-title { color: #98a2b3; text-decoration: line-through; text-decoration-color: #c9d2de; }

/* ---- 删除模式 ---- */
.del-mode-btn {
  flex: none; background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.6); border-radius: 6px;
  padding: 4px 10px; font-size: 13px; cursor: pointer; user-select: none;
}
.del-mode-btn.on { background: #c0392b; border-color: #c0392b; }
.q .del {
  display: none; flex: none; margin-top: 3px; font-size: 12px; line-height: 1.5;
  color: #c0392b; background: #fff; border: 1px solid #e6b0aa;
  border-radius: 4px; padding: 1px 8px; cursor: pointer;
}
body.del-mode .q .del { display: block; }
.q .del:active { background: #c0392b; color: #fff; }

.a { padding: 2px 14px 12px; border-top: 1px dashed #eceff3; }
.a ul { margin: 8px 0 4px; padding-left: 1.3em; }
.a li { margin: 6px 0; font-size: 15px; color: #333; line-height: 1.7; }
.a b { color: #111; }

.empty { text-align: center; color: #98a2b3; padding: 40px 0; }
