/* 白日梦游记 - 全局样式 */
@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* CSS变量定义 */
:root {
  /* 浅色主题 (白日梦模式) */
  --bg-primary: #FEFAE0;
  --bg-secondary: #FAEDCD;
  --bg-card: rgba(255, 250, 224, 0.8);
  --text-primary: #2d3436;
  --text-secondary: #636e72;
  --text-muted: #b2bec3;
  --accent-light: #A8DADC;
  --accent-pink: #FFAFCC;
  --accent-green: #CCD5AE;
  --accent-light-dark: #1D3557;
  --border-color: rgba(168, 218, 220, 0.3);
  --shadow-light: rgba(0, 0, 0, 0.05);
  --shadow-medium: rgba(0, 0, 0, 0.1);
  --gradient-primary: linear-gradient(135deg, var(--accent-light), var(--accent-green));
  --gradient-secondary: linear-gradient(135deg, var(--accent-pink), var(--accent-light));
}

/* 深色主题 (夜航模式) */
[data-theme="dark"] {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: rgba(29, 53, 87, 0.8);
  --text-primary: #f1f2f6;
  --text-secondary: #a4b0be;
  --text-muted: #57606f;
  --accent-light: #74b9ff;
  --accent-pink: #fd79a8;
  --accent-green: #55efc4;
  --accent-light-dark: #A8DADC;
  --border-color: rgba(116, 185, 255, 0.3);
  --shadow-light: rgba(0, 0, 0, 0.2);
  --shadow-medium: rgba(0, 0, 0, 0.4);
  --gradient-primary: linear-gradient(135deg, var(--accent-light), var(--accent-green));
  --gradient-secondary: linear-gradient(135deg, var(--accent-pink), var(--accent-light));
}

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  position: relative;
}

/* 背景纹理效果 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

/* 手写体样式 */
.handwriting {
  font-family: 'Kalam', cursive;
}

/* 毛玻璃效果 */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px var(--shadow-light);
}

/* 按钮基础样式 */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px var(--shadow-medium);
}

/* 卡片样式 */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px var(--shadow-medium);
}

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

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

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

h1 {
  font-size: 2.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: 2rem;
  color: var(--text-primary);
}

h3 {
  font-size: 1.5rem;
  color: var(--text-secondary);
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* 布局网格 */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* 响应式设计 */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .container {
    padding: 0 15px;
  }
  
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* 动画类 */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 主题切换动画 */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}