/* ============================================
   藏甄膳官网 - CSS Reset / Normalize
   基于 Modern CSS Reset
   ============================================ */

/* ===== 盒模型 ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ===== 移除默认 margin/padding ===== */
* {
  margin: 0;
  padding: 0;
}

/* ===== HTML & Body 基础设置 ===== */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: var(--leading-normal);
  font-family: var(--font-family-base);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ===== 排版元素重置 ===== */
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  font-family: var(--font-family-heading);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

p {
  overflow-wrap: break-word;
}

/* ===== 列表 ===== */
ul, ol {
  list-style: none;
}

/* ===== 链接 ===== */
a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

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

/* ===== 图片与媒体 ===== */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ===== 表单元素 ===== */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

/* ===== 表格 ===== */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ===== 滚动条美化（Webkit）===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}

/* ===== 选择高亮 ===== */
::selection {
  background-color: var(--color-primary);
  color: var(--text-on-primary);
}

/* ===== Focus 可见性（无障碍）===== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

/* ===== details/summary 重置 ===== */
details > summary {
  list-style: none;
  cursor: pointer;
}

details > summary::-webkit-details-marker {
  display: none;
}

/* ===== 隐藏但可访问的元素 ===== */
.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;
}
