/* ==========================================================================
   CSS Reset - 移除默认样式
   ========================================================================== */

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

/* Remove default margin and padding */
* {
  margin: 0;
  padding: 0;
}

/* HTML and Body */
html {
  height: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  min-height: 100%;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  scroll-behavior: smooth;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
}

/* Lists */
ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Links */
a {
  text-decoration: none;
  color: inherit;
}

/* Images and Media */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* Form elements */
input,
button,
textarea,
select {
  font: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

/* Tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Remove default styles */
address {
  font-style: normal;
}

/* Layout */
.container {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-top: 44px;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 768px) {
  .container {
    padding-left: 0;
    padding-right: 0;
  }
}

.site-main {
  min-height: calc(100vh - 84px);
}

/* 移动端全局适配 */
@media (max-width: 767px) {
  .container {
    padding-top: 24px;
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 24px;
  }

  .site-main {
    min-height: calc(100vh - 128px);
  }

  /* 安全区域 - 适配刘海屏 */
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* 抽屉打开时禁止背景滚动 */
  body.drawer-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
}

/* Accessibility */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
