* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f4f5f7; color: #2c2c2a; font-size: 14px; }
a { color: #185fa5; text-decoration: none; }
.topnav { background: #fff; border-bottom: 1px solid #e3e3df; display: flex; align-items: center; gap: 4px; padding: 0 12px; height: 52px; position: sticky; top: 0; z-index: 10; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
.topnav .brand { font-weight: 600; margin-right: 14px; color: #534ab7; flex: none; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.topnav a { padding: 6px 12px; border-radius: 8px; color: #5f5e5a; flex: none; }
.topnav a.active { background: #eeedfe; color: #534ab7; font-weight: 600; }
.container { max-width: 1180px; margin: 24px auto; padding: 0 16px; }
h1 { font-size: 20px; margin-bottom: 16px; }
h2 { font-size: 16px; margin: 20px 0 12px; }
.card { background: #fff; border: 1px solid #e3e3df; border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.seat-card { background: #fff; border: 1px solid #e3e3df; border-radius: 12px; padding: 16px; }
.seat-card.free { border-color: #97c459; background: #f7fbef; }
.seat-card.occupied { border-color: #ef9f27; background: #fdf8ec; }
.seat-card.disabled { background: #f1efe8; opacity: .6; }
.seat-no { font-size: 18px; font-weight: 600; }
.seat-meta { color: #888780; font-size: 12px; margin: 4px 0 10px; }
.badge { display: inline-block; font-size: 12px; border-radius: 20px; padding: 2px 10px; }
.badge.free { background: #eaf3de; color: #3b6d11; }
.badge.countdown { background: #e6f1fb; color: #185fa5; }
.badge.timing, .badge.overtime { background: #faecec; color: #a32d2d; }
.badge.member { background: #eeedfe; color: #534ab7; }
.badge.unlimited { background: #e1f5ee; color: #0f6e56; }
.big-timer { font-size: 40px; font-weight: 700; font-family: Consolas, monospace; letter-spacing: 2px; margin: 8px 0; }
.big-timer.warn { color: #a32d2d; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #eee; font-size: 13px; }
th { background: #f7f7f4; color: #5f5e5a; font-weight: 600; }
tr:hover td { background: #fafafa; }
.btn { display: inline-block; border: 1px solid #d3d1c7; background: #fff; color: #2c2c2a; padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.btn:hover { background: #f1efe8; }
.btn.primary { background: #534ab7; border-color: #534ab7; color: #fff; }
.btn.primary:hover { background: #463d9f; }
.btn.danger { background: #a32d2d; border-color: #a32d2d; color: #fff; }
.btn.sm { padding: 3px 10px; font-size: 12px; }
label { display: block; margin: 12px 0 4px; color: #5f5e5a; font-size: 13px; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid #d3d1c7; border-radius: 8px; font-size: 14px; background: #fff; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid #e3e3df; border-radius: 12px; padding: 16px; }
.stat .num { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat .lbl { color: #888780; font-size: 12px; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.msg.ok { background: #eaf3de; color: #3b6d11; }
.msg.err { background: #fcebeb; color: #a32d2d; }
.modal-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99; align-items: center; justify-content: center; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 28px 32px; text-align: center; width: 360px; max-width: 92vw; }
.modal .title { font-size: 18px; font-weight: 700; color: #a32d2d; margin-bottom: 8px; }
.modal .title.ok { color: #3b6d11; }
.modal .icon-big { font-size: 44px; line-height: 1.1; margin-bottom: 8px; }
.modal .rows { text-align: left; margin: 12px 0; border-top: 1px dashed #d3d1c7; border-bottom: 1px dashed #d3d1c7; padding: 2px; font-size: 13px; }
.modal .rows .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 2px; border-bottom: 1px solid #f0f0ee; }
.modal .rows .row:last-child { border-bottom: 0; }
.modal .rows .row b { color: #2c2c2a; text-align: right; }
.modal .amt-big { font-size: 26px; font-weight: 700; color: #a32d2d; margin: 4px 0 2px; }
.modal .muted-line { font-size: 12px; color: #888780; margin-bottom: 6px; }
.modal .actions { justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:disabled:hover { background: #fff; }
.right { text-align: right; }
.muted { color: #888780; font-size: 12px; }
.pull-right { float: right; }
table.receipt { font-size: 14px; }
table.receipt td { padding: 6px 4px; }
.total-line { font-size: 18px; font-weight: 700; color: #a32d2d; }

/* ==================== v4.1：收银台全新看板 ==================== */
.pos-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pos-head h1 { margin: 0; flex: 1; }

/* 视图切换 */
.view-toggle { display: inline-flex; background: #fff; border: 1px solid #d3d1c7; border-radius: 10px; padding: 3px; gap: 2px; }
.view-toggle button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; color: #5f5e5a; white-space: nowrap; }
.view-toggle button.active { background: #534ab7; color: #fff; font-weight: 600; }

/* 顶部统计栏 */
.pos-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.pstat { background: #fff; border: 1px solid #e3e3df; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.pstat .ico { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.pstat .num { font-size: 22px; font-weight: 700; line-height: 1.1; }
.pstat .lbl { color: #888780; font-size: 12px; margin-top: 2px; }
.pstat.s-free .ico { background: #eaf3de; } .pstat.s-free .num { color: #3b6d11; }
.pstat.s-busy .ico { background: #fdf3e3; } .pstat.s-busy .num { color: #b06c07; }
.pstat.s-group .ico { background: #eeedfe; } .pstat.s-group .num { color: #534ab7; }
.pstat.s-people .ico { background: #e6f1fb; } .pstat.s-people .num { color: #185fa5; }
.pstat.s-amount .ico { background: #fdeeec; } .pstat.s-amount .num { color: #a32d2d; }

/* 筛选条 */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.fchip { border: 1px solid #d3d1c7; background: #fff; border-radius: 20px; padding: 6px 16px; font-size: 13px; cursor: pointer; color: #5f5e5a; }
.fchip.active { background: #2c2c2a; border-color: #2c2c2a; color: #fff; font-weight: 600; }

/* 筐卡片网格 */
.basket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.bk { border-radius: 14px; padding: 12px 8px 10px; text-align: center; cursor: pointer;
      border: 2px solid #d3d1c7; background: #fff; position: relative; user-select: none;
      display: flex; flex-direction: column; align-items: center; gap: 3px;
      transition: transform .1s, box-shadow .1s; }
.bk:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.09); }
.bk-icon { font-size: 26px; line-height: 1; }
.bk-no { font-size: 20px; font-weight: 700; line-height: 1.15; }
.bk-phase { display: inline-block; font-size: 11px; border-radius: 20px; padding: 2px 9px; font-weight: 600; }
.bk-timer { font-size: 15px; font-weight: 700; font-family: Consolas, monospace; color: #185fa5; }
.bk-timer.warn { color: #a32d2d; }
.bk-timer.muted-timer { color: #888780; font-weight: 400; font-size: 12px; }
.bk-amount { font-size: 13px; font-weight: 700; color: #a32d2d; }
.bk-group { position: absolute; top: -8px; right: -4px; font-size: 10px; color: #fff; border-radius: 9px; padding: 2px 8px; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.15); }

/* 筐状态 */
.bk-free { border-color: #97c459; background: #f7fbef; border-style: dashed; }
.bk-free:hover { border-color: #3b6d11; background: #eef7e2; }
.bk-free .bk-no { color: #3b6d11; }
.bk-free .p-free { background: #eaf3de; color: #3b6d11; font-size: 12px; }
.bk-disabled { background: #f1efe8; opacity: .55; cursor: not-allowed; }
.p-dis { background: #eee; color: #888; }
.bk-ot { animation: bkblink 1.2s infinite; }
@keyframes bkblink { 0%,100% { box-shadow: 0 0 0 0 rgba(163,45,45,0); } 50% { box-shadow: 0 0 0 4px rgba(163,45,45,.25); } }

/* 计费阶段徽章色 */
.p-member    { background: #eeedfe; color: #534ab7; }
.p-timing    { background: #e6f1fb; color: #185fa5; }
.p-countdown { background: #fdf3e3; color: #b06c07; }
.p-overtime  { background: #fdeeec; color: #a32d2d; }
.p-unlimited { background: #e1f5ee; color: #0f6e56; }

/* 同组同色（8 档） */
.bk.g1 { border-color: #ef9f27; background: #fdf6ea; } .bk.g1 .bk-group { background: #ef9f27; }
.bk.g2 { border-color: #534ab7; background: #f3f1fd; } .bk.g2 .bk-group { background: #534ab7; }
.bk.g3 { border-color: #2b8a3e; background: #edf7ef; } .bk.g3 .bk-group { background: #2b8a3e; }
.bk.g4 { border-color: #c2255c; background: #fdf0f4; } .bk.g4 .bk-group { background: #c2255c; }
.bk.g5 { border-color: #0b7285; background: #e9f7f9; } .bk.g5 .bk-group { background: #0b7285; }
.bk.g6 { border-color: #862e9c; background: #f8effb; } .bk.g6 .bk-group { background: #862e9c; }
.bk.g7 { border-color: #a32d2d; background: #fdf1ef; } .bk.g7 .bk-group { background: #a32d2d; }
.bk.g8 { border-color: #5c7cfa; background: #eff1fe; } .bk.g8 .bk-group { background: #5c7cfa; }

/* ============ 组视图 ============ */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.gcard { background: #fff; border: 1.5px solid #e3e3df; border-top: 5px solid #d3d1c7; border-radius: 14px; padding: 14px 16px; }
.gcard-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gcard-tag { font-size: 12px; font-weight: 700; color: #fff; border-radius: 8px; padding: 2px 10px; }
.gcard-pkg { font-weight: 700; font-size: 15px; flex: 1; }
.gcard-baskets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.gchip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600;
         border: 1.5px solid #d3d1c7; border-radius: 9px; padding: 3px 10px; background: #fafaf7; }
.gchip-people { border-color: #b9d6ef; background: #e6f1fb; color: #185fa5; }
.gcard-meta { font-size: 12px; margin-bottom: 8px; }
.gcard-foot { display: flex; align-items: flex-end; gap: 12px; border-top: 1px dashed #e3e3df; padding-top: 10px; }
.gcard-timer { font-size: 26px; font-weight: 700; font-family: Consolas, monospace; color: #185fa5; flex: 1; }
.gcard-timer.warn { color: #a32d2d; }
.gcard-amount { font-size: 20px; font-weight: 700; color: #a32d2d; text-align: right; }
.gcard-amount small { display: block; font-size: 11px; color: #888780; font-weight: 400; }
.gcard-btns { display: flex; gap: 8px; }
/* 组卡同色系（顶部彩条 + 标签） */
.gcard.g1 { border-top-color: #ef9f27; } .gcard.g1 .gcard-tag { background: #ef9f27; }
.gcard.g2 { border-top-color: #534ab7; } .gcard.g2 .gcard-tag { background: #534ab7; }
.gcard.g3 { border-top-color: #2b8a3e; } .gcard.g3 .gcard-tag { background: #2b8a3e; }
.gcard.g4 { border-top-color: #c2255c; } .gcard.g4 .gcard-tag { background: #c2255c; }
.gcard.g5 { border-top-color: #0b7285; } .gcard.g5 .gcard-tag { background: #0b7285; }
.gcard.g6 { border-top-color: #862e9c; } .gcard.g6 .gcard-tag { background: #862e9c; }
.gcard.g7 { border-top-color: #a32d2d; } .gcard.g7 .gcard-tag { background: #a32d2d; }
.gcard.g8 { border-top-color: #5c7cfa; } .gcard.g8 .gcard-tag { background: #5c7cfa; }

/* 手机端浮动开单按钮 */
.fab { display: none; position: fixed; right: 18px; bottom: 24px; z-index: 50;
       width: 58px; height: 58px; border-radius: 50%; background: #534ab7; color: #fff;
       font-size: 30px; line-height: 1; align-items: center; justify-content: center;
       box-shadow: 0 6px 18px rgba(83,74,183,.45); }
.fab:active { transform: scale(.92); }

/* 开单/结账页的筐选择 */
.basket-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.basket-chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid #97c459; border-radius: 10px;
  padding: 8px 14px; cursor: pointer; background: #f7fbef; font-weight: 600; margin: 0; }
.basket-chip input { width: auto; margin: 0; }
.basket-chip:has(input:checked) { border-color: #534ab7; background: #eeedfe; color: #534ab7; }
.basket-chip.done { border-style: dashed; opacity: .55; cursor: not-allowed; filter: grayscale(1); }
.basket-chip.done span { text-decoration: line-through; }

/* ==================== 手机适配 ==================== */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .container { margin: 14px auto; padding: 0 10px; }
  h1 { font-size: 18px; }
  .card { padding: 14px; }
  .form-row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .big-timer { font-size: 34px; }
  /* 看板手机适配 */
  .pos-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .pstat { padding: 10px; gap: 8px; border-radius: 12px; }
  .pstat .ico { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
  .pstat .num { font-size: 17px; }
  .pstat .lbl { font-size: 11px; }
  .basket-grid { grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 9px; }
  .bk { padding: 9px 4px 8px; border-radius: 12px; }
  .bk-icon { font-size: 22px; }
  .bk-no { font-size: 17px; }
  .bk-timer { font-size: 13px; }
  .bk-amount { font-size: 12px; }
  .bk-group { top: -6px; right: -2px; }
  .group-grid { grid-template-columns: 1fr; }
  .gcard-timer { font-size: 22px; }
  .gcard-amount { font-size: 17px; }
  .fab { display: flex; }
  .view-toggle button { padding: 6px 10px; font-size: 12px; }
  table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  th, td { padding: 8px 10px; }
  .btn { padding: 10px 18px; }         /* 手指触控加大 */
  .btn.sm { padding: 6px 12px; }
  .topnav a { padding: 8px 10px; }
  .modal { padding: 20px; }
  .actions { gap: 8px; }
  .actions .btn { flex: 1; text-align: center; min-height: 44px; }
}
@media print { .topnav, .no-print { display: none !important; } body { background: #fff; } }
