/* 基础样式 */
:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --link-color: #0066cc;
  --button-bg: #f0f0f0;
  --button-text: #333333;
  --button-hover-bg: #e0e0e0;
}

/* 暗色模式变量 */
.dark-mode {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --link-color: #66b3ff;
  --button-bg: #333333;
  --button-text: #e0e0e0;
  --button-hover-bg: #444444;
}

/* 应用变量 */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 20px;
  line-height: 1.8;
  transition: background-color 0.3s, color 0.3s;
  min-height: 100vh;
  box-sizing: border-box;
}

/* 自动换行设置 */
p, h1, h2, h3, h4, h5, h6, div, span, a {
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* 段落特别设置 */
p {
  margin-bottom: 1.5em;
  text-align: justify;
}

/* 内容区域 */
.content {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 20px 40px;
  animation: fadeIn 0.8s ease-out;
}

/* 标题美化 */
h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  position: relative;
  padding-bottom: 10px;
}

h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 3px;
  background: var(--link-color);
  border-radius: 2px;
}

/* 链接美化 */
a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  padding: 5px 0;
  position: relative;
  display: inline-block;
  margin-right: 20px;
  margin-bottom: 10px;
}

a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--link-color);
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

a:hover {
  text-decoration: none;
}

/* 链接容器美化 */
.links {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.links a {
  padding: 10px 20px;
  background-color: rgba(0, 102, 204, 0.1);
  border-radius: 6px;
  transition: all 0.3s ease;
  margin: 0;
}

.links a:hover {
  background-color: rgba(0, 102, 204, 0.2);
  transform: translateY(-2px);
}

.dark-mode .links a {
  background-color: rgba(102, 179, 255, 0.1);
}

.dark-mode .links a:hover {
  background-color: rgba(102, 179, 255, 0.2);
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 按钮美化增强 */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  background-color: var(--button-bg);
  color: var(--button-text);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
  background-color: var(--button-hover-bg);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.theme-toggle:active {
  transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .content {
    padding: 70px 15px 30px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .theme-toggle {
    padding: 10px 16px;
    font-size: 14px;
  }
}
