@charset "UTF-8";
/*!
 * gn-ui / reset.css — 现代样式重置
 * 金蚁网响应式 UI 层 · 版本 1.0 · 2026-11-23
 *
 * 【关键设计：作用域隔离】
 *   全部规则限定在 .gn-ui 之下，且使用 :where() 把选择器优先级压到 0。
 *   因此：
 *     1) 旧页面（没有 .gn-ui）完全不受影响；
 *     2) 新层的组件样式（.gn-xxx，优先级 0,1,0）可以稳定覆盖这些重置。
 *   —— 这是与旧 CSS 共存而不打架的基础。
 *
 * 【启用方式】
 *   <body class="gn-ui">
 *   或在局部容器上 <div class="gn-ui"> ... </div>
 *
 * 【替换掉的历史问题】
 *   旧站 main.css 里有 13 处 `* { }` 通配符重置互相覆盖，本文件是全站唯一一份。
 */

/* ==================== 盒模型 ==================== */
:where(.gn-ui),
:where(.gn-ui) *,
:where(.gn-ui) *::before,
:where(.gn-ui) *::after {
  box-sizing: border-box;
}

/* ==================== 基础元素 ==================== */
/* 约定：<body class="gn-ui">，因此 body 自身用 body.gn-ui 匹配 */
:where(body.gn-ui) {
  margin: 0;
  padding: 0;
  background: var(--gn-bg-page);
  color: var(--gn-text);
  font-family: var(--gn-font-sans);
  font-size: var(--gn-fs-15);
  line-height: var(--gn-lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;   /* 防止 iOS 横屏自动放大 */
}

:where(.gn-ui) :where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd) {
  margin: 0;
}

:where(.gn-ui) :where(h1, h2, h3, h4, h5, h6) {
  font-weight: var(--gn-fw-bold);
  line-height: var(--gn-lh-tight);
}

:where(.gn-ui) :where(ul, ol) {
  margin: 0;
  padding: 0;
  list-style: none;
}

:where(.gn-ui) :where(a) {
  color: inherit;
  text-decoration: none;
}

:where(.gn-ui) :where(a):hover {
  color: var(--gn-primary);
}

/* ==================== 媒体 ==================== */
:where(.gn-ui) :where(img, svg, video, canvas) {
  display: block;
  max-width: 100%;
  height: auto;
}

:where(.gn-ui) :where(img) {
  /* 加载失败时不显示裂图边框 */
  font-style: italic;
  background-color: var(--gn-bg-subtle);
}

/* ==================== 表单 ==================== */
:where(.gn-ui) :where(button, input, select, textarea) {
  margin: 0;
  font: inherit;
  color: inherit;
}

:where(.gn-ui) :where(button) {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:where(.gn-ui) :where(textarea) {
  resize: vertical;
}

/* 移动端输入框小于 16px 会触发 iOS 自动缩放，这里兜底 */
:where(.gn-ui) :where(input, select, textarea) {
  font-size: max(1rem, var(--gn-fs-15));
}

/* ==================== 表格 ==================== */
:where(.gn-ui) :where(table) {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

:where(.gn-ui) :where(th, td) {
  padding: 0;
  text-align: left;
}

/* ==================== 焦点可见（键盘可达性） ==================== */
:where(.gn-ui) :focus-visible {
  outline: 2px solid var(--gn-primary);
  outline-offset: 2px;
}

:where(.gn-ui) :focus:not(:focus-visible) {
  outline: none;
}

/* ==================== 减少动效 ==================== */
@media (prefers-reduced-motion: reduce) {
  :where(.gn-ui) *,
  :where(.gn-ui) *::before,
  :where(.gn-ui) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==================== 工具类（极少量，保持克制） ==================== */
:where(.gn-ui) .gn-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;
}
