:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #16213a;
  --muted: #6b7891;
  --line: #e6ecf5;
  --brand: #2f6bff;
  --brand-dark: #1f4fd0;
  --ok: #12a35a;
  --warn: #f59e0b;
  --danger: #e5484d;
  --shadow: 0 10px 30px rgba(22, 33, 58, .08);
  --radius: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 500px at 50% -180px, #e8f0ff 0%, var(--bg) 60%) no-repeat, var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
.wrap { max-width: 520px; margin: 0 auto; padding: 22px 16px 40px; }
a { color: var(--brand); text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; margin: 4px 0 20px; }
.logo {
  width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #4c8dff, #2f6bff);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px;
  box-shadow: 0 6px 16px rgba(47, 107, 255, .35);
}
.brand h1 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: .5px; }
.brand .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px; border: 1px solid rgba(230, 236, 245, .8);
}
.card h2 { font-size: 16px; margin: 0 0 4px; }
.card .desc { color: var(--muted); font-size: 13px; }
.steps { display: flex; gap: 10px; margin-bottom: 16px; }
.step { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.step b { display: block; font-size: 12px; color: var(--brand); letter-spacing: 1px; }
.step span { font-size: 13px; color: var(--ink); }
.drop {
  border: 2px dashed #c9d7ef; border-radius: 16px; padding: 28px 16px; text-align: center;
  cursor: pointer; transition: .2s; background: #fbfcff;
}
.drop:active, .drop.hover { border-color: var(--brand); background: #f1f6ff; }
.drop .icon { font-size: 34px; }
.drop .t1 { font-weight: 600; margin-top: 6px; }
.drop .t2 { font-size: 12px; color: var(--muted); margin-top: 4px; }
.file-row { display: none; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #f8faff; }
.file-row.show { display: flex; }
.file-icon { width: 42px; height: 42px; border-radius: 10px; background: #eaf1ff; color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.file-meta { flex: 1; min-width: 0; }
.file-meta .name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta .info { font-size: 12px; color: var(--muted); }
.icon-btn { border: none; background: #f1f4fa; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row + .row { margin-top: 12px; }
.label { font-size: 13px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  font-size: 18px; color: var(--ink); cursor: pointer;
}
.stepper button:disabled { opacity: .4; }
.stepper .num { min-width: 24px; text-align: center; font-weight: 600; }
.price-box { display: flex; align-items: baseline; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.price-box .cur { font-size: 13px; color: var(--muted); }
.price-box .amt { font-size: 30px; font-weight: 700; color: var(--danger); letter-spacing: .5px; }
.price-box .cal { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }
.btn {
  display: block; width: 100%; border: none; border-radius: 14px; padding: 15px 16px; font-size: 16px;
  font-weight: 600; color: #fff; background: linear-gradient(135deg, #4c8dff, #2f6bff); cursor: pointer;
  box-shadow: 0 10px 22px rgba(47, 107, 255, .28); margin-top: 16px; letter-spacing: .5px;
}
.btn:disabled { background: #b9c8e2; box-shadow: none; cursor: not-allowed; }
.btn.ghost { background: #f1f5fd; color: var(--brand); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #ff7b7b, #e5484d); box-shadow: 0 10px 22px rgba(229, 72, 77, .25); }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; margin: 0; border-radius: 10px; box-shadow: none; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.6; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: #eef2f8; color: var(--muted);
}
.badge.ok { background: #e7f7ef; color: var(--ok); }
.badge.warn { background: #fff5e6; color: #b7791f; }
.badge.err { background: #fdecee; color: var(--danger); }
.badge.blue { background: #eaf1ff; color: var(--brand); }
.summary-name { font-size: 17px; font-weight: 700; word-break: break-all; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.kv { background: #f8faff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-size: 15px; font-weight: 600; margin-top: 2px; }
.progress { height: 10px; border-radius: 999px; background: #eaf0fa; overflow: hidden; margin: 14px 0 8px; }
.progress > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #4c8dff, #2f6bff); transition: width .4s; }
.alert { border-radius: 14px; padding: 14px; font-size: 14px; margin-top: 14px; }
.alert.warn { background: #fff8ec; border: 1px solid #ffe2b3; color: #8a5a12; }
.alert.err { background: #fdf0f1; border: 1px solid #ffd3d6; color: #a3282c; }
.alert.ok { background: #effaf4; border: 1px solid #c8ecd8; color: #0d7a43; }
.alert b { display: block; margin-bottom: 4px; }
.pay-box { text-align: center; margin-top: 8px; }
.pay-qr { width: 200px; height: 200px; margin: 12px auto; border-radius: 14px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.pay-qr img { width: 100%; height: 100%; object-fit: contain; }
.seg { display: flex; gap: 8px; background: #f1f5fd; padding: 4px; border-radius: 12px; }
.seg a { flex: 1; text-align: center; padding: 8px; border-radius: 9px; font-size: 13px; color: var(--muted); }
.seg a.on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 2px 8px rgba(47, 107, 255, .12); }
.footer { text-align: center; color: #9aa7bd; font-size: 12px; margin-top: 24px; }
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: #6c7f9e; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: rgba(22, 33, 58, .92); color: #fff; padding: 10px 16px; border-radius: 12px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; max-width: 86vw; z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.spinner { width: 16px; height: 16px; border: 2px solid #c8d8f8; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.muted { color: var(--muted); } .small { font-size: 12px; }

/* 大屏二维码 */
.screen-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(900px 500px at 50% 0%, #e9f1ff, #f5f8fe 55%, #eef3fb); }
.screen-card { width: min(92vw, 720px); background: #fff; border-radius: 26px; box-shadow: 0 24px 60px rgba(22, 33, 58, .12); padding: 34px; text-align: center; }
.screen-card h1 { margin: 0; font-size: 30px; letter-spacing: 2px; }
.screen-card .tag { color: var(--muted); margin-top: 6px; font-size: 14px; letter-spacing: 1px; }
.qr-frame { margin: 24px auto 10px; width: min(64vw, 400px); aspect-ratio: 1; border-radius: 20px; background: #f7faff; border: 1px solid var(--line); display: grid; place-items: center; padding: 10px; }
.qr-frame img { width: 100%; height: 100%; object-fit: contain; }
.url { font-family: ui-monospace, Consolas, monospace; color: var(--brand); font-size: 14px; word-break: break-all; }
.screen-foot { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.price-tag { font-size: 22px; font-weight: 700; color: var(--danger); }
.price-tag small { font-size: 13px; color: var(--muted); font-weight: 400; }

/* 管理后台 */
.admin-wrap { max-width: 1080px; }
.admin-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
td .fname { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
input[type=text], input[type=password], input[type=number] {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fff; outline: none;
}
input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.switch input { width: 18px; height: 18px; }
@media (max-width: 820px) { .admin-grid { grid-template-columns: 1fr; } }
