/* 全局样式 */
:root {
  /* 默认主题（春季） */
  --primary-color: #7cb342;
  --secondary-color: #ffca28;
  --background-color: #f1f8e9;
  --card-color: #ffffff;
  --text-color: #33691e;
  --border-color: #c5e1a5;
  --accent-color-1: #8bc34a;
  --accent-color-2: #aed581;
  --accent-color-3: #dcedc8;
  
  /* 季节背景图片 */
  --season-bg-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50"><path d="M25,2 L27,12 L37,12 L29,18 L32,28 L25,22 L18,28 L21,18 L13,12 L23,12 Z" fill="%238bc34a" fill-opacity="0.2"/></svg>');
  --season-bg-size: 100px 100px;
  
  /* 季节动画速度 */
  --animation-speed: 20s;
}

/* 夏季主题 */
body.summer-theme {
  --primary-color: #f57c00;
  --secondary-color: #ffeb3b;
  --background-color: #fff8e1;
  --card-color: #ffffff;
  --text-color: #e65100;
  --border-color: #ffe082;
  --accent-color-1: #ffa726;
  --accent-color-2: #ffcc80;
  --accent-color-3: #ffecb3;
  
  --season-bg-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50"><circle cx="25" cy="25" r="20" fill="%23ffa726" fill-opacity="0.2"/></svg>');
  --season-bg-size: 120px 120px;
  
  --animation-speed: 15s;
}

/* 秋季主题 */
body.autumn-theme {
  --primary-color: #bf360c;
  --secondary-color: #ff6f00;
  --background-color: #fbe9e7;
  --card-color: #ffffff;
  --text-color: #3e2723;
  --border-color: #ffccbc;
  --accent-color-1: #ff5722;
  --accent-color-2: #ff8a65;
  --accent-color-3: #ffab91;
  
  --season-bg-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50"><path d="M25,2 C15,2 5,15 5,30 C5,40 15,48 25,48 C35,48 45,40 45,30 C45,15 35,2 25,2 Z" fill="%23ff5722" fill-opacity="0.2"/></svg>');
  --season-bg-size: 150px 150px;
  
  --animation-speed: 25s;
}

/* 冬季主题 */
body.winter-theme {
  --primary-color: #1565c0;
  --secondary-color: #90caf9;
  --background-color: #e3f2fd;
  --card-color: #ffffff;
  --text-color: #0d47a1;
  --border-color: #bbdefb;
  --accent-color-1: #2196f3;
  --accent-color-2: #64b5f6;
  --accent-color-3: #bbdefb;
  
  --season-bg-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50"><path d="M25,2 L30,10 L40,12 L32,20 L35,30 L25,25 L15,30 L18,20 L10,12 L20,10 Z" fill="%232196f3" fill-opacity="0.2"/></svg>');
  --season-bg-size: 80px 80px;
  
  --animation-speed: 30s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans SC", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* 容器样式 */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

/* 头部样式 */
header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary-color);
}

h1 {
  color: var(--primary-color);
  font-family: "Noto Serif SC", serif;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.subtitle {
  font-size: 1.1rem;
  color: #666;
}

/* 输入区域样式 */
.input-section {
  background-color: var(--card-color);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  text-align: center;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input[type="text"] {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 1rem;
}

button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #b71c1c;
}

button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

/* 加载动画 */
.loading {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-top: 1rem;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top: 4px solid var(--primary-color);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 结果区域样式 */
.results-section {
  display: none;
}

.results-section h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  font-family: "Noto Serif SC", serif;
}

.names-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.name-card {
  background-color: var(--card-color);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--primary-color);
}

.chinese-name {
  font-family: "Noto Serif SC", serif;
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  text-align: center;
}

.pinyin {
  font-size: 1rem;
  color: #666;
  margin-bottom: 1rem;
  text-align: center;
}

.meaning {
  margin-bottom: 1rem;
}

.meaning h4 {
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.cultural-reference {
  font-style: italic;
  color: #666;
  font-size: 0.9rem;
}

/* 页脚样式 */
footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  color: #666;
  font-size: 0.9rem;
}

/* 响应式设计 */
@media (min-width: 768px) {
  .names-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  .input-section,
  .name-card {
    padding: 1.5rem;
  }
}

/* 页面加载动画 */
body {
  opacity: 0;
  transition: opacity 1s ease;
}

body.loaded {
  opacity: 1;
}

/* 输入框焦点动画 */
.input-focus {
  box-shadow: 0 0 15px rgba(198, 40, 40, 0.5);
  transform: scale(1.02);
}

input[type="text"] {
  transition: all 0.3s ease;
}

/* 按钮悬停效果 */
.btn-hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #c62828, #e53935);
}

button {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* 按钮点击波纹效果 */
.ripple {
  position: absolute;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* 通知样式 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 5px;
  color: white;
  font-weight: 500;
  z-index: 1000;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  background-color: #43a047;
}

.notification.error {
  background-color: #e53935;
}

.notification.info {
  background-color: #1e88e5;
}

/* 加载动画粒子效果 */
.loading-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: particle-float 3s ease-in-out infinite alternate;
}

@keyframes particle-float {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(-20px) rotate(360deg);
  }
}

/* 背景粒子效果 */
.background-particles {
  position: fixed;
  width: 100vw;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: -1;
  overflow: hidden;
}

.bg-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-30px) translateX(15px);
  }
  50% {
    transform: translateY(-15px) translateX(-15px);
  }
  75% {
    transform: translateY(-45px) translateX(10px);
  }
}

/* 名字卡片动画效果 */
.name-card {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.name-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.name-card.selected {
  border-color: #f9a825;
  box-shadow: 0 0 20px rgba(249, 168, 37, 0.4);
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(249, 168, 37, 0.2) 0%,
    rgba(249, 168, 37, 0) 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.name-card:hover .card-glow {
  opacity: 1;
}

/* 浮动字符动画 */
.floating-chars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
}

.floating-chars span {
  position: absolute;
  font-family: "Noto Serif SC", serif;
  font-size: 3rem;
  color: rgba(198, 40, 40, 0.2);
  animation: float-char 5s ease-in-out infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes float-char {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  100% {
    transform: translate(calc(-50% + 100px), calc(-50% - 100px)) scale(2);
    opacity: 0;
  }
}

/* 滚动动画效果 */
.animate-in {
  animation: fade-in 0.8s ease forwards;
}

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

/* 更新颜色方案 */
:root {
  --primary-color: #c62828;
  --secondary-color: #f9a825;
  --accent-color-1: #6a1b9a;
  --accent-color-2: #00838f;
  --accent-color-3: #2e7d32;
  --background-color: #121212;
  --card-color: #1e1e1e;
  --text-color: #e0e0e0;
  --border-color: #333333;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  background-image: linear-gradient(
    135deg,
    #121212 25%,
    #1a1a1a 25%,
    #1a1a1a 50%,
    #121212 50%,
    #121212 75%,
    #1a1a1a 75%,
    #1a1a1a 100%
  );
  background-size: 40px 40px;
}

.input-section,
.name-card {
  background-color: var(--card-color);
  border: 1px solid var(--border-color);
}

.chinese-name {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 10px rgba(198, 40, 40, 0.3);
}

h1,
h2,
h3 {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.meaning h4 {
  color: var(--secondary-color);
}

/* 霓虹灯效果 */
.neon-border {
  box-shadow: 0 0 10px rgba(198, 40, 40, 0.5), 0 0 20px rgba(198, 40, 40, 0.3),
    0 0 30px rgba(198, 40, 40, 0.1);
}

.input-section {
  border-left: 4px solid var(--primary-color);
  animation: border-pulse 3s infinite alternate;
}

@keyframes border-pulse {
  0% {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(198, 40, 40, 0.3);
  }
  50% {
    border-color: var(--secondary-color);
    box-shadow: 0 0 15px rgba(249, 168, 37, 0.3);
  }
  100% {
    border-color: var(--accent-color-1);
    box-shadow: 0 0 10px rgba(106, 27, 154, 0.3);
  }
}

/* 季节选择器样式 */
.season-selector {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.season-buttons {
  display: flex;
  gap: 0.5rem;
}

.season-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--card-color);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.season-btn:hover {
  transform: scale(1.1);
}

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

/* 季节背景效果 */
body {
  background-image: var(--season-bg-image);
  background-size: var(--season-bg-size);
  transition: background-color 1s ease, color 1s ease;
}

/* 季节过渡动画 */
.container, .input-section, .name-card, button, h1, h2, h3, .chinese-name {
  transition: all 0.8s ease;
}

/* 季节特有动画 */
.seasonal-element {
  position: absolute;
  pointer-events: none;
  z-index: -1;
  opacity: 0.6;
  animation: float-seasonal calc(var(--animation-speed) * 1.2) ease-in-out infinite alternate;
}

@keyframes float-seasonal {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(calc(var(--random-x) * 1px), calc(var(--random-y) * 1px)) rotate(calc(var(--random-rotate) * 1deg));
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}
