/* ============================================================
   基础层：reset / 版心 / 文字层级 / 通用工具类
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cw-neutral-100);
  color: var(--cw-neutral-900);
  font-family: var(--cw-font-sans);
  font-size: var(--cw-font-body);
  line-height: var(--cw-lh-body);
  -webkit-font-smoothing: antialiased;
}

/* 手机版心：桌面上居中显示为 430px 画板 */
.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--cw-neutral-50);
  overflow-x: hidden;
}
@media (min-width: 480px) {
  body { background: var(--cw-color-canvas-outer); }
  .app { box-shadow: 0 24px 60px rgba(16, 24, 26, .10); }
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ---------- 文字层级 ---------- */
.t-display { font-size: var(--cw-font-display); line-height: var(--cw-lh-display); font-weight: 600; }
.t-h1 { font-size: var(--cw-font-h1); line-height: var(--cw-lh-h1); font-weight: 600; }
.t-h2 { font-size: var(--cw-font-h2); line-height: var(--cw-lh-h2); font-weight: 600; }
.t-h3 { font-size: var(--cw-font-h3); line-height: var(--cw-lh-h3); font-weight: 600; }
.t-body { font-size: var(--cw-font-body); line-height: var(--cw-lh-body); font-weight: 400; }
.t-caption { font-size: var(--cw-font-caption); line-height: var(--cw-lh-caption); font-weight: 400; }
.t-tiny { font-size: var(--cw-font-tiny); line-height: var(--cw-lh-tiny); font-weight: 400; }

.c-primary { color: var(--cw-color-primary); }
.c-secondary { color: var(--cw-neutral-600); }
.c-tertiary { color: var(--cw-neutral-400); }
.c-danger { color: var(--cw-color-danger); }
.c-success { color: var(--cw-color-success); }
.c-warning { color: var(--cw-color-warning); }

.num { font-family: var(--cw-font-num); font-variant-numeric: tabular-nums; }

/* ---------- 安全区 ---------- */
.safe-top { padding-top: env(safe-area-inset-top); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* ---------- 布局工具 ---------- */
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: var(--cw-space-1); }
.gap-2 { gap: var(--cw-space-2); }
.gap-3 { gap: var(--cw-space-3); }
.gap-4 { gap: var(--cw-space-4); }
.flex-1 { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-2 { margin-top: var(--cw-space-2); }
.mt-3 { margin-top: var(--cw-space-3); }
.mt-4 { margin-top: var(--cw-space-4); }
.mt-5 { margin-top: var(--cw-space-5); }
.mt-6 { margin-top: var(--cw-space-6); }
