/* 寻神记 · searchgod.tmuxp.com — 深空金靛视觉 */
:root {
  --bg0: #070b14;
  --bg1: #0d1524;
  --card: rgba(18, 28, 46, 0.82);
  --card-solid: #121c2e;
  --text: #eef3ff;
  --muted: #9db0cc;
  --gold: #d4a84b;
  --gold2: #f3dd9a;
  --gold3: #8a6a28;
  --indigo: #6d5efc;
  --violet: #a78bfa;
  --cyan: #5ec8ff;
  --line: rgba(212, 168, 75, 0.22);
  --glow: 0 0 40px rgba(109, 94, 252, 0.18);
  --radius: 18px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.9;
  background:
    radial-gradient(1200px 700px at 12% -8%, rgba(109, 94, 252, 0.22), transparent 55%),
    radial-gradient(900px 500px at 90% 8%, rgba(212, 168, 75, 0.14), transparent 50%),
    radial-gradient(800px 600px at 50% 100%, rgba(94, 200, 255, 0.08), transparent 45%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 40%, #0a1220);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* 星尘背景 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 12%, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 22% 38%, rgba(243,221,154,.45), transparent),
    radial-gradient(1.2px 1.2px at 48% 18%, rgba(167,139,250,.5), transparent),
    radial-gradient(1px 1px at 72% 28%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.4px 1.4px at 86% 62%, rgba(94,200,255,.4), transparent),
    radial-gradient(1px 1px at 16% 78%, rgba(255,255,255,.35), transparent),
    radial-gradient(1.2px 1.2px at 58% 84%, rgba(243,221,154,.35), transparent),
    radial-gradient(1px 1px at 34% 56%, rgba(255,255,255,.3), transparent);
  opacity: .7;
  animation: starDrift 60s linear infinite;
}
@keyframes starDrift {
  from { transform: translateY(0); }
  to { transform: translateY(-40px); }
}

a { color: var(--gold2); text-decoration: none; transition: color .2s ease; }
a:hover { color: #fff6d0; text-decoration: none; }

.wrap {
  position: relative;
  z-index: 1;
  width: min(1040px, 92%);
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(7, 11, 20, 0.78);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.site-header .wrap { padding-top: .9rem; }
.brand a {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: .02em;
  background: linear-gradient(90deg, var(--gold2), #fff, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand p {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .92rem;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .7rem;
  padding: .85rem 0 1rem;
}
.nav a {
  color: var(--text);
  border: 1px solid var(--line);
  padding: .28rem .85rem;
  border-radius: 999px;
  font-size: .9rem;
  background: rgba(255,255,255,.03);
}
.nav a:hover {
  border-color: rgba(212,168,75,.55);
  color: var(--gold2);
  box-shadow: 0 0 0 3px rgba(212,168,75,.08);
}

/* Hero */
.hero {
  position: relative;
  padding: 2.8rem 0 1.2rem;
}
.hero::after {
  content: "";
  position: absolute;
  right: -4%;
  top: 10%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,75,.18), transparent 70%);
  filter: blur(4px);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.25;
  margin: 0 0 1rem;
  font-weight: 800;
  letter-spacing: .01em;
  text-shadow: 0 0 30px rgba(109,94,252,.25);
}
.hero h1 span.sub-en {
  display: block;
  margin-top: .35rem;
  font-size: .48em;
  font-weight: 600;
  color: var(--gold2);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero .lead {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 46rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1rem;
  padding: .28rem .75rem;
  border-radius: 999px;
  border: 1px solid rgba(167,139,250,.35);
  background: rgba(109,94,252,.12);
  color: var(--violet);
  font-size: .82rem;
  font-weight: 600;
}

/* Cards */
.card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(28, 40, 64, 0.88), rgba(16, 24, 40, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin: 1.1rem 0;
  box-shadow: var(--glow), 0 12px 36px rgba(0,0,0,.22);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(243,221,154,.45), transparent);
}
.card h2, .card h3 {
  color: var(--gold2);
  margin-top: 0;
  letter-spacing: .02em;
}
.card p { margin: .75rem 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .95rem;
}
.lesson-link {
  display: block;
  padding: 1.05rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255,255,255,.04), rgba(109,94,252,.05));
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.lesson-link:hover {
  transform: translateY(-3px);
  border-color: rgba(212,168,75,.55);
  box-shadow: 0 10px 28px rgba(0,0,0,.25), 0 0 0 1px rgba(212,168,75,.12);
}
.lesson-link strong {
  display: block;
  color: var(--gold2);
  margin-bottom: .35rem;
  font-size: 1.02rem;
}
.lesson-link span { color: var(--muted); font-size: .9rem; }

.section { margin: 1.35rem 0; }
.section h2 {
  border-left: 4px solid var(--gold);
  padding-left: .75rem;
  color: var(--gold2);
}
.muted { color: var(--muted); }

/* details */
details {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .9rem 1.05rem;
  margin: .85rem 0;
  background: rgba(255,255,255,.025);
  transition: border-color .2s ease, box-shadow .2s ease;
}
details[open] {
  border-color: rgba(167,139,250,.35);
  box-shadow: 0 0 0 1px rgba(109,94,252,.08), 0 10px 28px rgba(0,0,0,.15);
}
summary {
  cursor: pointer;
  color: var(--gold2);
  font-weight: 700;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .55rem;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "✦";
  color: var(--violet);
  font-size: .9rem;
}
details .speak-block {
  position: relative;
  margin-top: .7rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: .35rem .45rem .35rem 0;
  padding: .6rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #b8892f, #e0bf68 55%, #f3dd9a);
  color: #1a1205;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(212,168,75,.22);
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); text-decoration: none; color: #1a1205; }
.btn-ghost {
  background: transparent;
  color: var(--gold2);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-ghost:hover { color: var(--gold2); border-color: var(--gold); }

/* 朗读按钮 */
.speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  min-width: 34px;
  height: 34px;
  padding: 0 .65rem;
  border-radius: 999px;
  border: 1px solid rgba(167,139,250,.4);
  background: rgba(109, 94, 252, 0.16);
  color: var(--violet);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
}
.speak-btn:hover {
  background: rgba(109, 94, 252, 0.28);
  box-shadow: 0 0 0 4px rgba(109,94,252,.12);
}
.speak-btn.speaking {
  animation: speakPulse 1.4s ease-in-out infinite;
  background: rgba(212,168,75,.2);
  border-color: rgba(212,168,75,.55);
  color: var(--gold2);
}
@keyframes speakPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(167,139,250,.4); }
  50% { box-shadow: 0 0 0 10px rgba(167,139,250,0); }
}

.hero-actions, .toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin: 1rem 0 .4rem;
}
.toolbar {
  position: sticky;
  top: 78px;
  z-index: 40;
  padding: .65rem .8rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(7,11,20,.82);
  backdrop-filter: blur(12px);
}

/* 逐字高亮 */
.rh-ch { transition: color .1s ease, transform .1s ease, text-shadow .1s ease; }
.rh-active {
  color: #ff4d6d !important;
  font-weight: 800 !important;
  font-size: 1.12em !important;
  text-shadow: 0 0 12px rgba(255,77,109,.45);
}
.rh-passed {
  color: #f3dd9a !important;
  font-weight: 600 !important;
}
.reading-active {
  outline: 1px solid rgba(167,139,250,.35);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(109,94,252,.12), rgba(212,168,75,.06));
  box-shadow: inset 0 0 0 1px rgba(243,221,154,.08);
}

/* KTV 全屏面板 */
.ktv-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background:
    radial-gradient(800px 500px at 50% 30%, rgba(109,94,252,.25), transparent 60%),
    rgba(4, 8, 16, 0.92);
  backdrop-filter: blur(10px);
}
.ktv-overlay.show { display: flex; }
.ktv-panel {
  width: min(920px, 96vw);
  max-height: 86vh;
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(212,168,75,.28);
  background: linear-gradient(180deg, rgba(20,30,52,.96), rgba(10,16,28,.98));
  box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 60px rgba(109,94,252,.15);
  padding: 1.4rem 1.5rem 1.2rem;
}
.ktv-title {
  margin: 0 0 .8rem;
  color: var(--gold2);
  font-size: 1.05rem;
  letter-spacing: .06em;
}
.ktv-text {
  font-size: clamp(1.25rem, 3.2vw, 1.85rem);
  line-height: 1.95;
  color: #dbe7ff;
  letter-spacing: .03em;
}
.ktv-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.1rem;
}

/* 浮动控制条 */
.reader-float-bar {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 120;
  display: none;
  gap: .4rem;
  padding: .55rem .65rem;
  border-radius: 16px;
  border: 1px solid rgba(212,168,75,.3);
  background: rgba(12, 18, 32, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 36px rgba(0,0,0,.35);
}
.reader-float-bar.show { display: flex; }
.reader-float-bar button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 999px;
  padding: .4rem .75rem;
  cursor: pointer;
  font-size: .86rem;
}
.reader-float-bar button:hover {
  border-color: var(--gold);
  color: var(--gold2);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 3.2rem;
  padding: 2.2rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .92rem;
}

ul { padding-left: 1.2rem; }
li { margin: .35rem 0; }

/* 进度条装饰 */
.progress-rail {
  height: 3px;
  width: 100%;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  overflow: hidden;
  margin: .8rem 0 0;
}
.progress-rail > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--indigo), var(--gold), var(--cyan));
  transition: width .2s linear;
}

@media (max-width: 720px) {
  .nav { gap: .4rem; }
  .card { padding: 1rem; }
  .reader-float-bar { left: 12px; right: 12px; justify-content: center; }
  .toolbar { top: 108px; }
}
