:root { --bg: #f6f3f1; --card: #fff; --line: #e4dcd7; --text: #221a17; --muted: #7d6e66; --red: #c8102e; --pending: #b7791f; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
[hidden] { display: none !important; }
a { color: var(--red); }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { margin: 0; }
.muted { color: var(--muted); }
.error { color: var(--red); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
.grid { display: grid; gap: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
input, select, textarea { font: inherit; color: var(--text); padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
label.check input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 8px; padding: 10px 12px; }
legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
button.primary { background: var(--red); border-color: var(--red); color: #fff; }
button.danger { color: var(--red); border-color: #f0c7cd; }
button.link { border: 0; background: none; color: var(--muted); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login form { width: 100%; max-width: 360px; display: grid; gap: 12px; }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #221a17; color: #fff; flex-wrap: wrap; }
.bar a { color: #f3c7cd; font-size: 14px; }
.bar nav { display: flex; gap: 4px; }
.bar nav button { background: none; border: 0; color: #cbbdb5; }
.bar nav button.active { background: rgba(255,255,255,.12); color: #fff; }
.bar .who { margin-left: auto; font-size: 13px; color: #cbbdb5; }
.bar .link { color: #cbbdb5; }
main { max-width: 900px; margin: 0 auto; padding: 16px; }

.cat h3 { margin: 18px 0 6px; font-size: 16px; display: flex; gap: 8px; align-items: baseline; }
.items { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.item:first-child { border-top: 0; }
.item:hover { background: #fbf8f6; }
.item .n { flex: 1; min-width: 0; }
.item .n small { display: block; color: var(--muted); }
.item .p { font-weight: 600; white-space: nowrap; }
.item .p.pending, .missing { color: var(--pending); font-size: 13px; font-weight: 400; }
.item.off { opacity: .5; }
.empty-items { padding: 12px 14px; color: var(--muted); }
.cat-row { display: grid; grid-template-columns: 1fr 1fr 1fr 70px auto auto; gap: 6px; align-items: center; margin: 6px 0; }
dialog { border: 0; border-radius: 14px; padding: 18px; width: min(560px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(0,0,0,.4); }
.hours-row { display: grid; grid-template-columns: 60px 1fr; gap: 8px; align-items: center; }
@media (max-width: 600px) { .cat-row { grid-template-columns: 1fr 1fr; } }

/* ---------- 预约后台 ---------- */
main { max-width: 1200px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.toolbar input, .toolbar select { width: auto; }
.toolbar input[type=search] { flex: 1; min-width: 160px; }
table.list { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 14px; }
table.list th { text-align: left; font-weight: 600; color: var(--muted); background: #faf7f5; padding: 8px; }
table.list td { padding: 8px; border-top: 1px solid var(--line); vertical-align: top; }
table.list tr.row { cursor: pointer; }
table.list tr.row:hover { background: #fbf8f6; }
table.list tr.sep td { background: #f1ebe7; font-weight: 700; color: var(--text); }
table.list td.notes { max-width: 260px; color: var(--muted); font-size: 13px; }
.st-row-cancelled, .st-row-no_show { opacity: .5; }
.b { font-weight: 600; }
.small { font-size: 13px; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; margin-left: 4px; background: #eee; white-space: nowrap; }
.badge.st-pending { background: #fff4d6; color: #8a5a00; }
.badge.st-confirmed { background: #e3f1ff; color: #0b5cad; }
.badge.st-seated { background: #ffe1e5; color: #a3001d; }
.badge.st-completed { background: #e4f6e6; color: #22702b; }
.badge.st-cancelled, .badge.st-no_show { background: #eee; color: #777; }
.badge.vip { background: #fff0c2; color: #8a6100; }
.badge.bad { background: #ffe1e1; color: #b00; }
.badge.warn { background: #fff0e0; color: #9a4b00; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mh { text-align: center; color: var(--muted); font-size: 13px; padding: 4px; }
.md { background: #fff; border: 1px solid var(--line); border-radius: 8px; min-height: 84px; padding: 6px; cursor: pointer; font-size: 12px; }
.md:hover { border-color: var(--red); }
.md.empty { background: none; border: 0; cursor: default; }
.md.today { border-color: var(--red); border-width: 2px; }
.mdn { font-weight: 700; font-size: 14px; }
.mds { color: var(--muted); }
.mds.bad { color: #b00; }
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tcard { border-radius: 12px; padding: 10px; border: 2px solid; background: #fff; }
.tcard.free { border-color: #4caf50; }
.tcard.booked { border-color: #f0a030; background: #fff8ec; }
.tcard.seated { border-color: #d9263b; background: #fff0f2; }
.tcard.blocked { border-color: #999; background: #f0f0f0; }
.tcode { font-size: 20px; font-weight: 800; }
.tday { margin-top: 6px; display: grid; gap: 3px; }
.tslot { font-size: 12px; padding: 3px 6px; border-radius: 6px; background: #f3efec; cursor: pointer; }
.tslot.st-seated { background: #ffe1e5; }
.tslot.st-completed { background: #e4f6e6; }
.tslot.st-pending { background: #fff4d6; }
.tslot.blocked { background: #e2e2e2; }
dialog.wide { width: min(720px, calc(100vw - 16px)); max-height: 92vh; }
dialog .close { position: sticky; top: 0; float: right; font-size: 18px; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px; margin: 8px 0; }
.tpick .busy { color: #b00; }
.slotline { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin: 4px 0; }
.slot { padding: 2px 6px; font-size: 12px; }
.slot.off { opacity: .35; text-decoration: line-through; }
.wrow { display: grid; gap: 6px; }
.print-title { font-size: 18px; margin: 4px 0; }
details > summary { cursor: pointer; font-weight: 600; }
@media print {
  .bar, .no-print, .toolbar, #tabs { display: none !important; }
  .print-title { display: block; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  table.list { font-size: 12px; border: 0; }
  table.list tr.row:hover { background: none; }
}
@media (max-width: 700px) {
  table.list th:nth-child(7), table.list td:nth-child(7), table.list th:nth-child(8), table.list td:nth-child(8) { display: none; }
  .md { min-height: 60px; font-size: 10px; }
}

/* ---------- 发票 ---------- */
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
td.num, .num { text-align: right; white-space: nowrap; }
.preview { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; object-fit: contain; background: #fafafa; }
a.btnlink { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; margin: 0 4px; color: var(--text); }
#i-stats .two > div { font-size: 13px; }
@media (max-width: 600px) { .three { grid-template-columns: 1fr; } .two { grid-template-columns: 1fr; } }

/* ---------- 记账 ---------- */
.subtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.subtabs button.active { background: var(--red); color: #fff; border-color: var(--red); }
.card.narrow { max-width: 560px; }
.quick .big, input.big { font-size: 28px; font-weight: 700; padding: 12px; }
button.big { font-size: 17px; padding: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 10px; font-weight: 600; }
.seg button.sel { background: var(--text); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.chip.sel { background: var(--red); border-color: var(--red); color: #fff; }
.ok { color: #22702b; }
.dayhead { display: flex; justify-content: space-between; padding: 10px 4px 4px; border-bottom: 2px solid var(--line); margin-top: 8px; }
.lrow { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; }
.lrow:hover { background: #fbf8f6; }
.lcat { min-width: 84px; font-weight: 600; font-size: 14px; }
.lmid { flex: 1; min-width: 0; display: grid; }
.lmid small { font-size: 12px; }
.lamt { font-weight: 700; white-space: nowrap; }
.lamt.income, .kv-big.income { color: #22702b; }
.lamt.expense, .kv-big.expense { color: #a3001d; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.kv-big { font-size: 26px; font-weight: 800; }
@media (max-width: 600px) { .kpis { grid-template-columns: 1fr; } .lcat { min-width: 64px; } }

/* ---------- 手机优化（员工在店里用手机看） ---------- */
@media (max-width: 700px) {
  .bar { gap: 8px; padding: 8px 12px; }
  .bar nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .bar nav::-webkit-scrollbar { display: none; }
  .bar nav button { white-space: nowrap; flex: none; padding: 8px 12px; }
  .bar .who { margin-left: auto; }
  main { padding: 10px; }
  .floor { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .tcard { padding: 6px; border-radius: 10px; min-height: 76px; }
  .tcode { font-size: 18px; }
  .tcard .small { font-size: 11px; line-height: 1.25; }
  .tday { display: none; }
  .toolbar input, .toolbar select, .toolbar button { font-size: 14px; }
}

/* ---------- 时间轴 ---------- */
.tl-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.tl { width: calc(var(--w) + 64px); }
.tl-row { display: flex; border-top: 1px solid #efe8e3; min-height: 46px; }
.tl-head { border-top: 0; min-height: 30px; position: sticky; top: 0; background: #faf7f5; z-index: 3; }
.tl-label { position: sticky; left: 0; z-index: 2; flex: none; width: 64px; background: #faf7f5; border-right: 1px solid var(--line); display: grid; align-content: center; justify-items: center; font-size: 13px; }
.tl-label b { font-size: 17px; }
.tl-label small { color: var(--muted); font-size: 11px; }
.tl-track { position: relative; flex: none; width: var(--w); }
.tl-tick { position: absolute; top: 7px; font-size: 11px; color: var(--muted); transform: translateX(-50%); }
.tl-line { position: absolute; top: 0; bottom: 0; width: 1px; background: #f1ebe7; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: #d9263b; z-index: 1; }
.tl-bar { position: absolute; top: 5px; bottom: 5px; border-radius: 8px; padding: 2px 6px; font-size: 12px; line-height: 1.25; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; border: 1px solid rgba(0,0,0,.08); }
.tl-bar.st-pending, .tl-bar.st-confirmed { background: #ffe2b8; color: #6b3d00; }
.tl-bar.st-seated { background: #ffc9cf; color: #7a0012; }
.tl-bar.st-completed { background: #d9f2dc; color: #1d5e25; }
.tl-bar.blocked { background: repeating-linear-gradient(45deg, #e6e6e6 0 6px, #d6d6d6 6px 12px); color: #555; }

/* ---------- 后台视觉升级 ---------- */
body { background: #f3eee8; }
.bar { background: linear-gradient(110deg, #201412, #321719); box-shadow: 0 4px 18px rgba(35,15,8,.18); padding: 12px clamp(12px, 3vw, 28px); }
.bar nav button { border-radius: 999px; padding: 8px 12px; }
.bar nav button.active { background: #c5162e; color: #fff; }
main { padding-top: 24px; }
.card, .items, table.list, .tl-wrap, .kpi { border-color: #e5d9ce; box-shadow: 0 8px 24px rgba(50,25,12,.06); }
button { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
button:hover { transform: translateY(-1px); border-color: #c5162e; }
button.primary { background: #c5162e; box-shadow: 0 6px 15px rgba(197,22,46,.18); }
.desk { box-shadow: 0 14px 34px rgba(25,15,8,.12); }
.dk-new { background: #f0bf36; box-shadow: 0 6px 14px rgba(240,191,54,.18); }
.dk-main { gap: 18px; }
.dk-svc, .dk-date { box-shadow: 0 5px 14px rgba(0,0,0,.12); }
@media (max-width: 700px) { .bar { position: sticky; } main { padding-top: 14px; } }

/* ---------- 强化版后台：专业餐厅运营工作台 ---------- */
body { background: #eee7df; }
.bar { min-height: 70px; background: #1d1513; padding-inline: clamp(14px, 4vw, 42px); }
.bar nav { gap: 6px; overflow-x: auto; }
.bar nav button { padding: 9px 14px; color: #bca99d; }
.bar nav button.active { background: #c5162e; box-shadow: 0 5px 14px rgba(197,22,46,.28); }
main { max-width: 1280px; padding: 28px clamp(14px, 4vw, 44px); }
.desk { margin: 0; padding: 20px; border-radius: 26px; background: #171311; box-shadow: 0 20px 50px rgba(38,18,10,.22); }
.dk-top input[type=search] { background: #29211d; border-color: #45352c; min-height: 48px; }
.dk-new { min-height: 48px; padding-inline: 22px; }
.dk-walk { min-height: 48px; }
.dk-svcs { gap: 12px; margin-block: 16px; }
.dk-svc { min-height: 78px; padding: 14px 16px; border-radius: 18px; background: #28201c; }
.dk-svc.on { background: #38271e; box-shadow: inset 0 0 0 1px #f5c518; }
.dk-main { gap: 18px; }
.dk-plan, .dk-list { border-radius: 20px; }
.card, .items, table.list, .tl-wrap, .kpi { border-radius: 18px; }
.card { padding: 22px; }
@media (max-width: 700px) { .bar { min-height: 62px; } .bar nav button { padding: 8px 11px; } main { padding: 14px 10px; } .desk { padding: 12px; border-radius: 20px; } .dk-svcs { gap: 7px; } }

/* ===== 前台（深色，大按钮，手机/平板都好点） ===== */
.desk { --dk-bg:#16130f; --dk-card:#221d18; --dk-line:#3a322b; --dk-text:#f4ede6; --dk-muted:#a99a8c; --dk-acc:#f5c518;
  background: var(--dk-bg); color: var(--dk-text); border-radius: 18px; padding: 14px; margin: -8px -4px 0; }
.desk button { font: inherit; cursor: pointer; }
.dk-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dk-top input[type=search] { flex: 1 1 220px; min-width: 0; background: var(--dk-card); border: 1px solid var(--dk-line); color: var(--dk-text); border-radius: 999px; padding: 11px 16px; font-size: 15px; }
.dk-new { background: var(--dk-acc); color: #1b1300; border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 800; font-size: 15px; }
.dk-walk { background: transparent; color: var(--dk-acc); border: 1.5px solid var(--dk-acc); border-radius: 999px; padding: 10px 16px; font-weight: 700; font-size: 15px; }
.dk-date { display: flex; align-items: center; gap: 4px; margin-left: auto; background: var(--dk-card); border-radius: 999px; padding: 3px; }
.dk-date button { background: transparent; color: var(--dk-text); border: 0; width: 38px; height: 38px; border-radius: 50%; font-size: 22px; }
.dk-date button:hover { background: #2f2821; }
.dk-date span { font-weight: 700; padding: 0 6px; cursor: pointer; white-space: nowrap; }
.dk-date input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.dk-svcs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 8px; }
.dk-svcs.one { grid-template-columns: 1fr; }
.dk-svc { text-align: left; background: var(--dk-card); color: var(--dk-text); border: 1.5px solid var(--dk-line); border-radius: 14px; padding: 10px 14px; display: grid; gap: 2px; }
.dk-svc b { font-size: 16px; }
.dk-svc span { color: var(--dk-muted); font-size: 13px; }
.dk-svc.on { border-color: var(--dk-acc); }
.dk-svc.on b { color: var(--dk-acc); }
.dk-bar { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.dk-seg { display: inline-flex; background: var(--dk-card); border-radius: 999px; padding: 3px; }
.dk-seg button { background: transparent; color: var(--dk-muted); border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 700; }
.dk-seg button.on { background: var(--dk-acc); color: #1b1300; }
.dk-main { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 12px; align-items: start; }
.dk-list, .dk-plan { background: var(--dk-card); border-radius: 16px; padding: 10px; min-width: 0; }
.dk-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.dk-chips button { flex: none; background: transparent; color: var(--dk-muted); border: 1px solid var(--dk-line); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.dk-chips button.on { background: var(--dk-text); color: var(--dk-bg); border-color: var(--dk-text); }
.dk-rows { display: grid; gap: 6px; }
.dk-row { display: grid; grid-template-columns: 46px 1fr auto auto; gap: 10px; align-items: center; background: #2a241e; border-radius: 12px; padding: 8px 8px 8px 0; border-left: 5px solid #8a7a6b; cursor: pointer; }
.dk-row.st-confirmed { border-left-color: #f0a33a; }
.dk-row.st-pending { border-left-color: #e05d5d; }
.dk-row.st-seated { border-left-color: #3fbf6e; }
.dk-row.st-completed, .dk-row.st-no_show { opacity: .55; }
.dk-row.st-wait { border-left-color: #8e7cf0; }
.dk-tab { font-weight: 800; font-size: 17px; text-align: center; }
.dk-mid { min-width: 0; display: grid; }
.dk-mid b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-mid small { color: var(--dk-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-vip { background: var(--dk-acc); color: #1b1300; font-size: 10px; border-radius: 4px; padding: 1px 4px; margin-left: 6px; vertical-align: 2px; }
.dk-pax { font-weight: 700; color: var(--dk-muted); }
.dk-act { border: 0; border-radius: 10px; padding: 10px 12px; font-weight: 800; background: #3fbf6e; color: #06200f; min-width: 64px; }
.dk-act.completed { background: #4a4038; color: var(--dk-text); }
.dk-empty { color: var(--dk-muted); text-align: center; padding: 24px 0; }
.dk-pl-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.dk-tb { width: 92px; min-height: 84px; border-radius: 12px; border: 0; padding: 6px; display: grid; align-content: start; justify-items: start; text-align: left; gap: 1px; color: #fff; background: #5a4535; }
.dk-tb.big { width: 132px; }
.dk-tb-n { font-size: 20px; font-weight: 800; line-height: 1.1; }
.dk-tb-s { font-size: 12px; opacity: .85; }
.dk-tb-t { font-size: 13px; font-weight: 700; }
.dk-tb-name { font-size: 12px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-tb.booked { background: #c97a1c; }
.dk-tb.seated { background: #2f9e5a; }
.dk-tb.blocked { background: repeating-linear-gradient(45deg, #4a4038 0 6px, #3a322b 6px 12px); color: var(--dk-muted); }
.dk-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--dk-muted); font-size: 12px; margin-top: 6px; }
.dk-lg::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; background: #5a4535; }
.dk-lg.booked::before { background: #c97a1c; } .dk-lg.seated::before { background: #2f9e5a; } .dk-lg.blocked::before { background: #3a322b; }
.dk-tl { display: grid; gap: 4px; }
.dk-tl-row { display: flex; align-items: stretch; min-height: 34px; }
.dk-tl-head { min-height: 20px; }
.dk-tl-l { flex: none; width: 34px; font-weight: 800; align-self: center; }
.dk-tl-track { position: relative; flex: 1; background: #2a241e; border-radius: 8px; }
.dk-tl-head .dk-tl-track { background: transparent; }
.dk-tl-tick { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--dk-muted); }
.dk-tl-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; font-size: 11px; padding: 2px 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; background: #c97a1c; color: #fff; }
.dk-tl-bar.st-seated { background: #2f9e5a; } .dk-tl-bar.st-completed { background: #4a4038; color: var(--dk-muted); }
.dk-tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--dk-acc); }
@media (max-width: 800px) {
  .dk-main { grid-template-columns: 1fr; }
  .dk-date { margin-left: 0; width: 100%; justify-content: space-between; }
  .dk-top input[type=search] { flex-basis: 100%; }
  .dk-new, .dk-walk { flex: 1; }
  .dk-svc { padding: 8px 10px; }
  .dk-svc span { font-size: 12px; }
  .dk-pl-row { gap: 6px; margin-bottom: 6px; }
  .dk-tb { width: calc(25% - 5px); min-height: 70px; }
  .dk-tb.big { width: calc(50% - 3px); }
}

/* ===== 老板账本（清楚、大字、手机好按） ===== */
.fin { --fin-in: #1f9d55; --fin-out: #d9534f; --fin-iva: #3b6fd8; max-width: 1100px; margin: 0 auto; }
.fn-subs { display: flex; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.fn-subs button { flex: 1 0 auto; border: 0; background: transparent; border-radius: 999px; padding: 11px 16px; font: inherit; font-weight: 700; font-size: 16px; color: var(--muted); cursor: pointer; }
.fn-subs button.on { background: var(--text); color: #fff; }
.fn-panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.fn-panel h3 { margin: 0 0 12px; font-size: 17px; }
.fn-muted { color: var(--muted); } .fn-muted.small, .fn-panel .small { font-size: 13px; } .fn-center { text-align: center; padding: 18px 0; }
.fn-period { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fn-seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.fn-seg button { border: 0; background: transparent; border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 700; font-size: 16px; color: var(--muted); cursor: pointer; }
.fn-seg button.on { background: var(--red); color: #fff; }
.fn-nav { display: flex; align-items: center; gap: 8px; }
.fn-nav b { font-size: 17px; min-width: 120px; text-align: center; }
.fn-nav button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.fn-search { flex: 1 1 200px; max-width: 320px; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; font: inherit; }
.fn-hero { border-radius: 22px; padding: 22px; color: #fff; display: grid; gap: 2px; margin-bottom: 12px; }
.fn-hero.win { background: linear-gradient(135deg, #1f9d55, #15803d); }
.fn-hero.loss { background: linear-gradient(135deg, #e05d5d, #b91c1c); }
.fn-hero span { font-size: 18px; font-weight: 700; opacity: .95; }
.fn-hero b { font-size: 44px; line-height: 1.1; letter-spacing: -.5px; }
.fn-hero small { opacity: .85; }
.fn-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 6px; }
.fn-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 2px; border-top: 5px solid #999; }
.fn-card.in { border-top-color: var(--fin-in); } .fn-card.out { border-top-color: var(--fin-out); } .fn-card.iva { border-top-color: var(--fin-iva); }
.fn-card span { color: var(--muted); font-weight: 700; } .fn-card b { font-size: 24px; } .fn-card small { color: var(--muted); font-size: 12px; }
.fn-chart { display: flex; align-items: flex-end; gap: 3px; height: 170px; overflow-x: auto; padding-bottom: 2px; }
.fn-col { flex: 1 0 14px; display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; min-width: 14px; }
.fn-bars { display: flex; align-items: flex-end; justify-content: center; gap: 1px; }
.fn-bars i { display: block; width: 45%; max-width: 14px; border-radius: 3px 3px 0 0; min-height: 1px; }
.fn-bars i.in, .fn-legend .in::before, .fn-line i.in { background: var(--fin-in); }
.fn-bars i.out, .fn-legend .out::before, .fn-line i.out { background: var(--fin-out); }
.fn-col small { font-size: 10px; color: var(--muted); }
.fn-legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin: -6px 0 8px; }
.fn-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.fn-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fn-line { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid #f1ebe7; }
.fn-line em { font-style: normal; font-size: 11px; color: var(--muted); background: #f4efeb; border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.fn-line i { grid-column: 1 / -1; height: 5px; border-radius: 3px; opacity: .75; }
.fn-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.fn-btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; padding: 13px 24px; font: inherit; font-weight: 800; font-size: 16px; background: var(--red); color: #fff; cursor: pointer; text-decoration: none; }
.fn-btn:disabled { opacity: .5; }
.fn-btn.ghost { background: #fff; color: var(--text); border: 1.5px solid var(--line); }
.fn-btn.danger { background: #fff; color: var(--red); border: 1.5px solid #f2c4c9; }
.fn-btn.small { padding: 7px 14px; font-size: 13px; font-weight: 700; }
.fn-link { background: none; border: 0; color: var(--red); font: inherit; font-weight: 700; padding: 8px 0; cursor: pointer; display: inline-block; }
.fn-form .fn-field { display: grid; gap: 6px; margin-bottom: 12px; }
.fn-field > span, .fn-label { font-weight: 700; font-size: 14px; color: var(--muted); }
.fn-field small { color: var(--muted); font-size: 12px; }
.fn-form input:not([type=file]), .fn-form select { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; font-size: 16px; background: #fff; width: 100%; box-sizing: border-box; }
.fn-form input.fn-big { font-size: 28px; font-weight: 800; padding: 12px 14px; }
.fn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fn-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fn-chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 15px; font: inherit; font-size: 15px; cursor: pointer; }
.fn-chip.on { background: var(--text); color: #fff; border-color: var(--text); }
.fn-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.fn-kind { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 14px; text-align: left; display: grid; gap: 2px; cursor: pointer; font: inherit; }
.fn-kind b { font-size: 20px; } .fn-kind small { color: var(--muted); }
.fn-kind.income.on { border-color: var(--fin-in); background: #effaf3; } .fn-kind.income.on b { color: var(--fin-in); }
.fn-kind.expense.on { border-color: var(--fin-out); background: #fdf1f1; } .fn-kind.expense.on b { color: var(--fin-out); }
.fn-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #faf8f6; border: 1px solid #efe8e3; border-radius: 14px; padding: 10px 12px; margin-bottom: 6px; font: inherit; cursor: pointer; }
.fn-item.void { opacity: .5; }
.fn-date { flex: none; font-weight: 800; min-width: 52px; color: var(--muted); }
.fn-mid { flex: 1; min-width: 0; display: grid; }
.fn-mid b, .fn-mid small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fn-mid small { color: var(--muted); font-size: 12px; }
.fn-amt { flex: none; font-size: 16px; }
.fn-item.income .fn-amt { color: var(--fin-in); } .fn-item.expense .fn-amt { color: var(--text); }
.fn-thumb { flex: none; width: 48px; height: 48px; border-radius: 10px; background: #eee center/cover; display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.fn-upload { text-align: center; }
.fn-drop { display: grid; gap: 6px; border: 2.5px dashed #e5b9bf; background: #fff7f8; border-radius: 18px; padding: 28px 16px; cursor: pointer; }
.fn-drop b { font-size: 20px; color: var(--red); } .fn-drop small { color: var(--muted); }
.fn-month { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 4px 14px 10px; margin-bottom: 12px; }
.fn-month summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; }
.fn-month summary::-webkit-details-marker { display: none; }
.fn-month summary b { font-size: 19px; } .fn-month summary span { color: var(--muted); font-size: 14px; }
.fn-day { font-size: 13px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; }
.fn-inv { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.fn-preview img { width: 100%; border-radius: 12px; display: block; margin-bottom: 8px; cursor: zoom-in; }
.fn-preview object { width: 100%; height: 520px; border-radius: 12px; }
.fn-ocr { margin: -4px 0 12px; font-size: 14px; border-radius: 12px; padding: 0; }
.fn-ocr.busy, .fn-ocr.ok, .fn-ocr.warn { padding: 10px 12px; }
.fn-ocr.busy { background: #eef3ff; color: #2c4fa3; } .fn-ocr.ok { background: #effaf3; color: #166534; } .fn-ocr.warn { background: #fff7e6; color: #8a5300; }
.fn-lrow { display: grid; grid-template-columns: 1fr 60px 100px 76px 36px; gap: 6px; margin-bottom: 6px; }
.fn-lrow input, .fn-lrow select { padding: 10px !important; }
.fn-x { border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
.fn-total { font-size: 20px; font-weight: 800; margin-top: 8px; }
.fn-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1b1b1b; color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700; z-index: 99; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .4s; max-width: 90vw; text-align: center; }
.fn-toast.bad { background: #b91c1c; } .fn-toast.out { opacity: 0; }
@media (max-width: 760px) {
  .fn-cards, .fn-two, .fn-inv { grid-template-columns: 1fr; }
  .fn-hero b { font-size: 36px; }
  .fn-period { flex-direction: column; align-items: stretch; }
  .fn-seg { justify-content: space-between; } .fn-seg button { flex: 1; }
  .fn-nav { justify-content: space-between; }
  .fn-search { max-width: none; }
  .fn-lrow { grid-template-columns: 1fr 50px 80px 36px; } .fn-lrow input:first-child { grid-column: 1 / -1; } .fn-lrow select { display: none; }
  .fn-item .fn-btn.small { padding: 6px 10px; }
}

/* 前台：点一下的操作面板、换桌/现场客提示 */
.dk-sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.dk-sheet { background: #221d18; color: #f4ede6; width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.4); max-height: 85vh; overflow: auto; }
@media (min-width: 801px) { .dk-sheet-bg { align-items: center; } .dk-sheet { border-radius: 22px; } }
.dk-sheet h3 { margin: 0 0 6px; font-size: 22px; }
.dk-sheet p { margin: 4px 0; color: #cbbcae; }
.dk-call { display: inline-block; margin: 6px 0; color: #f5c518; font-weight: 800; font-size: 18px; text-decoration: none; }
.dk-sheet-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 8px; }
.dk-sb { border: 0; border-radius: 14px; padding: 16px 10px; font: inherit; font-size: 17px; font-weight: 800; background: #3a322b; color: #f4ede6; cursor: pointer; }
.dk-sb.go { background: #3fbf6e; color: #06200f; grid-column: 1 / -1; font-size: 19px; }
.dk-sb.warn { background: #6b4a1c; color: #ffd89a; }
.dk-sb.bad { background: #5a1f1f; color: #ffb4b4; }
.dk-sb.num { background: #f5c518; color: #1b1300; font-size: 22px; }
.dk-sb.close { width: 100%; background: transparent; border: 1.5px solid #3a322b; color: #a99a8c; }
.dk-sb:disabled { opacity: .5; }
.dk-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f5c518; color: #1b1300; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; font-size: 16px; }
.dk-banner[hidden] { display: none; }
.dk-banner button { border: 0; background: #1b1300; color: #f5c518; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 800; cursor: pointer; }
.dk-tb.dim { opacity: .3; }
.dk-tb.pick { outline: 3px solid #f5c518; outline-offset: 2px; animation: dkpulse 1.2s ease-in-out infinite; }
@keyframes dkpulse { 50% { outline-color: rgba(245,197,24,.35); } }

/* 语言切换：ES / 中文 */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.12); margin-left: auto; }
.lang-switch button { border: 0; background: transparent; color: inherit; border-radius: 999px; padding: 6px 12px; font: 700 13px system-ui, sans-serif; cursor: pointer; opacity: .75; }
.lang-switch button.on { background: #f5c518; color: #1b1300; opacity: 1; }
.login .lang-switch { background: #eee; margin: 0 0 12px; }

/* 拼桌 */
.dk-tb.joined { outline: 3px solid #3fbf6e; outline-offset: 2px; }
.dk-tb-join { font-size: 11px; font-weight: 800; background: rgba(0,0,0,.35); border-radius: 6px; padding: 1px 6px; margin-top: 2px; }
.dk-banner b { flex: 1; }
.dk-banner button + button { margin-left: 6px; }
.dk-banner { flex-wrap: wrap; } .dk-banner b { flex: 1 1 100%; } @media (min-width: 801px) { .dk-banner b { flex: 1; } }
.dk-tb-since { font-size: 12px; font-weight: 800; background: rgba(0,0,0,.3); border-radius: 6px; padding: 1px 6px; margin-top: 2px; } .dk-tb-since.over { background: #d92d3a; }
