/* ============================================
   Base Styles - Reset & Foundation
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* 动态滚动背景层（四季风景） */
.scroll-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.season-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.season-spring {
  opacity: 1;
}

/* 基础排版 */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

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

a:hover {
  color: var(--accent-soft);
}

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

ul, ol {
  list-style: none;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 8px;
  background: rgba(212,165,116,0.1);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  background: rgba(58,58,58,0.04);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  overflow-x: auto;
  margin: var(--space-6) 0;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

::selection {
  background: rgba(212,165,116,0.3);
  color: var(--text-primary);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--accent-light);
  border-radius: var(--radius-full);
}

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

/* 通用容器 */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-20) 0;
}

.section-title {
  font-size: var(--text-3xl);
  text-align: center;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: var(--space-12);
  font-size: var(--text-lg);
}

/* 主内容区 */
main {
  padding-top: 80px;
  min-height: calc(100vh - 200px);
}

body[data-page="home"] main {
  padding-top: 0;
}

/* 无障碍 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 响应式标题 */
@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  .section { padding: var(--space-12) 0; }
  .container { padding: 0 var(--space-4); }
}
