/* tokens.css 与 components.css 由各页面 <link> 单独引入，勿用 @import */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: #1a1f2e;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

body:not(.app-body):not(.website-page) {
  background:
    radial-gradient(circle at 84% 15%, rgba(80, 166, 255, 0.22), transparent 25rem),
    linear-gradient(180deg, #f7fbff 0%, #eef6ff 46%, #f8fbff 100%);
}

body.website-page {
  display: block;
  background: #f4f7fc;
}

body.app-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  min-height: 100dvh;
  min-height: 100svh;
  background: var(--app-bg, #f2f4f8);
}

body.app-body .site-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  min-height: 100dvh;
  min-height: 100svh;
}

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

button {
  font: inherit;
  cursor: pointer;
}

input,
textarea {
  font: inherit;
}

.site-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

body:not(.app-body):not(.website-page) .site-shell {
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 14%, rgba(95, 170, 255, 0.2), transparent 19rem),
    linear-gradient(180deg, #f7fbff 0%, #eef6ff 48%, #f8fbff 100%);
}

body.website-page .site-shell {
  max-width: none;
  overflow-x: clip;
  background: #f4f7fc;
}

body.app-body .site-shell {
  background: #f2f4f8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  background: #c41e22;
  border: 3px solid #c41e22;
  border-radius: 50%;
}

.brand-logo {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand strong {
  display: block;
  color: #092b73;
  font-size: clamp(18px, 5vw, 30px);
  font-weight: 900;
}

.brand small {
  display: block;
  color: #092b73;
  font-size: 10px;
  letter-spacing: 1.4px;
}

/* —— 无障碍：系统大字号适配（老年机 / 系统字体放大） —— */
/* 原理：不阻止系统字体放大，而是让中文不逐字断行、金额不横向溢出、横向卡片可换行 */
.app-body {
  overflow-x: hidden;
}

.app-body :where(
  p,
  small,
  li,
  label,
  h1,
  h2,
  h3,
  h4,
  strong,
  span:not([class*="__amt"]):not([class*="__value"]):not([class*="fi-amt"])
) {
  word-break: keep-all;
  overflow-wrap: break-word;
}

.app-body :where(
  [class*="__amt"],
  [class*="__value"],
  [class*="__amount"],
  [class*="__balance"],
  [class*="__amt-wrap"],
  .fi-amt,
  .fc-hero__amount,
  .gf-hero__balance,
  .salary-hero__amt,
  .hero-card__amount
) {
  max-width: 100%;
  font-variant-numeric: tabular-nums;
  word-break: keep-all;
  overflow-wrap: anywhere;
  /* 禁止金额区出现滚动条：overflow-x:auto 在 Windows 上会连带出带上下箭头的纵向滚动条 */
  overflow: hidden;
  scrollbar-width: none;
}

.app-body :where(
  [class*="__amt"],
  [class*="__value"],
  [class*="__amount"],
  [class*="__balance"],
  [class*="__amt-wrap"],
  .fi-amt,
  .fc-hero__amount,
  .gf-hero__balance,
  .salary-hero__amt,
  .hero-card__amount
)::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* 若误用 number 输入展示金额，隐藏步进箭头 */
.app-body input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.app-body input[type="number"]::-webkit-outer-spin-button,
.app-body input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.app-body :where([class*="-banner"], .fc-stats, .hero-card__main, .finance-card) {
  min-width: 0;
}

.app-body :where([class*="-banner"]) {
  flex-wrap: wrap;
}
