:root {
  color-scheme: light;
  --ink: #0E0E0E;
  --muted: #6F6F6F;
  --faint: #969696;
  --line: #ECECEC;
  --panel: #F4F4F1;
  --surface: #FFFFFF;
  --dark: #19191B;
  --gold: #FFD633;
  --up: #4FE3A5;
  --down: #F15A63;
  --pay: #07A84F;
  --pay-press: #06903F;
  --todo: #FFF2B3;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--panel); color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif; font-size: 15px; line-height: 1.6;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.shell { display: flex; flex-direction: column; width: 100%; max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--surface); }
.topbar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; min-height: 48px; padding: 0 6px; background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.topbar h1 { font-size: 16px; font-weight: 800; text-align: center; }
.icon-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 22px; text-decoration: none; }
.icon-btn svg { width: 22px; height: 22px; }
.page { flex: 1; padding: 8px 16px calc(32px + env(safe-area-inset-bottom)); }
.enter .page { animation: rise .4s cubic-bezier(.22, 1, .36, 1) both; }
.page.has-bar { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .enter .page { animation: none; } }

/* 按钮 */
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; padding: 0 20px; border-radius: 25px; font-size: 16px; font-weight: 800; text-align: center; text-decoration: none; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), background .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: #FFFFFF; }
.btn-pay { background: var(--pay); color: #FFFFFF; }
.btn-pay:active { background: var(--pay-press); }
.btn-ghost { background: var(--panel); }
.btn-text { min-height: 44px; color: var(--muted); font-size: 14px; font-weight: 600; }
.btn[disabled] { background: #E8E8E8; color: var(--faint); cursor: not-allowed; }
.btn + .btn { margin-top: 10px; }
.bottom-bar { position: fixed; z-index: 6; left: 50%; bottom: 0; width: 100%; max-width: 480px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); transform: translateX(-50%); }
.pay-bar { display: flex; align-items: center; gap: 14px; }
.pay-bar .btn { flex: 1; width: auto; }
.pay-total { flex: none; font-size: 12px; color: var(--muted); line-height: 1.3; }
.pay-total strong { display: block; color: var(--ink); font-size: 20px; font-weight: 800; }

/* 首页 */
.home-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 0; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; }
.brand img { width: 28px; height: 28px; }
.link-chip { display: flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 18px; background: var(--panel); font-size: 13px; font-weight: 700; text-decoration: none; }
.hero { padding: 18px 0 18px; }
.hero h2 { font-size: 32px; font-weight: 800; line-height: 1.2; }
.hero p { margin-top: 8px; color: var(--muted); }
.section-title { margin: 8px 0 12px; font-size: 18px; font-weight: 800; }
.idea-card { position: relative; display: block; min-height: 172px; margin-bottom: 12px; padding: 16px 112px 16px 16px; overflow: hidden; border-radius: 22px; color: var(--ink); text-decoration: none; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1); }
.idea-card:active { transform: scale(.98); }
.idea-card h3 { font-size: 20px; font-weight: 800; line-height: 1.3; }
.idea-card .figure { position: absolute; right: -6px; bottom: -8px; width: 116px; height: 116px; }
.author-chip { display: inline-block; max-width: 100%; margin-bottom: 8px; padding: 3px 11px; overflow: hidden; border-radius: 14px; background: rgba(255, 255, 255, .82); font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.bounty-tag { display: inline-flex; align-items: baseline; gap: 4px; margin-top: 12px; padding: 4px 12px; border-radius: 16px; background: var(--ink); color: #FFFFFF; font-size: 12px; font-weight: 700; }
.bounty-tag strong { font-size: 15px; font-weight: 800; color: var(--gold); }

.footer { padding: 20px 16px calc(92px + env(safe-area-inset-bottom)); background: var(--panel); color: var(--muted); font-size: 12px; line-height: 1.8; }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; color: var(--ink); font-weight: 700; }
.footer nav a { text-decoration: none; }
.todo { padding: 1px 6px; border-radius: 4px; background: var(--todo); color: #6B5500; font-weight: 600; }

/* 详情 */
.detail-card { position: relative; min-height: 300px; padding: 18px 18px 112px; overflow: hidden; border-radius: 24px; }
.detail-card h2 { font-size: 26px; font-weight: 800; line-height: 1.3; }
.detail-card .bubble { margin-top: 14px; padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, .92); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.detail-card .figure { position: absolute; right: 4px; bottom: -6px; width: 118px; height: 118px; }
.pk { margin-top: 12px; padding: 16px 18px; border-radius: 20px; background: var(--dark); color: #FFFFFF; }
.pk-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.pk-row .good { color: var(--up); }
.pk-row .bad { color: var(--down); text-align: right; }
.pk-row strong { display: block; color: #FFFFFF; font-size: 26px; line-height: 1.25; }
.pk-track { height: 8px; margin-top: 10px; overflow: hidden; border-radius: 4px; background: var(--down); }
.pk-track i { display: block; height: 100%; background: var(--up); }
.bounty-line { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 14px 18px; border-radius: 20px; background: var(--gold); font-weight: 800; }
.bounty-line strong { font-size: 22px; }

/* 规则便签 */
.rules { margin-top: 16px; padding: 14px 16px; border: 2px solid #1B1B1B; border-radius: 12px; background: #FFFBE6; font-size: 13px; line-height: 1.7; }
.rules h3 { margin-bottom: 6px; font-size: 14px; font-weight: 800; text-align: center; }
.rules ul { margin: 0; padding: 0 0 0 18px; }
.rules li + li { margin-top: 4px; }
.rules b { font-weight: 700; background: linear-gradient(transparent 58%, rgba(255, 214, 51, .75) 58%); }

/* 步骤条 */
.steps { display: flex; margin: 4px 0 16px; padding: 0; list-style: none; }
.steps li { position: relative; flex: 1; color: var(--faint); font-size: 12px; font-weight: 600; text-align: center; }
.steps li::before { content: attr(data-n); display: block; width: 22px; height: 22px; margin: 0 auto 4px; border-radius: 50%; background: #E8E8E8; color: #FFFFFF; font-size: 12px; font-weight: 800; line-height: 22px; }
.steps li + li::after { content: ''; position: absolute; top: 10px; left: calc(-50% + 15px); right: calc(50% + 15px); height: 2px; background: #E8E8E8; }
.steps li.done, .steps li.current { color: var(--ink); }
.steps li.done::before, .steps li.current::before { background: var(--ink); }
.steps li.done::after, .steps li.current::after { background: var(--ink); }
.steps li.done::before { content: '✓'; }

/* 表单 */
.field { display: block; margin-bottom: 16px; }
.field-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 14px; font-weight: 800; }
.field-label small { color: var(--faint); font-size: 12px; font-weight: 500; }
.input { display: block; width: 100%; padding: 12px 14px; border: 1.5px solid transparent; border-radius: 14px; outline: none; background: var(--panel); font-size: 16px; }
.input:focus { border-color: var(--ink); background: var(--surface); }
.input.invalid { border-color: var(--down); }
textarea.input { min-height: 120px; resize: vertical; }
.amount-wrap { display: flex; align-items: baseline; gap: 6px; padding: 8px 14px; border: 1.5px solid transparent; border-radius: 14px; background: var(--panel); }
.amount-wrap:focus-within { border-color: var(--ink); background: var(--surface); }
.amount-wrap.invalid { border-color: var(--down); }
.amount-wrap span { font-size: 22px; font-weight: 800; }
.amount-wrap input { flex: 1; min-width: 0; padding: 0; border: 0; outline: none; background: none; font-size: 30px; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { min-width: 64px; min-height: 40px; padding: 0 14px; border-radius: 20px; background: var(--panel); font-size: 14px; font-weight: 700; }
.chip.on { background: var(--ink); color: #FFFFFF; }
.error { margin-top: 6px; color: #C93640; font-size: 13px; font-weight: 600; }

/* 订单 */
.card { margin-bottom: 12px; padding: 14px 16px; border-radius: 18px; background: var(--panel); }
.card h3 { margin-bottom: 8px; font-size: 14px; font-weight: 800; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 14px; }
.kv > span:first-child { flex: none; color: var(--muted); }
.kv > span:last-child { min-width: 0; text-align: right; word-break: break-all; }
.kv.total { margin-top: 6px; padding-top: 10px; border-top: 1px solid #E2E2DE; font-weight: 800; }
.kv.total > span:last-child { font-size: 20px; }
.pay-method { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; }
.pay-method .mark { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--pay); color: #FFFFFF; }
.pay-method .mark svg { width: 18px; height: 18px; }
.pay-method .radio { width: 20px; height: 20px; margin-left: auto; border: 6px solid var(--pay); border-radius: 50%; background: #FFFFFF; }
.agree { display: flex; align-items: flex-start; gap: 8px; padding: 6px 2px; color: var(--muted); font-size: 13px; }
.agree input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); }
.agree a { color: var(--ink); font-weight: 700; }

/* 收银台 */
.cashier-amount { padding: 22px 0 20px; text-align: center; }
.cashier-amount small { display: block; color: var(--muted); font-size: 14px; }
.cashier-amount strong { font-size: 44px; font-weight: 800; line-height: 1.2; }
.notice { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #FFFBE6; font-size: 14px; font-weight: 600; }
.cashier-actions { margin-top: 18px; }

/* 结果 */
.result { padding: 28px 0 20px; text-align: center; }
.result h2 { font-size: 22px; font-weight: 800; }
.result p { margin-top: 6px; color: var(--muted); font-size: 14px; }
.result-actions { margin-top: 8px; }

/* 订单列表 */
.order-row { display: block; margin-bottom: 10px; padding: 14px 16px; border-radius: 18px; background: var(--panel); text-decoration: none; }
.order-row header { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.order-row h3 { margin: 6px 0; font-size: 15px; font-weight: 800; line-height: 1.4; word-break: break-word; }
.order-row footer { display: flex; align-items: center; justify-content: space-between; font-weight: 800; }
.status { flex: none; font-weight: 800; }
.status.pending { color: #B7791F; }
.status.closed { color: var(--faint); }
.empty { padding: 56px 16px; color: var(--muted); text-align: center; }
.empty .btn { margin-top: 16px; }

/* 说明页 */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; padding: 4px; border-radius: 22px; background: var(--panel); }
.tabs a { flex: 1; min-height: 36px; border-radius: 18px; font-size: 13px; font-weight: 700; line-height: 36px; text-align: center; text-decoration: none; color: var(--muted); }
.tabs a.on { background: var(--ink); color: #FFFFFF; }
.doc h2 { margin: 18px 0 6px; font-size: 16px; font-weight: 800; }
.doc h2:first-child { margin-top: 0; }
.doc p, .doc li { font-size: 14px; }
.doc ul { margin: 0; padding-left: 18px; }
.doc li + li { margin-top: 4px; }

/* 账户 */
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; min-width: 0; }
.send-code { flex: none; min-width: 104px; min-height: 48px; padding: 0 12px; border-radius: 14px; background: var(--ink); color: #FFFFFF; font-size: 14px; font-weight: 700; }
.send-code[disabled] { background: #E8E8E8; color: var(--muted); cursor: not-allowed; }
.auth-hint { margin: -6px 0 12px; color: var(--muted); font-size: 13px; }
.auth-submit { margin-top: 18px; }
.auth-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; font-size: 14px; font-weight: 700; }
.auth-links a { display: inline-flex; align-items: center; min-height: 32px; text-decoration: none; }
.auth-agree { margin-top: 18px; color: var(--muted); font-size: 12px; text-align: center; }
.auth-agree a { color: var(--ink); font-weight: 700; }
