:root {
  /* 设计 Token v2 现代极简白 —— 与 miniprogram/app.wxss、docs/design-tokens.md 对齐 */
  --bg: #f6f6f8;
  --card: #ffffff;
  --ink: #191c1f;
  --muted: #5c626b;
  --faint: #9aa0a8;
  --hair: #f1f1f3;
  --line: #eaeaec;
  --accent: #8b1e2d;
  --accent-soft: #f7eaec;
  --accent-2: #c9a227;
  --ok: #2f9e8f;
  --warn: #d98324;
  --danger: #c0392b;
  --info: #3a86c8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17,17,20,.03), 0 8px 24px rgba(17,17,20,.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.container { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* 顶栏 */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--hair);
  color: var(--ink);
  padding: 28px 0 24px;
  margin-bottom: 20px;
}
.topbar h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: .5px; }
.topbar .sub { margin: 0; color: var(--muted); font-size: 14px; }
.topbar code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px; border-radius: 4px; font-size: 13px;
}

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card h2 { margin: 0 0 12px; font-size: 17px; }

/* 搜索行 */
.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search-row select,
.search-row input[type="text"] {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}
.search-row select { flex: 0 0 200px; }
.search-row input[type="text"] { flex: 1 1 260px; min-width: 200px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 15px;
  cursor: pointer;
  transition: filter .15s;
}
.btn-primary:hover { filter: brightness(1.1); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.btn-ghost:hover { background: rgba(139,30,45,.06); }

/* 提示与联想 */
.hint { margin-top: 8px; font-size: 13px; color: var(--muted); min-height: 18px; }
.hint b { color: var(--accent-2); }
.suggest {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
  background: #fff;
}
.suggest .item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
.suggest .item:last-child { border-bottom: none; }
.suggest .item:hover { background: var(--bg); }
.suggest .item .model { font-weight: 600; margin-right: 8px; }
.suggest .item .price { color: var(--accent-2); }

/* 品牌 chips */
.brand-chips { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 官网 URL 解析行 */
.url-row { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.url-row input[type="text"] {
  flex: 1 1 300px;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* 汇率 */
.rate-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rate-card label { font-size: 14px; }
.rate-card input[type="number"] {
  width: 110px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.muted { color: var(--muted); font-size: 13px; margin-left: 6px; }

/* 结果卡片 */
.result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 14px;
  border-left: 5px solid var(--accent);
}
.result-card .rc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.result-card .rc-brand {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
}
.result-card .rc-model { font-size: 20px; font-weight: 700; }
.result-card .rc-name { color: var(--muted); font-size: 14px; margin-bottom: 12px; }

/* 产品图片 */
.rc-img { margin-bottom: 12px; }
.rc-img img {
  display: block;
  max-width: 220px;
  max-height: 220px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: contain;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.price-cell {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.price-cell .pc-label { font-size: 12px; color: var(--muted); }
.price-cell .pc-value { font-size: 17px; font-weight: 700; }
.price-cell .pc-sub { font-size: 12px; color: var(--muted); }
.price-cell.diff { background: rgba(47,158,143,.08); border-color: rgba(47,158,143,.35); }
.price-cell.diff .pc-value { color: var(--ok); }

.rc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rc-steps { margin: 10px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.8; color: var(--muted); }
.rc-note { margin-top: 10px; font-size: 12px; color: var(--muted); }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 30px 10px;
  font-size: 15px;
}
.empty-state .big { font-size: 34px; margin-bottom: 6px; }

/* 历史 */
.history-list { list-style: none; margin: 0 0 12px; padding: 0; }
.history-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.history-list .h-model { font-weight: 600; }
.history-list .h-brand { color: var(--muted); font-size: 12px; }
.history-list .h-time { color: var(--muted); font-size: 12px; }

/* 添加记录 */
.add-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.add-row select,
.add-row input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.add-row select { flex: 0 0 150px; }
.add-row input { flex: 1 1 160px; min-width: 120px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 0 30px; }

/* 加载中 */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(139,30,45,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
