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

:root {
  --primary: #e8a87c;
  --primary-light: #f5d6c6;
  --bg: #faf5ef;
  --bg-card: rgba(255, 255, 255, 0.75);
  --text: #3d2c2e;
  --text-secondary: #7a6a6c;
  --border: rgba(0, 0, 0, 0.06);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --navbar-blur: 12px;
  --hue: 25;
  --card-transparent: 0.75;
}

.dark {
  --primary: #e8a87c;
  --primary-light: #5a3e32;
  --bg: #1a1412;
  --bg-card: rgba(30, 22, 20, 0.8);
  --text: #e8ddd8;
  --text-secondary: #a89890;
  --border: rgba(255, 255, 255, 0.06);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: "LXGW WenKai Screen", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
}

#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
}

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 1.5rem;
  height: 64px;
  backdrop-filter: blur(var(--navbar-blur));
  -webkit-backdrop-filter: blur(var(--navbar-blur));
  background: rgba(from var(--bg) r g b / 0.6);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s ease, border-color 0.4s ease;
}

.nav-inner {
  max-width: 1000px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: background 0.25s, color 0.25s;
}

.nav-links a:hover {
  background: var(--primary-light);
  color: var(--text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.music-nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  transition: background 0.25s, color 0.25s;
  line-height: 1;
  font-family: inherit;
}

.music-nav-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.music-nav-btn.active {
  color: var(--primary);
}
.music-nav-btn.spin {
  animation: navSpin 4s linear infinite;
}
@keyframes navSpin {
  to { transform: rotate(360deg); }
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  transition: background 0.25s, color 0.25s;
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--primary-light);
  color: var(--text);
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 3rem;
  position: relative;
}

.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary);
  box-shadow: 0 0 40px rgba(232, 168, 124, 0.3);
  margin-bottom: 1.2rem;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  background: linear-gradient(135deg, var(--primary), #f5b895);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 2rem;
}

.hero-socials {
  display: flex;
  gap: 0.75rem;
}

.hero-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1.3rem;
  text-decoration: none;
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  transition: background 0.3s, color 0.3s, transform 0.25s;
}

.hero-socials a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-3px);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-secondary);
  font-size: 0.85rem;
  animation: bounce 2s infinite;
  cursor: default;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title .icon {
  font-size: 1.4rem;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

.about-text {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-secondary);
}

.about-text strong {
  color: var(--text);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s, background 0.4s, border-color 0.4s;
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.card .tags span {
  background: var(--primary-light);
  color: var(--text);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.music-dropdown {
  position: fixed; top: 64px;
  right: max(0.5rem, calc((100% - 1000px) / 2));
  z-index: 200; display: none;
  animation: dropIn 0.2s ease;
  transform-origin: top right;
}
.music-dropdown.open { display: block; }
@keyframes dropIn {
  from { opacity: 0; transform: scale(0.92) translateY(-6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.music-dropdown-inner {
  background: var(--bg-card);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
  width: 380px; max-height: min(80vh, 560px);
  overflow: hidden;
}

.music-player-inner { padding: 1.25rem; }

.music-loading {
  text-align: center; color: var(--text-secondary);
  font-size: 0.85rem; padding: 2rem 0;
}

.music-top-row {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.music-cover-wrap {
  position: relative; flex-shrink: 0;
  width: 56px; height: 56px;
}
.music-cover-circle {
  width: 100%; height: 100%; border-radius: 50%;
  overflow: hidden; position: relative;
  border: 2px solid var(--primary);
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
}
.music-cover-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); opacity: 0.4; font-size: 1.4rem;
  pointer-events: none;
}
.music-cover-img {
  width: 100%; height: 100%; object-fit: cover;
  position: relative; z-index: 1;
  opacity: 0; transition: opacity 0.3s;
}
.music-cover-img.loaded { opacity: 1; }
.music-cover-img.playing { animation: spin 8s linear infinite; }
.music-cover-img.paused { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }

.music-info-area { flex: 1; min-width: 0; }
.music-info-area .title {
  font-size: 0.95rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.music-info-area .artist {
  font-size: 0.8rem; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.music-time-row {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--text-secondary);
  margin-bottom: 0.2rem;
}
.music-progress-wrap {
  position: relative; height: 6px; cursor: pointer;
  margin-bottom: 0.75rem;
}
.music-progress-track {
  position: absolute; inset: 2px 0; border-radius: 3px;
  background: var(--border);
}
.music-progress-fill {
  height: 100%; width: 0%; border-radius: 3px;
  background: var(--primary);
  position: relative; transition: width 0.1s linear;
}
.music-progress-thumb {
  position: absolute; right: -6px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  opacity: 0; transition: opacity 0.2s;
}
.music-progress-wrap:hover .music-progress-thumb { opacity: 1; }

.music-ctrl-row {
  display: flex; align-items: center; justify-content: center;
  gap: 0.2rem; margin-bottom: 0.5rem;
}
.music-ctrl-row button {
  background: none; border: none;
  color: var(--text-secondary); font-size: 1.15rem;
  cursor: pointer; padding: 0.35rem;
  border-radius: 50%; line-height: 1;
  transition: color 0.2s, background 0.2s;
}
.music-ctrl-row button:hover { color: var(--primary); background: var(--primary-light); }
.music-ctrl-row .ctrl-play {
  font-size: 1.8rem; color: var(--primary);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.music-ctrl-row .ctrl-play:hover { background: var(--primary-light); }
.music-ctrl-row .ctrl-mode { font-size: 1.05rem; }

.music-bottom-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem;
}
.music-vol-area {
  display: flex; align-items: center; gap: 0.4rem; flex: 1;
}
.music-vol-area button {
  background: none; border: none;
  color: var(--text-secondary); font-size: 1rem;
  cursor: pointer; padding: 0.25rem; line-height: 1;
  transition: color 0.2s;
}
.music-vol-area button:hover { color: var(--primary); }
.music-vol-slider {
  flex: 1; height: 4px; cursor: pointer;
  background: var(--border); border-radius: 2px;
  position: relative; max-width: 80px;
}
.music-vol-fill {
  height: 100%; border-radius: 2px;
  background: var(--primary); width: 70%;
}
.music-actions {
  display: flex; align-items: center; gap: 0.1rem;
}
.music-actions button {
  background: none; border: none;
  color: var(--text-secondary); font-size: 1.05rem;
  cursor: pointer; padding: 0.3rem; line-height: 1;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.music-actions button:hover { color: var(--primary); background: var(--primary-light); }
.music-actions .action-active { color: var(--primary); }

.lrc-drawer {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
  border-top: 1px solid var(--border);
}
.lrc-drawer.open { grid-template-rows: 1fr; }
.lrc-drawer-inner { overflow: hidden; }
.lrc-container {
  max-height: 180px; overflow-y: auto; padding: 0.75rem 1rem;
  text-align: center; font-size: 0.85rem; line-height: 2;
}
.lrc-line { color: var(--text-secondary); transition: color 0.2s, font-size 0.2s; }
.lrc-line.active { color: var(--primary); font-size: 0.95rem; font-weight: 600; }

.pl-drawer {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
  border-top: 1px solid var(--border);
}
.pl-drawer.open { grid-template-rows: 1fr; }
.pl-drawer-inner { overflow: hidden; }
.pl-container {
  max-height: 220px; overflow-y: auto; padding: 0.4rem 0;
}
.pl-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 1rem; cursor: pointer;
  transition: background 0.15s; font-size: 0.82rem;
}
.pl-item:hover { background: var(--primary-light); }
.pl-item.active { color: var(--primary); font-weight: 600; }
.pl-item-cover {
  width: 32px; height: 32px; border-radius: 4px;
  object-fit: cover; flex-shrink: 0;
  background: var(--primary-light);
}
.pl-item-info { flex: 1; min-width: 0; }
.pl-item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-item-artist { font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pl-container::-webkit-scrollbar,
.lrc-container::-webkit-scrollbar { width: 4px; }
.pl-container::-webkit-scrollbar-thumb,
.lrc-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.8rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item .date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.timeline-item h4 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.timeline-item p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .nav-links { gap: 0; }
  .nav-links a { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero-avatar { width: 90px; height: 90px; }
  section { padding: 3rem 1rem; }
  .music-dropdown { right: 0.5rem; }
  .music-dropdown-inner { width: calc(100vw - 1rem); }
}

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
