:root {
  --blue: #2f6bff;
  --blue-deep: #1d4ed8;
  --violet: #7c3aed;
  --red: #dc2626;
  --green: #059669;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --gray: #94a3b8;
  --line: #e8eef7;
  --bg: #f6f8fc;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 14px 16px calc(32px + env(safe-area-inset-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(800px 300px at 85% -50px, rgba(47, 107, 255, 0.08), transparent 60%),
    radial-gradient(600px 260px at 0% 0%, rgba(124, 58, 237, 0.05), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
[hidden] { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pre { white-space: pre-wrap; word-break: break-word; line-height: 1.7; }

.page { max-width: 620px; margin: 0 auto; }

/* ---------- 顶栏 ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 4px 12px rgba(47, 107, 255, 0.28); }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: 0.5px; }
.brand-sub { font-size: 11px; color: var(--gray); margin-top: 1px; }
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; font-size: 17px;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.icon-btn:active { transform: scale(0.94); }

/* ---------- 标题 ---------- */
.hero { text-align: center; padding: 14px 0 4px; }
.hero h1 { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: 1px; color: #2563eb; text-shadow: 0 2px 8px rgba(37, 99, 235, 0.15); }
.hero-sub { margin: 7px 0 0; font-size: 12.5px; color: var(--gray); letter-spacing: 2px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.notice-bar {
  display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 9px 10px 9px 12px;
  background: linear-gradient(135deg, #eef5ff, #f5f8ff); border: 1px solid #dbeafe; border-radius: 12px;
}
.notice-tag { flex-shrink: 0; font-size: 11px; font-weight: 700; color: #fff; background: var(--blue); padding: 2px 8px; border-radius: 999px; }
.notice-text { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.notice-more { flex-shrink: 0; border: 0; background: none; color: var(--blue); font-size: 12.5px; font-weight: 700; padding: 0; }
.notice-close { flex-shrink: 0; border: 0; background: none; color: var(--gray); font-size: 18px; line-height: 1; padding: 0 2px; }

.info-card { margin: 12px 0 0; padding: 12px 16px; }
.info-card summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none; cursor: pointer; user-select: none; }
.info-card summary::-webkit-details-marker { display: none; }
.info-text { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.info-text b { color: var(--red); white-space: nowrap; }
.info-toggle { flex-shrink: 0; font-size: 12.5px; font-weight: 700; color: var(--blue); }
.info-toggle::after { content: '详细说明 ›'; }
.info-card[open] .info-toggle::after { content: '收起 ˄'; }
.rules { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); line-height: 1.9; }

/* ---------- 提交区 ---------- */
.submit-card { margin: 12px 0 0; padding: 16px; }
.input-row { display: flex; gap: 10px; }
.input-wrap { position: relative; flex: 1; min-width: 0; }
.input-row input[type="tel"] {
  width: 100%; height: 46px; padding: 0 78px 0 14px; font-size: 17px; letter-spacing: 1px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #f8fafc; color: var(--ink);
  outline: none; transition: border-color 0.2s, background 0.2s;
}
.input-row input[type="tel"]:focus { border-color: var(--blue); background: #fff; }
.scan-btn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  height: 34px; padding: 0 10px; border: 1px solid #dbe5ff; border-radius: 9px;
  background: #eef3ff; color: var(--blue); font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.scan-btn:active:not(:disabled) { transform: translateY(-50%) scale(0.95); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; padding: 0 18px; border: 0; border-radius: 12px; font-size: 15px; font-weight: 700;
  text-decoration: none; white-space: nowrap; transition: transform 0.15s, opacity 0.15s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--blue), #5086ff); box-shadow: 0 4px 12px rgba(47, 107, 255, 0.28); }
.btn-ghost { color: var(--ink-2); background: #f1f5f9; }
.btn-block { display: flex; width: 100%; margin-top: 14px; }
.btn-onekey {
  width: 100%; margin-top: 12px; color: #fff;
  background: linear-gradient(135deg, var(--violet), #a855f7); box-shadow: 0 4px 12px rgba(124, 58, 237, 0.28);
}
.help-dot {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 4px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.28); font-size: 11px; font-style: italic; font-family: Georgia, serif;
}
.countdown { margin: 12px 0 0; text-align: center; font-size: 12px; color: var(--gray); }
.countdown b { color: var(--blue); }

/* ---------- 列表 ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 10px; }
.list-head h2 { margin: 0; font-size: 15px; font-weight: 800; }
.link-btn { border: 0; background: none; color: var(--blue); font-size: 13px; font-weight: 600; padding: 0; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.item.is-used { background: #fafbfd; }
.item-main { min-width: 0; }
.item-code { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 17px; font-weight: 700; letter-spacing: 1px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.item.is-used .item-code { color: var(--gray); }
.item-time { margin-top: 3px; font-size: 11.5px; color: var(--gray); }
.item-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tag { font-family: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: 0; padding: 1px 7px; border-radius: 999px; }
.tag-mine { color: var(--blue-deep); background: #e0ebff; }
.tag-just { color: var(--green); background: #d1fae5; }
.btn-jump { height: 34px; padding: 0 18px; font-size: 14px; color: #fff; background: linear-gradient(135deg, #ff5a4e, #e02e24); box-shadow: 0 3px 10px rgba(224, 46, 36, 0.25); }
.used-text, .wait-text { font-size: 13px; color: var(--gray); }
.wait-text { color: var(--blue); }
.btn-report { height: 28px; padding: 0 10px; border: 1px solid #fecaca; border-radius: 8px; background: #fff5f5; color: var(--red); font-size: 12px; font-weight: 600; }
.empty { margin: 24px 0; text-align: center; font-size: 13px; color: var(--gray); }

.footer { margin-top: 28px; text-align: center; font-size: 11.5px; line-height: 2; color: var(--gray); }
.footer a { color: var(--muted); }

/* ---------- 内置浏览器提示 ---------- */
.browser-tip {
  margin: 0 0 10px; padding: 10px 14px; font-size: 13px; line-height: 1.7; text-align: center;
  color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px;
}

/* ---------- 福利位 ---------- */
.welfare { margin: 12px 0 0; padding: 12px 14px 14px; background: linear-gradient(135deg, #fff7ed, #fff); border-color: #fde3c8; }
.welfare-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.welfare-title { font-size: 14px; font-weight: 800; color: #c2410c; }
.welfare-close { border: 0; background: none; color: var(--gray); font-size: 18px; line-height: 1; padding: 0 2px; }
.welfare-items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.welfare-item {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; text-align: left; text-decoration: none;
  background: #fff; border: 1px solid #fde3c8; border-radius: 12px; transition: transform 0.15s;
}
.welfare-item:active { transform: scale(0.97); }
.welfare-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.welfare-desc { font-size: 11.5px; color: var(--muted); }

/* ---------- 文档页 ---------- */
.doc { margin-top: 12px; padding: 20px 18px; font-size: 14px; line-height: 1.85; color: var(--ink-2); }
.doc h1 { margin: 0 0 4px; font-size: 20px; color: var(--ink); }
.doc h2 { margin: 18px 0 4px; font-size: 15px; color: var(--ink); }
.doc p, .doc ul { margin: 0 0 6px; }
.doc ul { padding-left: 20px; }

/* ---------- 弹窗 / 提示 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(15, 23, 42, 0.45); animation: fade 0.18s ease;
}
.modal {
  position: relative; width: 100%; max-width: 380px; max-height: 86vh; overflow: auto; padding: 22px 20px 18px;
  background: #fff; border-radius: 20px; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25); animation: pop 0.2s ease;
}
.modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 22px; color: var(--gray); line-height: 1; }
.modal-title { margin: 0 24px 12px 0; font-size: 17px; font-weight: 800; }
.modal-body { font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.modal-body p { margin: 0 0 8px; }
.modal-body b { color: var(--blue-deep); }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; height: 42px; font-size: 14px; }
.code-box {
  margin: 4px 0 12px; padding: 12px; text-align: center; font-size: 26px; font-weight: 800; letter-spacing: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--red);
  background: #fff7f7; border: 1px dashed #fecaca; border-radius: 12px; user-select: all; -webkit-user-select: all;
}
.code-choices { display: flex; flex-direction: column; gap: 8px; }
.code-choice {
  height: 46px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc;
  font-size: 20px; font-weight: 800; letter-spacing: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.code-choice:active { background: #eef3ff; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th, .table td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; background: #f8fafc; }

.toast {
  position: fixed; left: 50%; top: 40%; z-index: 200; max-width: 80vw; padding: 11px 18px;
  transform: translate(-50%, -50%) scale(0.95); opacity: 0; pointer-events: none;
  background: rgba(15, 23, 42, 0.88); color: #fff; font-size: 14px; line-height: 1.6; text-align: center;
  border-radius: 12px; white-space: pre-line; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.95); } }

/* ---------- 宽屏双栏 ---------- */
@media (min-width: 900px) {
  .page { max-width: 1040px; }
  .layout { display: grid; grid-template-columns: 420px 1fr; gap: 24px; align-items: start; }
  .col-left { position: sticky; top: 14px; }
  .list-head { margin-top: 12px; }
}
