/* 询盘系统：手机优先，跟随系统深浅色。 */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1c1f24;
  --muted: #6b7280;
  --line: #e3e6ea;
  --accent: #1a56db;
  --accent-text: #ffffff;
  --win: #0e7a3e;
  --warn: #b42318;
  --warn-bg: #fdecea;
  --badge: #eef2f7;
  --ok-bg: #e7f6ec;
  --wa: #128c4a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --card: #181c22;
    --text: #e8eaed;
    --muted: #9aa3ad;
    --line: #2a3038;
    --accent: #5b8def;
    --accent-text: #0f1216;
    --win: #4cc38a;
    --warn: #f97066;
    --warn-bg: #3a1d1b;
    --badge: #232a33;
    --ok-bg: #173325;
    --wa: #4cc38a;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px 48px; }
main.narrow { max-width: 420px; padding-top: 48px; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 17px; margin: 6px 0; }
.brand-title { font-size: 22px; text-align: center; margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { margin-left: auto; }
.empty { text-align: center; padding: 32px 0; }

/* 顶栏 */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.top nav { display: flex; gap: 12px; }
.top nav a { text-decoration: none; color: var(--muted); padding: 2px 0; }
.top nav a.on { color: var(--text); font-weight: 600; border-bottom: 2px solid var(--accent); }
.top .who { margin-left: auto; font-size: 13px; color: var(--muted); }
form.inline { display: inline; }

/* 表单元素 */
input, select, textarea, button, .btn { font: inherit; color: inherit; }
input, select, textarea { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 40px; }
button, .btn { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-decoration: none; color: var(--text); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; }
button.wide { width: 100%; justify-content: center; margin-top: 8px; }
.field { display: block; margin-bottom: 12px; font-size: 14px; }
.field input { display: block; width: 100%; margin-top: 4px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.check { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.check input { min-height: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.card.off { opacity: .6; }
.flash { background: var(--ok-bg); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.flash.error { background: var(--warn-bg); color: var(--warn); }
.warn { color: var(--warn); font-weight: 600; }
table.kv td { padding: 2px 12px 2px 0; }
table.kv td:first-child { color: var(--muted); }

/* 分页和筛选 */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 4px 0 8px; }
.tabs a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); background: var(--badge); white-space: nowrap; }
.tabs a.on { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }

/* 询盘卡片 */
.lead { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.lead.stale { border-color: var(--warn); }
.lead-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--badge); font-size: 12px; font-weight: 600; }
.badge.ads { color: var(--accent); }
.badge.ok { background: var(--ok-bg); color: var(--win); }
.status { font-size: 13px; font-weight: 600; }
.s-new { color: var(--warn); }
.s-won { color: var(--win); }
.s-lost { color: var(--muted); }
.contact { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.contact .btn { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.btn.wa { color: var(--wa); border-color: var(--wa); }
.msg { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 14px; }
.deal { margin: 6px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.actions form { margin: 0; }
details.pop { display: contents; }
details.pop > summary { list-style: none; }
details.pop > summary::-webkit-details-marker { display: none; }
details.pop[open] > form { flex-basis: 100%; margin: 0; }
details.pop form input { flex: 1; min-width: 0; }
.btn.win { color: var(--win); border-color: var(--win); font-weight: 600; }
.assign label { display: inline-flex; align-items: center; gap: 6px; }
details.more { margin-top: 6px; }
details.more ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
