/* ==========================================================================
   base.css — reset + 全局排版 + 无障碍基础设施
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
dl,
dd,
blockquote,
figure,
fieldset {
  margin: 0;
}

/* figure 不在上面的列表里就会带着 UA 默认的 1em 40px 左右外边距进场，
   通栏图位会直接撑破窄视口 */
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

body {
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: var(--fz-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  color: var(--text);
  line-height: var(--lh-heading);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--fz-h1);
  font-weight: 800;
}

h2 {
  font-size: var(--fz-h2);
  font-weight: 800;
}

h3 {
  font-size: var(--fz-h3);
}

h4 {
  font-size: var(--fz-card);
}

p {
  text-wrap: pretty;
}

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

a:hover {
  color: var(--text);
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

strong,
b {
  font-weight: 700;
  color: var(--text-body);
}

hr {
  border: 0;
  border-block-start: 1px solid var(--line);
  margin: 0;
}

/* 组件里写 display:flex 会盖掉 UA 的 [hidden]{display:none}，
   筛选、折叠一律靠这个兜底 */
[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--brand);
  color: #fff;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  font-size: var(--fz-xs);
  font-weight: 600;
  transition: top var(--ease);
}

.skip-link:focus {
  top: 16px;
  color: #fff;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 行内代码：番剧源索引地址、包名这类内容需要与正文区分，
   否则在深色底上容易和普通文字糊在一起。 */
code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  word-break: break-all;
}
