:root {
  --c-paper: #F5F7FA;
  --c-bg: #F5F7FA;
  --bg: #F5F7FA;
  --c-card: #FFFFFF;
  --card: #FFFFFF;
  --c-subcard: #F0F2F5;
  --c-neutral-soft: #F0F2F5;
  --c-header: #EAF3FF;
  --c-ink: #1F2329;
  --ink: #1F2329;
  --c-sub: #4E5969;
  --sub: #4E5969;
  --muted: #4E5969;
  --c-faint: #626C7F;
  --faint: #626C7F;
  --c-line: #E5E7EB;
  --line: #E5E7EB;
  --c-line-soft: #E5E7EB;
  --c-border: #D0D5DD;
  --c-border-interactive: #667085;
  --c-brand: #1677FF;
  --c-action: #0958D9;
  --c-action-text: #0958D9;
  --down: #0958D9;
  --c-action-deep: #003EB3;
  --down-deep: #003EB3;
  --c-action-soft: #E6F4FF;
  --down-soft: #EAF3FF;
  --c-action-border: #91CAFF;
  --c-trust: #066B76;
  --c-trust-graphic: #087F8C;
  --c-trust-soft: #E8F6F5;
  --c-success: #006C45;
  --c-success-soft: #E3F9E9;
  --c-warn: #954500;
  --c-warn-soft: #FFF1E9;
  --c-danger: #AD352F;
  --c-danger-soft: #FFF0ED;
  --c-disabled: #98A2B3;
  --c-disabled-bg: #EAECF0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius: 12px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow-card: none;
  --shadow: none;
  --shadow-float: 0 8px 24px rgba(31, 35, 41, 0.12);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 22px;
  -webkit-text-size-adjust: 100%;
}
body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
button, input, textarea { font: inherit; }
button, a, input, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; color: var(--c-disabled); opacity: 1; }
a { color: inherit; text-decoration: none; }
p { margin: 8px 0; font-size: 14px; line-height: 22px; }
h1 { margin: 0; font-size: 22px; line-height: 30px; font-weight: 600; color: var(--c-ink); }
h2 { margin: 24px 0 12px; font-size: 18px; line-height: 26px; font-weight: 600; color: var(--c-ink); }
strong { font-weight: 600; }
input { min-width: 0; color: var(--c-ink); border: 0; background: transparent; border-radius: 0; }
input:focus { outline: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--c-action);
  outline-offset: 2px;
}
input::placeholder { color: var(--c-faint); }

.page { width: 100%; max-width: 540px; margin: 0 auto; padding: 16px 16px 12px; }
header { margin-bottom: 16px; }
header p { margin: 4px 0 0; font-size: 14px; line-height: 22px; }
.card {
  padding: 16px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 12px;
  box-shadow: none;
  margin-bottom: 12px;
}
.muted { color: var(--c-sub); }
.small { font-size: 12px; line-height: 18px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.btn {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--c-action);
  color: #FFFFFF;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  padding: 12px 16px;
  transition: background-color 100ms ease-out, border-color 100ms ease-out, color 100ms ease-out;
}
.btn:active:not(:disabled) { background: var(--c-action-deep); }
.btn:disabled { background: var(--c-disabled-bg); color: var(--c-disabled); opacity: 1; cursor: default; }
.btn.secondary { background: var(--c-card); color: var(--c-ink); border: 1px solid var(--c-border); }
.btn.secondary:active:not(:disabled) { background: var(--c-subcard); }

.text-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--c-action-text);
  font-size: 14px;
  line-height: 22px;
  font-weight: 500;
  padding: 0 8px;
  white-space: nowrap;
  transition: background-color 100ms ease-out, color 100ms ease-out;
}
.text-button:active:not(:disabled) { background: var(--c-action-soft); color: var(--c-action-deep); }
.text-button:disabled { color: var(--c-disabled); opacity: 1; cursor: default; }

.chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  padding: 2px 8px;
  background: var(--c-action-soft);
  color: var(--c-action-text);
  border-radius: 4px;
  white-space: nowrap;
}
.chip-success { background: var(--c-success-soft); color: var(--c-success); }
.chip-warn { background: var(--c-warn-soft); color: var(--c-warn); }
.chip-danger { background: var(--c-danger-soft); color: var(--c-danger); }
.chip-neutral { background: var(--c-neutral-soft); color: var(--c-sub); }

.state { padding: 28px 12px; text-align: center; color: var(--c-sub); font-size: 14px; line-height: 22px; }
.state .btn { max-width: 240px; margin: 12px auto 0; display: block; }
.state p { overflow-wrap: anywhere; }

.tabbar {
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--c-card);
  border-top: 1px solid var(--c-line);
}
.tabbar a {
  flex: 1;
  max-width: 135px;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  line-height: 16px;
  color: var(--c-faint);
  font-weight: 400;
}
.tabbar a[aria-current="page"] { color: var(--c-action-text); font-weight: 600; }
.tabbar svg { width: 24px; height: 24px; display: block; }

.toast {
  position: fixed;
  z-index: 30;
  bottom: calc(84px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: max-content;
  background: var(--c-ink);
  color: var(--c-card);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  line-height: 22px;
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease-out;
}
.toast.on { opacity: 1; }

.invite-rewards { background: var(--c-header); border: 1px solid #BAE0FF; }
.invite-benefit { padding: 0 0 16px; }
.invite-benefit + .invite-benefit { padding: 16px 0; border-top: 1px solid #D0E4FF; }
.invite-benefit h2 { margin: 0 0 8px; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--c-ink); }
.invite-benefit-value { display: flex; align-items: baseline; gap: 8px; color: var(--c-action-text); white-space: nowrap; }
.invite-benefit-value strong { font-size: 28px; line-height: 36px; font-weight: 600; font-variant-numeric: tabular-nums; }
.invite-benefit-value > span { font-size: 14px; line-height: 22px; color: var(--c-sub); }
.invite-benefit-value .invite-percent { font-size: 20px; line-height: 28px; margin-left: 2px; }
.invite-benefit p { margin: 8px 0 0; color: var(--c-sub); font-size: 14px; line-height: 22px; }
.invite-rewards .invite-settlement { margin: 0; padding-top: 12px; border-top: 1px solid #D0E4FF; font-size: 14px; line-height: 22px; color: var(--c-sub); }
.code-card { text-align: center; padding: 20px 16px; }
.code-card .btn { margin: 16px 0 12px; }
.code-card > p:last-child { margin-bottom: 0; }
#inviteHint { font-size: 12px; line-height: 18px; }
#inviteHint a { color: var(--c-action-text); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.invite-image {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  margin: 0 auto 12px;
  padding: 12px;
  background: #FFFFFF;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  -webkit-touch-callout: default;
  user-select: auto;
}

.range-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 12px;
}
.range-form label { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.range-form label > span:first-child { font-size: 12px; line-height: 18px; color: var(--c-sub); }
.range-control {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 44px;
  padding: 0 8px;
  font-size: 14px;
  white-space: nowrap;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: var(--c-card);
  font-variant-numeric: tabular-nums;
}
.range-control input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 0;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.range-control input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.range-control input:focus-visible { opacity: 1; background: var(--c-card); }
@media (max-width: 480px) {
  .range-form { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
  .range-form button { grid-column: 1 / -1; }
}
.range-form button { padding: 0 8px; height: 40px; min-height: 44px; }

.funnel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.metric { display: flex; flex-direction: column; gap: 4px; }
.metric span { font-size: 14px; line-height: 22px; color: var(--c-sub); }
.metric strong { margin-top: auto; font-size: 24px; line-height: 32px; font-weight: 600; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.list { padding: 0 16px; }
.person, .income-item { padding: 12px 0; border-bottom: 1px solid var(--c-line); }
.person:last-child, .income-item:last-child { border-bottom: 0; }
.person .between { flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.person strong, .person-name { min-width: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--c-ink); overflow-wrap: anywhere; }
.person time { font-variant-numeric: tabular-nums; flex-shrink: 0; }
.person p { margin: 6px 0 0; font-size: 14px; line-height: 22px; color: var(--c-sub); }

.income-summary > span { font-size: 14px; line-height: 22px; color: var(--c-sub); }
.total { display: block; font-size: 28px; line-height: 36px; font-weight: 600; margin: 4px 0 12px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.income-summary .between { border-top: 1px solid var(--c-line); padding-top: 12px; font-size: 14px; line-height: 22px; }
.amount { flex-shrink: 0; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--c-action-text); font-variant-numeric: tabular-nums; }
.income-item .between { align-items: baseline; }
.income-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 14px; line-height: 22px; color: var(--c-sub); }
.income-item > p { margin: 4px 0 0; font-size: 14px; line-height: 22px; color: var(--c-sub); }

.breakdown { margin-top: 6px; font-size: 14px; line-height: 22px; }
.breakdown summary { min-height: 44px; display: flex; align-items: center; color: var(--c-action-text); font-weight: 500; cursor: pointer; list-style: none; }
.breakdown summary::-webkit-details-marker { display: none; }
.breakdown-row { display: flex; justify-content: space-between; gap: 16px; line-height: 22px; padding: 4px 0; color: var(--c-sub); font-variant-numeric: tabular-nums; }
.breakdown-row span:last-child { text-align: right; overflow-wrap: anywhere; color: var(--c-ink); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--c-sub); font-size: 14px; line-height: 22px; padding: 4px 0; font-variant-numeric: tabular-nums; }

.form-row { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--c-line); }
.form-row > span { width: 96px; flex-shrink: 0; font-size: 14px; line-height: 22px; color: var(--c-sub); }
.form-row input { flex: 1; width: 100%; height: 48px; font-size: 16px; line-height: 24px; color: var(--c-ink); }
.form-row .text-button { font-size: 14px; line-height: 22px; flex-shrink: 0; padding: 0 4px; }
.form-note { margin-top: 16px; }
.form-error { color: var(--c-danger); font-size: 14px; line-height: 22px; margin: 8px 0; min-height: 0; overflow-wrap: anywhere; }
.form-error:empty { display: none; margin: 0; }

.profile-page .account { padding-block: 0; }
.account > strong { font-size: 18px; line-height: 26px; font-weight: 600; display: block; padding: 11px 0; font-variant-numeric: tabular-nums; }
.menu-row { display: flex; align-items: center; gap: 12px; min-height: 48px; border-top: 1px solid var(--c-line); font-size: 16px; line-height: 24px; color: var(--c-ink); }
.menu-row > span:first-child { flex: 1; }
.menu-row > span:last-child { font-size: 20px; color: var(--c-faint); }
.info-list { padding: 0 16px; }
.info-list details + details { border-top: 1px solid var(--c-line); }
.info-list summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; list-style: none; }
.info-list summary::-webkit-details-marker { display: none; }
.info-list p { font-size: 14px; line-height: 22px; color: var(--c-sub); margin: 0 0 12px; }

.pg-login .form-row > span { width: 56px; }
.pg-login .btn { margin-top: 12px; }
.pg-login header { margin-top: 16px; margin-bottom: 24px; }

@media (max-width: 360px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .card { padding: 14px; }
  .list { padding: 0 14px; }
  .range-form { row-gap: 4px; padding: 10px; }
  .form-row > span { width: 88px; }
  .form-row { gap: 8px; }
  .pg-login .form-row input { font-size: 15px; }
  .pg-login .form-row > span { width: 48px; }
  .total { font-size: 24px; line-height: 32px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Disclosure arrows are drawn with CSS, not font-dependent symbol icons. */
.breakdown summary::after,
.info-list summary::after,
.agreement-details summary::after,
.bank-consent summary::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 6px;
  margin-top: -3px;
  flex-shrink: 0;
}
.info-list summary::after { margin-left: auto; color: var(--c-faint); }
.breakdown[open] summary::after,
.info-list details[open] summary::after,
.agreement-details[open] summary::after,
.bank-consent[open] summary::after {
  content: '';
  transform: rotate(225deg);
  margin-top: 3px;
}
.menu-row .chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--c-faint);
  border-bottom: 1.5px solid var(--c-faint);
  transform: rotate(-45deg);
  margin-right: 3px;
}

.pay-card h2 { margin: 0 0 8px; font-size: 18px; line-height: 26px; font-weight: 600; }
.pay-card > p { font-size: 14px; line-height: 22px; }
.pay-card > .btn { margin-top: 8px; }
.pay-card > [role="status"]:empty { display: none; }
.pay-guidance { padding-top: 12px; border-top: 1px solid var(--c-line); color: var(--c-sub); }
.pay-refresh { display: flex; margin: 8px auto 0; }
.pay-continue { display: flex; align-items: center; justify-content: center; }
.pay-card .form-error:empty { display: none; }
.pg-pay header .text-button { min-width: 44px; }

.browser-guidance {
  padding: 12px 0;
  margin-bottom: 12px;
  color: var(--c-sub);
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
}
.browser-guidance > strong { font-size: 14px; line-height: 22px; font-weight: 600; color: var(--c-ink); }
.browser-guidance p { font-size: 14px; line-height: 22px; margin: 4px 0; }
.browser-guidance .text-button { padding: 0 8px; min-width: 64px; }
.browser-guidance .wechat-copy-link {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  font-size: 12px;
  line-height: 18px;
  user-select: all;
}
.pay-card .browser-guidance { margin: 14px 0 0; border-bottom: 0; padding-bottom: 0; }

#browserGuide { position: relative; z-index: 12; width: 100%; max-width: 540px; margin: 0 auto; padding: 12px 16px 0; }
#browserGuide[hidden], #browserGuide [hidden] { display: none !important; }
#browserGuide .browser-guidance {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  padding: 12px 16px;
  margin: 0;
  background: var(--c-header);
  border: 1px solid #BAE0FF;
  border-radius: 12px;
}
#browserGuide .browser-guidance > strong { grid-column: 1; grid-row: 1; }
#browserGuide .browser-guidance > .text-button { grid-column: 2; grid-row: 1; }
#browserGuide .browser-guidance > p, #browserGuide .browser-guidance > input { grid-column: 1 / -1; margin: 0; }
#browserGuide .browser-guidance > input { margin-top: 8px; }
#browserGuide [data-copy-status] { padding-top: 6px; }
.pg-help .help-shell {
  margin-top: var(--browser-guide-height, 0px);
  height: calc(var(--bole-viewport-height, 100vh) - var(--browser-guide-height, 0px)) !important;
  height: calc(var(--bole-viewport-height, 100dvh) - var(--browser-guide-height, 0px)) !important;
}

.bank-consent { font-size: 14px; line-height: 22px; color: var(--c-sub); margin-top: 12px; }
.bank-consent summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--c-action-text); font-weight: 500; list-style: none; }
.bank-consent summary::-webkit-details-marker { display: none; }
.bank-consent p { font-size: 14px; line-height: 22px; color: var(--c-sub); }
.bank-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 22px;
  color: var(--c-sub);
  padding: 12px 0;
  min-height: 44px;
  cursor: pointer;
}
.bank-check input { width: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; accent-color: var(--c-action); }

.agreement-details { margin: 12px 0; text-align: left; }
.agreement-details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--c-action-text); font-size: 14px; line-height: 22px; font-weight: 500; list-style: none; }
.agreement-details summary::-webkit-details-marker { display: none; }
.agreement-details .page { padding: 8px 0; }
.agreement-details .subpage-header { display: none; }
.agreement-details .rules-content { max-height: 50vh; overflow-y: auto; }
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  min-height: 44px;
  text-align: left;
  font-size: 14px;
  line-height: 22px;
  color: var(--c-sub);
  cursor: pointer;
}
.consent-row input { width: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; accent-color: var(--c-action); }
#agreementError { color: var(--c-danger); font-size: 14px; line-height: 22px; margin: 8px 0; }
#agreementError:empty { display: none; }
