/* ===== Blue theme ===== */
:root {
  --blue: #3b82f6;
  --blue-hover: #2563eb;
  --blue-light: rgba(59, 130, 246, 0.12);
  --blue-btn: rgba(59, 130, 246, 0.85);
  --blue-btn-hover: rgba(59, 130, 246, 1);
  --red: #ef4444;
  --bg: #f0f4f8;
  --card: #ffffff;
  --text: #333333;
  --text-muted: #666666;
  --border: #e5e7eb;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; height: auto; }

.page { width: 100%; min-height: 100vh; padding: 8px; }
.page-inner { width: 100%; max-width: 1200px; margin: 0 auto; }
@media (min-width: 768px) { .page { padding: 20px; } }

/* ===== Header ===== */
.site-header {
  display: flex; align-items: center; justify-content: center;
  height: 50px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-hover) 100%);
  color: #fff; border-radius: var(--radius);
  font-size: 18px; font-weight: 600; letter-spacing: 0.5px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
@media (min-width: 1024px) {
  .site-header { height: 56px; font-size: 20px; margin-top: 8px; margin-bottom: 16px; }
}

.user-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; margin-bottom: 10px;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); font-size: 14px;
}
.user-bar.hidden { display: none; }
.user-bar-text { color: var(--text-muted); }
.user-bar-text strong { color: var(--blue); font-weight: 600; }
.btn-logout {
  flex-shrink: 0; padding: 6px 14px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text-muted); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-logout:hover { border-color: var(--blue); color: var(--blue); }

.badge-demo {
  display: inline-block; background: rgba(255,255,255,.22); color: #fff;
  font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 999px; margin-left: 8px;
}

/* ===== Cards ===== */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow);
}
@media (min-width: 768px) { .card { padding: 16px; margin-bottom: 12px; } }

/* ===== Payment grid ===== */
.method-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 4px 0;
}
@media (min-width: 640px) { .method-grid { grid-template-columns: repeat(3, 1fr); gap: 15px; } }
@media (min-width: 1024px) { .method-grid { grid-template-columns: repeat(6, 1fr); } }

.method-item {
  display: flex; align-items: center; justify-content: center;
  min-height: 90px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; user-select: none; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.method-item:hover { border-color: var(--blue); box-shadow: 0 2px 10px rgba(59,130,246,.15); }
.method-item:active { transform: scale(.98); }
.method-item.active {
  border: 2px solid var(--blue);
  background: var(--blue-light);
  box-shadow: 0 2px 12px rgba(59,130,246,.2);
}
.method-item img { width: 100%; max-width: 150px; height: 56px; object-fit: contain; padding: 6px 8px; }

/* ===== Deposit form ===== */
.form-section { padding: 8px 4px 20px; }
@media (min-width: 1024px) { .form-section { max-width: 680px; margin: 0 auto; padding: 16px 40px 32px; } }

.form-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 14px; }
.form-label { font-size: 16px; font-weight: 600; color: var(--text); }
.hint { font-size: 14px; color: var(--blue); flex: 1; min-width: 180px; }
.hint .count { color: var(--red); font-weight: 700; }

.input-wrap {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 0 15px; height: 56px; display: flex; align-items: center; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.input-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.input-wrap input { width: 100%; border: none; outline: none; font-size: 16px; color: var(--text); background: transparent; }
.input-wrap input::placeholder { color: #bbb; }

.divider { border: none; border-top: 1px solid #ddd; margin: 20px 0; }
.tips { list-style: disc; margin-left: 18px; font-size: 12px; color: var(--text-muted); line-height: 1.75; }
.tips li { margin-bottom: 4px; }

.submit-wrap { padding: 16px 25px 8px; text-align: center; }
.btn-submit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 50%; min-width: 200px; max-width: 343px; height: 56px;
  border: none; border-radius: 12px;
  background: var(--blue-btn); color: #fff;
  font-size: 16px; font-weight: 500; cursor: pointer;
  transition: background .15s;
}
.btn-submit:hover { background: var(--blue-btn-hover); }
.btn-submit:disabled { background: #d1d5db; color: #9ca3af; cursor: not-allowed; }

/* ===== Site footer ===== */
.site-footer {
  text-align: center; font-size: 12px; color: #888;
  padding: 20px 12px 36px; line-height: 1.9;
}
.site-footer .copyright { margin-bottom: 6px; }
.site-footer .footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; }
.site-footer .footer-links a {
  display: inline-block; padding: 0 10px;
  border-right: 1px solid #ccc; color: #666; font-size: 12px;
}
.site-footer .footer-links a:last-child { border-right: none; }
.site-footer .admin-link { display: inline-block; margin-top: 10px; color: var(--blue); font-size: 13px; }

.order-back-wrap { max-width: 480px; margin: 16px auto 0; padding: 0 4px; }
.btn-back {
  width: 100%; padding: 12px; border: 1px solid var(--blue); border-radius: 12px;
  background: #fff; color: var(--blue); font-size: 16px; font-weight: 500;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-back:hover { background: var(--blue-light); }
.btn-back:active { transform: scale(.99); }

/* ===== Order page - shared ===== */
.order-layout { max-width: 480px; margin: 0 auto; }
.order-card { padding: 0; overflow: hidden; }
.order-card--transfer { background: #fff; }

/* ----- 银行卡 / 对公 汇款页 ----- */
.transfer-page {
  padding: 20px 18px 22px;
  background: #fff;
}

.transfer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.transfer-header img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.transfer-title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: 0.5px;
}

.transfer-amount {
  margin-bottom: 6px;
  font-size: 16px;
  color: #374151;
  line-height: 1.6;
}

.transfer-amount-value {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.5px;
}

.transfer-fields {
  margin-top: 8px;
}

.transfer-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 0;
  border-bottom: 1px solid #f0f0f0;
}

.transfer-field:last-child {
  border-bottom: none;
}

.transfer-field-text {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  color: #333;
  line-height: 1.5;
  word-break: break-all;
}

.transfer-field-text .field-label {
  color: #4b5563;
  white-space: nowrap;
}

.transfer-field-text .field-value {
  color: #111827;
  font-weight: 500;
}

.btn-copy {
  flex-shrink: 0;
  min-width: 58px;
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn-copy:hover {
  background: var(--blue-hover);
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.45);
}

.btn-copy:active {
  transform: scale(0.97);
}

.transfer-countdown {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--red);
  margin: 22px 0 18px;
  letter-spacing: 1px;
}

.transfer-footer {
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;
  margin-top: 4px;
}

.transfer-tips {
  list-style: disc;
  margin-left: 18px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.8;
}

.transfer-tips li {
  margin-bottom: 2px;
}

@media (min-width: 768px) {
  .order-layout { max-width: 520px; }
  .transfer-page { padding: 28px 32px 30px; }
  .transfer-title { font-size: 22px; }
  .transfer-amount-value { font-size: 22px; }
  .transfer-field-text { font-size: 16px; }
}

/* ----- QR 扫码页 ----- */
.order-brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 16px; padding: 20px 18px 0;
}
.order-brand img { width: 48px; height: 48px; object-fit: contain; }
.order-brand .brand-text { font-size: 18px; font-weight: 600; color: var(--text); }

.order-no-line {
  text-align: center; font-size: 13px; color: #888;
  word-break: break-all; margin-bottom: 8px; letter-spacing: .5px;
  padding: 0 18px;
}

.qr-amount {
  text-align: center; font-size: 36px; font-weight: 700;
  color: var(--text); margin: 8px 0 16px;
}

.countdown {
  text-align: center; font-size: 22px; font-weight: 700;
  color: var(--red); margin: 18px 0 8px;
}

.order-tips {
  list-style: disc; margin: 16px 18px 20px; font-size: 12px;
  color: var(--text-muted); line-height: 1.75;
}
.order-tips li { margin-bottom: 4px; }

/* QR layout */
.qr-box { text-align: center; padding: 8px 0 4px; }
.qr-box img {
  width: min(260px, 72vw); height: min(260px, 72vw);
  margin: 0 auto; object-fit: contain;
  border: 1px solid var(--border); border-radius: 12px;
  background: #fafafa; padding: 10px;
}

.status-badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 500; margin-bottom: 12px;
}
.status-pending { background: #fef3c7; color: #b45309; }
.status-paid { background: #d1fae5; color: #047857; }
.status-expired, .status-cancelled { background: #f3f4f6; color: #6b7280; }

.order-expired-mask {
  text-align: center; padding: 40px 20px; color: var(--red); font-size: 16px;
}

/* ===== Admin ===== */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.admin-nav button {
  padding: 8px 14px; border: 1px solid var(--border); background: #fff;
  border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text);
}
.admin-nav button.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.stat-card {
  background: var(--blue-light); border: 1px solid rgba(59,130,246,.2);
  border-radius: 8px; padding: 12px; text-align: center;
}
.stat-card .num { font-size: 24px; font-weight: 700; color: var(--blue); }
.stat-card .lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px; text-align: left; }
th { background: #f8fafc; color: #555; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: block; font-size: 13px; margin-bottom: 4px; color: #555; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px;
}
.form-grid .full { grid-column: 1 / -1; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border: none; border-radius: 8px;
  background: var(--blue); color: #fff; font-size: 14px; cursor: pointer;
}
.btn-primary:hover { background: var(--blue-hover); }
.btn-sm {
  padding: 4px 10px; font-size: 12px; border-radius: 6px;
  border: 1px solid var(--border); background: #fff; cursor: pointer; margin: 2px;
}
.btn-danger { color: var(--red); border-color: #fecaca; }
.btn-success { color: #10b981; border-color: #bbf7d0; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.alert-info { background: var(--blue-light); color: var(--blue-hover); border: 1px solid rgba(59,130,246,.2); }
.alert-warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

.code-hint {
  font-size: 12px; color: #888; background: #f8fafc;
  border: 1px dashed var(--border); border-radius: 6px;
  padding: 10px; margin-bottom: 10px; line-height: 1.6;
}

@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .admin-wrap { padding: 8px; }
}

/* ===== Cashier modals ===== */
.cashier-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.cashier-overlay.hidden { display: none; }
.cashier-modal {
  width: 100%; max-width: 400px;
  background: var(--card); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.2);
  overflow: hidden;
}
.cashier-modal-head {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-hover) 100%);
  color: #fff; font-size: 17px; font-weight: 600; text-align: center;
}
.cashier-modal-body {
  padding: 20px; font-size: 14px; line-height: 1.7; color: var(--text);
  max-height: 50vh; overflow-y: auto;
}
.cashier-modal-body p { margin-bottom: 8px; }
.cashier-modal-foot {
  display: flex; gap: 10px; padding: 0 20px 20px;
}
.cashier-modal-foot.single { justify-content: center; }
.cashier-modal-foot.single .btn-modal { max-width: 200px; }
.btn-modal {
  flex: 1; height: 44px; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background .15s, opacity .15s;
}
.btn-modal.primary {
  background: var(--blue-btn); color: #fff;
}
.btn-modal.primary:hover { background: var(--blue-btn-hover); }
.btn-modal.outline {
  background: #fff; color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-modal.outline:hover { border-color: var(--blue); color: var(--blue); }
.login-hint {
  font-size: 13px; color: var(--text-muted); margin-bottom: 16px;
  padding: 10px 12px; background: var(--blue-light); border-radius: 8px;
}
.login-field { margin-bottom: 14px; }
.login-field label {
  display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px;
}
.login-field input {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 15px;
}
.login-field input:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-light);
}
.login-error {
  color: var(--red); font-size: 13px; margin-top: 4px; text-align: center;
}
.login-error.hidden { display: none; }
