/* ============ 设计令牌 & 基础 ============ */
:root {
  --brand: #FF4E33;
  --brand-dark: #E43A1F;
  --brand-soft: #FFF1EE;
  --brand-2: #FF8A3D;
  --ink: #1B1D21;
  --ink-2: #5B6270;
  --ink-3: #8D95A3;
  --ink-4: #B4BAC5;
  --line: #EBEDF1;
  --line-2: #F2F4F7;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --gold: #C08A2E;
  --green: #16A34A;
  --blue: #2F6BFF;
  --radius: 14px;
  --shadow-s: 0 1px 2px rgba(20, 24, 32, .05);
  --shadow-m: 0 6px 20px -6px rgba(20, 24, 32, .12);
  --shadow-l: 0 20px 60px -20px rgba(20, 24, 32, .24);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
ul { margin: 0; padding: 0; list-style: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D7DBE2; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 通用按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2); transition: .18s;
  white-space: nowrap;
}
.btn:hover { border-color: #D9DDE4; color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px -4px rgba(255, 78, 51, .5); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.ghost { background: #fff; }
.btn.ghost:hover { background: #FAFBFC; }
.btn.dark { background: #22252B; border-color: #22252B; color: #fff; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: 11.5px; font-weight: 600; background: #F3F5F8; color: var(--ink-2);
  white-space: nowrap;
}
.chip.red { background: var(--brand-soft); color: var(--brand-dark); }
.chip.green { background: #EAF7EF; color: #15803D; }
.chip.blue { background: #EEF3FF; color: #2F5FD0; }
.chip.gold { background: #FBF3E2; color: #9A6B12; }
.chip.gray { background: #F3F5F8; color: var(--ink-3); }

/* ============ Toast ============ */
.toast-wrap { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(24, 26, 31, .92); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 10px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); animation: toastIn .22s ease;
  backdrop-filter: blur(8px); max-width: 76vw; text-align: center;
}
.toast.ok { background: rgba(22, 163, 74, .95); }
.toast.err { background: rgba(214, 48, 32, .95); }
.toast.out { animation: toastOut .24s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px) scale(.98); } }

/* ============ 底部弹层 ============ */
.sheet-mask { position: fixed; inset: 0; background: rgba(17, 20, 26, .45); z-index: 900; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .24s; }
.sheet-mask.show { opacity: 1; }
.sheet {
  width: 100%; max-width: 430px; background: #fff; border-radius: 20px 20px 0 0; padding: 6px 18px 24px;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.32, .72, 0, 1); max-height: 82vh; overflow-y: auto;
}
.sheet-mask.show .sheet { transform: translateY(0); }
.sheet-bar { display: flex; justify-content: center; padding: 6px 0 10px; }
.sheet-bar span { width: 38px; height: 4px; border-radius: 4px; background: #E3E6EB; }
.sheet h3 { font-size: 16px; margin-bottom: 14px; }

/* ============ 对话框 ============ */
.dlg-mask { position: fixed; inset: 0; background: rgba(17, 20, 26, .42); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; transition: .2s; }
.dlg-mask:not(.show) { pointer-events: none; }
.dlg-mask.show { opacity: 1; }
.dlg { background: #fff; border-radius: 16px; padding: 22px; width: 320px; box-shadow: var(--shadow-l); transform: scale(.94); transition: .2s; }
.dlg-mask.show .dlg { transform: scale(1); }
.dlg h4 { font-size: 16px; margin-bottom: 8px; }
.dlg p { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }
.dlg-btns { display: flex; gap: 10px; margin-top: 20px; }
.dlg-btns .btn { flex: 1; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: var(--ink-4); font-size: 13px; }
.empty .ico { font-size: 40px; display: block; margin-bottom: 10px; opacity: .7; }
