/* 文件: styles.css */
/* 描述: 页面的整体样式，遵循 Material Design 3 (MD3) 设计规范。 */

/* --- 1. 全局与根元素设置 --- */
/* ----------------------------------- */
:root {
  /* MD3 调色板，基于主色 #E95420 和次色 #77216F */
  --md-sys-color-primary: #E95420;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #FFE0B2;
  --md-sys-color-on-primary-container: #4E342E;
  --md-sys-color-secondary: #77216F;
  --md-sys-color-on-secondary: #FFFFFF;
  --md-sys-color-secondary-container: #FCE4EC;
  --md-sys-color-on-secondary-container: #4A0047;
  --md-sys-color-surface: #FFFFFF;
  --md-sys-color-surface-variant: #F5F5F5;
  --md-sys-color-on-surface: #1C2526;
  --md-sys-color-on-surface-variant: #4A4E4F;
  --md-sys-color-outline: #BDBDBD; /* 稍微加深轮廓色以提高对比度 */

  /* MD3 阴影 */
  --md-sys-elevation-1: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --md-sys-elevation-2: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  --md-sys-elevation-3: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito Sans', sans-serif;
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 16px;
  font-weight: 400;
}

/* --- 2. 页面布局与主要组件 --- */
/* ----------------------------------- */

.site-header {
  width: 100%;
  max-width: 600px;
  margin-bottom: 24px;
  text-align: center;
}

.content-area {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-grow: 1;
}

.photo-container {
  width: 100%;
  margin-bottom: 24px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-container:hover {
  transform: scale(1.02);
}

#cover-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 24px; /* MD3 Large Shape */
  box-shadow: var(--md-sys-elevation-1);
}

.md-elevated-card {
  width: 100%;
  background-color: var(--md-sys-color-surface);
  padding: 16px;
  border-radius: 16px; /* MD3 Medium Shape */
  box-shadow: var(--md-sys-elevation-1);
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-elevated-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--md-sys-elevation-2);
}

/* --- 3. 文本与按钮样式 --- */
/* ----------------------------------- */

.md-headline {
  font-size: 32px; /* MD3 Headline Large */
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
  padding: 8px 16px;
  background: linear-gradient(45deg, var(--md-sys-color-primary), var(--md-sys-color-secondary));
  -webkit-background-clip: text; /* 兼容 WebKit 内核 */
  background-clip: text;
  color: transparent;
  position: relative;
  display: inline-block;
}

.md-headline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  /* 使用内联SVG恢复波浪线效果，并为其添加动画 */
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 10"><path d="M0 5 Q 25 0, 50 5 T 100 5" stroke="%23E95420" stroke-width="2" fill="none"/></svg>') repeat-x;
  animation: slide-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}


.song-info {
  text-align: center;
  margin-bottom: 16px;
  width: 100%;
}

/* 增大标题和艺术家字号，使其更易读 */
.song-info h2 {
  font-size: 22px; 
  font-weight: 500;
  margin-bottom: 4px;
}

.song-info p {
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
}


/* --- 4. 播放器控制 --- */
/* ----------------------------------- */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  width: 100%;
}

.md-filled-button {
  background: var(--md-sys-color-primary);
  border: none;
  border-radius: 50%; /* 完全圆形按钮 */
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-filled-button:hover {
  background: hsl(from var(--md-sys-color-primary) h s calc(l * 0.92));
}

.md-filled-button:active {
  transform: scale(0.95);
}

.play-icon,
.pause-icon {
  fill: var(--md-sys-color-on-primary);
  width: 24px;
  height: 24px;
}

.hidden {
  display: none;
}

.progress-container {
  flex-grow: 1;
  height: 4px;
  background-color: var(--md-sys-color-surface-variant);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
  transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-container:hover {
  height: 6px; /* 悬浮时进度条变粗，易于交互 */
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--md-sys-color-primary);
  border-radius: 2px;
  transition: width 0.1s linear; /* 减少延迟，使其更跟手 */
}

.time-display {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
  min-width: 70px; /* 保证足够宽度，防止时间跳动导致布局变化 */
  text-align: center;
}

/* --- 5. 歌词样式 --- */
/* ----------------------------------- */
.lyrics {
  max-height: 280px;
  overflow-y: auto;
  text-align: center;
  font-size: 16px; /* 增大歌词字号 */
  line-height: 1.8; /* 增大行高 */
  color: var(--md-sys-color-on-surface-variant);
  width: 100%;
  scrollbar-width: thin; /* Firefox 滚动条 */
  scrollbar-color: var(--md-sys-color-outline) var(--md-sys-color-surface-variant);
}

/* Webkit 浏览器滚动条样式 */
.lyrics::-webkit-scrollbar {
  width: 6px;
}
.lyrics::-webkit-scrollbar-track {
  background: var(--md-sys-color-surface-variant);
  border-radius: 3px;
}
.lyrics::-webkit-scrollbar-thumb {
  background-color: var(--md-sys-color-outline);
  border-radius: 3px;
}

.lyrics.loading p {
  animation: blink 1.2s infinite ease-in-out;
}

.lyrics p {
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.6;
}

.lyrics p.current-line {
  color: var(--md-sys-color-on-primary-container);
  font-weight: 500;
  background-color: var(--md-sys-color-primary-container);
  opacity: 1;
  transform: scale(1.05); /* 当前行稍微放大 */
}

/* --- 6. 信息框与页脚 --- */
/* ----------------------------------- */
.info-box {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
}

.info-box.active::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, hsla(from var(--md-sys-color-secondary) h s l / 20%) 10%, transparent 80%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#date-lunar {
  font-size: 18px;
  font-weight: 500;
  background: linear-gradient(45deg, var(--md-sys-color-primary), var(--md-sys-color-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

#easter-egg-trigger {
  color: var(--md-sys-color-on-surface-variant);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
  display: inline-block;
  font-size: 16px;
  padding: 4px;
}

#easter-egg-trigger:hover {
  transform: scale(1.1);
  color: var(--md-sys-color-secondary);
}

.site-footer {
  margin-top: auto;
  padding: 24px 0;
  text-align: center;
}

.site-footer p {
  font-size: 14px; /* 调整页脚字体大小 */
  font-weight: 400;
  color: var(--md-sys-color-on-surface-variant);
}


/* --- 7. Toast 提示 --- */
/* ----------------------------------- */
.md-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  background-color: #323232; /* MD3 Toast 推荐颜色 */
  color: var(--md-sys-color-surface);
  padding: 12px 24px;
  border-radius: 24px; /* MD3 Full Shape */
  box-shadow: var(--md-sys-elevation-3);
  font-size: 14px;
  font-weight: 500;
  visibility: hidden;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.md-toast.show {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --- 8. 动画效果 --- */
/* ----------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  50% { opacity: 0.5; }
}

@keyframes ripple {
  to {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

/* --- 9. 响应式设计 --- */
/* ----------------------------------- */
@media (max-width: 600px) {
  .md-headline {
    font-size: 28px;
    padding: 6px 12px;
  }
  .song-info h2 {
    font-size: 20px;
  }
  .song-info p {
    font-size: 14px;
  }
  .lyrics {
    max-height: 240px;
    font-size: 15px; /* 在小屏幕上稍微增大歌词可读性 */
  }
  .md-filled-button {
    width: 44px;
    height: 44px;
  }
  .md-toast {
    width: calc(100% - 32px);
    bottom: 16px; /* 调整位置以避免与系统UI冲突 */
  }
}