/* ============================================================
   WTCBUY · Base  (v2 · 白底潮流 · 面向 13-35 岁)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
/* iOS 上 overflow-x:hidden 拦不住「橡皮筋」：手指从页面边缘往旁边拖，整版会跟着
   位移再弹回，看起来就是版面在飘。overscroll-behavior 关掉横向的链式滚动与回弹，
   纵向保留（否则滚到底不能继续滑，手感会变硬）。 */
html, body { overscroll-behavior-x: none; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,h2,h3,h4,h5,h6 { margin: 0; font-weight: 700; line-height: 1.2; color: var(--text); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

::selection { background: var(--accent-wash); color: var(--accent-press); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-400); }

/* ---------- 通用布局 ---------- */
.container, .wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-5); }
@media (max-width: 640px) { .container, .wrap { padding: 0 var(--sp-4); } }

.section { padding: var(--sp-16) 0; }
.section-soft { background: var(--bg-soft); }
.section-muted { background: var(--bg-muted); }
.section-tight { padding: var(--sp-10) 0; }

.row { display: flex; gap: var(--sp-4); }
.col { display: flex; flex-direction: column; gap: var(--sp-4); }
.grid { display: grid; gap: var(--sp-4); }
.between { display: flex; align-items: center; justify-content: space-between; }
/* 全站通用布局工具（页面模板里高频使用，勿删） */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
/* .wrap 本身是容器类，这里只对「行 + wrap」组合还原为换行，避免把行撑成容器宽度 */
.row.wrap, .row-between.wrap { flex-wrap: wrap; width: auto; max-width: none; margin: 0; padding: 0; }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.center { display: flex; align-items: center; justify-content: center; }
.vcenter { display: flex; align-items: center; }
.wrap-flex { display: flex; flex-wrap: wrap; }
.gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); } .gap-6 { gap: var(--sp-6); }
.grow { flex: 1; }
.hide-sm { } .show-sm { display: none; }
@media (max-width: 640px) { .hide-sm { display: none !important; } .show-sm { display: block; } }

/* ---------- 文字工具 ---------- */
.small { font-size: var(--fs-sm); }
.faint { color: var(--text-faint); }
.muted { color: var(--text-muted); }
.strong { font-weight: 700; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: var(--fs-sm); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.display { font-family: var(--font-display); }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: 44px; padding: 0 var(--sp-5);
  border-radius: var(--r-pill); font-weight: 700; font-size: var(--fs-md);
  background: var(--ink-900); color: #fff; border: 2px solid var(--ink-900);
  transition: transform var(--dur-fast) var(--ease-bounce), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  white-space: nowrap; user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--accent-press); border-color: var(--accent-press); }
.btn-teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-press); border-color: var(--teal-press); }
.btn-ghost { background: transparent; color: var(--ink-900); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--ink-300); }
.btn-white { background: #fff; color: var(--ink-900); border-color: #fff; }
.btn-sm { height: 36px; padding: 0 var(--sp-4); font-size: var(--fs-base); }
.btn-lg { height: 52px; padding: 0 var(--sp-6); font-size: var(--fs-lg); }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-link { color: var(--brand); font-weight: 700; background: none; border: 0; height: auto; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* ---------- 标签 / chip ---------- */
.chip, .tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 var(--sp-3);
  border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600;
  background: var(--ink-100); color: var(--ink-700);
}
.chip-brand { background: var(--accent-wash); color: var(--accent-press); }
.chip-teal { background: var(--teal-wash); color: var(--teal-press); }
.chip-grape { background: var(--grape-wash); color: var(--grape-press); }
.chip-pink { background: var(--pink-wash); color: #BE185D; }
.chip-line { background: transparent; border: 1px solid var(--line); color: var(--text-muted); }
.chip-active { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.badge { display: inline-flex; align-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; }

/* ---------- 卡片 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.card-pad { padding: var(--sp-5); }
.card-head { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: var(--fs-md); font-weight: 700; }
.card-soft { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); }

/* ---------- 输入 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.field-hint { font-size: var(--fs-xs); color: var(--text-faint); }
.input, .select, textarea.input {
  width: 100%; height: 44px; padding: 0 var(--sp-4);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-md);
  font-size: var(--fs-base); color: var(--text); transition: border-color var(--dur) var(--ease);
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--brand); }
textarea.input { height: auto; min-height: 88px; padding: var(--sp-3) var(--sp-4); resize: vertical; }
.input-group { display: flex; align-items: stretch; min-width: 0; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-pill); transition: border-color var(--dur) var(--ease); }
.input-group:focus-within { border-color: var(--brand); }
/* 输入框默认 width:100% 会把按钮挤出圆角框，这里必须允许收缩 */
.input-group .input { flex: 1 1 auto; min-width: 0; width: auto; border: 0; background: transparent; height: 48px; }
.input-group .btn { flex: none; border-radius: var(--r-pill); height: 48px; margin: 2px; }

/* ---------- 分隔 / 点 ---------- */
.divider { height: 1px; background: var(--line); border: 0; margin: var(--sp-6) 0; }
.dot { width: 6px; height: 6px; border-radius: 999px; background: var(--ink-400); display: inline-block; }
.dot-brand { background: var(--brand); } .dot-teal { background: var(--teal); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: var(--sp-16) var(--sp-5); color: var(--text-faint); }
.empty-mark { width: 64px; height: 64px; margin: 0 auto var(--sp-4); border-radius: var(--r-lg); background: var(--bg-muted); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.empty-title { font-size: var(--fs-md); font-weight: 700; color: var(--text-muted); margin-bottom: var(--sp-2); }

/* ---------- 骨架屏 ---------- */
.skeleton { background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-50) 37%, var(--ink-100) 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: var(--r-sm); }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- 页面容器 ---------- */
.page { min-height: calc(100vh - var(--header-h)); min-height: calc(100dvh - var(--header-h)); padding-top: var(--sp-8); padding-bottom: var(--sp-16); }
.page-head { margin-bottom: var(--sp-8); }
.page-title { font-size: var(--fs-3xl); font-family: var(--font-display); }
.page-sub { color: var(--text-muted); margin-top: var(--sp-2); }

/* ---------- 动效 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp var(--dur) var(--ease) both; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
.grad-text { background: var(--grad-sunset); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-text-grape { background: var(--grad-grape); -webkit-background-clip: text; background-clip: text; color: transparent; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 按钮补充：描边 / 静音 / 强调别名 ---------- */
.btn-outline { background: #fff; color: var(--ink-900); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink-900); background: #fff; }
.btn-quiet { background: transparent; color: var(--text-muted); border-color: transparent; box-shadow: none; }
.btn-quiet:hover { background: var(--bg-soft); color: var(--ink-900); }
.btn-accent { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-accent:hover { background: var(--accent-press); border-color: var(--accent-press); }
