/* ============================================================
   base.css — 重置 / 排版 / 焦点 / 无障碍
   ============================================================ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{
  -webkit-text-size-adjust:100%;
  overflow-x:clip;
  scroll-behavior:smooth;
}
@supports not (overflow:clip){ html{overflow-x:hidden} }
html.lock, html.lock body{ overflow:hidden }
body{
  font-family:var(--font);
  font-size:var(--fs-4);
  line-height:1.55;
  color:var(--text);
  background:var(--bg);
  min-height:100vh; min-height:var(--app-h);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  transition:background var(--d-3) var(--ease), color var(--d-3) var(--ease);
}
/* 点击高亮：全局消除 iOS/Android 蓝色半透明方块 */
*{ -webkit-tap-highlight-color:transparent; -webkit-touch-callout:none }
input,textarea,select{ -webkit-touch-callout:default }

img{ display:block; max-width:100%; }
button,input,textarea,select{ font:inherit; color:inherit; background:none; border:0; }
button{ cursor:pointer; user-select:none; }
a{ color:inherit; text-decoration:none; }
ul,ol{ list-style:none }
svg{ display:block; flex:none }
b,strong{ font-weight:650 }

h1,h2,h3,h4{ font-weight:700; line-height:1.25; text-wrap:balance }
p{ text-wrap:pretty }

/* 数字宽度统一（时长/计数） */
.nums{ font-variant-numeric:tabular-nums }

/* 焦点可见性 */
:focus{ outline:none }
:focus-visible{
  outline:2px solid var(--brand);
  outline-offset:2px;
  border-radius:8px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible{
  outline:none; border-color:var(--brand);
  box-shadow:var(--ring);
}

/* 选区 */
::selection{ background:var(--brand); color:#fff }
[data-theme="dark"] ::selection{ color:#17140f }

/* 滚动条 */
*{ scrollbar-width:thin; scrollbar-color:var(--line-2) transparent }
*::-webkit-scrollbar{ width:9px; height:9px }
*::-webkit-scrollbar-thumb{ background:var(--line-2); border-radius:99px; border:2px solid transparent; background-clip:content-box }
*::-webkit-scrollbar-track{ background:transparent }
*::-webkit-scrollbar-corner{ background:transparent }

/* 无障碍隐藏 */
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}
[hidden]{ display:none !important }

/* 减少动态效果偏好：全局降级 */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
}

/* 通用工具 */
.hide{ display:none !important }
.ellipsis{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.row{ display:flex; align-items:center; gap:8px }
.col{ display:flex; flex-direction:column }
.grow{ flex:1; min-width:0 }
