/* ============================================================
   NO:2-COFFEE · POS 收银台 样式 (触屏大屏)
   ============================================================ */
:root {
  --primary: #ff7a1a;
  --primary-dark: #e5670a;
  --primary-light: #fff3e6;
  --bg: #f5f7fa;
  --text: #1a1a1a;
  --sub: #888;
  --line: #ebeef3;
  --card: #ffffff;
  --shadow: 0 2px 8px rgba(0,0,0,.04);
  --green: #34c759;
  --red: #ff3b30;
  --blue: #007aff;
  --purple: #af52de;
  --orange: #ff9500;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin:0; padding:0; height:100%; font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif; color: var(--text); background: #2a2d36; }
button, input, select, textarea { font-family: inherit; outline: none; border: none; background: transparent; }
input, select, textarea { padding: 8px 12px; border-radius: 6px; font-size: 13px; }
a { color: inherit; text-decoration: none; }
body { overflow: hidden; }

/* ---------- 主框架 ---------- */
.pos { display: flex; flex-direction: column; height: 100vh; background: var(--bg); }

/* ---------- 顶栏 ---------- */
.pos-top { height: 64px; background: #fff; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; box-shadow: 0 2px 4px rgba(0,0,0,.04); flex-shrink: 0; }
.pos-brand { display: flex; gap: 12px; align-items: center; }
.pb-logo { width: 44px; height: 44px; background: var(--primary-light); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.pb-title { font-size: 16px; font-weight: 800; }
.pb-sub { font-size: 11px; color: var(--sub); }
.pos-info { display: flex; align-items: center; gap: 24px; }
.pi-item { text-align: right; }
.pi-label { font-size: 10px; color: var(--sub); }
.pi-val { font-size: 14px; font-weight: 700; }
.pi-btn { padding: 8px 14px; background: var(--primary-light); color: var(--primary); border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; }
.pi-btn-danger { background: #ffe5e5; color: var(--red); }

/* ---------- 主体 ---------- */
.pos-main { flex: 1; display: flex; overflow: hidden; }

/* 左侧 */
.pos-left { width: 100px; background: #fff; border-right: 1px solid var(--line); overflow-y: auto; }
.left-tabs { padding: 8px 0; }
.lt { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; cursor: pointer; border-left: 3px solid transparent; }
.lt:hover { background: #fafbfc; }
.lt.lt-active { background: var(--primary-light); border-left-color: var(--primary); }
.lt-ico { font-size: 24px; }
.lt-name { font-size: 12px; font-weight: 600; margin-top: 4px; }
.lt-count { font-size: 10px; color: var(--sub); margin-top: 2px; }

/* 中间 */
.pos-mid { flex: 1; display: flex; flex-direction: column; padding: 16px; overflow: hidden; }
.mid-search { margin-bottom: 12px; }
.mid-search input { width: 100%; padding: 10px 16px; background: #fff; border-radius: 8px; box-shadow: var(--shadow); font-size: 13px; }
.mid-goods { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; overflow-y: auto; align-content: start; }
.goods-card { background: #fff; border-radius: 12px; padding: 12px; cursor: pointer; box-shadow: var(--shadow); transition: all .15s; }
.goods-card:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.08); }
.goods-card-stop { opacity: .5; }
.gc-ico { font-size: 36px; text-align: center; }
.gc-name { font-size: 13px; font-weight: 700; margin-top: 4px; line-height: 1.3; height: 34px; overflow: hidden; }
.gc-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.gc-price { color: var(--primary); font-weight: 800; font-size: 14px; }
.gc-price i { font-size: 10px; }
.gc-tag { font-size: 9px; background: var(--primary); color: #fff; padding: 1px 4px; border-radius: 3px; }

/* 右侧 */
.pos-right { width: 360px; background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.right-tabs { display: flex; padding: 8px; gap: 4px; border-bottom: 1px solid var(--line); }
.rt-tab { flex: 1; text-align: center; padding: 8px; font-size: 12px; color: #666; border-radius: 6px; cursor: pointer; }
.rt-tab.rt-active { background: var(--primary); color: #fff; font-weight: 700; }
.right-info { padding: 10px 12px; }
.ri-input { width: 100%; padding: 8px 12px; background: #f5f7fa; border-radius: 6px; font-size: 12px; }
.cart-list { flex: 1; overflow-y: auto; padding: 0 12px; }
.cart-empty { text-align: center; padding: 60px 0; color: #aaa; }
.cart-empty-ico { font-size: 60px; margin-bottom: 8px; opacity: .5; }
.cart-item { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ci-ico { font-size: 24px; }
.ci-info { flex: 1; min-width: 0; }
.ci-name { font-size: 13px; font-weight: 700; }
.ci-spec { font-size: 10px; color: var(--sub); }
.ci-price { color: var(--primary); font-weight: 700; font-size: 12px; margin-top: 2px; }
.ci-ctrl { display: flex; align-items: center; gap: 6px; }
.ci-btn { width: 22px; height: 22px; background: #f0f0f0; border-radius: 4px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; }
.ci-qty { min-width: 18px; text-align: center; font-size: 12px; font-weight: 700; }
.cart-fee { padding: 10px 12px; border-top: 1px solid var(--line); }
.cf-row { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0; }
.cf-row b { font-weight: 700; }
.cf-total { font-size: 16px; font-weight: 800; color: var(--primary); margin-top: 4px; }
.cf-total b { font-size: 20px; }
.pay-methods { padding: 8px 12px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; border-top: 1px solid var(--line); }
.pm { display: flex; flex-direction: column; align-items: center; padding: 6px; border-radius: 6px; cursor: pointer; font-size: 10px; color: #666; }
.pm.pm-active { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.pm-ico { font-size: 18px; margin-bottom: 2px; }

.pay-btn { margin: 8px 12px 12px; padding: 16px; background: linear-gradient(90deg, #ffa552, #ff7a1a); color: #fff; border-radius: 10px; font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 12px rgba(255,122,26,.3); }
.pay-btn b { font-size: 20px; margin-left: 4px; }
.pay-btn:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; }

/* ---------- 底栏 ---------- */
.pos-bottom { height: 56px; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: space-between; padding: 0 16px; align-items: center; flex-shrink: 0; }
.bottom-left { display: flex; gap: 4px; }
.bb-btn { padding: 8px 16px; font-size: 12px; color: #666; border-radius: 6px; cursor: pointer; position: relative; }
.bb-btn.bb-active { background: var(--primary); color: #fff; font-weight: 700; }
.bb-badge { background: var(--red); color: #fff; border-radius: 8px; padding: 0 5px; font-size: 10px; margin-left: 4px; }
.bottom-right { display: flex; align-items: center; }
.stock-mini { display: flex; align-items: center; gap: 12px; }
.sm-title { font-size: 11px; color: var(--sub); }
.sm-list { display: flex; gap: 8px; }
.sm-item { font-size: 11px; background: #fff3e6; color: var(--primary-dark); padding: 4px 8px; border-radius: 12px; font-weight: 600; }

/* ---------- 收款弹层 ---------- */
.pay-modal, .success-modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.pay-modal[hidden], .success-modal[hidden] { display: none; }
.pay-modal-card { width: 480px; background: #fff; border-radius: 16px; padding: 24px; }
.pmc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.pmc-title { font-size: 18px; font-weight: 800; }
.pmc-close { font-size: 24px; color: #aaa; cursor: pointer; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.pmc-amount { text-align: center; font-size: 48px; font-weight: 900; color: var(--primary); margin: 16px 0; }
.pmc-amount b { font-size: 60px; }
.pmc-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.pmc-m { padding: 12px; background: #f5f7fa; border-radius: 8px; text-align: center; cursor: pointer; font-size: 12px; }
.pmc-m.pmc-active { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.pmc-cash { background: #fafbfc; border-radius: 8px; padding: 12px; margin: 12px 0; }
.pc-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; }
.pc-row b { font-weight: 700; }
.pc-row input { width: 120px; padding: 6px 10px; font-size: 14px; }
.pc-change { color: var(--red); font-size: 18px; font-weight: 800; }
.pc-quick { display: flex; gap: 6px; margin-top: 8px; }
.pc-quick a { flex: 1; text-align: center; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; cursor: pointer; }
.pmc-qr { text-align: center; padding: 20px; }
.qr-img { width: 180px; height: 180px; background: repeating-linear-gradient(45deg, #000 0 4px, transparent 4px 8px), repeating-linear-gradient(-45deg, #000 0 4px, transparent 4px 8px), #fff; margin: 0 auto; border: 4px solid var(--primary); border-radius: 8px; position: relative; }
.qr-inner { position: absolute; inset: 8px; background: #fff; border-radius: 4px; }
.qr-inner::before { content:''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; background: var(--primary); border-radius: 50%; }
.qr-text { margin-top: 12px; color: var(--sub); font-size: 13px; }
.qr-text b { color: var(--primary); }
.pmc-confirm { width: 100%; padding: 14px; background: var(--primary); color: #fff; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 12px; }

/* 成功 */
.success-modal { flex-direction: column; }
.sm-bear { font-size: 100px; animation: bounce .5s ease infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-10px); } }
.sm-title { font-size: 28px; font-weight: 900; color: #fff; margin-top: 16px; }
.sm-amount { font-size: 48px; font-weight: 900; color: var(--primary); margin: 8px 0; }
.sm-amount b { font-size: 60px; }
.sm-order { color: rgba(255,255,255,.7); font-size: 14px; margin-bottom: 20px; }
.sm-actions { display: flex; gap: 12px; }
.sm-actions button { padding: 12px 24px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.sm-actions button:first-child { background: rgba(255,255,255,.2); color: #fff; }
.sm-actions button:last-child { background: var(--primary); color: #fff; }

/* ---------- 抽屉 ---------- */
.drawer { position: fixed; inset: 0; z-index: 90; display: flex; }
.drawer[hidden] { display: none; }
.drawer-mask { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.drawer-body { position: relative; margin-left: auto; width: 720px; max-width: 90vw; background: #fff; display: flex; flex-direction: column; animation: slideIn .2s; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
.drawer-head { height: 56px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.drawer-title { font-size: 16px; font-weight: 800; }
.drawer-close { font-size: 22px; color: #aaa; cursor: pointer; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.drawer-content { flex: 1; overflow-y: auto; padding: 20px; }

/* 抽屉内订单卡 */
.order-card { background: #fff; border-radius: 12px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.oc-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.oc-id { font-size: 13px; font-weight: 700; }
.oc-status { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.oc-line { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 0; }
.oc-ico { font-size: 18px; }
.oc-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 8px; }
.oc-actions { display: flex; gap: 6px; }
.oc-btn { padding: 6px 12px; background: var(--primary); color: #fff; border-radius: 6px; font-size: 11px; cursor: pointer; font-weight: 600; }
.oc-btn-ghost { background: #f0f0f0; color: #666; }

/* 桌台 */
.desk-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.desk { aspect-ratio: 1; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; }
.desk-free { background: #e0f7e9; color: #2a8043; border: 2px solid #34c759; }
.desk-use { background: #fff3e6; color: var(--primary-dark); border: 2px solid var(--primary); }
.desk-clean { background: #f0f0f0; color: #888; }
.desk-name { font-size: 16px; font-weight: 800; }
.desk-info { font-size: 11px; }

/* 会员 */
.member-search { display: flex; gap: 8px; margin-bottom: 14px; }
.member-search input { flex: 1; padding: 10px 14px; background: #f5f7fa; border-radius: 8px; }
.member-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: linear-gradient(135deg, #ff9d4d, #ff7a1a); color: #fff; border-radius: 12px; margin-bottom: 12px; }
.mc-avatar { width: 50px; height: 50px; background: rgba(255,255,255,.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.mc-info { flex: 1; }
.mc-name { font-size: 16px; font-weight: 800; }
.mc-level { font-size: 11px; opacity: .8; }
.mc-score { font-size: 11px; background: rgba(255,255,255,.2); padding: 4px 10px; border-radius: 12px; }

/* 库存 */
.stk-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stk-item { padding: 12px; background: #f5f7fa; border-radius: 8px; }
.stk-item .si-name { font-size: 13px; font-weight: 700; }
.stk-item .si-stock { font-size: 12px; color: var(--sub); margin-top: 4px; }
.stk-item .si-bar { height: 6px; background: #e0e0e0; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.stk-item .si-bar div { height: 100%; background: var(--green); border-radius: 3px; }
.stk-warn .si-bar div { background: var(--red); }
