:root { --ink:#1f3864; --line:#e6ebf3; --muted:#8b94a5; --bg:#f4f6fa; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:#1f2937;
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif; }
.wrap { max-width:760px; margin:0 auto; padding:20px 14px 60px; }
.head { display:flex; align-items:baseline; gap:10px; margin-bottom:14px; }
h1 { font-size:20px; margin:0; color:var(--ink); letter-spacing:-.2px; }
.tag { font-size:12.5px; color:var(--muted); }
.card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px;
  box-shadow:0 1px 2px rgba(20,35,70,.04); margin-bottom:12px; }
input, textarea, button { font-size:16px; font-family:inherit; }
.row { display:flex; gap:8px; }
#q { flex:1; height:46px; padding:0 14px; border:1px solid #dfe6f0; border-radius:11px;
  background:#fbfcfe; outline:none; }
#q:focus { border-color:#9db6dc; background:#fff; }
.sugs { position:relative; }
.sug-list { position:absolute; left:0; right:0; top:50px; background:#fff; border:1px solid #e2e8f2;
  border-radius:12px; box-shadow:0 12px 28px rgba(20,35,70,.14); overflow:hidden; z-index:9; display:none; }
.sug { display:flex; justify-content:space-between; gap:10px; padding:12px 14px; cursor:pointer; font-size:15px; }
.sug.on, .sug:hover { background:#f2f7ff; }
.sug small { color:var(--muted); font-size:12px; }
.sug b { color:var(--ink); }
.line-row { display:flex; gap:8px; margin-top:12px; align-items:stretch; }
#bulk { flex:1; padding:10px 12px; border:1px solid #dfe6f0; border-radius:11px; background:#fbfcfe;
  resize:none; line-height:1.5; outline:none; font-size:15px; }
#bulk:focus { border-color:#9db6dc; background:#fff; }
.btn { border:1px solid #dbe3ef; background:#fff; border-radius:11px; padding:0 16px; cursor:pointer;
  color:var(--ink); font-size:14px; white-space:nowrap; }
.btn:hover { background:#f3f7fe; }
.btn.primary { background:linear-gradient(180deg,#2b4c7e,#1f3864); color:#fff; border-color:#1f3864; }
.btn.ghost { background:#f7f9fc; }
.btn.sm { padding:6px 12px; font-size:13px; border-radius:9px; }
.tools { display:flex; align-items:center; gap:8px; margin-top:10px; flex-wrap:wrap; }
.hint { font-size:12.5px; color:var(--muted); }
.hint.bad { color:#b23b2e; }
.tpl-head { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.tpl-title { font-size:13px; color:#5b6577; }
.muted { color:var(--muted); font-weight:400; font-size:12px; }
.tpl-tools { display:flex; gap:8px; align-items:center; }
#tplQ { width:130px; height:34px; padding:0 10px; border:1px solid #dfe6f0; border-radius:9px;
  background:#fbfcfe; font-size:13px; }
.tpl-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(210px, 1fr)); gap:8px;
  margin-top:10px; max-height:280px; overflow-y:auto; padding-right:2px; }
.tpl-chip { border:1px solid #e2e8f2; background:#fbfcfe; border-radius:11px; padding:9px 11px;
  cursor:pointer; font-size:13px; color:var(--ink); position:relative; line-height:1.45; }
.tpl-chip:hover { background:#f2f7ff; border-color:#c9dbf7; }
.tpl-chip b { font-size:13.5px; }
.tpl-chip .n { color:var(--muted); font-size:11.5px; margin-left:4px; }
.tpl-chip .note { color:#8b94a5; font-size:11.5px; margin-top:5px; display:-webkit-box;
  -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.tpl-chip .x { position:absolute; top:6px; right:8px; color:#b9c1cd; font-size:13px; }
.tpl-chip .x:hover { color:#b23b2e; }
.tpl-chip.user { border-style:dashed; }
table { width:100%; border-collapse:collapse; font-size:14px; }
th { text-align:left; font-size:12px; color:var(--muted); font-weight:600; padding:8px 6px;
  border-bottom:1px solid var(--line); }
td { padding:8px 6px; border-bottom:1px solid #f2f5f9; vertical-align:middle; }
tr:last-child td { border-bottom:0; }
.name { font-weight:600; color:var(--ink); }
.price { color:var(--muted); font-size:12.5px; }
.g { width:88px; height:40px; padding:0 10px; border:1px solid #dfe6f0; border-radius:9px;
  background:#fbfcfe; text-align:right; }
.sub-total { text-align:right; font-variant-numeric:tabular-nums; }
.del { border:0; background:transparent; color:#b23b2e; font-size:13px; cursor:pointer; padding:6px; }
.empty { text-align:center; color:var(--muted); font-size:13px; padding:22px 0; }
.sum { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.sum .big { font-size:22px; font-weight:700; color:var(--ink); font-variant-numeric:tabular-nums; }
.sum .lab { font-size:12.5px; color:var(--muted); }
.ji { width:70px; height:40px; padding:0 8px; border:1px solid #dfe6f0; border-radius:9px;
  background:#fbfcfe; text-align:right; }
.tip { font-size:12px; color:var(--muted); margin-top:10px; line-height:1.7; }
.link { color:#2f6fd0; text-decoration:none; }
@media (max-width:480px) {
  .wrap { padding:14px 10px 50px; }
  h1 { font-size:18px; }
  .g { width:70px; }
  .line-row { flex-direction:column; }
  #bulk { width:100%; }
  #parse { height:42px; }
}
