/* ============================================
   Reset 样式 & 全局基础样式
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-disabled);
  border-radius: var(--radius-round);
}

/* 通用工具类 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-secondary { color: var(--text-secondary); }
.text-hint { color: var(--text-hint); }
.text-primary-color { color: var(--primary-500); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-bold { font-weight: bold; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.relative { position: relative; }

/* 页面容器 */
.page-container {
  min-height: 100vh;
  background: var(--background);
}

/* 内容区（留出底部 TabBar 间距） */
.page-content {
  padding-bottom: calc(var(--tabbar-height) + var(--safe-area-bottom) + var(--spacing-md));
}

/* 页面内边距 */
.px-page {
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}
