/* 掌柜帮手 · 共用样式 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #f7f5f0; --card: #fff; --line: #e8e2d6; --line2: #eee8dc;
  --ink: #2b2b2b; --ink2: #4a3f2d; --mute: #8a7d66; --mute2: #a3967f;
  --brand: #9a6b1f; --brand-dark: #835a19; --soft: #fbf3df; --soft-line: #e6d5ad;
  --good: #2f6b34; --good-bg: #eef7ee; --bad: #a33c2f; --bad-bg: #fdf0f0;
  --warn: #8a5a12; --warn-bg: #fdf6e3;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.6;
  padding: 0 12px 48px;
}
.app { max-width: 560px; margin: 0 auto; }

/* 顶栏 */
.top { display: flex; align-items: center; gap: 10px; padding: 14px 0 10px; }
.top a.back { color: var(--brand); text-decoration: none; font-size: 15px; white-space: nowrap; }
.top h1 { font-size: 20px; letter-spacing: .5px; flex: 1; }
.top .badge { font-size: 11.5px; color: var(--good); background: var(--good-bg); border-radius: 999px; padding: 2px 9px; }
.sub { font-size: 13px; color: var(--mute); margin: -4px 0 12px; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.label { font-size: 13px; color: var(--mute); margin-bottom: 8px; display: block; }
.hint { font-size: 12.5px; color: var(--mute2); margin-top: 6px; line-height: 1.6; }

/* 输入 */
input[type=text], input[type=number], input[type=date], textarea, select {
  width: 100%; border: 1px solid #ded5c2; border-radius: 10px; padding: 10px;
  font-size: 16px; font-family: inherit; background: #fffdf8; color: var(--ink);
}
textarea { min-height: 84px; line-height: 1.5; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid #c99a3c; outline-offset: 0; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; min-width: 0; }
.field { margin-bottom: 9px; }
.field > span { display: block; font-size: 12.5px; color: var(--mute); margin-bottom: 4px; }

/* 选文件 */
.pick {
  display: block; width: 100%; text-align: center; padding: 13px; border-radius: 11px;
  background: #faf8f3; border: 1.5px dashed #d8cfba; color: var(--warn); font-size: 15.5px; font-weight: 600; cursor: pointer;
}
.pick input { display: none; }

/* 按钮 */
.btn {
  display: block; width: 100%; padding: 14px; border: 0; border-radius: 12px;
  background: var(--brand); color: #fff; font-size: 16.5px; font-weight: 600; font-family: inherit;
  letter-spacing: .5px; cursor: pointer; margin-top: 10px;
}
.btn:active:enabled { background: var(--brand-dark); }
.btn:disabled { background: #cfc5b2; cursor: default; }
.btn.gray { background: #7d7466; }
.btn.light { background: var(--soft); color: var(--warn); border: 1px solid var(--soft-line); }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }
.tip { font-size: 12.5px; color: var(--good); text-align: center; margin-top: 8px; min-height: 17px; }
.warn { font-size: 13px; color: var(--bad); margin-top: 8px; min-height: 16px; }

/* 结果 */
.big { font-size: 32px; font-weight: 700; color: var(--warn); line-height: 1.2; letter-spacing: -.5px; }
.big small { font-size: 15px; font-weight: 500; color: var(--mute2); margin-left: 3px; }
.biglabel { font-size: 12.5px; color: var(--mute2); }
.nums { display: flex; gap: 8px; }
.num { flex: 1; text-align: center; background: #fffdf6; border: 1px solid var(--soft-line); border-radius: 11px; padding: 9px 4px; }
.num b { display: block; font-size: 22px; font-weight: 700; color: var(--warn); line-height: 1.25; }
.num.bad b { color: var(--bad); }
.num.good b { color: var(--good); }
.num span { font-size: 11.5px; color: var(--mute); }
.say {
  background: #faf8f3; border: 1px dashed #d8cfba; border-radius: 10px;
  padding: 11px; font-size: 15px; line-height: 1.75; color: #3d3325; white-space: pre-wrap; word-break: break-word;
}
.say.empty { color: var(--mute2); font-size: 14px; }
.verdict { margin-top: 9px; font-size: 14px; padding: 8px 11px; border-radius: 9px; }
.v-good { background: var(--good-bg); color: var(--good); }
.v-ok { background: var(--warn-bg); color: var(--warn); }
.v-bad { background: var(--bad-bg); color: var(--bad); }
.v-none { background: #f4f2ee; color: var(--mute); }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 7px 5px; border-bottom: 1px solid var(--line2); text-align: left; }
.tbl th { color: var(--mute); font-weight: normal; font-size: 12.5px; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }

/* 小标签 */
.tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; margin-right: 6px; vertical-align: 1px; }
.t-amount { background: var(--warn-bg); color: var(--warn); }
.t-date { background: #f2f0fb; color: #54479a; }
.t-miss { background: var(--bad-bg); color: var(--bad); }
.t-extra { background: var(--good-bg); color: var(--good); }

/* 分段选择 */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  border: 1px solid var(--soft-line); background: #fff; color: var(--ink2); border-radius: 999px;
  padding: 6px 13px; font-size: 14px; font-family: inherit; cursor: pointer;
}
.seg button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 免费次数条 */
.quota { font-size: 12.5px; color: var(--mute); text-align: center; margin-top: 8px; }
.quota a { color: var(--brand); }

/* 弹层 */
.mask { position: fixed; inset: 0; background: rgba(40, 32, 20, .45); display: none; align-items: flex-end; justify-content: center; z-index: 50; }
.mask.on { display: flex; }
.sheet { background: #fff; width: 100%; max-width: 560px; border-radius: 16px 16px 0 0; padding: 18px 16px 24px; max-height: 88vh; overflow-y: auto; }
.sheet h2 { font-size: 18px; margin-bottom: 6px; }
.sheet .x { float: right; border: 0; background: none; font-size: 22px; color: var(--mute); cursor: pointer; line-height: 1; }

footer { text-align: center; font-size: 11.5px; color: var(--mute2); margin-top: 18px; line-height: 1.8; }
.hide { display: none !important; }

@media print {
  body { background: #fff; padding: 0; }
  .top a.back, .btn, .pick, footer, .quota, .noprint { display: none !important; }
  .card { border: 0; padding: 4px 0; }
}
