/* base.css — 布局/头部/工具栏/筛选/页脚 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: #17171a;
  color: #d8d8dc;
  font: 15px/1.6 "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---------- 头部 ---------- */
.top {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: #1f1f24;
  border-bottom: 2px solid #f0a030;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.home {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 8px; background: #2a2a30; color: #d8d8dc;
  font-size: 20px; text-decoration: none;
}
.home:hover { background: #35353d; }
.brand h1 {
  font-size: 17px; font-weight: 600; color: #f0c060;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#searchInput {
  flex: 1; min-width: 90px; max-width: 340px; margin-left: auto;
  padding: 8px 12px;
  background: #26262c; color: #e8e8ec;
  border: 1px solid #3a3a42; border-radius: 8px;
  font: inherit;
}
#searchInput::placeholder { color: #8a8a94; }
#searchInput:focus-visible { outline: 2px solid #f0a030; outline-offset: 0; }

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: #1b1b1f;
  border-bottom: 1px solid #2a2a30;
  flex-wrap: wrap;
}
.tool-toggle, .tool-btn {
  min-height: 36px; padding: 6px 14px;
  border-radius: 18px; border: 1px solid #3a3a42;
  background: #242429; color: #d8d8dc; font-size: 14px;
}
.tool-toggle[aria-pressed="true"] {
  background: #5a2410; border-color: #f0a030; color: #ffd08a;
}
.tool-toggle:hover, .tool-btn:hover { background: #2e2e35; }
.tool-toggle[aria-pressed="true"]:hover { background: #6a2c12; }
.tool-select {
  min-height: 36px; padding: 6px 10px;
  background: #242429; color: #d8d8dc;
  border: 1px solid #3a3a42; border-radius: 8px; font: inherit; font-size: 14px;
}
.count { color: #aaa; font-size: 13px; }
.toolbar-gap { flex: 1; }
.tool-btn { border-color: #7a5a20; color: #f0c060; }
.tool-btn:hover { background: #2e2a1c; }

/* ---------- 筛选 ---------- */
.filters {
  margin: 12px 16px 0;
  background: #1d1d21;
  border: 1px solid #2c2c33;
  border-radius: 10px;
}
.filters > summary {
  padding: 10px 14px; cursor: pointer; user-select: none;
  color: #f0c060; font-size: 14px; font-weight: 600;
  list-style: none;
}
.filters > summary::before { content: "▸ "; }
.filters[open] > summary::before { content: "▾ "; }
.filters > summary::-webkit-details-marker { display: none; }
.fgroup { padding: 2px 14px 10px; }
.fgroup + .fgroup { border-top: 1px solid #26262c; }
.fgroup h3 {
  display: inline-block;
  font-size: 13px; font-weight: 600; color: #999; width: 64px;
  vertical-align: middle;
}
.chiprow { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; max-width: calc(100% - 70px); }
.chip {
  min-height: 30px; padding: 3px 11px;
  border-radius: 15px;
  background: #242429; color: #c0c0c6;
  border: 1px solid #33333b; font-size: 13px;
}
.chip:hover { background: #2e2e35; }
.chip.on { background: #3d2a10; border-color: #f0a030; color: #ffd08a; }

/* ---------- 主体/页脚 ---------- */
main { padding: 0 0 24px; }
.cards-view { padding: 12px 16px 0; }
.foot {
  padding: 14px 16px 18px;
  color: #888; font-size: 12.5px;
  border-top: 1px solid #26262c;
  text-align: center;
}
.empty { padding: 48px 16px; text-align: center; color: #999; }

:focus-visible { outline: 2px solid #f0a030; outline-offset: 1px; }

@media (max-width: 640px) {
  .top { flex-wrap: wrap; }
  .brand { flex: 1 1 100%; }
  .brand h1 { font-size: 16px; }
  #searchInput { max-width: none; margin-left: 0; min-height: 44px; }
  .filters { margin: 10px 10px 0; }
  .fgroup h3 { display: block; width: auto; margin-bottom: 6px; }
  .chiprow { max-width: 100%; display: flex; }
  .cards-view { padding: 10px 10px 0; }
  .toolbar { padding: 8px 10px; }
  /* 触控目标 ≥44px */
  .chip { min-height: 44px; padding: 10px 15px; }
  .tool-toggle, .tool-btn { min-height: 44px; padding: 10px 16px; }
  .tool-select { min-height: 44px; }
  .modal-close { width: 44px; height: 44px; }
}
