/**
 * 家脉云 - 基础样式文件
 * 
 * 【文档引用】UI设计规范-V1.0.md
 * 
 * @description 包含重置样式、基础布局、排版等
 * @version V1.3.0
 */

/* ==================== CSS重置 ==================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--text-secondary);
  background: var(--background-light);
  min-height: 100vh;
}

/* ==================== 排版样式 ==================== */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-h2);
}

h1 {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-h1);
  font-weight: var(--font-weight-bold);
}

h2 {
  font-size: var(--font-size-h2);
}

h3 {
  font-size: var(--font-size-h3);
}

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-color-dark);
}

/* ==================== 列表样式 ==================== */

ul, ol {
  list-style: none;
}

/* ==================== 图片样式 ==================== */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==================== 表单样式 ==================== */

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
}

/* ==================== 容器样式 ==================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

.container-fluid {
  width: 100%;
  padding: 0 var(--page-padding);
}

/* ==================== 布局工具类 ==================== */

.d-flex {
  display: flex;
}

.d-block {
  display: block;
}

.d-none {
  display: none;
}

.flex-column {
  flex-direction: column;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

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

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

/* ==================== 间距工具类 ==================== */

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }
.mt-2xl { margin-top: var(--spacing-2xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }
.mb-2xl { margin-bottom: var(--spacing-2xl); }

.pt-0 { padding-top: 0; }
.pt-sm { padding-top: var(--spacing-sm); }
.pt-md { padding-top: var(--spacing-md); }
.pt-lg { padding-top: var(--spacing-lg); }
.pt-xl { padding-top: var(--spacing-xl); }
.pt-2xl { padding-top: var(--spacing-2xl); }

.pb-0 { padding-bottom: 0; }
.pb-sm { padding-bottom: var(--spacing-sm); }
.pb-md { padding-bottom: var(--spacing-md); }
.pb-lg { padding-bottom: var(--spacing-lg); }
.pb-xl { padding-bottom: var(--spacing-xl); }
.pb-2xl { padding-bottom: var(--spacing-2xl); }

/* ==================== 文字工具类 ==================== */

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

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-color); }
.text-white { color: var(--white); }

.text-small { font-size: var(--font-size-small); }
.text-xs { font-size: var(--font-size-xs); }

.font-normal { font-weight: var(--font-weight-normal); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* ==================== 背景工具类 ==================== */

.bg-white { background: var(--white); }
.bg-light { background: var(--background-light); }

/* ==================== 显示隐藏（响应式） ==================== */

@media (max-width: 768px) {
  .d-none-mobile {
    display: none;
  }
}

@media (min-width: 769px) {
  .d-none-desktop {
    display: none;
  }
}

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

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-light);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==================== 选择文本样式 ==================== */

::selection {
  background: rgba(30, 64, 175, 0.1);
  color: var(--text-primary);
}

/* ==================== 禁用样式 ==================== */

.disabled,
[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
