/* 重置与排版基线。不做任何组件样式。
   颜色一律引用 tokens.css 的变量，不写死色值；
   间距写 4px 刻度的字面值（4/8/12/16/24/32/48），不出现刻度外数值。 */
*{box-sizing:border-box}
html,body{margin:0;padding:0}
/* 横竖屏切换时不让移动浏览器自行放大正文字号 */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{
  background-color:var(--bg); color:var(--fg);
  /* 极淡的圆点网格（参考站的大气感来源之一）：1px 硬边圆点，22px 见方。
     background-size 是纹理特征——回归测试据此区分「背景纹理」与「顶部径向光晕」。 */
  background-image:radial-gradient(var(--line) 1px, transparent 1px);
  background-size:22px 22px; background-attachment:fixed;
  font:var(--t3)/1.6 -apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  min-height:100vh; min-height:100dvh; display:flex; flex-direction:column;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
b,strong{font-weight:650}
.hidden{display:none !important}
.muted{color:var(--muted)}
.tiny{font-size:var(--t1)}
.link{color:var(--accent);background:none;border:none;padding:0;font:inherit;cursor:pointer}
.link:hover{text-decoration:underline;text-underline-offset:3px}

/* 表单元素统一基线；组件层只加变体 */
input,textarea,select,button{font-family:inherit;font-size:var(--t3)}
input,textarea,select{
  background:var(--surface); color:var(--fg);
  border:1px solid var(--line-strong); border-radius:var(--r1);
  padding:8px 12px; outline:none; transition:border-color .15s;
}
/* radio/checkbox/file 是控件不是文本框，撑满父宽会把行内控件挤变形 */
input:not([type=radio]):not([type=checkbox]):not([type=file]),textarea,select{width:100%}
input::placeholder,textarea::placeholder{color:var(--faint)}   /* --faint 仅限此处 */
input:focus,textarea:focus,select:focus{border-color:var(--accent)}
textarea{min-height:96px;resize:vertical;line-height:1.6}
button{cursor:pointer;transition:.15s}

/* iOS Safari 在输入框字号小于 16px 时，聚焦会强制把整页放大一次。
   窄屏统一抬到 16px。选择器带上 body 是为了稳赢 pages.css 里
   `.sel` / `.tokValue` / `.drop .row select` 这些更晚加载的小字号规则。 */
@media (max-width:820px){
  /* iOS Safari 对 background-attachment:fixed 支持不好（滚动时重绘卡顿、纹理不跟手） */
  body{background-attachment:scroll}
  body input:not([type=radio]):not([type=checkbox]):not([type=file]),
  body textarea,body select,
  body .sel,body .tokValue,body .drop .row select{font-size:16px}
  /* 原生勾选框默认只有 13px，手指很难点中 */
  input[type=checkbox],input[type=radio]{width:18px;height:18px}
}
