/* 基础样式：重置、排版、通用工具类 */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main { flex: 1 0 auto; outline: none; }

h1, h2, h3, h4 { margin: 0 0 var(--space-3); line-height: var(--lh-tight); font-weight: 700; }
p { margin: 0 0 var(--space-3); }
ul, ol { margin: 0 0 var(--space-3); padding-left: 1.4em; }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
table { border-collapse: collapse; width: 100%; }
button { font: inherit; color: inherit; }
strong { font-weight: 700; }

a { color: var(--c-link); text-decoration: none; }
a:hover { color: var(--c-link-hover); text-decoration: underline; }

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

[id] { scroll-margin-top: calc(var(--header-h) + var(--space-4)); }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 200;
  padding: var(--space-2) var(--space-4);
  background: var(--c-ink);
  color: var(--c-on-ink);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--space-2); color: var(--c-on-ink); }

.icon { width: 24px; height: 24px; flex: none; }
.icon--sm { width: 16px; height: 16px; }
.icon--xl { width: 40px; height: 40px; }

.sep { margin: 0 var(--space-3); color: var(--c-border-strong); }

/* 待确认占位：上线前须全部替换（见 TODO.md） */
.todo {
  display: inline-block;
  padding: 0 6px;
  background: #FFF4CC;
  border: 1px dashed #D9A400;
  border-radius: 4px;
  color: #6B5200;
  font-size: 0.9em;
}

/* 高亮：目标区块淡黄 2 秒后淡出 */
@keyframes gt-flash {
  0%, 60% { background-color: var(--c-highlight); }
  100% { background-color: transparent; }
}
.is-flash { animation: gt-flash 2s var(--ease); border-radius: var(--radius-lg); }

mark, .search-hit { background: var(--c-highlight); color: inherit; border-radius: 2px; padding: 0 1px; }

/* 段落中的文字链接加底线，不只依赖颜色区分 */
:is(.policy-section, .policy-intro, .manual-section, .acc-panel, .after-faq, .contact-box, .noscript-card, .dl-error) :is(p, li, td) a:not(.btn):not([data-section]):not(.pager-link) {
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
