:root {
  --bg: #F6F3EE;
  --card: #FFFFFF;
  --ink: #16130F;
  --ink-2: #3A352D;
  --ink-3: #7A7367;
  --ink-4: #A39B8F;
  --line: #ECE7DF;
  --soft: #F8F5F0;
  --brand: #FF4D1C;
  --brand-2: #FF7A3D;
  --brand-soft: #FFF1EA;
  --ok: #12A150;
  --ok-soft: #E8F7EE;
  --bad: #E5372E;
  --bad-soft: #FDECEA;
  --warn: #C77700;
  --warn-soft: #FFF6E0;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(22, 19, 15, .04), 0 16px 40px -24px rgba(22, 19, 15, .16);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[v-cloak] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { outline: none; }
a { color: var(--brand); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }

/* 加载 */
.boot { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; }
.spinner.dark { border-color: rgba(22,19,15,.15); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 14px;
  font-size: 15px; font-weight: 600; letter-spacing: .3px;
  transition: transform .12s ease, opacity .12s ease, box-shadow .2s ease;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 100%); box-shadow: 0 10px 24px -10px rgba(255, 77, 28, .7); }
.btn-dark { color: #fff; background: var(--ink); }
.btn-ghost { color: var(--ink-2); background: #F1EDE6; }
.btn-line { color: var(--ink-2); background: #fff; border: 1px solid var(--line); }
.btn-danger { color: #fff; background: var(--bad); }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 14px; border-radius: 10px; font-size: 13px; }

/* 表单 */
.field { margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field-hint { font-size: 12px; color: var(--ink-4); margin-top: 6px; }
.input-wrap {
  display: flex; align-items: center; gap: 8px;
  height: 50px; padding: 0 6px 0 16px; border-radius: 14px;
  background: var(--soft); border: 1px solid transparent;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input-wrap:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(255, 77, 28, .1); }
.input-wrap input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 15px; }
.input-wrap input::placeholder, textarea::placeholder { color: #B9B1A5; }
.input-prefix { font-size: 13px; color: var(--ink-3); flex-shrink: 0; }
.input-btn { flex-shrink: 0; height: 38px; padding: 0 14px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; }
.input-btn[disabled] { opacity: .45; }
.captcha-img { height: 38px; width: 104px; border-radius: 10px; flex-shrink: 0; cursor: pointer; background: #fff; object-fit: cover; }
.eye { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; color: var(--ink-4); font-size: 12px; flex-shrink: 0; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); cursor: pointer; user-select: none; }
.check-box { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid #D2CABE; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.check.on .check-box { background: var(--brand); border-color: var(--brand); }
.check.on .check-box::after { content: ''; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }

.switch { position: relative; width: 46px; height: 28px; border-radius: 999px; background: #DDD6CB; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: transform .2s; }
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(18px); }

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

/* 状态胶囊 */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.queued { color: var(--warn); background: var(--warn-soft); }
.pill.running { color: var(--brand); background: var(--brand-soft); }
.pill.running::before { animation: blink 1.2s ease-in-out infinite; }
.pill.succeeded, .pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.failed, .pill.bad { color: var(--bad); background: var(--bad-soft); }
.pill.gray { color: var(--ink-3); background: #F1EDE6; }
@keyframes blink { 50% { opacity: .25; } }

/* 底部弹层 */
.mask { position: fixed; inset: 0; z-index: 900; background: rgba(22, 19, 15, .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade-in .2s ease-out; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 901;
  max-width: 560px; margin: 0 auto; max-height: 88vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 24px 24px 0 0; padding-bottom: var(--safe-bottom);
  animation: sheet-in .28s cubic-bezier(.2, .9, .3, 1);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; }
.sheet-title { font-size: 17px; font-weight: 700; }
.sheet-close { width: 32px; height: 32px; border-radius: 50%; background: #F1EDE6; font-size: 18px; line-height: 32px; text-align: center; color: var(--ink-3); }
.sheet-body { padding: 6px 20px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 12px 20px 18px; border-top: 1px solid #F1EDE6; display: flex; gap: 12px; }
.sheet-foot .btn { flex: 1; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* 确认弹窗 */
.dialog-wrap { position: fixed; inset: 0; z-index: 950; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(22, 19, 15, .52); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in .2s; }
.dialog { width: 100%; max-width: 340px; padding: 26px 22px 20px; border-radius: 24px; background: #fff; text-align: center; animation: dialog-in .26s cubic-bezier(.2, .9, .3, 1.2); }
.dialog-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 26px; font-weight: 800; line-height: 56px; }
.dialog-icon.danger { background: var(--bad-soft); color: var(--bad); }
.dialog-title { font-size: 18px; font-weight: 700; }
.dialog-desc { margin-top: 8px; font-size: 14px; color: var(--ink-3); line-height: 1.7; white-space: pre-line; }
.dialog-actions { display: flex; gap: 12px; margin-top: 22px; }
.dialog-actions .btn { flex: 1; height: 46px; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.95); } to { opacity: 1; transform: none; } }

/* 轻提示 */
.toast { position: fixed; left: 50%; top: 40%; z-index: 1000; transform: translate(-50%, -50%); max-width: 78vw; padding: 12px 18px; border-radius: 14px; background: rgba(22, 19, 15, .88); color: #fff; font-size: 14px; line-height: 1.6; text-align: center; animation: fade-in .15s; pointer-events: none; }

/* 列表 */
.empty { padding: 48px 20px; text-align: center; color: var(--ink-4); font-size: 13px; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: #F1EDE6; display: flex; align-items: center; justify-content: center; }
.empty-icon i { width: 0; height: 0; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #C9C0B3; margin-left: 4px; }
.more { padding: 16px; text-align: center; font-size: 13px; color: var(--ink-4); }
.more button { color: var(--ink-3); padding: 8px 16px; }

.row-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid #F3EFE9; }
.row-item:last-child { border-bottom: 0; }
.row-main { min-width: 0; flex: 1; }
.row-title { font-size: 14px; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 12px; color: var(--ink-4); margin-top: 2px; }
.row-amount { font-size: 16px; font-weight: 700; white-space: nowrap; }
.plus { color: var(--ok); }
.minus { color: var(--ink); }

.seg { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: #EFEAE2; }
.seg button { flex: 1; height: 36px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--ink-3); transition: all .15s; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px -2px rgba(22, 19, 15, .15); }
