// reset.less - 现代 CSS 样式重置
// 统一盒模型为 border-box
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

// 基础字体与颜色设置
html {
  // 基础字体大小 (1rem = 16px)
  font-size: 16px;
  // 平滑滚动
  scroll-behavior: smooth;
  height: 100%;
  width: 100%;
}

body {
  // 继承父级字体设置
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 1rem;
  line-height: 1.5; // 舒适行高
  color: #333; // 基础文本色
  // background-color: #fff; // 基础背景色
  -webkit-text-size-adjust: 100%; // 防止iOS横屏字体放大
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

// 移除默认边框
img,
iframe,
embed,
object,
video {
  border: 0;
}

// 图片与媒体元素自适应
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
  height: auto;
}

// 表格重置
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

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

// 文本元素重置
a {
  color: inherit; // 继承父级颜色
  text-decoration: none;
  background-color: transparent;
}

a:hover,
a:focus {
  outline: none;
}

// 标题元素重置
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

// 表单元素重置
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
}

button,
input {
  overflow: visible;
}

button,
select {
  text-transform: none;
}

// 按钮样式重置
button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  cursor: pointer;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

// 输入框聚焦样式
input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: none;
}

// 文本区域不允许拖拽调整大小
textarea {
  overflow: auto;
  resize: vertical; // 仅允许垂直调整
}

// 移除占位符默认样式
::-webkit-input-placeholder {
  color: #999;
  opacity: 1;
}

::-moz-placeholder {
  color: #999;
  opacity: 1;
}

:-ms-input-placeholder {
  color: #999;
  opacity: 1;
}

::placeholder {
  color: #999;
  opacity: 1;
}

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

// 隐藏元素（屏幕阅读器可见）
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}