/* 三香云商零售管理系统（ThreeAroma Cloud）V1.0 | © 2026 陈新腾 | 保留所有权利 */
/* ==========================================================================
   ThreeAroma Cloud · 全局样式
   ========================================================================== */
:root {
  --brand: #d97706;
  --brand-dark: #92400e;
  --brand-light: #fef3c7;
  --brand-soft: #fde68a;
  --sidebar: #1c120b;
  --sidebar-2: #2b1d12;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --text-2: #5b6577;
  --text-3: #98a1b0;
  --line: #e8ebf2;
  --line-2: #f1f3f8;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f59e0b;
  --purple: #8b5cf6;
  --cyan: #059669;
  --pink: #ec4899;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(33, 21, 16, .04), 0 4px 16px rgba(33, 21, 16, .05);
  --shadow-lg: 0 12px 32px rgba(33, 21, 16, .14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; outline: none; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cdd4e0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b6bfce; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer;
  transition: all .15s; white-space: nowrap; font-size: 13.5px;
}
.btn:hover { border-color: #c9d3e4; background: #fafbfe; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { filter: brightness(.94); }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--red); }
.btn-danger:hover { background: #fef2f2; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #f1f4fa; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { height: 44px; padding: 0 24px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 8px; }

/* ------------------------------ 表单 ------------------------------ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field > label .req { color: var(--red); margin-left: 2px; }
.input, .select, .textarea {
  height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text); width: 100%; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 70px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(217, 119, 6, .1); }
.input[readonly] { background: #f7f9fc; color: var(--text-2); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2398a1b0' d='M6 8L2 4h8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }

/* ------------------------------ 卡片 / 布局 ------------------------------ */
.card { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--line-2); }
.card-head { padding: 15px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head h3::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--brand); }
.card-head .sub { font-size: 12.5px; color: var(--text-3); font-weight: 400; }
.card-body { padding: 18px; }
.card-body.tight { padding: 10px 14px; }

/* ------------------------------ 表格 ------------------------------ */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; padding: 11px 12px; color: var(--text-2); font-weight: 600;
  background: #fafbfe; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 13px;
}
table.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tbody tr:hover { background: #fafcff; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl .num { font-variant-numeric: tabular-nums; text-align: right; }
table.tbl .mono { font-family: Consolas, Monaco, monospace; font-size: 12.5px; }
.empty-row { text-align: center; padding: 40px 0; color: var(--text-3); }

/* ------------------------------ 标签 ------------------------------ */
.tag { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 5px; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; }
.tag-blue { background: var(--brand-light); color: var(--brand); }
.tag-green { background: #ecfdf5; color: #059669; }
.tag-red { background: #fef2f2; color: var(--red); }
.tag-orange { background: #fffbeb; color: #d97706; }
.tag-purple { background: #f5f3ff; color: #7c3aed; }
.tag-gray { background: #f3f4f6; color: var(--text-2); }
.tag-cyan { background: #ecfeff; color: #0891b2; }

/* ------------------------------ 弹窗 ------------------------------ */
.mask { position: fixed; inset: 0; background: rgba(33, 21, 16, .45); display: flex; align-items: center; justify-content: center; z-index: 900; padding: 24px; backdrop-filter: blur(2px); }
.mask.closing { opacity: 0; transition: opacity .15s; }
.modal { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: 90vh; display: flex; flex-direction: column; animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.wide { max-width: 900px; }
.modal.xwide { max-width: 1180px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 15.5px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { width: 28px; height: 28px; border: none; background: transparent; color: var(--text-3); border-radius: 6px; cursor: pointer; font-size: 18px; line-height: 1; }
.modal-close:hover { background: #f1f4fa; color: var(--text); }

/* ------------------------------ 提示 ------------------------------ */
#toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 9px; background: #fff; box-shadow: var(--shadow-lg); border: 1px solid var(--line); font-size: 13.5px; display: flex; align-items: center; gap: 8px; animation: drop .2s ease-out; max-width: 520px; }
@keyframes drop { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.ok { border-left: 3px solid var(--green); }
.toast.err { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--brand); }
.toast.warn { border-left: 3px solid var(--orange); }

/* ------------------------------ 统计卡 ------------------------------ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat { background: var(--card); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); border: 1px solid var(--line-2); position: relative; overflow: hidden; }
.stat .label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 25px; font-weight: 650; margin-top: 8px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 3px; }
.stat .foot { margin-top: 8px; font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.stat .ico { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.up { color: var(--red); }   /* 涨=红（国内习惯） */
.down { color: var(--green); } /* 跌=绿 */

/* ------------------------------ 工具条 ------------------------------ */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.search-box { position: relative; }
.search-box .input { padding-left: 32px; width: 220px; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); }

/* ------------------------------ 分页 ------------------------------ */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); flex-wrap: wrap; gap: 10px; }
.pager .pages { display: flex; gap: 5px; align-items: center; }
.pager .pg { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line); background: #fff; border-radius: 7px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.pager .pg:hover:not([disabled]) { border-color: var(--brand); color: var(--brand); }
.pager .pg.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .pg[disabled] { opacity: .45; cursor: not-allowed; }

/* ------------------------------ 标签页 ------------------------------ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; overflow-x: auto; }
.tabs .tab { padding: 11px 14px; font-size: 14px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: all .15s; }
.tabs .tab:hover { color: var(--brand); }
.tabs .tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ------------------------------ 骨架屏 / 加载 ------------------------------ */
.loading { padding: 50px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.spin { width: 18px; height: 18px; border: 2px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; display: inline-block; animation: sp .7s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes sp { to { transform: rotate(360deg); } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
@media (max-width: 1100px) {
  .grid-2, .grid-3, .grid-1-2, .grid-2-1 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-2); }
.kv .v { font-weight: 500; }
.text-right { text-align: right; }
.text-muted { color: var(--text-3); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.bold { font-weight: 600; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; }
.wrap { flex-wrap: wrap; }

/* ==========================================================================
   登录页
   ========================================================================== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(125deg, #0b1220 0%, #142646 45%, #1b3a6b 100%);
  position: relative; overflow: hidden; padding: 24px;
}
.login-page::before, .login-page::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .4;
}
.login-page::before { width: 520px; height: 520px; background: #d97706; top: -140px; right: -100px; }
.login-page::after { width: 420px; height: 420px; background: #059669; bottom: -160px; left: -80px; opacity: .25; }
.login-card {
  position: relative; z-index: 2; width: 100%; max-width: 900px; min-height: 480px;
  display: grid; grid-template-columns: 1.05fr .95fr; border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(20, 12, 5, .5); background: #fff;
}
.login-left { padding: 44px 40px; background: linear-gradient(160deg, #2b1d12, #1a110a); color: #fff; display: flex; flex-direction: column; }
.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #d97706, #059669); font-size: 20px; font-weight: 700; color: #fff;
  box-shadow: 0 6px 16px rgba(217, 119, 6, .45);
}
.brand-name { font-size: 19px; font-weight: 650; letter-spacing: .3px; }
.brand-sub { font-size: 11.5px; color: #7d8ca8; letter-spacing: 2px; text-transform: uppercase; }
img.brand-logo { background: none; box-shadow: none; display: block; }
.login-left h2 { font-size: 24px; font-weight: 620; margin: 40px 0 12px; line-height: 1.45; }
.login-left p.desc { font-size: 13.5px; color: #9aa8c0; line-height: 1.85; }
.feature-list { margin-top: 26px; display: flex; flex-direction: column; gap: 13px; }
.feature { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: #c3cddd; }
.feature .dot { width: 6px; height: 6px; border-radius: 50%; background: #fbbf24; margin-top: 7px; flex-shrink: 0; box-shadow: 0 0 8px #fbbf24; }
.login-left .foot { margin-top: auto; font-size: 12px; color: #5f6f8c; padding-top: 24px; }
.login-right { padding: 46px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-right h3 { font-size: 21px; font-weight: 650; margin-bottom: 6px; }
.login-right .tip { font-size: 13px; color: var(--text-3); margin-bottom: 26px; }
.login-links { display: flex; justify-content: space-between; font-size: 13px; margin-top: 4px; }
.login-links a { color: var(--text-3); }
.login-links a:hover { color: var(--brand); }
.demo-accounts { margin-top: 22px; padding: 12px 14px; background: #f7f9fd; border: 1px dashed #d6deec; border-radius: 10px; font-size: 12.5px; color: var(--text-2); line-height: 1.9; }
.demo-accounts b { color: var(--text); }
.demo-accounts .acc { cursor: pointer; }
.demo-accounts .acc:hover { color: var(--brand); }
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row .input { flex: 1; }
.captcha-img { height: 36px; width: 106px; border-radius: 8px; cursor: pointer; flex-shrink: 0; overflow: hidden;
  background: linear-gradient(120deg, #f5efe3, #ece0cb); display: flex; align-items: center; justify-content: center;
  user-select: none; }
.captcha-img svg { display: block; width: 106px; height: 36px; border-radius: 8px; }
/* 短信验证码：输入框 + 获取按钮（60 秒倒计时态） */
.sms-row { display: flex; gap: 10px; align-items: center; }
.sms-row .input { flex: 1; }
.sms-row .btn { height: 36px; flex-shrink: 0; min-width: 104px; padding: 0 12px; }
.sms-row .btn[disabled] { opacity: .65; cursor: not-allowed; }
/* 演示模式提示（醒目黄字，与主题一致） */
.sms-demo-tip { margin-top: 8px; font-size: 12.5px; line-height: 1.7; color: #92400e;
  background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; }
.sms-demo-tip b { color: #b45309; }
@media (max-width: 820px) { .login-card { grid-template-columns: 1fr; max-width: 420px; min-height: 0; } .login-left { display: none; } }

/* ==========================================================================
   收银台
   ========================================================================== */
body.pos-body { height: 100vh; overflow: hidden; background: #eef1f7; }
.pos-app { height: 100vh; display: grid; grid-template-columns: 1fr 396px; grid-template-rows: 54px 1fr; grid-template-areas: "head head" "main cart"; }
.pos-head { grid-area: head; background: var(--sidebar); color: #fff; display: flex; align-items: center; padding: 0 16px; gap: 16px; }
.pos-head .logo { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; }
.pos-head .logo .brand-logo { width: 30px; height: 30px; border-radius: 8px; font-size: 15px; }
.pos-head .store-chip { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .1); padding: 5px 12px; border-radius: 7px; font-size: 13px; }
.pos-head .grow { flex: 1; }
.pos-head .head-info { font-size: 12.5px; color: #8fa1bd; }
.pos-head .head-btn { background: rgba(255, 255, 255, .1); border: none; color: #e3eaf5; height: 32px; padding: 0 13px; border-radius: 7px; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.pos-head .head-btn:hover { background: rgba(255, 255, 255, .2); }
.pos-head .head-btn.primary { background: var(--brand); color: #fff; }
.pos-head .head-btn.primary:hover { background: var(--brand-dark); }

.pos-main { grid-area: main; padding: 12px; overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
.pos-search-bar { display: flex; gap: 10px; align-items: center; }
.pos-search-bar .search-box { flex: 1; }
.pos-search-bar .search-box .input { width: 100%; height: 44px; font-size: 15px; padding-left: 40px; border-radius: 10px; }
.pos-search-bar .search-box svg { left: 14px; }
.pos-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; flex-shrink: 0; }
.pos-cats .cat { padding: 7px 14px; background: #fff; border-radius: 20px; font-size: 13.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; border: 1px solid var(--line); transition: all .15s; }
.pos-cats .cat:hover { color: var(--brand); border-color: var(--brand-soft); }
.pos-cats .cat.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.pos-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; align-content: start; padding-right: 4px; }
.pos-item { background: #fff; border-radius: 11px; padding: 26px 12px 12px; cursor: pointer; border: 1px solid var(--line-2); transition: all .13s; display: flex; flex-direction: column; gap: 6px; position: relative; }
.pos-item:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(217, 119, 6, .13); transform: translateY(-2px); }
.pos-item .nm { font-size: 13.5px; font-weight: 500; line-height: 1.4; height: 38px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pos-item .meta { font-size: 11.5px; color: var(--text-3); display: flex; justify-content: space-between; }
.pos-item .pr { font-size: 16px; font-weight: 650; color: var(--red); font-variant-numeric: tabular-nums; }
.pos-item .pr small { font-size: 11px; font-weight: 400; color: var(--text-3); }
.pos-item .stk { position: absolute; right: 10px; top: 10px; font-size: 11px; color: var(--text-3); }
.pos-item .stk.low { color: var(--orange); font-weight: 600; }
.pos-item.out { opacity: .55; }
/* 威云对齐 T10：停售商品置灰 + 「停售」角标（点击仍响应，由 addToCart toast 提示） */
.pos-item.off { opacity: .5; }
.pos-item.off:hover { border-color: var(--line-2); box-shadow: none; transform: none; }
.pos-item .off-badge { position: absolute; left: 10px; top: 10px; font-size: 11px; font-weight: 600; color: var(--red, #dc2626); background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; padding: 1px 6px; }

.pos-cart { grid-area: cart; background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.cart-member { padding: 11px 14px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 9px; background: #fbfcfe; }
.cart-member .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-light); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.cart-member .info { flex: 1; min-width: 0; }
.cart-member .info .n { font-size: 13.5px; font-weight: 600; }
.cart-member .info .d { font-size: 11.5px; color: var(--text-3); }
.cart-member .setter { font-size: 12.5px; color: var(--brand); cursor: pointer; white-space: nowrap; }
.cart-list { flex: 1; overflow-y: auto; }
.cart-empty { padding: 60px 20px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.cart-row { padding: 10px 14px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.cart-row:hover { background: #fafcff; }
.cart-row .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cart-row .nm { font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.cart-row .del { color: var(--text-3); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.cart-row .del:hover { color: var(--red); }
.cart-row .bottom { display: flex; justify-content: space-between; align-items: center; }
.cart-row .unit-price { font-size: 12px; color: var(--text-3); }
.cart-row .unit-price b { color: var(--text-2); font-weight: 500; }
.qty-box { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.qty-box button { width: 26px; height: 26px; border: none; background: #fafbfe; color: var(--text-2); cursor: pointer; font-size: 14px; line-height: 1; }
.qty-box button:hover { background: var(--brand-light); color: var(--brand); }
.qty-box input { width: 46px; height: 26px; border: none; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.cart-row .amt { font-size: 14.5px; font-weight: 650; color: var(--red); font-variant-numeric: tabular-nums; }

.cart-foot { border-top: 1px solid var(--line); padding: 12px 14px; background: #fbfcfe; }
.sum-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); padding: 3px 0; }
.sum-row.discount { color: var(--red); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0 4px; border-top: 1px dashed var(--line); margin-top: 6px; }
.sum-total .lb { font-size: 14px; font-weight: 500; }
.sum-total .vl { font-size: 27px; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.pay-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 8px; }
.pay-btn { height: 38px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--text); }
.pay-btn:hover { border-color: var(--brand); color: var(--brand); }
.pay-btn.primary { grid-column: span 3; height: 46px; background: var(--brand); border-color: var(--brand); color: #fff; font-size: 16px; font-weight: 600; }
.pay-btn.primary:hover { background: var(--brand-dark); }
.pay-btn.primary[disabled] { background: #c3cddd; border-color: #c3cddd; cursor: not-allowed; }

.pos-hint { font-size: 12px; color: var(--text-3); margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.pos-hint kbd { background: #f1f4fa; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-family: Consolas, monospace; font-size: 11px; }

/* 支付面板 */
.pay-panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.pay-opt { padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; text-align: center; font-size: 13.5px; transition: all .15s; }
.pay-opt:hover { border-color: var(--brand-soft); background: #fafcff; }
.pay-opt.on { border-color: var(--brand); background: var(--brand-light); color: var(--brand); font-weight: 600; }
.pay-opt .sm { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 3px; font-weight: 400; }

/* 小票 */
.receipt { font-family: Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.75; color: #222; background: #fff; padding: 22px; max-width: 340px; margin: 0 auto; border: 1px dashed #cfd8e6; }
.receipt h4 { text-align: center; font-size: 16px; margin-bottom: 4px; letter-spacing: 1px; }
.receipt .ctr { text-align: center; }
.receipt .hr { border-top: 1px dashed #b9c3d3; margin: 9px 0; }
.receipt .li { display: flex; justify-content: space-between; gap: 8px; }
.receipt .li .l { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt .big { font-size: 15px; font-weight: 700; }

@media (max-width: 900px) { .pos-app { grid-template-columns: 1fr; grid-template-areas: "head" "main"; } .pos-cart { display: none; } }

/* ==========================================================================
   后台框架
   ========================================================================== */
.admin { display: grid; grid-template-columns: 218px 1fr; height: 100vh; overflow: hidden; }
.side { background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2)); display: flex; flex-direction: column; overflow: hidden; }
.side-logo { height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 17px; border-bottom: 1px solid rgba(255, 255, 255, .07); flex-shrink: 0; }
.side-logo .brand-name { font-size: 15.5px; color: #fff; font-weight: 600; }
.side-logo .brand-sub { font-size: 10px; color: #66799a; letter-spacing: 1.6px; }
.side-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); }
.nav-group { font-size: 11px; color: #5a6b8a; padding: 14px 9px 7px; letter-spacing: 1px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9.5px 11px; border-radius: 8px; color: #a9b7cd; cursor: pointer; font-size: 13.5px; margin-bottom: 1px; transition: all .13s; user-select: none; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #e5ecf7; }
.nav-item.on { background: var(--brand); color: #fff; font-weight: 500; box-shadow: 0 4px 12px rgba(217, 119, 6, .35); }
.nav-item .ni { width: 17px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-item .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10.5px; padding: 1px 6px; border-radius: 9px; font-weight: 600; }
.side-foot { padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 11.5px; color: #55688a; flex-shrink: 0; }

.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 58px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 20px; gap: 14px; flex-shrink: 0; }
.topbar h1 { font-size: 17px; font-weight: 620; }
.topbar .sub { font-size: 12.5px; color: var(--text-3); }
.topbar .grow { flex: 1; }
.topbar .icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.topbar .icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 11px 5px 5px; border-radius: 22px; cursor: pointer; border: 1px solid var(--line); }
.user-chip:hover { border-color: var(--brand-soft); background: #fafcff; }
.user-chip .avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #d97706, #059669); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.user-chip .nm { font-size: 13px; font-weight: 500; }
.user-chip .rl { font-size: 11px; color: var(--text-3); }
.content { flex: 1; overflow-y: auto; padding: 16px 20px 40px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 16px; font-weight: 620; }
.page-head .desc { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }

.dropdown { position: absolute; right: 20px; top: 52px; background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); min-width: 178px; padding: 6px; z-index: 500; }
.dropdown .di { padding: 9px 12px; border-radius: 7px; cursor: pointer; font-size: 13.5px; display: flex; align-items: center; gap: 9px; color: var(--text); }
.dropdown .di:hover { background: #f5f8fe; color: var(--brand); }
.dropdown .divider { height: 1px; background: var(--line-2); margin: 5px 0; }

/* 顶栏铃铛未读角标 + 通知下拉 */
.bell-badge { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 600; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.bell-drop { right: 96px; top: 56px; width: 360px; max-height: 480px; overflow: auto; }
.bell-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.bell-item:hover { background: #f5f8fe; }
.bell-item .t { font-size: 13.5px; line-height: 1.5; }
.bell-item .c { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }

/* 图表 */
.chart-wrap { position: relative; width: 100%; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 10px; justify-content: center; }
.chart-legend .lg { display: flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 9px; height: 9px; border-radius: 2px; }
svg.chart text { font-family: inherit; }

.rank-list { display: flex; flex-direction: column; }
.rank-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.rank-row:last-child { border-bottom: none; }
.rank-row .idx { width: 20px; height: 20px; border-radius: 6px; background: #f1f4fa; color: var(--text-2); font-size: 11.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank-row .idx.top1 { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; }
.rank-row .idx.top2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rank-row .idx.top3 { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.rank-row .nm { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .vl { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

.bar-line { height: 6px; border-radius: 3px; background: #eef1f7; overflow: hidden; margin-top: 4px; }
.bar-line > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #fbbf24, #d97706); }

/* 打印 */
#print-area { display: none; }
@media print {
  /* 纸张规格由 JS 按 paperWidth + 实测内容高度动态写入（receipt.js ensurePrintPageCss）。
     ⚠ 高度必须写具体值：`size: 58mm auto` 是无效语法（auto 不能作第二个值），
     整条规则会被浏览器直接丢弃 → 退回 Letter 布局 → 打印驱动再把整页缩到 58mm，
     字被压到不足原来的 1/3，这就是「小票模糊」的真正原因。这里只是兜底。 */
  @page { size: 58mm 297mm; margin: 0; }
  /* 打印根节点复位：后台框架是 height:100vh + overflow:hidden，
     不复位会把小票裁掉或吐出多余空白页。 */
  html, body { height: auto !important; max-height: none !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; background: #fff !important; }
  .admin, .main, .pos-app { display: block !important; height: auto !important; overflow: visible !important; }
  body * { visibility: hidden; }
  #print-area, #print-area *, #receipt-print, #receipt-print * { visibility: visible; }
  #print-area, #receipt-print { display: block !important; position: absolute; left: 0; top: 0; width: var(--cp-paper-w, 58mm); padding: 0; border: none; background: #fff; }
  /* 热敏机物理可打印宽度小于纸宽（58mm 纸约 48mm），两侧留 6mm 安全边，避免右边被裁。
     字体用宋体族：中文有内嵌点阵、笔画硬朗，位图化后比矢量无衬线体清晰得多。
     ⚠ 与下面 .cp-measure 块保持一致（打印前靠它量高度）。 */
  #print-area .receipt, #receipt-print .receipt {
    max-width: none; width: auto; border: none; margin: 0; padding: 0 6mm;
    font-family: "SimSun", "宋体", "NSimSun", "Microsoft YaHei", monospace;
    font-size: 12px; line-height: 1.4; color: #000; font-weight: 500;
  }
  #print-area .receipt h4 { font-size: 14px; letter-spacing: 0; }
  #print-area .receipt .big { font-size: 14px; font-weight: 700; }
  /* 12px 中文每个占 3.2mm，58mm 纸一行只放得下约 9 个字的品名（点阵字库能放 16 个，
     这是 browser 通道的本质局限）。宁可行高多一行，也不要商品名被省略号吃掉。 */
  #print-area .receipt .li .l, #receipt-print .receipt .li .l { white-space: normal; word-break: break-all; }
  /* 热敏是二值输出：灰色会被抖成网点 → 看着发虚。打印时一律压成纯黑。 */
  #print-area .receipt .li.sub, #print-area .receipt .ctr.dim { font-size: 11px; color: #000; }
  #print-area .receipt .hr { border-top-style: solid; border-top-color: #000; }
}
/* 测量态：套用打印版式离线量一次真实高度，供 printReceipt 注入精确的 @page 高度，
   否则短小票也得按 297mm 走纸。⚠ 样式需与上面 @media print 同步修改。 */
#print-area.cp-measure { display: block !important; position: absolute; left: -10000px; top: 0; }
#print-area.cp-measure .receipt {
  max-width: none; width: auto; border: none; margin: 0; padding: 0 6mm; background: #fff;
  font-family: "SimSun", "宋体", "NSimSun", "Microsoft YaHei", monospace;
  font-size: 12px; line-height: 1.4; color: #000; font-weight: 500;
}
#print-area.cp-measure .receipt h4 { font-size: 14px; letter-spacing: 0; }
#print-area.cp-measure .receipt .big { font-size: 14px; font-weight: 700; }
#print-area.cp-measure .receipt .li .l { white-space: normal; word-break: break-all; }
#print-area.cp-measure .receipt .li.sub, #print-area.cp-measure .receipt .ctr.dim { font-size: 11px; color: #000; }
#print-area.cp-measure .receipt .hr { border-top-style: solid; border-top-color: #000; }
#print-area .receipt.paper-80 { width: 80mm; }
/* B-03 批发单：与热敏小票共用 #print-area，但打印时按 A4 排版（58mm 装不下开票明细） */
#print-area.has-invoice .invoice-sheet { max-width: 760px; margin: 0 auto; font-size: 12.5px; }
@media print {
  #print-area.has-invoice { width: 186mm; padding: 8mm; }
  #print-area.has-invoice .invoice-sheet { max-width: none; width: 100%; font-size: 12px; }
}
.receipt .li.sub { font-size: 11px; color: #666; }
.receipt .ctr.dim { font-size: 10.5px; color: #999; margin-top: 6px; }
#receipt-preview-box .receipt { max-width: 300px; font-size: 12px; }
.receipt-modal-preview { max-width: 320px; }

/* ------------------------------ 功能宫格（F6） ------------------------------ */
.panel-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.panel-item { border: 1px solid var(--line); border-radius: 12px; padding: 16px 8px 12px; text-align: center; cursor: pointer; transition: all .15s; user-select: none; background: #fff; }
.panel-item:hover { border-color: var(--brand); background: var(--brand-light); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(217, 119, 6, .12); }
.panel-item .ico { font-size: 26px; line-height: 1.2; }
.panel-item .nm { font-size: 13.5px; font-weight: 600; margin-top: 8px; }
.panel-item .hint { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.panel-item.disabled { opacity: .45; cursor: not-allowed; }
.panel-item.disabled:hover { border-color: var(--line); background: #fff; transform: none; box-shadow: none; }
@media (max-width: 760px) { .panel-grid { grid-template-columns: repeat(3, 1fr); } }

/* ------------------------------ 锁屏遮罩 ------------------------------ */
#lock-screen {
  position: fixed; inset: 0; z-index: 3000;
  background: linear-gradient(125deg, #0b1220 0%, #142646 55%, #1b3a6b 100%);
  display: flex; align-items: center; justify-content: center;
}
#lock-screen .lock-card {
  width: 100%; max-width: 340px; background: #fff; border-radius: 16px;
  padding: 34px 30px; text-align: center; box-shadow: 0 30px 70px rgba(20, 12, 5, .5);
}
#lock-screen .lock-ico { font-size: 40px; }
#lock-screen .lock-title { font-size: 18px; font-weight: 650; margin-top: 10px; }
#lock-screen .lock-sub { font-size: 12.5px; color: var(--text-3); margin: 6px 0 18px; }
#lock-screen .lock-pwd { text-align: center; letter-spacing: 2px; font-size: 16px; }
#lock-screen .lock-err { min-height: 20px; font-size: 12.5px; color: var(--red); margin-top: 8px; }
#lock-screen .lock-btn { width: 100%; margin-top: 6px; }
