:root {
  /* 夜间（默认）主题变量 */
  --bg: #070b1c;
  --bg-2: #0d1430;
  --text: #e8edff;
  --dim: #9aa6cc;
  --line: rgba(120, 160, 255, 0.18);
  --card-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  --panel: rgba(255, 255, 255, 0.04);
  --nav-bg: rgba(7, 11, 28, 0.72);
  --footer-bg: #06091a;
  --section-alt-from: rgba(13, 20, 48, 0.5);
  --accent: #4f8cff;
  --accent-2: #9b5cff;
  --accent-3: #25e0c8;
  --glow: 0 0 24px rgba(79, 140, 255, 0.45);
  --hero-from: #0b1026;
  --hero-to: #1a1140;
  --radius: 16px;
  --maxw: 1180px;
}

/* ===== 日间（浅色）主题 ===== */
:root[data-theme="light"] {
  --bg: #eef1f8;
  --bg-2: #e3e8f5;
  --text: #18213a;
  --dim: #5b6585;
  --line: rgba(40, 80, 180, 0.16);
  --card-bg: linear-gradient(160deg, #ffffff, #f1f4fc);
  --panel: rgba(255, 255, 255, 0.7);
  --nav-bg: rgba(255, 255, 255, 0.82);
  --footer-bg: #e6eaf4;
  --section-alt-from: rgba(255, 255, 255, 0.6);
  --accent: #2f6fe6;
  --accent-2: #8a3ff0;
  --accent-3: #0fae97;
  --glow: 0 0 24px rgba(47, 111, 230, 0.25);
  --hero-from: #e9eeff;
  --hero-to: #dde6ff;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .35s, color .35s;
}

a { color: inherit; text-decoration: none; }

/* ===== 导航 ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  transition: background .35s, border-color .35s;
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: baseline; gap: 8px; }
.logo-mark {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo-sub { font-size: 13px; color: var(--dim); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a {
  font-size: 14px;
  color: var(--dim);
  position: relative;
  transition: color .25s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s;
}
.nav-links a:hover::after { width: 100%; }

/* 主题切换按钮 */
.theme-toggle {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  transition: transform .2s, border-color .2s, background .2s;
}
.theme-toggle:hover { transform: rotate(-15deg) scale(1.06); border-color: var(--accent); }

/* ===== 英雄区 ===== */
.hero {
  position: relative;
  padding: 110px 24px 90px;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 60% at 20% 10%, rgba(79,140,255,.25), transparent 60%),
    radial-gradient(50% 50% at 85% 20%, rgba(155,92,255,.22), transparent 60%),
    radial-gradient(60% 60% at 50% 100%, rgba(37,224,200,.16), transparent 60%),
    linear-gradient(180deg, var(--hero-from), var(--hero-to));
  animation: bgShift 14s ease-in-out infinite alternate;
}
:root[data-theme="light"] .hero-bg {
  background:
    radial-gradient(60% 60% at 20% 10%, rgba(79,140,255,.16), transparent 60%),
    radial-gradient(50% 50% at 85% 20%, rgba(155,92,255,.14), transparent 60%),
    radial-gradient(60% 60% at 50% 100%, rgba(37,224,200,.12), transparent 60%),
    linear-gradient(180deg, var(--hero-from), var(--hero-to));
}
@keyframes bgShift {
  0% { filter: hue-rotate(0deg) brightness(1); transform: scale(1); }
  100% { filter: hue-rotate(18deg) brightness(1.08); transform: scale(1.05); }
}
.hero-inner { position: relative; max-width: 820px; margin: 0 auto; }

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--accent-3);
  background: rgba(37,224,200,.08);
  margin-bottom: 22px;
  animation: fadeDown .8s ease both;
}
.hero-title {
  font-size: clamp(34px, 6vw, 60px);
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1.1;
  background: linear-gradient(120deg, #ffffff 10%, var(--accent) 55%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(79,140,255,.25);
  animation: fadeUp .9s ease both;
}
:root[data-theme="light"] .hero-title {
  background: linear-gradient(120deg, #18213a 5%, var(--accent) 55%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none;
}
.hero-desc {
  margin: 22px auto 0;
  max-width: 640px;
  color: var(--dim);
  font-size: clamp(15px, 2.2vw, 18px);
  animation: fadeUp 1s ease .1s both;
}
.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeUp 1.1s ease .2s both;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 34px rgba(79,140,255,.6); }
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--panel);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent); }

.hero-stats {
  margin-top: 48px;
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeUp 1.2s ease .3s both;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat b {
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent-3), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { font-size: 13px; color: var(--dim); }

/* ===== 区块 ===== */
.section { max-width: var(--maxw); margin: 0 auto; padding: 80px 24px; }
.section-alt { max-width: 100%; background: linear-gradient(180deg, var(--section-alt-from), transparent); }
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: "";
  display: block;
  width: 60px; height: 4px;
  margin: 14px auto 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.section-sub { margin-top: 16px; color: var(--dim); font-size: 16px; }

/* ===== 卡片网格（弹出动画）===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.card {
  position: relative;
  padding: 26px 24px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, border-color .3s;
  opacity: 0;
  transform: translateY(26px) scale(.92);
  animation: popIn .6s cubic-bezier(.2,.9,.25,1) forwards;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% -10%, rgba(79,140,255,.18), transparent 60%);
  opacity: 0;
  transition: opacity .3s;
}
.card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 18px 50px rgba(0,0,0,.45), 0 0 0 1px rgba(79,140,255,.4);
}
.card:hover::before { opacity: 1; }
.card-ico {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  font-size: 30px;
  border-radius: 14px;
  background: rgba(79,140,255,.12);
  border: 1px solid var(--line);
  margin-bottom: 16px;
  position: relative;
}
.card-name { font-size: 19px; font-weight: 700; position: relative; }
.card-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent-3);
  position: relative;
}
.card-desc {
  margin-top: 12px;
  font-size: 14px;
  color: var(--dim);
  position: relative;
}
.card-more {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  position: relative;
  transition: gap .2s;
}
.card:hover .card-more { gap: 12px; }

/* ===== 能力概览 ===== */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.feature {
  padding: 30px 26px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: center;
  transition: transform .3s, border-color .3s;
}
.feature:hover { transform: translateY(-4px); border-color: var(--accent-2); }
.feature-ico { font-size: 34px; }
.feature h3 { margin: 14px 0 8px; font-size: 19px; }
.feature p { color: var(--dim); font-size: 14px; }

/* ===== 页脚 ===== */
.footer { border-top: 1px solid var(--line); margin-top: 40px; background: var(--footer-bg); transition: background .35s, border-color .35s; }
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 44px 24px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}
.footer-brand .logo-mark { font-size: 24px; }
.footer-brand p { color: var(--dim); font-size: 14px; margin-top: 10px; max-width: 360px; }
.footer-meta { text-align: right; font-size: 13px; color: var(--dim); }
.footer-meta p { margin: 4px 0; }
.beian a { color: var(--dim); text-decoration: underline; text-underline-offset: 3px; transition: color .2s; }
.beian a:hover { color: var(--accent); }
.copyright { margin-top: 10px; color: var(--dim); opacity: .8; }

/* ===== 动画 ===== */
@keyframes popIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .nav-links { gap: 14px; font-size: 13px; }
  .hero { padding: 80px 18px 60px; }
  .footer-inner { flex-direction: column; }
  .footer-meta { text-align: left; }
}

/* 离线兜底提示条 */
.load-tip {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  background: linear-gradient(90deg, #ff8a3d, #ff5e62);
  color: #fff; text-align: center; font-size: 13px; padding: 7px 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
[data-theme="light"] .load-tip { color: #fff; }

[data-theme="light"] .music-player { background: var(--card-bg); }
[data-theme="light"] .mp-play { background: #fff; }

/* ===== 背景音乐悬浮按钮 ===== */
.music-toggle {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 50px; height: 50px; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 6px 18px rgba(0,0,0,.32);
  transition: transform .15s ease, background .25s, border-color .25s;
}
.music-toggle:hover { transform: scale(1.08); }
/* ===== 音乐播放器 / LRC 歌词 ===== */
.music-section {
  position: relative;
  padding: 40px 20px 60px;
  display: flex; justify-content: center; align-items: center;
  background: radial-gradient(60% 60% at 50% 0%, rgba(255, 255, 255, 0.04), transparent 60%);
  overflow: hidden;
}
.music-player {
  position: relative; z-index: 2;
  width: min(560px, 92vw);
  text-align: center;
  padding: 28px 24px 22px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
.mp-play {
  width: 58px; height: 58px; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font-size: 22px; cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s;
  margin-bottom: 14px;
}
.mp-play:hover { transform: scale(1.08); }
.mp-play.playing { box-shadow: var(--glow); }
.mp-title { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.mp-artist { font-size: 13px; color: var(--dim); margin-top: 4px; }
.mp-lyric {
  position: relative;
  height: 130px; margin: 22px 0 18px;
  overflow: hidden; overflow-y: auto;
  mask-image: linear-gradient(180deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
  scroll-behavior: smooth;
}
.mp-lyric-list p {
  margin: 0; padding: 8px 0;
  font-size: 15px; color: var(--dim);
  transition: all .25s ease;
  opacity: .55;
  transform: scale(.96);
}
.mp-lyric-list p.near { opacity: .8; transform: scale(.98); }
.mp-lyric-list p.active {
  font-size: 17px; font-weight: 600;
  color: var(--text);
  opacity: 1;
  transform: scale(1.02);
}
.mp-lyric-list .mp-empty { color: var(--dim); opacity: .7; padding-top: 40px; }
.mp-progress {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--dim);
}
.mp-progress input[type="range"] {
  flex: 1;
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px;
  background: var(--line);
  outline: none; cursor: pointer;
}
.mp-progress input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px rgba(79,140,255,.5);
  cursor: pointer;
}
.mp-progress input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; border: none;
  background: var(--accent); box-shadow: 0 0 10px rgba(79,140,255,.5);
}

/* ===== 飘落花瓣 ===== */
.petals {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  overflow: hidden;
}
.petal {
  position: absolute; top: -20px;
  border-radius: 150% 0 150% 0;
  opacity: .7;
  animation-name: petalFall;
  animation-timing-function: linear;
  animation-iteration-count: 1;
}
@keyframes petalFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  10% { opacity: .8; }
  90% { opacity: .6; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

@media (max-width: 640px) {
  .music-section { padding: 28px 16px 40px; }
  .music-player { padding: 22px 18px 18px; }
  .mp-title { font-size: 20px; }
  .mp-lyric { height: 110px; margin: 18px 0 14px; }
  .mp-lyric-list p { font-size: 14px; }
  .mp-lyric-list p.active { font-size: 15px; }
}
