:root {
  --ink: #16191d;
  --muted: #4a535e;
  --faint: #8a949f;
  --line: #d9dee4;
  --line-soft: #e8ecf0;
  --bg: #f4f6f8;
  --card: #ffffff;
  --accent: #0b6e79;
  --accent-soft: #e4f2f3;
  --red: #b42318;
  --red-soft: #fef3f2;
  --green: #05603a;
  --green-soft: #ecfdf3;
  --amber: #8a5a00;
  --amber-soft: #fff8e6;
  --radius: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* 顶栏 */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px; height: 52px;
  background: var(--ink); color: #fff;
}
.brand { font-weight: 700; letter-spacing: .04em; }
.top nav { display: flex; gap: 4px; flex: 1; }
.top nav a { color: #c5ccd3; text-decoration: none; padding: 6px 12px; border-radius: 6px; }
.top nav a.on { color: #fff; background: rgba(255,255,255,.12); }
.top .link { color: #c5ccd3; margin-left: auto; }

main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 80px; }
h1 { font-size: 20px; margin: 0 0 14px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.sub { color: var(--muted); font-size: 13px; }
.faint { color: var(--faint); font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* 表单 */
label.f { display: block; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff;
  min-height: 38px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=number] { font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; min-height: 38px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
button.add { background: none; border: 1px dashed var(--line); border-radius: 7px; padding: 7px 12px; color: var(--accent); cursor: pointer; width: 100%; }
button.add:hover { border-color: var(--accent); }
.x { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 18px; line-height: 1; padding: 6px; }
.x:hover { color: var(--red); }

/* 报价台 */
.quote-layout { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.quote-form { position: sticky; top: 68px; }
.seg { display: grid; grid-template-columns: 1fr 76px 28px; gap: 6px; align-items: center; }
.kids { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.kid { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; padding-left: 8px; }
.kid input { width: 56px; border: 0; min-height: 34px; padding: 4px; }
.kid input:focus { outline: none; }
.hotel-meta { font-size: 13px; color: var(--muted); }

.banner { border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.banner.ok { background: var(--green-soft); color: var(--green); }
.banner.bad { background: var(--red-soft); color: var(--red); font-weight: 600; }
.banner.info { background: var(--accent-soft); color: var(--accent); }

.opt { padding: 0; overflow: hidden; }
.opt-head { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.opt-rank { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); color: var(--muted); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.opt.best .opt-rank { background: var(--accent); color: #fff; }
.opt-name { font-weight: 600; }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 99px; background: var(--bg); color: var(--muted); margin-left: 6px; vertical-align: 1px; font-weight: 400; }
.tag.pkg { background: var(--accent-soft); color: var(--accent); }
.opt-total { margin-left: auto; text-align: right; }
.opt-total b { font-size: 22px; font-variant-numeric: tabular-nums; }
.opt-total .cny { display: block; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.warns { margin: 0 16px 12px; padding: 10px 12px; background: var(--red-soft); border-radius: 8px; }
.warns p { margin: 0; color: var(--red); font-weight: 600; font-size: 14px; }
.warns p + p { margin-top: 6px; }
.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines td { padding: 7px 10px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.lines td:first-child { padding-left: 16px; }
.lines td:last-child { padding-right: 16px; }
.lines .calc { color: var(--muted); font-size: 13px; }
.lines .amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lines .neg { color: var(--green); }
.src { font-size: 12px; white-space: nowrap; }
.notes { padding: 8px 16px 12px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line-soft); }
.notes p { margin: 2px 0; }
.opt-foot { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line-soft); background: #fafbfc; }
details > summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details[open] > summary { margin-bottom: 8px; }
.rej { font-size: 13px; color: var(--muted); margin: 0; padding-left: 18px; }
.err-big { color: var(--red); font-weight: 600; }
.votes { font-size: 13px; color: var(--muted); }
.empty { text-align: center; color: var(--faint); padding: 48px 16px; }

/* 合同 */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fafbfc; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.run { background: var(--amber-soft); color: var(--amber); }
.pill.bad { background: var(--red-soft); color: var(--red); }
.pill.on { background: var(--accent-soft); color: var(--accent); }

.models { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.model h3 { display: flex; align-items: center; gap: 8px; }
.model .mname { font-size: 12px; color: var(--faint); font-weight: 400; }
.kv { font-size: 13px; color: var(--muted); }
.kv b { color: var(--ink); font-weight: 600; }
.bar { height: 4px; background: var(--line-soft); border-radius: 2px; overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; background: var(--amber); width: 30%; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .bar i { animation: none; width: 100%; opacity: .5; } }
.finding { font-size: 13px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.finding .lv { font-weight: 600; margin-right: 4px; }
.finding.error .lv { color: var(--red); }
.finding.warn .lv { color: var(--amber); }
.finding.info .lv, .finding.ack .lv { color: var(--faint); }
.issues { font-size: 13px; padding-left: 18px; margin: 4px 0; color: var(--muted); }
td.odd { color: var(--red); font-weight: 700; }
.agree { font-variant-numeric: tabular-nums; font-weight: 600; }
.agree.good { color: var(--green); }
.agree.mid { color: var(--amber); }
.agree.low { color: var(--red); }
.examples { font-size: 12px; color: var(--muted); padding-left: 16px; margin: 4px 0 0; }
.files { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.file { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; }
.file .fname { font-weight: 600; word-break: break-all; }
.seg-ctl { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-ctl button { border: 0; background: #fff; padding: 6px 14px; cursor: pointer; }
.seg-ctl button + button { border-left: 1px solid var(--line); }
.seg-ctl button.on { background: var(--accent); color: #fff; }
.seg-ctl button:disabled { color: var(--faint); cursor: not-allowed; }

/* 登录 */
.login { max-width: 360px; margin: 12vh auto 0; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 900px) {
  .quote-layout { grid-template-columns: 1fr; }
  .quote-form { position: static; }
  .models { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .top { padding: 0 12px; gap: 10px; }
  main { padding: 14px 12px 60px; }
  .files { grid-template-columns: 1fr; }
  .opt-head { flex-wrap: wrap; }
  .opt-total { margin-left: 40px; text-align: left; }
  .lines .calc-col { display: none; }
  .tbl .hide-m { display: none; }
}
