:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --primary-color: #4a6cf7;
  --primary-hover-color: #3a5ce5;
  --secondary-color: #f5f8ff;
  --border-color: #e0e0e0;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --card-bg: #ffffff;
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --primary-color: #6b8aff;
  --primary-hover-color: #5a79ff;
  --secondary-color: #2d2d2d;
  --border-color: #444444;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --card-bg: #252525;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  /* 禁止移动端缩放和拖动调整大小 */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  /* iOS Safari兼容性：确保主题切换正常工作 */
  -webkit-tap-highlight-color: transparent;
  /* 强制硬件加速，提高iOS Safari上的渲染性能 */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* 禁止移动端缩放和拖动调整大小 */
  touch-action: none;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* 防止iOS Safari橡皮筋效果 */
  overscroll-behavior: none;
}

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  width: 100%;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  z-index: 10;
  background-color: transparent;
}

[data-theme="dark"] header {
  background-color: transparent;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-color) 0 2px 10px;
  opacity: 0.1;
}

.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-color) 0 4px 15px;
}

.sun-icon, .moon-icon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
  stroke: black;
}

.sun-icon {
  fill: transparent;
  opacity: 1;
}

.moon-icon {
  opacity: 0;
  transform: rotate(20deg);
}

[data-theme="dark"] .sun-icon {
  opacity: 0;
}

[data-theme="dark"] .moon-icon {
  opacity: 1;
  transform: rotate(0deg);
}

[data-theme="dark"] .sun-icon,
[data-theme="dark"] .moon-icon {
  stroke: white;
}

.sound-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-color) 0 2px 10px;
  opacity: 0.1;
  position: relative;
}

.sound-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-color) 0 4px 15px;
}

.sound-on-icon, .sound-off-icon {
  transition: opacity 0.3s ease, transform 0.3s ease;
  stroke: black;
  width: 24px;
  height: 24px;
}

.water-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-color) 0 2px 10px;
  opacity: 0.1;
  position: relative;
}

.water-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-color) 0 4px 15px;
}

.water-on-icon, .water-off-icon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
  stroke: black;
  width: 24px;
  height: 24px;
}

[data-theme="dark"] .water-on-icon,
[data-theme="dark"] .water-off-icon {
  stroke: white;
}

.water-on-icon {
  opacity: 1;
}

.water-off-icon {
  opacity: 0;
}

.water-effect-disabled .water-on-icon {
  opacity: 0;
}

.water-effect-disabled .water-off-icon {
  opacity: 1;
}

[data-theme="dark"] .sound-on-icon,
[data-theme="dark"] .sound-off-icon {
  stroke: white;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 2rem; /* 增加顶部内边距，为顶部按钮留出空间 */
}

.title {
  font-size: clamp(2rem, 8vw, 4rem);
  margin-bottom: 3.5rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--primary-color), var(--primary-hover-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 0.5rem 0;
  animation: fadeIn 1s ease-out;
}

.title-logo {
  max-width: 60%;
  height: auto;
  margin: 0 auto 3.5rem;
  display: block;
  filter: drop-shadow(var(--shadow-color) 0 4px 8px);
  overflow: visible;
}

#signature-inline {
  display: block;
  /* max-width: 60%; 被JavaScript内联样式覆盖 */
  height: auto;
  margin: 0 auto 3.5rem;
}

#signature-inline svg {
  width: 100%;
  height: auto;
}

/* 确保SVG路径可见 */
#signature-inline path {
  stroke: currentColor;
  fill: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 在没有动画类的情况下，确保SVG可见 */
#signature-inline path:not(.animated-path-light):not(.animated-path-dark) {
  fill: var(--text-color);
  stroke: var(--text-color);
}

[data-theme="dark"] .title-logo {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)) brightness(1.1);
}

/* 深色模式下SVG的白色显示 */
[data-theme="dark"] #signature-inline svg {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)) brightness(0) invert(1);
}

/* 深色模式下SVG路径的颜色重写为纯白色，只禁用呼吸动画，保留绘制动画 */
[data-theme="dark"] #signature-inline .animated-path-dark {
  fill: #ffffff !important;
  stroke: #ffffff !important;
  animation: drawAndFillDark 3s ease-in-out forwards !important;
}

/* 深色模式下SVG路径的备用样式，防止颜色闪烁 */
[data-theme="dark"] #signature-inline path {
  fill: #ffffff !important;
  stroke: #ffffff !important;
}

/* 亮色模式下保留SVG内部定义的绘制动画，但确保颜色正确 */
[data-theme="light"] #signature-inline .animated-path-light {
  fill: #333333 !important;
  stroke: #333333 !important;
}

/* 亮色模式下SVG路径的备用样式，防止颜色闪烁 */
[data-theme="light"] #signature-inline path {
  fill: #333333 !important;
  stroke: #333333 !important;
}

/* iOS Safari兼容性：确保深色模式在iOS上正确应用 */
@supports (-webkit-touch-callout: none) {
  [data-theme="dark"] {
    /* 强制应用深色模式背景色 */
    background-color: #1a1a1a !important;
  }
  
  [data-theme="dark"] body {
    background-color: #1a1a1a !important;
  }
  
  [data-theme="dark"] #signature-inline svg {
    /* 强制SVG在深色模式下显示为白色 */
    filter: brightness(0) invert(1) !important;
  }
  
  [data-theme="dark"] #signature-inline path {
    fill: #ffffff !important;
    stroke: #ffffff !important;
  }
}







footer {
  text-align: center;
  padding: 2rem 0 1rem;
}

.copyright {
  font-size: 0.9rem;
  opacity: 0.7;
}

.copyright a {
  color: inherit;
  text-decoration: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .title, .title-logo {
    margin-bottom: 2rem;
  }
  
  .title-logo {
    max-width: 80%;
  }
  
  header {
    padding: 0.75rem 1rem; /* 移动端减小内边距 */
    gap: 0.75rem; /* 移动端减小按钮间距 */
  }
  
  .theme-toggle, .sound-toggle, .water-toggle {
    width: 40px;
    height: 40px; /* 移动端减小按钮尺寸 */
  }
  
  /* 移动端调整图标大小，使其与按钮尺寸协调 */
  .sun-icon, .moon-icon, .sound-on-icon, .sound-off-icon, .water-on-icon, .water-off-icon {
    width: 18px;
    height: 18px;
  }
  
  main {
    padding: 5rem 1rem 2rem; /* 移动端调整顶部内边距 */
  }
}