
@charset "utf-8";

/*
 * 现代化 CSS 重置样式
 * 基于 Normalize.css 和现代最佳实践
 * 适配移动端和桌面端
 */
/* ==========================================================================
   基础重置
   ========================================================================== */

/* 使用更好的盒模型 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 移除默认边距和内边距 */
* {
  margin: 0;
  padding: 0;
}

/* HTML 和 Body 基础设置 */
html {
  /* 防止 iOS 字体大小调整 */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  /* 更好的字体渲染 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 设置根字体大小 */
  font-size: 16px;
  /* 滚动行为 */
  scroll-behavior: smooth;
}

body {
  /* 基础字体设置 */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
  /* 防止水平滚动 */
  overflow-x: hidden;
  /* 更好的文本渲染 */
  text-rendering: optimizeLegibility;
}

/* ==========================================================================
   HTML5 元素显示定义
   ========================================================================== */

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
  display: block;
}

/* ==========================================================================
   链接
   ========================================================================== */

a {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
  /* 移除 iOS 上的灰色背景 */
  -webkit-tap-highlight-color: transparent;
}

a:active,
a:hover {
  outline: 0;
}

/* ==========================================================================
   文本元素
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
}

/* 代码元素 */
code,
kbd,
pre,
samp {
  font-family: 'SFMono-Regular', 'Monaco', 'Inconsolata', 'Liberation Mono', 'Courier New', monospace;
  font-size: 1em;
}

pre {
  overflow: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* 引用 */
blockquote,
q {
  quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
  content: '';
  content: none;
}

/* 强调元素 */
b,
strong {
  font-weight: bolder;
}

small {
  font-size: 80%;
}

/* 防止 sub 和 sup 影响行高 */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

/* ==========================================================================
   列表
   ========================================================================== */

ol,
ul {
  list-style: none;
}

/* ==========================================================================
   嵌入内容
   ========================================================================== */

img {
  border: 0;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  /* 防止图片下方出现空隙 */
  display: block;
}

/* SVG 在 IE 中的显示问题 */
svg:not(:root) {
  overflow: hidden;
}

/* ==========================================================================
   表格
   ========================================================================== */

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

td,
th {
  padding: 0;
  text-align: left;
}

/* ==========================================================================
   表单元素
   ========================================================================== */

button,
input,
optgroup,
select,
textarea {
  color: inherit;
  font: inherit;
  margin: 0;
  /* 移除 iOS 样式 */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

button {
  overflow: visible;
  background: transparent;
  border: none;
  cursor: pointer;
}

button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
  -webkit-appearance: button;
  cursor: pointer;
}

button[disabled],
html input[disabled] {
  cursor: default;
  opacity: 0.6;
}

button::-moz-focus-inner,
input::-moz-focus-inner {
  border: 0;
  padding: 0;
}

input {
  line-height: normal;
}

input[type="checkbox"],
input[type="radio"] {
  box-sizing: border-box;
  padding: 0;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  height: auto;
}

input[type="search"] {
  -webkit-appearance: textfield;
  box-sizing: content-box;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

fieldset {
  border: 1px solid #c0c0c0;
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em;
}

legend {
  border: 0;
  padding: 0;
}

textarea {
  overflow: auto;
  resize: vertical;
}

optgroup {
  font-weight: bold;
}

/* ==========================================================================
   移动端优化
   ========================================================================== */

/* 移除点击高亮 */
a,
button,
input,
select,
textarea,
div {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* 防止用户选择 */
.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* ==========================================================================
   滚动条样式
   ========================================================================== */

/* Webkit 滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

::-webkit-scrollbar-corner {
  background: #f1f1f1;
}

/* ==========================================================================
   辅助功能和可访问性
   ========================================================================== */

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

/* 焦点样式 */
:focus {
  outline: 2px solid #4A90E2;
  outline-offset: 2px;
}

/* 移除按钮和链接的默认焦点样式 */
button:focus,
a:focus {
  outline: none;
}

/* 为键盘用户提供焦点指示 */
.js-focus-visible :focus:not(.focus-visible) {
  outline: none;
}

.js-focus-visible .focus-visible {
  outline: 2px solid #4A90E2;
  outline-offset: 2px;
}

/* ==========================================================================
   打印样式
   ========================================================================== */

@media print {
  *,
  *:before,
  *:after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }

  abbr[title]:after {
    content: " (" attr(title) ")";
  }

  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

/* ==========================================================================
   工具类
   ========================================================================== */

/* 清除浮动 */
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* 隐藏元素 */
.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}

/* 文本对齐 */
.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* 文本截断 */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 多行文本截断 */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   响应式工具
   ========================================================================== */

/* 响应式图片 */
.img-responsive {
  max-width: 100%;
  height: auto;
}

/* 响应式视频 */
.video-responsive {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.video-responsive iframe,
.video-responsive object,
.video-responsive embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   动画和过渡
   ========================================================================== */

/* 减少动画（用户偏好） */
@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;
  }
}

/* 基础过渡 */
.transition {
  transition: all 0.3s ease;
}

.transition-fast {
  transition: all 0.15s ease;
}

.transition-slow {
  transition: all 0.5s ease;
}

