/* 码支付平台 公共样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; color: #2c3e50; background: #f4f6f9; }
a { color: #3b82f6; text-decoration: none; }
a:hover { opacity: .85; }
code { background: #eef2f7; padding: 2px 6px; border-radius: 4px; font-size: 12px; word-break: break-all; }
small.muted, .muted { color: #8a94a6; font-size: 12px; }
.ok { color: #16a34a; } .bad { color: #dc2626; } .warn { color: #d97706; }

/* ---------- 登录/注册 ---------- */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); }
.auth-card { background: #fff; border-radius: 12px; padding: 40px 36px; width: 360px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.auth-card h1 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.auth-sub { text-align: center; color: #8a94a6; margin-bottom: 24px; }
.auth-card input { width: 100%; padding: 11px 14px; border: 1px solid #dde3ec; border-radius: 8px; margin-bottom: 14px; font-size: 14px; outline: none; }
.auth-card input:focus { border-color: #3b82f6; }
.auth-card button { width: 100%; padding: 12px; background: #3b82f6; color: #fff; border: 0; border-radius: 8px; font-size: 15px; cursor: pointer; }
.auth-card button:hover { background: #2563eb; }
.auth-links { text-align: center; margin-top: 18px; font-size: 13px; color: #8a94a6; }

/* ---------- 收银台 ---------- */
.pay-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); padding: 20px; }
.pay-wrap { width: 400px; max-width: 100%; }
.pay-card { background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.pay-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.pay-merchant { color: #8a94a6; font-size: 13px; }
.pay-state { font-size: 13px; padding: 4px 12px; border-radius: 20px; background: #fff7ed; color: #d97706; }
.pay-state.ok { background: #f0fdf4; color: #16a34a; }
.pay-state.expired { background: #f3f4f6; color: #6b7280; }
.pay-title { font-size: 15px; color: #4b5563; margin-bottom: 6px; }
.pay-money { font-size: 34px; font-weight: 700; color: #111827; margin-bottom: 14px; }
.pay-money b { font-size: 42px; }
.pay-meta { display: flex; justify-content: space-between; color: #8a94a6; font-size: 12px; margin-bottom: 20px; }
.qr-box { text-align: center; padding: 16px; border: 1px dashed #dde3ec; border-radius: 12px; }
.qrcode-img { width: 200px; height: 200px; object-fit: contain; }
.qr-empty { color: #8a94a6; padding: 40px 0; }
.qr-tip { font-size: 13px; color: #4b5563; margin-top: 10px; }
.qr-warn { font-size: 12px; color: #d97706; background: #fffbeb; border-radius: 8px; padding: 8px; margin-top: 10px; }
.qr-warn b { color: #dc2626; }
.pay-countdown { text-align: center; color: #8a94a6; font-size: 13px; margin-top: 14px; }
.pay-countdown b { color: #d97706; }
.monitor-state { text-align: center; font-size: 12px; color: #8a94a6; margin-top: 8px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot.on { background: #16a34a; } .dot.off { background: #9ca3af; }
.pay-foot { text-align: center; color: rgba(255,255,255,.6); font-size: 12px; margin-top: 16px; }

/* ---------- 后台面板 ---------- */
.panel-page { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: #1e293b; color: #cbd5e1; flex-shrink: 0; display: flex; flex-direction: column; }
.logo { font-size: 16px; font-weight: 700; color: #fff; padding: 22px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav a { display: block; padding: 11px 20px; color: #cbd5e1; font-size: 13.5px; border-left: 3px solid transparent; }
.sidebar nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar nav a.active { background: rgba(59,130,246,.15); border-left-color: #3b82f6; color: #fff; }
.sidebar-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot a { color: #94a3b8; font-size: 13px; }
.main { flex: 1; padding: 26px 30px; min-width: 0; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 10px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-label { color: #8a94a6; font-size: 13px; }
.stat-value { font-size: 26px; font-weight: 700; margin: 6px 0 4px; }
.stat-tip { color: #8a94a6; font-size: 12px; }

.card { background: #fff; border-radius: 10px; padding: 20px 22px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 20px; }
.card.narrow { max-width: 560px; }
.card-row { display: flex; gap: 20px; flex-wrap: wrap; }
.card-row .card.half { flex: 1; min-width: 320px; }
.card h3 { font-size: 15px; margin-bottom: 14px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid #eef1f6; text-align: left; font-size: 13px; vertical-align: middle; }
.table th { color: #6b7280; font-weight: 600; white-space: nowrap; }
.table.kv th { width: 140px; color: #334155; }
.ops { white-space: nowrap; }

button, .btn-mini { background: #3b82f6; color: #fff; border: 0; border-radius: 6px; padding: 8px 16px; font-size: 13px; cursor: pointer; }
.btn-mini { padding: 4px 10px; font-size: 12px; text-decoration: none; display: inline-block; margin: 1px 2px 1px 0; }
.btn-mini.bad, .btn-danger { background: #dc2626; }
button:hover, .btn-mini:hover { opacity: .9; }

input, select, textarea { padding: 8px 10px; border: 1px solid #dde3ec; border-radius: 6px; font-size: 13px; outline: none; }
input:focus, select:focus { border-color: #3b82f6; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 6px; }
.form-row input, .form-row select { width: 100%; max-width: 340px; }
.form-row small.muted { display: block; margin-top: 4px; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert.err { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert.ok { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.pager { margin-top: 14px; display: flex; gap: 6px; align-items: center; }
.pager a { padding: 5px 10px; border-radius: 6px; background: #f1f5f9; color: #475569; font-size: 12px; }
.pager a.on { background: #3b82f6; color: #fff; }
.qr-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid #eef1f6; }

.chart { display: flex; align-items: flex-end; gap: 18px; height: 160px; padding-top: 10px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar { width: 34px; background: linear-gradient(180deg, #60a5fa, #3b82f6); border-radius: 6px 6px 0 0; min-height: 4px; }
.bar-col span { font-size: 11px; color: #8a94a6; }

.code { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 8px; font-size: 12px; line-height: 1.7; overflow-x: auto; white-space: pre-wrap; word-break: break-all; font-family: Menlo, Consolas, monospace; }

@media (max-width: 768px) {
  .panel-page { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar nav { display: flex; flex-wrap: wrap; padding: 4px; }
  .sidebar nav a { border-left: 0; padding: 8px 12px; }
  .main { padding: 16px; }
}
