:root {
  --brand: #1f6f5c;
  --brand-dark: #155044;
  --brand-soft: #e6f2ee;
  --gold: #b88a2e;
  --ink: #1e2622;
  --muted: #68746e;
  --line: #dfe6e2;
  --bg: #f4f6f4;
  --card: #ffffff;
  --danger: #b3413a;
  --danger-soft: #fbecea;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(31, 111, 92, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(circle at top left, #e8f4ef 0, var(--bg) 38%, #f7f8f6 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
.hidden { display: none !important; }
.wrap { width: min(1120px, calc(100% - 28px)); margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(31, 111, 92, 0.96);
  color: #fff;
  backdrop-filter: blur(12px);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #f7e7b0, #d9b665);
  color: #4a3510; font-weight: 800;
}
.userbox { display: flex; align-items: center; gap: 10px; font-size: 13px; opacity: .95; }
.role-pill { padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: 12px; }
.container { padding: 22px 0 56px; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.col-7 { grid-column: span 7; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-12 { grid-column: span 12; }
.card {
  background: var(--card);
  border: 1px solid rgba(223, 230, 226, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card h2, .card h3 { margin: 0 0 12px; line-height: 1.25; }
.card h2 { font-size: 20px; }
.card h3 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; }
.mb12 { margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.right { margin-left: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 16px;
  border: 0; border-radius: 11px;
  background: var(--brand); color: #fff;
  font-weight: 650;
  transition: transform .12s ease, background .12s ease, opacity .12s ease;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--brand); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--brand-soft); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #94342e; }
.btn-ghost { background: transparent; color: var(--brand); border: 1px dashed #b9d3c9; }
.btn-sm { min-height: 34px; padding: 0 11px; border-radius: 9px; font-size: 13px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px;
  border: 1px solid var(--line); border-radius: 11px;
  background: #fff; color: var(--ink);
  padding: 10px 12px; outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,92,.1); }
textarea.input { min-height: 76px; resize: vertical; }
.field { margin-bottom: 12px; }
.label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 180px; margin-bottom: 0; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 430px; min-width: 0; padding: 22px; border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(18, 72, 58, .16); }
.login-card .row { flex-wrap: nowrap; }
.login-card .row .input { width: auto; flex: 1 1 0; min-width: 0; }
.login-card .row .btn { flex: 0 0 auto; white-space: nowrap; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-brand .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
.login-title { font-size: 25px; font-weight: 800; margin: 14px 0 4px; }
.login-sub { color: var(--muted); margin-bottom: 20px; }
.dev-code { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fff8e5; border: 1px solid #f0dfb0; color: #70551a; font-size: 13px; }
.member-card {
  background: linear-gradient(145deg, #1d6a58 0%, #124b40 58%, #0d3b33 100%);
  color: #fff; border: 0; position: relative; overflow: hidden;
}
.member-card::after {
  content: ""; position: absolute; width: 280px; height: 280px; right: -110px; top: -130px;
  background: radial-gradient(circle, rgba(238, 205, 126, .35), transparent 65%); border-radius: 50%;
}
.member-card > * { position: relative; z-index: 1; }
.tier-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 12px; }
.tier-dot { width: 7px; height: 7px; border-radius: 50%; background: #f1ce7b; }
.points-line { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 4px; }
.points-big { font-size: 48px; line-height: 1; font-weight: 800; letter-spacing: -.03em; }
.points-label { opacity: .72; font-size: 13px; }
.member-no { font-size: 13px; opacity: .8; letter-spacing: .06em; }
.qr-box { margin-top: 16px; display: inline-block; background: #fff; padding: 8px; border-radius: 12px; }
.qr-box img { display: block; width: 150px; height: 150px; }
.progress { height: 8px; background: rgba(255,255,255,.18); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #f1ce7b, #fff0bb); border-radius: inherit; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: #fbfcfb; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--brand-soft); color: var(--brand-dark); }
.badge.gold { background: #fbf3dd; color: #7d5b13; }
.badge.gray { background: #eef1ef; color: #59645e; }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.stat { padding: 16px; border-radius: 13px; background: #fafcfb; border: 1px solid var(--line); }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 25px; font-weight: 800; margin-top: 4px; }
.result-list { display: grid; gap: 8px; margin-top: 10px; }
.result-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfb; }
.selected-box { padding: 12px; border-radius: 12px; background: var(--brand-soft); border: 1px solid #cfe5dc; margin-bottom: 14px; }
.section-gap { margin-top: 16px; }
.rule-block { padding: 14px; border-left: 3px solid var(--gold); background: #fffbf1; border-radius: 0 10px 10px 0; color: #4e4328; font-size: 13px; }
.rule-block + .rule-block { margin-top: 10px; }
.tier-list { display: grid; gap: 8px; margin-top: 12px; }
.tier-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.tier-row strong { color: var(--brand-dark); }
.tier-table { min-width: 560px; }
.tier-table .tier-name { min-width: 150px; }
.tier-table .tier-threshold { min-width: 95px; }
.tier-table .tier-sort { min-width: 70px; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  max-width: min(520px, calc(100% - 32px)); z-index: 100;
  padding: 12px 16px; border-radius: 12px; color: #fff; background: #23352f;
  box-shadow: 0 12px 40px rgba(0,0,0,.2); font-size: 14px;
}
.empty { padding: 24px 8px; text-align: center; color: var(--muted); font-size: 13px; }
.loading { min-height: 50vh; display: grid; place-items: center; color: var(--muted); }
.footer-note { margin-top: 20px; color: #87918c; font-size: 11px; text-align: center; line-height: 1.8; }
.footer-legal .footer-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 8px; margin-top: 2px; }
.footer-legal .footer-links span { color: #b2bdb8; }
.footer-note a { color: #617a70; text-decoration: none; border-bottom: 1px dotted #a9bbb3; }
.footer-note a:hover { color: var(--brand); }
.legal-wrap { width: min(860px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 60px; }
.legal-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 26px; }
.legal-card h1 { margin: 0 0 6px; font-size: 24px; }
.legal-card h2 { margin: 24px 0 8px; font-size: 17px; }
.legal-card p, .legal-card li { color: #33413a; font-size: 14px; line-height: 1.8; }
.legal-card ul { padding-left: 20px; }
.legal-back { display: inline-block; margin-bottom: 16px; color: var(--brand); text-decoration: none; font-size: 13px; }
.legal-date { color: var(--muted); font-size: 12px; margin-bottom: 18px; }
@media (max-width: 860px) {
  .col-7, .col-5, .col-6 { grid-column: span 12; }
  .col-4 { grid-column: span 6; }
  .container { padding-top: 14px; }
  .card { padding: 16px; border-radius: 14px; }
  .points-big { font-size: 42px; }
  .topbar-inner { padding: 10px 0; }
  .userbox .hide-mobile { display: none; }
  .inline-form .field { flex-basis: 100%; }
}
