/* ===========================================================
   基础样式：reset、字体、排版、页面容器
   =========================================================== */

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

html {
  color-scheme: light only;
  background-color: #F6F6F8;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  overscroll-behavior-y: none;
}

h1, h2, h3, p, figure { margin: 0; }

button {
  font: inherit;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input, textarea {
  font: inherit;
  color: inherit;
}

a { color: var(--accent); text-decoration: none; }

/* 页面容器：底部留出 Tab 栏与安全区 */
.view {
  min-height: 100dvh;
  padding: max(var(--safe-t), 8px) var(--page-pad)
    calc(var(--tab-h) + var(--tab-inset) + var(--safe-b) + var(--sp-8));
}

/* 标题 */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 10px 0 21px;
  min-height: 34px;
}

.h1 {
  font-size: var(--fs-page);
  line-height: var(--lh-page);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: 700;
}

.group-label {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 600;
  color: var(--text-2);
  margin: var(--sp-6) 0 var(--sp-2);
}

.caption {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  color: var(--text-2);
}

.sub {
  font-size: var(--fs-sub);
  line-height: var(--lh-sub);
  color: var(--text-2);
}

/* 布局工具 */
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.grow { flex: 1; min-width: 0; }

.card {
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: var(--sp-4);
}

@media (min-width: 768px) {
  .view {
    max-width: 720px;
    margin: 0 auto;
    padding-top: var(--sp-8);
  }

  .tabbar {
    left: 50%;
    right: auto;
    width: 420px;
    transform: translateX(-50%);
  }
}

/* 视觉隐藏但仍可被 label 触发（安卓对 display:none 的 file input 不弹选择器） */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
