/**
 * CSS Reset - 重置浏览器默认样式
 * 确保各浏览器表现一致
 */

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

/* 移除默认margin和padding */
html,
body,
div,
span,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
address,
cite,
code,
del,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strong,
sub,
sup,
var,
b,
u,
i,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
main,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

/* HTML5 语义化元素重置 */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section {
  display: block;
}

/* 设置基础样式 */
html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  line-height: 1;
  min-height: 100vh;
}

/* 列表样式重置 */
ol,
ul {
  list-style: none;
}

/* 引用样式重置 */
blockquote,
q {
  quotes: none;
}

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

/* 表格样式重置 */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* 链接样式重置 */
a {
  text-decoration: none;
  color: inherit;
  background-color: transparent;
}

/* 图片样式 */
img {
  display: block;
  max-width: 100%;
  height: auto;
  border-style: none;
}

/* 按钮样式重置 */
button {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
  overflow: visible;
  text-transform: none;
  -webkit-appearance: button;
  cursor: pointer;
  background: none;
  border: none;
}

button::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

button:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/* 输入框样式重置 */
input,
textarea,
select {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

input {
  overflow: visible;
}

textarea {
  overflow: auto;
  resize: vertical;
}

/* 移除输入框默认样式 */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="search"] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}

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

/* 聚焦状态 */
:focus {
  outline: none;
}

:focus-visible {
  /* outline: 2px solid var(--color-primary, #F5A623);
  outline-offset: 2px; */
}

/* 选择文本样式 */
::selection {
  background-color: var(--color-primary, #F5A623);
  color: var(--color-white, #FFFFFF);
}

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

/* 可访问性：跳过链接 */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-black, #1A1A1A);
  color: var(--color-white, #FFFFFF);
  padding: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* ========== 自定义滚动条样式 ========== */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary, #F5A623) transparent;
}

/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: linear-gradient(
    to bottom,
    rgba(26, 26, 26, 0.02) 0%,
    rgba(26, 26, 26, 0.05) 100%
  );
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    135deg,
    var(--color-primary, #F5A623) 0%,
    #ff8c42 50%,
    var(--color-primary, #F5A623) 100%
  );
  background-size: 200% 200%;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background-position 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    135deg,
    #ff8c42 0%,
    var(--color-primary, #F5A623) 50%,
    #ff8c42 100%
  );
  background-size: 200% 200%;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(
    135deg,
    #e6951f 0%,
    #ff7a2a 100%
  );
  border-radius: 10px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}
