:root {
  --brand: #1b4fd8;
  --brand-dark: #1337a3;
  --accent: #ff6b2c;
  --ink: #16202e;
  --muted: #6b7a90;
  --line: #e3e8f0;
  --bg: #f4f6fb;
  --card: #ffffff;
  --ok: #10a35a;
  --warn: #e5a000;
  --danger: #d63b3b;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(22, 32, 46, .08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }

.hero {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand) 55%, #3a7bff);
  color: #fff;
  padding: 28px 20px 26px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.hero h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: .5px; }
.hero p { margin: 0; opacity: .88; font-size: 14px; }
.hero .meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero .meta span {
  background: rgba(255, 255, 255, .16);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 13px;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 18px 16px 48px; }
.wrap.wide { max-width: 1180px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 {
  margin: 0 0 14px;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2 .dot { width: 6px; height: 18px; border-radius: 3px; background: var(--accent); display: inline-block; }

label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
label.req::after { content: " *"; color: var(--danger); }

input[type=text], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(27, 79, 216, .12);
}
textarea { resize: vertical; min-height: 90px; }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
@media (max-width: 640px) { .row { flex-direction: column; gap: 0; } }

.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
  user-select: none;
}
.item:hover { border-color: #b9c8e8; }
.item.on { border-color: var(--brand); background: #eef3ff; box-shadow: 0 0 0 3px rgba(27, 79, 216, .1); }
.item .n { font-weight: 600; font-size: 15px; }
.item .f { color: var(--accent); font-size: 13px; margin-top: 2px; }

.total-bar {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 0 0 var(--radius) var(--radius);
  margin: 16px -20px -20px;
}
.total-bar .label { color: var(--muted); font-size: 14px; }
.total-bar .amount { font-size: 24px; font-weight: 700; color: var(--accent); }
.total-bar .amount small { font-size: 14px; font-weight: 500; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 10px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #b7c2d6; cursor: not-allowed; }
.btn.ghost { background: #eef1f7; color: var(--ink); }
.btn.ghost:hover { background: #e2e7f1; }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

.hint { font-size: 13px; color: var(--muted); margin-top: 8px; }
.err { color: var(--danger); font-size: 14px; margin-top: 10px; min-height: 20px; }
.ok-msg { color: var(--ok); font-size: 14px; margin-top: 10px; }

.check { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font-size: 14px; color: var(--muted); }
.check input { margin-top: 3px; width: 16px; height: 16px; flex: none; }

.qr-box { text-align: center; padding: 8px 0; }
.qr-box img { width: 210px; height: 210px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.qr-box .note { font-size: 13px; color: var(--muted); margin-top: 8px; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.paid { background: #e6f7ee; color: var(--ok); }
.badge.pending { background: #fff4e0; color: var(--warn); }
.badge.external { background: #eef1f7; color: var(--muted); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 9px 16px;
  border: none;
  background: none;
  font-size: 15px;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 13px; background: #fafbfe; position: sticky; top: 0; }
tr:hover td { background: #fafbff; }
.table-scroll { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }

.search-bar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.search-bar input, .search-bar select { width: auto; flex: 1; min-width: 160px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.stat .v.money { color: var(--accent); }

.event-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.event-card .t { font-weight: 600; font-size: 16px; }
.event-card .s { font-size: 13px; color: var(--muted); margin-top: 3px; }

.login-wrap { max-width: 380px; margin: 12vh auto; padding: 0 16px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
  z-index: 999;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--danger); }

.score-table { font-size: 15px; }
.score-table td:last-child { text-align: right; font-weight: 600; }
.score-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.score-head .name { font-size: 20px; font-weight: 700; }
.score-head .rank { color: var(--accent); font-weight: 700; }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0 0; }
