/* ============================================================
   雲上查經音頻 · 全局樣式
   ============================================================ */

:root {
  --bg:        #0f0f1a;
  --bg-card:   #1a1a2e;
  --bg-card-2: #22224a;
  --line:      #2a2a4a;
  --accent:    #6c63ff;
  --accent-2:  #a78bfa;
  --text:      #e6e6ef;
  --text-dim:  #8f8fa8;
  --ok:        #4ade80;
  --warn:      #fbbf24;
  --err:       #f87171;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { color: inherit; }

/* ===================== 頭部 ===================== */

.site-header {
  padding: 2.5rem 1.5rem 2rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #16162a 0%, var(--bg) 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.logo {
  font-size: 2.4rem;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  flex-shrink: 0;
}

.brand h1 { font-size: 1.6rem; color: #fff; letter-spacing: .5px; }
.subtitle { color: var(--text-dim); font-size: .9rem; }

.verses {
  max-width: 1000px;
  margin: 1.5rem auto 0;
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--accent);
  background: rgba(108, 99, 255, .07);
  border-radius: 0 10px 10px 0;
}
.verses p { font-size: .9rem; color: #c9c9dd; }
.verses span { font-size: .8rem; color: var(--accent-2); }

/* 內頁頭部 */
.page-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #16162a 0%, var(--bg) 100%);
}
.page-header h1 { font-size: 1.4rem; color: #fff; margin-top: .5rem; }
.page-header .subtitle { font-size: .85rem; }

.back-btn {
  display: inline-block;
  font-size: .85rem;
  color: var(--accent-2);
  text-decoration: none;
  padding: .35rem .8rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: all .18s ease;
}
.back-btn:hover { border-color: var(--accent); background: rgba(108,99,255,.12); }

/* ===================== 首頁導航卡片 ===================== */

.nav-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
  padding: 2rem 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.nav-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.6rem 1.3rem;
  text-decoration: none;
  color: var(--text);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.nav-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(108, 99, 255, .22);
}

.nav-icon { font-size: 2.4rem; margin-bottom: .7rem; }
.nav-card h2 { font-size: 1.1rem; color: #fff; margin-bottom: .35rem; }
.nav-card p  { font-size: .8rem; color: var(--text-dim); }
.nav-card .count {
  margin-top: .8rem;
  font-size: .72rem;
  color: var(--accent-2);
  background: rgba(108,99,255,.14);
  padding: .2rem .7rem;
  border-radius: 12px;
}

/* ===================== 快速鏈接 ===================== */

.quick-links {
  max-width: 1000px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  width: 100%;
}
.quick-links h3 { font-size: .9rem; color: var(--text-dim); margin-bottom: .8rem; }
.quick-links-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.quick-link {
  font-size: .82rem;
  padding: .45rem .9rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-card);
  color: #c9c9dd;
  text-decoration: none;
  transition: all .18s ease;
}
.quick-link:hover { border-color: var(--accent); color: #fff; }
.quick-link.disabled { opacity: .45; cursor: not-allowed; }

/* ===================== 分段導航卡片 ===================== */

.section-cards { max-width: 860px; margin: 1.5rem auto 0; padding: 0 1.5rem; width: 100%; }
.section-cards h3 { font-size: .9rem; color: var(--text-dim); margin-bottom: .8rem; }

.sub-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .9rem;
}

.sub-nav-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all .18s ease;
  text-align: center;
  user-select: none;
}
.sub-nav-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.sub-nav-card.active {
  border-color: var(--accent);
  background: var(--bg-card-2);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, .35);
}
.sub-nav-card h4 { font-size: .98rem; color: #fff; margin-bottom: .25rem; }
.sub-nav-card p  { font-size: .76rem; color: var(--text-dim); }

/* ===================== 播放器 ===================== */

.player-page { flex: 1; padding: 1.5rem; }
.player-container {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.8rem 1.5rem;
}

.cover-wrap { display: grid; place-items: center; margin-bottom: 1.2rem; }
.cover {
  width: 150px; height: 150px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  font-size: 3.4rem;
  color: #fff;
  box-shadow: 0 10px 30px rgba(108, 99, 255, .3);
  animation: spin 18s linear infinite;
  animation-play-state: paused;
}
.cover.playing { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }

.track-info { text-align: center; margin-bottom: 1.2rem; }
.track-info h2 { font-size: 1.15rem; color: #fff; }
.track-info p  { font-size: .82rem; color: var(--text-dim); margin-top: .25rem; }

.progress-wrap { display: flex; align-items: center; gap: .7rem; font-size: .76rem; color: var(--text-dim); }
.progress-wrap span { min-width: 38px; text-align: center; }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 5px; border-radius: 4px;
  background: #33335a; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent-2); border: 2px solid #fff2;
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; border: none;
  background: var(--accent-2);
}

.controls { display: flex; justify-content: center; gap: 1rem; margin: 1.2rem 0; }
.controls button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-card-2);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: all .16s ease;
  display: grid; place-items: center;
}
.controls button:hover { border-color: var(--accent); color: #fff; }
#btnPlay {
  width: 56px; height: 56px;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; color: #fff;
}

.extra-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  padding: .8rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.speed-wrap, .volume-wrap { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--text-dim); }
.speed-wrap select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .35rem .55rem;
  font-size: .82rem;
  cursor: pointer;
}
.volume-wrap input { width: 90px; }

.status-bar {
  margin: 1rem 0;
  padding: .6rem .9rem;
  border-radius: 10px;
  font-size: .78rem;
  background: rgba(255,255,255,.04);
  color: var(--text-dim);
  word-break: break-all;
}
.status-bar.ok   { background: rgba(74,222,128,.12);  color: var(--ok); }
.status-bar.warn { background: rgba(251,191,36,.12);  color: var(--warn); }
.status-bar.err  { background: rgba(248,113,113,.12); color: var(--err); }
.status-bar.info { background: rgba(108,99,255,.12);  color: var(--accent-2); }

.playlist-wrap h3 { font-size: .9rem; color: var(--text-dim); margin: 1rem 0 .6rem; }
#playlist { list-style: none; max-height: 320px; overflow-y: auto; }

.track-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem .8rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background .16s ease;
  font-size: .86rem;
}
.track-item:hover { background: rgba(255,255,255,.05); }
.track-item.active { background: rgba(108,99,255,.18); color: #fff; }
.track-item .idx {
  min-width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: rgba(255,255,255,.07);
  font-size: .72rem;
  color: var(--text-dim);
  flex-shrink: 0;
}
.track-item.active .idx { background: var(--accent); color: #fff; }
.track-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-item .d { font-size: .72rem; color: var(--text-dim); flex-shrink: 0; }
.track-item.loading .t { color: var(--warn); }
.track-item.failed  .t { color: var(--err); }

/* ===================== 頁腳 ===================== */

.site-footer {
  text-align: center;
  padding: 1.6rem 1rem;
  color: var(--text-dim);
  font-size: .78rem;
  border-top: 1px solid var(--line);
}
.site-footer p { margin: .2rem 0; }
.site-footer .copy { opacity: .6; margin-top: .5rem; }

/* ===================== 響應式 ===================== */

@media (max-width: 600px) {
  .brand h1 { font-size: 1.3rem; }
  .logo { width: 46px; height: 46px; font-size: 1.9rem; }
  .nav-grid { grid-template-columns: 1fr; padding: 1.2rem; }
  .sub-nav-grid { grid-template-columns: 1fr 1fr; }
  .player-container { padding: 1.3rem 1rem; }
  .cover { width: 120px; height: 120px; font-size: 2.7rem; }
  .extra-row { flex-direction: column; align-items: stretch; }
}
