:root {
  --bg: #0f1220;
  --panel: rgba(24, 28, 45, 0.86);
  --panel-strong: #181c2d;
  --border: rgba(255,255,255,0.10);
  --text: #f5f7ff;
  --muted: #aab2cc;
  --accent: #ff7ab6;
  --accent-2: #7bdcff;
  --danger: #ff6d6d;
  --ok: #6ef5a4;
  --warn: #ffd166;
  --shadow: 0 24px 90px rgba(0,0,0,0.45);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.page-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 122, 182, 0.24), transparent 34%),
    radial-gradient(circle at 80% 12%, rgba(123, 220, 255, 0.18), transparent 32%),
    linear-gradient(135deg, #101324 0%, #171127 48%, #0d1322 100%);
  z-index: -1;
}
.shell { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0; }
.auth-card, .identity-card {
  width: min(520px, 100%);
  margin: 8vh auto;
  padding: 34px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.brand-kicker { color: var(--accent-2); font-size: 12px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(32px, 5vw, 54px); line-height: 0.95; letter-spacing: -0.04em; }
h2 { margin-bottom: 8px; font-size: 22px; }
.muted { color: var(--muted); line-height: 1.65; }
.small { font-size: 13px; }
.tiny-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-form, .identity-form { display: grid; gap: 12px; margin-top: 16px; }
label { color: #dce2ff; font-size: 13px; font-weight: 700; }
input, textarea, select {
  width: 100%; padding: 14px 15px; border-radius: 16px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.07); color: var(--text); outline: none;
}
input:focus { border-color: rgba(123,220,255,0.55); box-shadow: 0 0 0 4px rgba(123,220,255,0.08); }
button { cursor: pointer; border: 0; font-weight: 800; }
.primary-btn, .ghost-btn {
  border-radius: 16px; padding: 13px 18px; transition: transform .12s ease, opacity .12s ease, background .12s ease;
}
.primary-btn { color: #190913; background: linear-gradient(135deg, var(--accent), #ffd0e5); }
.ghost-btn { color: var(--text); background: rgba(255,255,255,0.08); border: 1px solid var(--border); }
button:hover { transform: translateY(-1px); }
button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.error { color: var(--danger); background: rgba(255,109,109,0.10); border: 1px solid rgba(255,109,109,0.28); padding: 12px; border-radius: 14px; }
.hidden { display: none !important; }
.app { display: grid; gap: 22px; }
.topbar, .toolbar, .status-card, .history-panel, .reward-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); backdrop-filter: blur(18px);
}
.topbar { display:flex; justify-content:space-between; align-items:center; padding: 24px 26px; }
.hero { align-items:flex-end; }
.hero p { max-width: 760px; margin-bottom: 0; }
.identity-card { width: 100%; margin: 0; display:grid; grid-template-columns: 1fr minmax(320px, 430px); gap: 20px; align-items:start; }
.topbar h1 { font-size: 34px; margin: 4px 0 0; }
.status-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.status-card { padding: 20px; display:grid; gap:6px; }
.status-card strong { font-size: 24px; }
.label { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.toolbar { display:flex; justify-content:space-between; gap:16px; align-items:center; padding: 22px 24px; }
.toolbar.compact { box-shadow: none; border: 0; padding: 0; background: transparent; }
.catalog-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.reward-card { overflow:hidden; display:grid; position:relative; }
.reward-card.selected { outline: 2px solid rgba(123,220,255,0.72); }
.select-line { position:absolute; z-index:2; top:12px; left:12px; display:inline-flex; align-items:center; gap:8px; padding:7px 10px; border-radius:999px; background:rgba(10,14,28,.76); border:1px solid var(--border); font-size:12px; }
.select-line input { width:auto; accent-color:#7bdcff; }
.cover { height: 170px; background: linear-gradient(135deg, rgba(255,122,182,0.25), rgba(123,220,255,0.18)); display:flex; align-items:center; justify-content:center; color: rgba(255,255,255,0.55); font-weight:900; }
.cover img { width:100%; height:100%; object-fit:cover; display:block; }
.reward-body { padding:18px; display:grid; gap:12px; }
.reward-title { margin:0; font-size:18px; }
.badges { display:flex; flex-wrap:wrap; gap:7px; }
.badge { font-size: 11px; padding: 5px 8px; border-radius:999px; background:rgba(255,255,255,.08); color:#dbe2ff; border:1px solid var(--border); }

.history-panel { padding: 24px; display:grid; gap:18px; }
.request-list { display:grid; gap:12px; }
.request-item { display:grid; grid-template-columns: 1fr auto; gap:16px; align-items:center; padding:14px; border:1px solid var(--border); border-radius:18px; background:rgba(255,255,255,0.05); }
.status-pill { display:inline-flex; align-items:center; gap:7px; width:max-content; padding: 6px 9px; border-radius:999px; font-size:12px; font-weight:800; background:rgba(255,255,255,.08); }
.status-pill.sent { color: var(--ok); }
.status-pill.processing, .status-pill.queued { color: var(--warn); }
.status-pill.failed { color: var(--danger); }
.empty { text-align:center; padding:28px; border:1px dashed var(--border); border-radius:20px; color:var(--muted); }
.toast { position:fixed; right:20px; bottom:20px; max-width:360px; padding:14px 16px; background:#11172a; border:1px solid var(--border); border-radius:16px; box-shadow:var(--shadow); }
@media (max-width: 860px) {
  .status-grid, .catalog-grid, .identity-card { grid-template-columns: 1fr; }
  .topbar, .toolbar { align-items:flex-start; flex-direction:column; }
  .request-item { grid-template-columns: 1fr; }
}
