/* ========================================
   全局基础样式 (Reset + Base)
   ======================================== */

/* --- Modern CSS Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  word-break: break-all;
}

ul, ol {
  list-style: none;
}

a {
  color: var(--color-blue);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-blue-hover);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-sans);
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* --- 中文排版基础 --- */
p {
  line-height: var(--line-height-base);
  margin-bottom: 1.5em;
}

p:last-child {
  margin-bottom: 0;
}

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

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-md); }

/* --- 无障碍：焦点样式 --- */
:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- 滚动条样式（Webkit） --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-gray);
}

::-webkit-scrollbar-thumb {
  background: var(--color-blue-mid);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-blue);
}

/* --- 选中文字颜色 --- */
::selection {
  background: var(--color-blue);
  color: #fff;
}

/* --- 工具类 --- */
.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;
}

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

.fw-bold    { font-weight: var(--font-weight-bold); }
.fw-medium  { font-weight: var(--font-weight-medium); }

.text-blue  { color: var(--color-blue); }
.text-red   { color: var(--color-red); }
.text-muted { color: var(--color-text-muted); }
.text-white { color: #ffffff; }

.bg-blue-light { background-color: var(--color-blue-light); }
.bg-gray       { background-color: var(--color-bg-gray); }
.bg-navy       { background-color: var(--color-navy); }

/* --- 响应式隐藏 --- */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  h1 { font-size: var(--font-size-2xl); }
  h2 { font-size: var(--font-size-xl); }
  h3 { font-size: var(--font-size-lg); }
}

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

/* --- 打印样式 --- */
@media print {
  .no-print { display: none !important; }
  body { font-size: 12pt; color: #000; }
  a { color: #000; }
}
