/* 焰狸 · 店主看账：和小程序、收银台一套样子。亮色暖白、深色夜空蓝，跟着手机 / 电脑的深浅色走。
   图片（标志、小狐狸、夜空、单色图标）在 /brand/，见 cloud/server/app.js、tools/art.py */
:root {
  --red: #e0261d;
  --red-d: #b3141a;
  --red-l: #fdecea;
  --gold: #b47a18;
  --gold-l: #fcefd5;
  --green: #1f9d55;
  --green-l: #e4f6eb;
  --ink: #1d1814;
  --ink2: #6f655c;
  --ink3: #9b9086;
  --line: rgba(70, 36, 10, 0.1);
  --bg: #fbf7f2;
  --card: #fff;
  --card2: #fff6ec;
  --shadow: 0 10px 28px rgba(120, 64, 20, 0.08);
  --bar: rgba(255, 255, 255, 0.9);
  --brand: linear-gradient(135deg, #ff7a45 0%, #f0322a 48%, #b9111b 100%);
  --night: linear-gradient(135deg, #14112e 0%, #3b1530 55%, #7a2420 100%);
  --mono: 'DIN Alternate', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --red: #ff5340;
    --red-d: #ff7a6a;
    --red-l: rgba(255, 83, 64, 0.14);
    --gold: #f5c460;
    --gold-l: rgba(245, 196, 96, 0.14);
    --green: #3ccf7a;
    --green-l: rgba(60, 207, 122, 0.14);
    --ink: #fff6e6;
    --ink2: rgba(255, 246, 230, 0.7);
    --ink3: rgba(255, 246, 230, 0.45);
    --line: rgba(255, 255, 255, 0.09);
    --bg: #090b17;
    --card: #14172e;
    --card2: #1b1f3a;
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
    --bar: rgba(14, 16, 34, 0.88);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif; -webkit-text-size-adjust: 100%; }
body { background: radial-gradient(120% 380px at 50% -80px, rgba(240, 70, 40, 0.1) 0%, rgba(0, 0, 0, 0) 100%), var(--bg); min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
.loading { text-align: center; color: var(--ink2); padding: 80px 16px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 12px 16px 96px; }

/* 单色图标：形状做遮罩，颜色跟字 */
.gl { display: inline-block; flex: none; width: 1.25em; height: 1.25em; background: currentColor; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; vertical-align: -0.25em; }

/* 顶栏：标志 + 焰狸 + 这一页 */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--bar); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); }
.top .logo { width: 30px; height: 30px; }
.top .brand { font-weight: 800; font-size: 19px; color: var(--red); letter-spacing: 1px; }
.top .sep { width: 1px; height: 16px; background: var(--line); }
.top h1 { font-size: 16px; margin: 0; flex: 1; font-weight: 600; }
.top button { background: var(--card2); color: var(--ink2); border: 1px solid var(--line); border-radius: 16px; height: 32px; padding: 0 14px; font-size: 13px; }

/* 底部 Tab：单色图标 + 字，选中红色 */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; background: var(--bar); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); border-radius: 18px 18px 0 0; -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08); }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; height: 60px; color: var(--ink3); font-size: 12px; }
.tabs button .gl { font-size: 19px; }
.tabs button.on { color: var(--red); font-weight: 700; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card h2 { font-size: 16px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.card h2::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--brand); transform: rotate(45deg); flex: none; }
.muted { color: var(--ink2); }
.small { font-size: 12px; }

/* 选日子 */
.daybar { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.daybar input { flex: 1; height: 40px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--card); min-width: 0; }
.daybar button, .btn { height: 40px; padding: 0 16px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; }
.btn.primary { background: var(--brand); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 8px 22px rgba(232, 40, 30, 0.3); }
.btn:disabled, .daybar button:disabled { opacity: 0.45; }

/* 汇总大卡：夜空到暖红，右上一朵烟花（两套主题一样） */
.big { position: relative; overflow: hidden; background: var(--night); border: 1px solid rgba(255, 170, 120, 0.3); color: #fff6e6; }
.big::after { content: ''; position: absolute; right: -40px; top: -50px; width: 220px; height: 220px; background: url(/brand/hero.jpg) 78% 10% / 520px auto no-repeat; opacity: 0.35; border-radius: 50%; -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%); pointer-events: none; }
.big > * { position: relative; z-index: 1; }
.big .muted { color: rgba(255, 246, 230, 0.75); }
.big .kpi b { color: #ffe08a; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.kpi { min-width: 0; }
.kpi small { display: block; font-size: 12px; opacity: 0.8; }
/* 手机上半格只有 150 来像素：¥123,456.5 这种大数字跟着屏宽缩，还放不下就折行，不撑出卡片 */
.kpi b { display: block; font: 800 clamp(17px, 5.4vw, 22px)/1.2 var(--mono); overflow-wrap: anywhere; }
.kpi.lead b { font-size: clamp(22px, 6.6vw, 32px); }

.store { cursor: pointer; transition: transform 0.12s; }
.store h2::before, .card h2:has(> .dot)::before { display: none; }
.store:active { transform: scale(0.99); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #aaa; display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 12px; background: var(--gold-l); color: var(--gold); }
.chip.red { background: var(--red-l); color: var(--red); }
.chip.ok { background: var(--green-l); color: var(--green); }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.row:last-child { border-bottom: 0; }
.row b { font-family: var(--mono); white-space: nowrap; }

/* 柱状图：红色渐变 */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin: 6px 0; }
.bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.bars i { display: block; width: 100%; background: linear-gradient(180deg, #ff7a45 0%, #e0261d 100%); border-radius: 4px 4px 0 0; min-height: 2px; opacity: 0.85; }
.bars small { font-size: 10px; color: var(--ink3); }
.hbar { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 8px; margin: 7px 0; }
.hbar .bar { height: 8px; background: var(--card2); border-radius: 4px; overflow: hidden; }
.hbar .bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.hbar b { font-family: var(--mono); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--card); border-radius: 16px; height: 32px; padding: 0 14px; font-size: 13px; }
.seg button.on { background: var(--brand); border-color: transparent; color: #fff; font-weight: 600; }

/* 登录：夜空主视觉 + 毛玻璃登录卡（两套主题都是夜空） */
/* 登录页：和官网一个样子（浅色、小狐狸大图、橙色圆角按钮），不跟深色模式变 */
.gate { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr); background: #fff; color: #0f1d3a; }
.gate__side { position: relative; overflow: hidden; background: #f5f7fb; }
.gate__pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 74% 100%; }
.gate__side::after { content: ''; position: absolute; inset: 0; background: radial-gradient(70% 45% at 0% 0%, rgba(248, 250, 253, 0.95) 0%, rgba(248, 250, 253, 0.7) 45%, rgba(248, 250, 253, 0) 100%); }
.gate__say { position: absolute; z-index: 1; left: 7%; top: 8%; }
.gate__eb { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.16em; color: #f26a1b; }
.gate__h { margin: 12px 0 0; font-size: clamp(32px, 3.4vw, 50px); font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; }
.gate__main { display: flex; flex-direction: column; padding: 32px clamp(28px, 6vw, 88px); }
.gate__logo { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.gate__logo img { width: 32px; height: 32px; border-radius: 8px; }
.gate__logo b { font-size: 19px; letter-spacing: 0.04em; }
.gate__logo small { font-size: 12px; color: #7a8599; padding-top: 3px; }
.gate form { width: 100%; max-width: 400px; margin: auto 0; padding: 40px 0; }
.gate h1 { margin: 12px 0 0; font-size: 38px; font-weight: 800; letter-spacing: -0.01em; color: #0f1d3a; }
.gate__sub { margin: 8px 0 26px; color: #3c4a63; font-size: 15px; }
.gate label { display: block; margin-top: 16px; font-size: 13px; font-weight: 600; color: #3c4a63; }
.gate input { display: block; width: 100%; height: 52px; margin-top: 8px; padding: 0 18px; border: 0; border-radius: 14px; background: #f3f5f9; box-shadow: inset 0 0 0 1px #e4e9f0; color: #0f1d3a; font-size: 16px; outline: none; transition: box-shadow 0.2s, background 0.2s; }
.gate input::placeholder { color: #a3acbb; }
.gate input:focus { background: #fff; box-shadow: inset 0 0 0 2px #f26a1b; }
.gate__err { margin: 14px 0 0; color: #d6352b; font-size: 14px; }
.gate__btn { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 54px; margin-top: 26px; padding: 0 12px 0 24px; border: 0; border-radius: 999px; background: #f26a1b; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: 0 10px 24px -10px rgba(242, 106, 27, 0.7); transition: background 0.2s, transform 0.2s; }
.gate__btn span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); }
.gate__btn:hover { background: #e85f10; transform: translateY(-1px); }
.gate__btn:disabled { opacity: 0.6; pointer-events: none; }
.gate__note { margin: 18px 0 0; font-size: 14px; color: #7a8599; }
.gate__note a, .gate__foot a { color: #f26a1b; font-weight: 600; text-decoration: none; }
.gate__foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 13px; color: #7a8599; }
.gate__foot > a { color: #3c4a63; font-weight: 500; }
@media (max-width: 860px) {
  .gate { display: block; }
  .gate__side { height: 46vw; min-height: 200px; max-height: 340px; }
  .gate__side::after { background: linear-gradient(180deg, rgba(255, 255, 255, 0) 60%, #fff 100%); }
  .gate__say { display: none; }
  .gate__pic { object-position: 78% 30%; }
  .gate__main { padding: 0 22px 28px; }
  .gate__logo { margin-top: -6px; position: relative; z-index: 1; }
  .gate form { margin: 0; padding: 24px 0 30px; }
  .gate h1 { font-size: 30px; }
}

.err { color: var(--red); }
.warn { color: var(--gold); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--ink2); font-size: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
td.r, th.r { text-align: right; font-family: var(--mono); }
.state-out, .state-negative { color: var(--red); font-weight: 600; }
.state-low { color: var(--gold); font-weight: 600; }
.back { background: none; border: 0; color: var(--red); padding: 0; margin: 8px 0 0; }
pre.text { white-space: pre-wrap; font: 13px/1.6 inherit; background: var(--card2); padding: 12px; border-radius: 12px; margin: 0; }
.foot { text-align: center; margin-top: 24px; }
.foot img { display: block; width: 84px; height: 78px; margin: 0 auto 4px; }

/* 管理（商户自助后台） */
.ok { color: var(--green); }
/* 管理里点了按钮的结果：贴在底部 Tab 上面，手机上点在页面下面也看得见；点一下收起 */
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 6; max-width: 736px; margin: 0 auto; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; }
button.mini { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 3px 10px; font-size: 12px; }
button.mini:disabled { opacity: 0.5; }
.card input, .card select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; background: var(--card); box-sizing: border-box; }
.card label.small { display: block; margin: 8px 0 4px; color: var(--ink2); }
.card table select { padding: 4px; font-size: 12px; }
/* 加店员：电脑上一行；手机上称呼一行、角色和口令一行、按钮整行在下面，手指好点 */
.add-staff { display: flex; gap: 8px; align-items: center; }
.card .add-staff input, .card .add-staff select { height: 44px; padding: 0 12px; font-size: 16px; min-width: 0; }
.add-staff .name { flex: 1; }
.add-staff .pin { width: 130px; }
.add-staff .btn { height: 44px; flex: none; }
@media (max-width: 560px) {
  .add-staff { display: grid; grid-template-columns: 1fr 1fr; }
  .add-staff .name, .add-staff .btn { grid-column: 1 / -1; }
  .add-staff .pin { width: auto; }
  .add-staff .btn { width: 100%; height: 46px; font-size: 16px; }
}
.big-code { margin-top: 10px; font-size: 15px; }
.big-code b { font-family: var(--mono); font-size: 22px; letter-spacing: 2px; color: var(--red); }
/* 续费 */
.due { background: var(--red-l); color: var(--red); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; font-size: 14px; cursor: pointer; }
.pay-box { text-align: center; }
.pay-box .qr { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.pay-box .qr svg { display: block; width: 220px; height: 220px; }

/* 问焰狸 */
.ask { display: flex; flex-direction: column; gap: 10px; }
.ask-list { display: flex; flex-direction: column; gap: 10px; min-height: 40vh; }
.ask-msg { display: flex; align-items: flex-end; gap: 8px; }
.ask-msg.me { justify-content: flex-end; }
.ask-ava { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--card2); flex: none; }
.ask-bubble { max-width: 82%; padding: 10px 13px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 15px; line-height: 1.6; white-space: pre-wrap; }
.ask-msg.ai .ask-bubble { border-bottom-left-radius: 4px; }
.ask-msg.me .ask-bubble { background: var(--red); border-color: var(--red); color: #fff; border-bottom-right-radius: 4px; }
.ask-by { display: block; margin-top: 4px; font-size: 11px; color: var(--ink3); }
.ask-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.ask-chips button { flex: none; padding: 6px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--card2); color: var(--ink); font-size: 13px; }
.ask-foot { position: sticky; bottom: 64px; padding: 8px 0 6px; background: var(--bg); }
.ask-bar { display: flex; gap: 8px; margin-top: 8px; }
.ask-bar input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 15px; }

/* 报表里燃放秀一节的小标题 */
.card h3.sub { margin: 14px 0 6px; font-size: 14px; color: var(--ink2); font-weight: 600; }

/* 顾客评价 */
.rv-item { padding: 10px 0; border-top: 1px solid var(--line); }
.rv-text { margin: 4px 0; font-size: 15px; line-height: 1.5; }
.rv-act { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.rv-act .btn { padding: 4px 12px; font-size: 13px; }
.rv-act span { flex: 1; }
