:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --panel: #ffffff;
  --line: #dbe6df;
  --text: #1c2b24;
  --muted: #5d6c64;
  --brand: #1e5a3f;
  --brand-soft: #eef6f1;
  --warning: #8a6110;
  --warning-soft: #fdf7e8;
  --danger: #9b2f2f;
  --danger-soft: #fdf0f0;
  --shadow: 0 10px 30px rgba(24, 49, 34, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

body {
  min-height: 100vh;
}

.page-shell {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.hero-block,
.section-block,
.login-panel,
.metric-card,
.withdrawal-card,
.tip-block,
.dialog-panel,
.toolbar-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-block,
.login-panel,
.section-block,
.toolbar-block {
  padding: 18px 16px;
}

.hero-eyebrow,
.section-eyebrow,
.field-label,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
}

.hero-title,
.login-title,
.section-title {
  margin: 10px 0 6px;
  font-size: 30px;
  line-height: 1.18;
  font-weight: 700;
}

.section-title {
  font-size: 24px;
}

.hero-copy,
.login-copy,
.section-copy,
.muted-copy,
.field-help,
.meta-line,
.empty-copy {
  color: var(--muted);
  line-height: 1.6;
  font-size: 15px;
}

.stack-16 > * + *,
.stack-12 > * + *,
.stack-10 > * + *,
.stack-8 > * + * {
  display: block;
}

.stack-16 > * + * {
  margin-top: 16px;
}

.stack-12 > * + * {
  margin-top: 12px;
}

.stack-10 > * + * {
  margin-top: 10px;
}

.stack-8 > * + * {
  margin-top: 8px;
}

.login-panel {
  margin-top: 18px;
}

.field-block {
  display: grid;
  gap: 8px;
}

.text-input,
.text-area,
.dialog-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.text-input:focus,
.text-area:focus,
.dialog-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 90, 63, 0.12);
}

.text-area {
  min-height: 108px;
  resize: vertical;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  border: 0;
  border-radius: var(--radius);
  min-height: 46px;
  padding: 0 16px;
  font-weight: 600;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.secondary-button {
  background: var(--brand-soft);
  color: var(--brand);
}

.ghost-button {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-button {
  background: var(--danger-soft);
  color: var(--danger);
}

.button-row > button,
.button-row > .button-stretch {
  flex: 1 1 0;
}

.toolbar-block {
  margin-top: 16px;
}

.toolbar-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.toolbar-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.toolbar-user {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  padding: 14px 12px;
}

.metric-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
}

.metric-row + .metric-row {
  margin-top: 8px;
}

.metric-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-card {
  padding: 14px 12px;
  border-radius: var(--radius);
  background: var(--warning-soft);
  border: 1px solid #f1e0af;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
  color: var(--warning);
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-button {
  white-space: nowrap;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}

.filter-button.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.withdrawal-list {
  display: grid;
  gap: 12px;
}

.withdrawal-card {
  padding: 14px 14px 16px;
}

.withdrawal-head,
.row-between {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.withdrawal-name {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
}

.withdrawal-amount {
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  color: var(--brand);
}

.status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-tag.audit_pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-tag.approved,
.status-tag.transfer_config_required,
.status-tag.wait_user_confirm,
.status-tag.transfer_processing {
  background: var(--brand-soft);
  color: var(--brand);
}

.status-tag.transfer_failed,
.status-tag.transfer_cancelled {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-tag.paid {
  background: #edf3ff;
  color: #335ea8;
}

.status-tag.rejected {
  background: var(--danger-soft);
  color: var(--danger);
}

.meta-stack {
  margin-top: 10px;
  display: grid;
  gap: 4px;
}

.note-block {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #f7faf8;
  border: 1px solid var(--line);
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.card-actions button {
  flex: 1 1 0;
}

.empty-block {
  padding: 20px 14px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.tip-block {
  padding: 14px 12px;
}

.transfer-config.ready {
  border-color: rgba(37, 94, 69, 0.24);
  background: #f3faf6;
}

.transfer-config.missing {
  border-color: rgba(166, 126, 45, 0.24);
  background: #fffaf0;
}

.tip-title {
  font-size: 16px;
  font-weight: 700;
}

.error-banner {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid #f4c7c7;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
  line-height: 1.6;
}

.loading-line {
  color: var(--muted);
  font-size: 14px;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 21, 17, 0.42);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.dialog-panel {
  width: 100%;
  max-width: 560px;
  padding: 18px 16px;
}

.dialog-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
}

.dialog-copy {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.dialog-actions button {
  flex: 1 1 0;
}

.login-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 420px) {
  .page-shell {
    padding: 16px 12px 28px;
  }

  .hero-title,
  .login-title {
    font-size: 28px;
  }

  .section-title {
    font-size: 22px;
  }

  .grid-3,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .toolbar-main,
  .withdrawal-head,
  .row-between {
    flex-direction: column;
  }

  .toolbar-actions,
  .card-actions,
  .dialog-actions {
    width: 100%;
  }
}
