/* ============================================================
   PayWallet 设计系统
   色板：深邃靛蓝 + 暗金强调 + 中性灰阶
   ============================================================ */

:root {
  --color-ink: #0B1F3F;        /* 主品牌色，深邃靛蓝 */
  --color-blue: #1E3A8A;       /* 交互色 */
  --color-blue-light: #3B5BDB;
  --color-gold: #C9A86A;       /* 金额强调色，暗金 */
  --color-gold-light: #E8D5A8;
  --color-bg: #F5F6FA;         /* 页面背景 */
  --color-surface: #FFFFFF;    /* 卡片背景 */
  --color-text: #1A2138;       /* 主文字 */
  --color-text-secondary: #6B7280;
  --color-text-tertiary: #9CA3AF;
  --color-border: #E5E7EB;
  --color-success: #16A34A;
  --color-danger: #DC2626;
  --color-warning: #D97706;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-card: 0 1px 3px rgba(11, 31, 63, 0.06), 0 1px 2px rgba(11, 31, 63, 0.04);
  --shadow-elevated: 0 8px 30px rgba(11, 31, 63, 0.12);

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

/* 数字一律使用等宽数字特性，金融产品对齐感很重要 */
.num, .amount, input[type="number"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

a { color: inherit; text-decoration: none; }

/* ---------- 余额账本卡片（signature组件） ---------- */
.balance-card {
  background: linear-gradient(135deg, var(--color-ink) 0%, #142B52 100%);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.balance-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,106,0.12) 0%, transparent 70%);
}
.balance-card .label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.balance-card .label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
}
.balance-card .eye-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
}
.balance-card .eye-toggle:hover { color: #fff; }
.balance-card .amount-display {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-gold-light);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.balance-card .amount-display .currency {
  font-size: 20px;
  font-weight: 500;
  margin-right: 4px;
  color: rgba(232,213,168,0.7);
}
.balance-card .sub-row {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.balance-card .sub-item .sub-label {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 2px;
}
.balance-card .sub-item .sub-value {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}
.balance-card .bill-link {
  position: absolute;
  top: 28px;
  right: 24px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------- 功能宫格 ---------- */
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
}
@media (max-width: 480px) {
  .action-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
}
.action-item {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 18px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.action-item:active { transform: scale(0.96); }
.action-item .icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-item .icon-wrap svg { width: 22px; height: 22px; fill: currentColor; }
.action-item .icon-wrap.transfer { background: #EBF1FF; color: var(--color-blue); }
.action-item .icon-wrap.receive { background: #E8F8EF; color: var(--color-success); }
.action-item .icon-wrap.recharge { background: #FDF3E3; color: var(--color-warning); }
.action-item .icon-wrap.withdraw { background: #FCE9E9; color: var(--color-danger); }
.action-item .action-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}

/* ---------- 通用卡片/列表 ---------- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
}
.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title .more-link {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-tertiary);
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}
.list-item:last-child { border-bottom: none; }
.list-item .item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.list-item .item-icon svg { width: 18px; height: 18px; fill: currentColor; color: var(--color-text-secondary); }
.list-item .item-main { flex: 1; min-width: 0; }
.list-item .item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item .item-sub {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}
.list-item .item-amount {
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}
.list-item .item-amount.positive { color: var(--color-success); }
.list-item .item-amount.negative { color: var(--color-text); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.15s ease;
}
.btn:active { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--color-ink); color: #fff; }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-danger { background: var(--color-danger); color: #fff; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-size: 15px;
  font-family: var(--font-ui);
  background: var(--color-surface);
  color: var(--color-text);
}
.form-input:focus {
  outline: none;
  border-color: var(--color-blue-light);
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.1);
}
.form-hint {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-top: 6px;
}
.form-error {
  font-size: 12px;
  color: var(--color-danger);
  margin-top: 6px;
}

/* ---------- 状态标签 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-processing { background: #FEF3E2; color: var(--color-warning); }
.badge-success { background: #E8F8EF; color: var(--color-success); }
.badge-failed { background: #FCE9E9; color: var(--color-danger); }

/* ---------- 顶部导航 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}
.topbar .back-btn svg { width: 20px; height: 20px; fill: var(--color-text); }
.topbar .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.page-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 80px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--color-text-tertiary);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; margin: 0; }
