/* ===== Base：重置 / 排版 / 表单元素 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg-page);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}
::selection { background: rgba(var(--accent-rgb), 0.28); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg, video, audio { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; }
code, kbd, pre, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* 可见焦点环（键盘可达） */
:focus { outline: none; }
:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.7); outline-offset: 2px; border-radius: 10px; }

/* 输入控件：统一为内凹 well */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
textarea, select {
  width: 100%;
  font: inherit;
  font-size: var(--fs-md);
  color: var(--text-1);
  background: var(--bg-well);
  box-shadow: var(--well-shadow);
  border: 0;
  border-radius: var(--r-well);
  padding: 11px 14px;
  min-height: 44px;
  transition: box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-fast);
}
textarea { resize: vertical; line-height: 1.65; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus-visible, textarea:focus-visible, select:focus-visible,
input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: var(--well-shadow), 0 0 0 2px rgba(var(--accent-rgb), 0.55);
}
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
    linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="file"] { font: inherit; font-size: var(--fs-sm); color: var(--text-2); max-width: 100%; }
input[type="file"]::file-selector-button {
  font: inherit; border: 0; border-radius: var(--r-pill); padding: 7px 14px; margin-right: 10px;
  background: var(--bg-pill); color: var(--text-1); cursor: pointer;
}

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: rgba(127, 135, 150, 0.35) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(127, 135, 150, 0.32); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* 屏幕阅读器专用 */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 767px) {
  /* iOS：输入框字号 ≥16px 避免自动缩放 */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), textarea, select { font-size: 16px; }
}
