/* PriceFinder — 黑色护眼 · 商务简约 · 科技感 */
:root {
  --bg: #000;
  --s1: #0b0b0c;
  --s2: #121214;
  --s3: #1a1a1d;
  --line: #222226;
  --line2: #2e2e33;
  --tx: #e9e9ea;
  --tx2: #a1a1a6;
  --tx3: #6b6b71;
  --acc: #a8c7ff;
  --acc-dim: rgba(168, 199, 255, .12);
  --ok: #5ee39a;
  --warn: #f5c451;
  --bad: #ff7a7a;
  --r: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Sukhumvit Set", Thonburi, "Noto Sans Thai", Tahoma, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ——— Top bar ——— */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-t) + 10px) 16px 10px; background: rgba(0,0,0,.78); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid #111; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: .02em; }
.logo { width: 24px; height: 25px; color: var(--tx); }
.top-r { display: flex; gap: 8px; align-items: center; }
.pill { display: flex; align-items: center; gap: 6px; background: var(--s2); border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px; font-size: 12px; color: var(--tx2); min-height: 28px; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--tx3); }
.sync[data-s=online] i { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.sync[data-s=offline] i { background: var(--warn); }
.sync[data-s=auth] i { background: var(--bad); }

main { padding: 6px 16px calc(96px + var(--safe-b)); max-width: 760px; margin: 0 auto; outline: none; }
h1 { font-size: 28px; line-height: 1.15; margin: 14px 0 4px; font-weight: 650; letter-spacing: -.02em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--tx3); font-weight: 600; margin: 26px 0 10px; }
.sub { color: var(--tx2); font-size: 13px; margin: 0 0 14px; }
.muted { color: var(--tx2); } .dim { color: var(--tx3); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }

/* ——— Tab bar ——— */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  padding: 6px 6px calc(6px + var(--safe-b)); background: rgba(6,6,7,.86); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid #141416; }
.tabbar button { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; color: var(--tx3); font-size: 11px; padding: 6px 0; border-radius: 12px; }
.tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.on { color: var(--tx); }

/* ——— Search ——— */
.search { position: relative; margin: 12px 0 10px; }
.search input { width: 100%; height: 48px; border-radius: 24px; background: var(--s2); border: 1px solid var(--line); padding: 0 18px 0 46px; font-size: 16px; outline: none; transition: border-color .15s; }
.search input:focus { border-color: var(--line2); background: var(--s3); }
.search svg { position: absolute; left: 17px; top: 14px; width: 20px; height: 20px; fill: none; stroke: var(--tx3); stroke-width: 1.8; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: transparent; color: var(--tx2); border-radius: 99px; padding: 6px 13px; font-size: 13px; }
.chip.on { background: var(--tx); color: #000; border-color: var(--tx); }

/* ——— Cards / lists ——— */
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--s1); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; text-align: left; width: 100%; transition: background .12s, border-color .12s; }
.item:active { background: var(--s2); border-color: var(--line2); }
.item .main { flex: 1; min-width: 0; }
.item .t { font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .d { color: var(--tx3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.item .r { text-align: right; flex: none; }
.item .r b { display: block; font: 600 15px var(--mono); }
.item .r small { color: var(--tx3); font-size: 11.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.c-herbicide { background: #7ee0a1; } .c-insecticide { background: #f3a86b; } .c-fungicide { background: #9db8ff; } .c-pgr { background: #d7a6ff; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--s3); color: var(--tx2); border: 1px solid var(--line); }
.empty { text-align: center; color: var(--tx3); padding: 48px 0; font-size: 14px; }

/* ——— Forms ——— */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 12px; color: var(--tx3); letter-spacing: .02em; }
.input, .field input, .field select, .field textarea { width: 100%; background: var(--s2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 16px; outline: none; -webkit-appearance: none; appearance: none; }
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--tx3) 50%), linear-gradient(135deg, var(--tx3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #3a3a40; }
.field textarea { min-height: 76px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 6px; background: var(--s2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 13px; }
.checks input { accent-color: #fff; }

.seg { display: flex; background: var(--s2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--tx2); padding: 8px 4px; border-radius: 9px; font-size: 13.5px; font-weight: 550; }
.seg button.on { background: var(--tx); color: #000; }

.range { display: flex; align-items: center; gap: 12px; }
.range input[type=range], .field .range input[type=range] { flex: 1; accent-color: #fff; height: 28px; background: none; border: 0; padding: 0; -webkit-appearance: auto; appearance: auto; }
.range .input { width: 84px; text-align: right; font-family: var(--mono); }

/* ——— Buttons ——— */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; padding: 0 18px; border-radius: 23px; border: 1px solid var(--line2); background: var(--s2); color: var(--tx); font-weight: 560; font-size: 15px; }
.btn:active { transform: scale(.98); }
.btn.pri { background: #fff; color: #000; border-color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: #3a1e1e; background: transparent; }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 17px; }
.btn.block { width: 100%; }
.btns { display: flex; gap: 10px; margin-top: 14px; }
.btns .btn { flex: 1; }
.fab { position: fixed; right: 18px; bottom: calc(84px + var(--safe-b)); z-index: 25; width: 54px; height: 54px; border-radius: 27px; border: 0; background: #fff; color: #000; font-size: 28px; line-height: 1; box-shadow: 0 8px 28px rgba(0,0,0,.6); }
.linkbtn { background: none; border: 0; color: var(--acc); padding: 0; font-size: 13px; }

/* ——— Result panel ——— */
.result { position: relative; overflow: hidden; border-radius: 20px; border: 1px solid var(--line2); background:
  radial-gradient(120% 90% at 100% 0%, rgba(168,199,255,.10), transparent 55%),
  radial-gradient(90% 80% at 0% 100%, rgba(94,227,154,.06), transparent 60%), var(--s1); padding: 18px 18px 14px; margin-top: 18px; }
.result::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000 0%, transparent 70%); pointer-events: none; }
.result > * { position: relative; }
.r-label { color: var(--tx2); font-size: 12.5px; letter-spacing: .04em; }
.r-price { font: 650 40px/1.1 var(--mono); letter-spacing: -.03em; margin: 6px 0 2px; }
.r-price small { font-size: 15px; color: var(--tx3); font-weight: 500; margin-left: 4px; }
.r-sub { color: var(--tx2); font-size: 13px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 14px 0 12px; }
.kpis div { background: var(--s1); padding: 10px 12px; }
.kpis span { display: block; font-size: 11.5px; color: var(--tx3); }
.kpis b { font: 600 15.5px var(--mono); }
.terms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.terms button { background: var(--s2); border: 1px solid var(--line); border-radius: 11px; padding: 8px 4px; text-align: center; }
.terms button span { display: block; font-size: 11px; color: var(--tx3); letter-spacing: .06em; }
.terms button b { font: 600 13.5px var(--mono); }
.terms button.on { border-color: var(--acc); background: var(--acc-dim); }
.terms button.on span { color: var(--acc); }
.bd { margin-top: 12px; border-top: 1px dashed var(--line2); padding-top: 10px; }
.bd summary { list-style: none; color: var(--tx2); font-size: 13px; cursor: pointer; }
.bd summary::-webkit-details-marker { display: none; }
.bd table, .tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.bd td, .tbl td, .tbl th { padding: 6px 0; border-bottom: 1px solid #18181b; }
.tbl th { text-align: left; color: var(--tx3); font-weight: 500; font-size: 12px; }
.bd td:last-child, .tbl td.n, .tbl th.n { text-align: right; font-family: var(--mono); }
.warns { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.warns div { font-size: 12.5px; color: var(--warn); }
.draftbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 10px 14px; border-radius: 14px; background: var(--acc-dim); border: 1px solid rgba(168,199,255,.25); color: var(--acc); font-size: 13.5px; width: 100%; }
.draftbar b { font-family: var(--mono); }

/* ——— Sheet (bottom modal) ——— */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); animation: fade .18s ease; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92dvh; overflow-y: auto; background: #0c0c0e; border-top: 1px solid var(--line2); border-radius: 22px 22px 0 0; padding: 8px 18px calc(24px + var(--safe-b)); max-width: 760px; margin: 0 auto; animation: up .24s cubic-bezier(.2,.8,.2,1); }
.sheet .grab { width: 38px; height: 4px; border-radius: 2px; background: #333; margin: 4px auto 10px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sheet-h h3 { margin: 0; font-size: 19px; font-weight: 620; }
.x { width: 32px; height: 32px; border-radius: 16px; border: 0; background: var(--s3); color: var(--tx2); font-size: 18px; flex: none; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin: 10px 0; }
.kv div { background: var(--s1); padding: 9px 12px; }
.kv span { display: block; font-size: 11.5px; color: var(--tx3); }
.kv b { font-weight: 560; font-size: 14px; }
.spark { width: 100%; height: 54px; }

#toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 80; background: #fff; color: #000; padding: 9px 16px; border-radius: 20px; font-size: 14px; font-weight: 550; opacity: 0; pointer-events: none; transition: .2s; max-width: 86vw; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ——— Quotation document (white paper) ——— */
.doc-wrap { position: fixed; inset: 0; z-index: 70; background: #1b1b1d; overflow: auto; padding: calc(var(--safe-t) + 60px) 10px 40px; }
.doc-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 71; display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: calc(var(--safe-t) + 10px) 12px 10px; background: rgba(0,0,0,.85); backdrop-filter: blur(14px); }
.doc-bar .t { margin-right: auto; font-weight: 600; }
.doc { background: #fff; color: #111; width: 760px; max-width: none; margin: 0 auto; padding: 36px 34px; font: 12.5px/1.5 "Helvetica Neue", Arial, "PingFang SC", sans-serif; border-radius: 4px; }
.doc .hd { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #111; padding-bottom: 12px; }
.doc .co { font-size: 18px; font-weight: 700; letter-spacing: .01em; }
.doc .co small { display: block; font-size: 11px; font-weight: 400; color: #555; margin-top: 3px; }
.doc .ttl { text-align: right; } .doc .ttl b { font-size: 20px; letter-spacing: .08em; }
.doc .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.doc .meta div { font-size: 12px; } .doc .meta b { display: inline-block; min-width: 92px; color: #555; font-weight: 500; }
.doc table { width: 100%; border-collapse: collapse; margin: 6px 0 12px; }
.doc th { background: #111; color: #fff; font-weight: 600; font-size: 11.5px; padding: 7px 6px; text-align: left; }
.doc td { border-bottom: 1px solid #ddd; padding: 8px 6px; vertical-align: top; }
.doc .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc tfoot td { font-weight: 700; border-bottom: 2px solid #111; }
.doc .terms-doc div { margin: 3px 0; } .doc .terms-doc b { display: inline-block; min-width: 112px; color: #555; font-weight: 500; }
.doc .sign { display: flex; justify-content: space-between; margin-top: 40px; font-size: 12px; color: #555; }
.doc .sign div { border-top: 1px solid #999; padding-top: 6px; min-width: 200px; }

/* ——— Login ——— */
body.locked .tabbar, body.locked .top-r { display: none; }
body.locked main { padding-bottom: 40px; }
.login { max-width: 380px; margin: 0 auto; padding: 8vh 4px 0; text-align: center; }
.login-logo { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 0 0 1px #222, 0 18px 50px rgba(168,199,255,.10); }
.login h1 { margin-top: 18px; }
.login .sub { margin-bottom: 28px; }
.login form { text-align: left; }
.login .field input { height: 50px; font-size: 17px; }
.login .btn { height: 50px; margin-top: 6px; }
.login-msg { color: var(--bad); font-size: 13.5px; margin: -2px 0 10px; }
.login-hint { font-size: 12.5px; margin: 18px 0 26px; line-height: 1.6; }
.login-lang .seg { max-width: 280px; margin: 0 auto; }

@media print {
  body { background: #fff; }
  #app, #sheet-root, #toast, .doc-bar { display: none !important; }
  .doc-wrap { position: static; padding: 0; background: #fff; overflow: visible; }
  .doc { padding: 0; width: auto; max-width: none; border-radius: 0; zoom: 1 !important; }
  @page { size: A4; margin: 14mm; }
}
@media (min-width: 720px) { h1 { font-size: 32px; } .r-price { font-size: 46px; } }
