/* 广府鲜骨渔粉 · 商家端（门店后台） */
:root {
  --brand: #C8402F; --brand-dark: #A93323; --gold: #F5A623;
  --bg: #F4F5F8; --card: #fff; --line: #EAECF1;
  --text: #22242A; --muted: #8A8E99;
  --sidebar: #241A15; --sidebar-act: #D8432F;
  --green: #07C160; --blue: #3B7CFF; --orange: #F5A623;
  --shadow: 0 1px 3px rgba(16, 20, 34, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
button { font-family: inherit; border: none; cursor: pointer; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; outline: none; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: #D4D7DE; border-radius: 4px; }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #2A1512, #4A221B 45%, #1E1410);
  position: relative; overflow: hidden;
}
.login-page::before { content: '🍜'; position: absolute; font-size: 340px; opacity: .06; right: -40px; bottom: -80px; }
.login-wrap { display: flex; gap: 72px; align-items: center; position: relative; z-index: 1; padding: 40px 24px; }
.login-brand { display: none; color: #fff; max-width: 420px; }
.login-brand .big { font-size: 30px; font-weight: 800; line-height: 1.5; }
.login-brand .big em { font-style: normal; color: #F5A623; }
.login-brand .sub { font-size: 13px; color: rgba(255,255,255,.5); letter-spacing: 3px; margin-top: 10px; }
.login-brand ul { list-style: none; margin-top: 28px; }
.login-brand li { font-size: 14.5px; color: rgba(255,255,255,.85); line-height: 2.4; display: flex; gap: 10px; align-items: center; }
.login-brand li::before { content: '✓'; width: 20px; height: 20px; border-radius: 50%; background: rgba(245,166,35,.25); color: #F5A623; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
@media (min-width: 1100px) { .login-brand { display: block; } }
.login-card { width: 380px; background: #fff; border-radius: 18px; padding: 36px 34px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.login-card .logo { text-align: center; font-size: 40px; }
.login-card h1 { text-align: center; font-size: 20px; margin: 8px 0 2px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 24px; letter-spacing: 1px; }
.fld { margin-bottom: 14px; }
.fld label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.fld input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; transition: border .15s;
}
.fld input:focus { border-color: var(--brand); }
.btn-main { width: 100%; background: var(--brand); color: #fff; padding: 12px; border-radius: 9px; font-size: 15px; font-weight: 600; margin-top: 6px; }
.btn-main:hover { background: var(--brand-dark); }
.demo-tip { margin-top: 16px; background: #FBF4E7; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #7A5A1E; line-height: 1.8; }
.demo-tip code { background: #fff; padding: 1px 6px; border-radius: 4px; border: 1px solid #EAD9B0; }

/* ---------- 主框架 ---------- */
#frame { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 216px; background: var(--sidebar); color: #CBC4BF; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar .s-logo { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar .s-logo .t { font-weight: 700; color: #fff; font-size: 16px; }
.sidebar .s-logo .s { font-size: 11px; color: #9B8F88; margin-top: 3px; }
.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav .item {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 9px; margin-bottom: 3px;
  cursor: pointer; font-size: 14px; transition: all .15s; position: relative;
}
.nav .item:hover { background: rgba(255,255,255,.06); }
.nav .item.active { background: var(--sidebar-act); color: #fff; font-weight: 600; }
.nav .item .ic { width: 20px; text-align: center; }
.nav .item .badge { position: absolute; right: 10px; background: #E5484D; color: #fff; font-size: 10px; border-radius: 10px; padding: 1px 6px; }
.sidebar .s-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; }
.sidebar .s-foot .store { color: #fff; font-weight: 600; }
.sidebar .s-foot .st { margin-top: 5px; display: flex; align-items: center; gap: 6px; color: #9B8F88; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .35; } }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  padding: 0 22px; gap: 14px; flex-shrink: 0;
}
.topbar .crumb { font-size: 15px; font-weight: 700; }
.topbar .live { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); background: #F4F9F5; border: 1px solid #D9F0E1; border-radius: 14px; padding: 4px 12px; }
.topbar .user { font-size: 13px; color: var(--muted); }
.topbar .user b { color: var(--text); }
.topbar .logout { color: var(--muted); font-size: 12px; padding: 5px 9px; border-radius: 6px; }
.topbar .logout:hover { background: #F2F3F6; color: var(--brand); }
.content { flex: 1; overflow-y: auto; padding: 20px 22px 30px; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border-radius: 13px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h3.card-t { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h3.card-t::before { content: ''; width: 4px; height: 15px; background: var(--brand); border-radius: 2px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 300px; }
.btn { padding: 8px 16px; border-radius: 8px; font-size: 13px; transition: all .15s; min-height: 36px; }
.btn-p { background: var(--brand); color: #fff; } .btn-p:hover { background: var(--brand-dark); }
.btn-o { border: 1px solid var(--line); color: #555; background: #fff; } .btn-o:hover { border-color: var(--brand); color: var(--brand); }
.btn-g { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; min-height: 30px; }
.btn-danger { color: #E5484D; border: 1px solid #F3D6D6; background: #fff; }
.btn-danger:hover { background: #FDF1F1; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; padding: 11px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAF7F4; }
.table td { padding: 13px 10px; border-bottom: 1px solid #F4F5F8; vertical-align: middle; }
.table tbody tr:nth-child(even) td { background: #FCFAF8; }
.table tr:hover td { background: #FAF3EF; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 5px; font-size: 11.5px; font-weight: 600; }
.tag-red { background: #FDECE8; color: var(--brand); }
.tag-green { background: #E8F8EE; color: var(--green); }
.tag-blue { background: #EAF1FF; color: var(--blue); }
.tag-orange { background: #FDF3E0; color: #C57B21; }
.tag-gray { background: #F2F3F6; color: var(--muted); }
.tag-mt { background: #FFF6DA; color: #946E00; }
.tag-tb { background: #FFF0E3; color: #C2540A; }
.tag-jd { background: #FDECEC; color: #C02926; }
.switch { position: relative; width: 42px; height: 23px; display: inline-block; }
.switch input { display: none; }
.switch .sl { position: absolute; inset: 0; background: #D4D7DE; border-radius: 12px; transition: .18s; }
.switch .sl::after { content: ''; position: absolute; width: 19px; height: 19px; background: #fff; border-radius: 50%; top: 2px; left: 2px; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .sl { background: var(--green); }
.switch input:checked + .sl::after { transform: translateX(19px); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 13px; color: var(--muted); }
.search-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search-bar input, .search-bar select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.empty-tip { text-align: center; color: var(--muted); padding: 46px 0; font-size: 13px; }

/* ---------- 工作台 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--card); border-radius: 13px; padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat .ic { position: absolute; right: 12px; top: 12px; font-size: 30px; opacity: .5; }
.stat .lb { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 25px; font-weight: 800; margin-top: 5px; }
.stat .sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.stat .sub b { color: var(--green); }
.stat .ic {
  position: absolute; right: 14px; top: 14px; width: 42px; height: 42px; border-radius: 10px;
  background: var(--brand); opacity: 1; display: flex; align-items: center; justify-content: center;
  font-size: 21px; box-shadow: 0 4px 10px rgba(200,64,47,.25);
}

.board-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.board-head .title { font-size: 16px; font-weight: 700; }
.chan-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.chan-tabs .ct { padding: 6px 14px; border-radius: 18px; font-size: 12.5px; background: #F2F3F6; color: #555; cursor: pointer; }
.chan-tabs .ct.active { background: var(--text); color: #fff; font-weight: 600; }
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1100px) { .board { grid-template-columns: 1fr; } }
.board .col-h { font-size: 13px; font-weight: 700; padding: 4px 2px 10px; display: flex; align-items: center; gap: 7px; }
.board .col-h .cnt { background: #F2F3F6; border-radius: 10px; font-size: 11px; padding: 1px 8px; }
.board .col { background: #F7F8FA; border-radius: 13px; padding: 12px; min-height: 220px; }
.ocard { background: #fff; border-radius: 11px; padding: 13px 14px; margin-bottom: 10px; box-shadow: var(--shadow); border-left: 4px solid var(--line); animation: pop .25s ease-out; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.ocard.ch-scan { border-left-color: var(--green); } .ocard.ch-dinein { border-left-color: var(--blue); }
.ocard.ch-meituan { border-left-color: #FFC300; } .ocard.ch-taobao { border-left-color: #FF6A00; } .ocard.ch-jd { border-left-color: #E1251B; }
.ocard .oh { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ocard .oh .no { font-family: Consolas, monospace; }
.ocard .tbl-big { font-size: 17px; font-weight: 800; color: var(--text); }
.ocard .cust { font-size: 12px; color: #555; margin-top: 5px; line-height: 1.6; }
.ocard .items { margin: 8px 0; background: #FAFBFC; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.9; color: #333; }
.ocard .items b { color: var(--brand); }
.ocard .of { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ocard .amt { font-size: 16px; font-weight: 800; color: var(--brand); }
.ocard .ops { margin-left: auto; display: flex; gap: 7px; }
.ocard .remark { color: #C57B21; background: #FDF3E0; border-radius: 5px; padding: 2px 8px; font-size: 11.5px; display: inline-block; margin-top: 5px; }

/* ---------- 平台卡片 ---------- */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.pf-card { border-radius: 13px; padding: 18px; color: #fff; position: relative; overflow: hidden; min-height: 150px; }
.pf-card::after { content: ''; position: absolute; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.08); right: -50px; top: -50px; }
.pf-card .pf-name { font-size: 17px; font-weight: 700; }
.pf-card .pf-st { font-size: 11.5px; opacity: .9; margin-top: 3px; }
.pf-card .pf-data { display: flex; gap: 26px; margin-top: 14px; position: relative; z-index: 1; }
.pf-card .pf-data .n { font-size: 21px; font-weight: 800; }
.pf-card .pf-data .l { font-size: 11px; opacity: .85; }
.pf-card .pf-ops { position: absolute; right: 14px; bottom: 12px; display: flex; gap: 8px; }
.pf-card .pf-ops button { background: rgba(255,255,255,.24); color: #fff; border-radius: 7px; padding: 6px 12px; font-size: 12px; }
.pf-card .pf-ops button:hover { background: rgba(255,255,255,.4); }
.pf-mock-tip { margin-top: 12px; font-size: 12px; color: var(--muted); background: #F7F8FA; border-radius: 8px; padding: 9px 12px; line-height: 1.7; }

/* ---------- 弹窗 ---------- */
#modal-mask { position: fixed; inset: 0; background: rgba(15, 18, 25, .5); z-index: 60; display: flex; align-items: center; justify-content: center; }
#modal { background: #fff; border-radius: 15px; padding: 22px; width: min(560px, 92vw); max-height: 86vh; overflow-y: auto; animation: pop .2s ease-out; }
#modal h3 { font-size: 16px; margin-bottom: 16px; }
.m-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.emoji-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.emoji-pick span { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: #F5F6F8; border-radius: 9px; cursor: pointer; }
.emoji-pick span.sel { background: #FDECE8; outline: 2px solid var(--brand); }

/* 图片上传器 */
.img-uploader { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.img-preview { width: 72px; height: 72px; border-radius: 10px; background: #F5F6F8; border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.dish-thumb { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; margin-right: 4px; vertical-align: middle; }

/* toast */
#toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-8px); background: #22242A; color: #fff; padding: 10px 22px; border-radius: 9px; font-size: 13.5px; z-index: 99; opacity: 0; pointer-events: none; transition: all .22s; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: 80vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
canvas.chart { width: 100%; display: block; }
.chart-flex { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.chart-flex .legend { font-size: 12.5px; line-height: 2.1; color: #555; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; }

/* ---------- 桌码物料（屏幕预览 + A4 打印） ---------- */
.qr-sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 4px 0 30px; }
.qr-mat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  text-align: center; break-inside: avoid; page-break-inside: avoid; box-shadow: var(--shadow);
}
.qr-mat-card .qm-brand { font-size: 15px; font-weight: 800; color: var(--brand); letter-spacing: 1px; }
.qr-mat-card .qm-store { font-size: 11.5px; color: var(--muted); margin: 3px 0 10px; }
.qr-mat-card .qm-qr { display: block; margin: 0 auto; }
.qr-mat-card .qm-table { font-size: 46px; font-weight: 900; line-height: 1.1; margin-top: 8px; }
.qr-mat-card .qm-table span { font-size: 18px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.qr-mat-card .qm-hint { font-size: 12px; color: var(--brand); margin-top: 6px; font-weight: 600; }
.qr-mat-note { border: 1px dashed var(--line); box-shadow: none; }

@media print {
  .sidebar, .topbar, .no-print, #toast, #modal-mask { display: none !important; }
  #frame { height: auto !important; }
  .main { display: block !important; }
  .content { overflow: visible !important; padding: 0 !important; }
  body, .content { background: #fff !important; }
  .qr-sheet { grid-template-columns: repeat(2, 1fr); gap: 10mm; }
  .qr-mat-card { box-shadow: none; border: 1px solid #ddd; border-radius: 4mm; padding: 6mm; }
  .qr-mat-card .qm-qr { width: 38mm !important; height: 38mm !important; }
  @page { size: A4; margin: 10mm; }
}
