/* CSS重置和基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 链接样式 */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-light);
  text-decoration: underline;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: var(--color-text);
}

h1 {
  font-size: 2.5rem;
  margin-top: 0;
}

h2 {
  font-size: 2rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.3em;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

/* 段落和列表 */
p {
  margin-bottom: 1em;
}

ul, ol {
  margin-bottom: 1em;
  padding-left: 2em;
}

li {
  margin-bottom: 0.5em;
}

/* 代码样式 */
code {
  font-family: var(--font-family-code);
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background-color: var(--color-code-bg);
  border-radius: 3px;
  color: var(--color-text);
}

pre {
  font-family: var(--font-family-code);
  font-size: 0.9em;
  line-height: 1.5;
  padding: 1em;
  background-color: var(--color-code-bg);
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.5em;
  border: 1px solid var(--color-border);
}

pre code {
  padding: 0;
  background-color: transparent;
  border-radius: 0;
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
}

th, td {
  padding: 0.75em 1em;
  border: 1px solid var(--color-border);
  text-align: left;
}

th {
  background-color: var(--color-bg-secondary);
  font-weight: 600;
}

tr:nth-child(even) {
  background-color: var(--color-bg-secondary);
}

/* 图片样式 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 实用类 */
.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

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

.hidden {
  display: none !important;
}

/* 打印样式 */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
  }
  
  a {
    color: #000;
    text-decoration: none;
  }
  
  pre, code {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
  }
}