* { box-sizing: border-box; }

:root {
  --primary: #1677ff;
  --primary-dark: #0f5fd7;
  --primary-soft: #eaf3ff;
  --success: #00a870;
  --success-soft: #e6f8f1;
  --warning: #ff8f1f;
  --warning-soft: #fff4e6;
  --danger: #e34d59;
  --text: #1d2129;
  --text-2: #4e5969;
  --text-3: #86909c;
  --line: #e5e8ef;
  --bg: #f4f6fa;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(15, 35, 75, 0.07);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: var(--text-3); }

h1, h2, h3 { margin: 0; }
p { margin: 0; }

.btn {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .16s ease;
  background: #f2f3f5;
  color: var(--text-2);
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(22, 119, 255, .22); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.success { background: var(--success); color: #fff; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text-2); }
.btn.ghost:hover { border-color: #b9c2d4; color: var(--text); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.block { display: block; width: 100%; margin-top: 10px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border .15s, box-shadow .15s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}
textarea { resize: vertical; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%2386909c' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.field-label { display: block; margin: 16px 0 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 15% 0%, rgba(22, 119, 255, .10), transparent 60%),
    radial-gradient(800px 400px at 100% 100%, rgba(0, 168, 112, .08), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 18px;
  padding: 34px 32px 28px;
  box-shadow: 0 20px 60px rgba(15, 35, 75, .10);
}
.login-logo {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 8px 18px rgba(22, 119, 255, .28);
}
.login-card h1 { font-size: 21px; letter-spacing: .5px; }
.login-sub { color: var(--text-3); margin: 4px 0 22px; font-size: 13px; }
.login-card form label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--text-2); }
.login-card form .btn { margin-top: 22px; padding: 11px; }
.login-hint { margin-top: 18px; font-size: 12px; color: var(--text-3); line-height: 1.7; }
.error-text { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

.topbar {
  height: 66px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--primary); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand h1 { font-size: 16px; }
.brand p { font-size: 11px; color: var(--text-3); letter-spacing: .4px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.who { font-size: 13px; color: var(--text-2); }
.badge { font-size: 11px; padding: 3px 9px; border-radius: 20px; font-weight: 500; }
.badge.demo { background: var(--warning-soft); color: #b36200; border: 1px solid #ffdca8; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 14px 26px 0;
  max-width: 1240px;
  margin: 0 auto;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 9px 9px 0 0;
  cursor: pointer;
  position: relative;
  font-weight: 500;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); background: #fff; }
.tab.active::after {
  content: "";
  position: absolute; left: 18px; right: 18px; bottom: 0;
  height: 2px; background: var(--primary); border-radius: 2px;
}

.main { max-width: 1240px; margin: 0 auto; padding: 16px 26px 46px; }
.panel { display: none; }
.panel.active { display: block; }

.site-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 26px 10px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.9;
}
.site-footer p { margin: 2px 0; }
.site-footer .beian a { color: var(--text-3); text-decoration: none; }
.site-footer .beian a:hover { color: var(--primary); }
.site-footer .beian a + a { margin-left: 14px; }
.login-wrap .site-footer {
  max-width: 400px;
  margin-top: 20px;
  padding: 0;
  border-top: none;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(229, 232, 239, .7);
}
.card-title { font-size: 16px; margin-bottom: 6px; }

.cashier-grid { display: grid; grid-template-columns: 420px 1fr; gap: 18px; align-items: start; }
.product-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.product-option {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
}
.product-option strong { display: block; font-size: 13px; color: var(--text); }
.product-option span { font-size: 11px; color: var(--text-3); line-height: 1.5; display: block; margin-top: 2px; }
.product-option:hover { border-color: #b6d4ff; }
.product-option.active { border-color: var(--primary); background: var(--primary-soft); }
.product-option.active strong { color: var(--primary-dark); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12px; color: var(--text-3); margin-top: 12px; line-height: 1.7; }

.pay-card { min-height: 520px; display: flex; flex-direction: column; justify-content: center; }
.pay-empty { text-align: center; color: var(--text-3); padding: 60px 0; }
.empty-mark {
  width: 60px; height: 60px; border-radius: 18px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.pay-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pay-head h3 { font-size: 17px; }
.pay-head .mono { margin-top: 3px; }
.status { font-size: 12px; padding: 4px 12px; border-radius: 20px; white-space: nowrap; background: #f2f3f5; color: var(--text-2); }
.status.wait { background: var(--warning-soft); color: #b36200; }
.status.paid { background: var(--success-soft); color: #007a50; }
.status.auth { background: var(--primary-soft); color: var(--primary-dark); }
.status.closed { background: #f2f3f5; color: var(--text-3); }
.pay-amount { margin: 18px 0 2px; font-size: 38px; font-weight: 700; letter-spacing: -.5px; color: var(--text); }
.cny { font-size: 20px; font-weight: 600; margin-right: 4px; color: var(--text-2); }
.pay-meta { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12px; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: #c9cdd4; }

.qr-wrap { text-align: center; margin-top: 20px; }
.qr-wrap img {
  width: 220px; height: 220px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}
.qr-tip { margin-top: 10px; color: var(--text-3); font-size: 12px; }

.redirect-wrap { text-align: center; margin-top: 26px; background: #f8faff; border: 1px dashed #bcd7ff; border-radius: 12px; padding: 22px; }
.redirect-wrap p { color: var(--text-2); font-size: 13px; }

.paid-wrap { display: none; text-align: center; margin-top: 12px; }
.paid-wrap.show { display: block; }
.paid-icon {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--success-soft); color: var(--success);
  font-size: 30px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin: 10px auto 12px;
}
.paid-icon.blue { background: var(--primary-soft); color: var(--primary); font-size: 22px; }
.paid-wrap h3 { font-size: 18px; }
.paid-sub { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.paid-info {
  background: #fafbfe;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 16px 0;
  text-align: left;
}
.paid-info div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.paid-info dt { color: var(--text-3); font-size: 12px; }
.paid-info dd { margin: 0; font-size: 12px; color: var(--text-2); }

.pay-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.pay-actions .btn { flex: 1; min-width: 120px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.search { width: 240px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #fafbfd;
  font-size: 12px;
}
.table td { padding: 13px 12px; border-bottom: 1px solid #f0f2f7; color: var(--text-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafcff; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions-col { text-align: right; width: 1%; white-space: nowrap; }
.table td.actions { text-align: right; white-space: nowrap; }
.mini-btn {
  border: 0; background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
}
.mini-btn:hover { text-decoration: underline; }
.mini-btn.danger { color: var(--danger); }
.mini-btn.gray { color: var(--text-3); }
.table-empty { text-align: center; color: var(--text-3); padding: 44px 0; font-size: 13px; }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--primary-soft); color: var(--primary-dark); }
.progress { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.progress-bar { flex: 1; height: 5px; border-radius: 4px; background: #eceff5; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.progress span { font-size: 11px; color: var(--text-3); white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 18px 22px;
  box-shadow: var(--shadow); border: 1px solid rgba(229, 232, 239, .7);
}
.stat-card span { color: var(--text-3); font-size: 12px; }
.stat-card strong { display: block; font-size: 24px; margin-top: 6px; font-variant-numeric: tabular-nums; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.product-settings { display: grid; gap: 8px; margin-top: 12px; }
.product-check {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; cursor: pointer;
  transition: all .15s;
}
.product-check.active { border-color: var(--primary); background: var(--primary-soft); }
.product-check input { width: auto; margin-top: 3px; accent-color: var(--primary); }
.product-check .pc-title { font-size: 13px; font-weight: 500; color: var(--text); }
.product-check .pc-desc { font-size: 11px; color: var(--text-3); }
.switch-row { display: flex; gap: 10px; align-items: center; margin-top: 18px; font-size: 13px; color: var(--text-2); }
.switch-row input { width: auto; accent-color: var(--primary); }
.settings-actions { display: flex; gap: 10px; margin-top: 22px; }
.settings-actions .btn { flex: 1; }
.info-list { margin: 12px 0 0; }
.info-list div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px dashed #eef0f5; }
.info-list div:last-child { border-bottom: 0; }
.info-list dt { color: var(--text-3); font-size: 12px; }
.info-list dd { margin: 0; font-size: 12px; color: var(--text-2); word-break: break-all; text-align: right; }

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(17, 24, 39, .45); backdrop-filter: blur(2px); }
.modal-card {
  position: relative; background: #fff; border-radius: 16px;
  width: 100%; max-width: 560px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(15, 35, 75, .22);
  max-height: 86vh; overflow-y: auto;
}
.modal-card h3 { font-size: 17px; margin-bottom: 8px; }
.modal-body { margin-top: 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-body .field-label { margin-top: 12px; }
.receiver-row {
  display: grid; grid-template-columns: 92px 1fr 110px 34px; gap: 8px; align-items: center; margin-bottom: 8px;
}
.receiver-row select, .receiver-row input { padding: 8px 10px; font-size: 13px; }
.remove-row { border: 0; background: #f4f6fa; color: var(--text-3); border-radius: 8px; width: 30px; height: 32px; cursor: pointer; font-size: 15px; }
.total-line { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 2px; font-size: 13px; color: var(--text-2); }
.total-line strong { color: var(--text); font-size: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(10px);
  background: rgba(29, 33, 41, .92); color: #fff;
  padding: 11px 22px; border-radius: 10px; font-size: 13px;
  z-index: 80; opacity: 0; transition: all .22s ease; pointer-events: none; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 980px) {
  .cashier-grid, .settings-grid { grid-template-columns: 1fr; }
  .pay-card { min-height: auto; }
  .stats { grid-template-columns: 1fr; }
  .topbar, .tabs, .main { padding-left: 14px; padding-right: 14px; }
  .search { width: 100%; }
  .receiver-row { grid-template-columns: 80px 1fr 80px 30px; }
}
