/* ============ 听力播放中心 · 毛玻璃高端主题 ============ */
:root {
  --bg: #0b1020;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: #eef2ff;
  --text-dim: rgba(238, 242, 255, 0.62);
  --accent-a: #6366f1;
  --accent-b: #22d3ee;
  --gold-a: #f59e0b;
  --gold-b: #fbbf24;
  --radius: 18px;
}

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

html, body { min-height: 100%; }

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

/* ---------- 背景 aurora ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 90%, rgba(34, 211, 238, 0.14), transparent 60%),
    var(--bg);
}
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }
.b1 { width: 420px; height: 420px; left: -120px; top: -80px; background: #4f46e5; animation: float 22s ease-in-out infinite alternate; }
.b2 { width: 360px; height: 360px; right: -100px; top: 30%; background: #0ea5e9; animation: float 18s ease-in-out -6s infinite alternate-reverse; }
.b3 { width: 300px; height: 300px; left: 35%; bottom: -120px; background: #9333ea; animation: float 26s ease-in-out -12s infinite alternate; }
@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(60px, 40px) scale(1.15); }
}

/* ---------- 毛玻璃卡片 ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.container { max-width: 880px; margin: 0 auto; padding: 28px 20px 60px; }

/* ---------- 头部 ---------- */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; margin-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.logo {
  width: 52px; height: 52px; border-radius: 14px; font-size: 26px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(34, 211, 238, 0.3));
  border: 1px solid var(--stroke);
}
.header h1 { font-size: 21px; font-weight: 700; letter-spacing: 0.5px; }
.header .sub { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.admin-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-dim); text-decoration: none; font-size: 13px;
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--stroke); background: var(--glass);
  transition: all 0.2s;
  white-space: nowrap;
}
.admin-link:hover { color: var(--text); background: var(--glass-strong); transform: translateY(-1px); }

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }

.item {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 15px 18px;
  transition: transform 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
  overflow: hidden;
}
.item:hover { transform: translateY(-2px); background: var(--glass-strong); }
.item.playing {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.25);
}
.item.merged { background: rgba(251, 191, 36, 0.07); }
.item.merged::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--gold-a), var(--gold-b));
}
.item.merged.playing {
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 8px 32px rgba(251, 191, 36, 0.2);
}

.idx {
  min-width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  flex-shrink: 0;
}
.item.merged .idx { color: var(--gold-b); border-color: rgba(251, 191, 36, 0.3); }

.info { flex: 1; min-width: 0; }
.name-line { display: flex; align-items: flex-start; gap: 8px; }
.name {
  font-size: 15px; font-weight: 500; line-height: 1.55;
  word-break: break-all; overflow-wrap: anywhere; /* 文件名过长自适应换行 */
}
.badge {
  flex-shrink: 0; margin-top: 2px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: #1c1917; padding: 2.5px 9px; border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-a), var(--gold-b));
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

.player-line { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.progress {
  flex: 1; height: 4px; border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}
.item .bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  border-radius: 999px; transition: width 0.15s linear;
}
.item.merged .bar { background: linear-gradient(90deg, var(--gold-a), var(--gold-b)); }
.time { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 播放按钮 ---------- */
.play-btn {
  position: relative; flex-shrink: 0;
  width: 48px; height: 48px; border-radius: 50%;
  border: none; cursor: pointer; color: #fff;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}
.play-btn:hover { transform: scale(1.1); box-shadow: 0 8px 26px rgba(99, 102, 241, 0.6); }
.play-btn:active { transform: scale(0.96); }
.play-btn svg { width: 20px; height: 20px; }
.play-btn .icon-pause { display: none; }
.item.playing .play-btn { background: linear-gradient(135deg, #4f46e5, #06b6d4); }
.item.playing .play-btn .icon-play { display: none; }
.item.playing .play-btn .icon-pause { display: block; }
.item.playing .play-btn::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.55);
  animation: pulse 1.6s ease-out infinite;
}
.item.merged .play-btn { background: linear-gradient(135deg, var(--gold-a), #f97316); box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45); }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* ---------- 状态卡片 ---------- */
.state { padding: 44px 24px; text-align: center; color: var(--text-dim); }
.state p { margin-top: 14px; font-size: 14px; line-height: 1.8; }
.state .hint {
  display: inline-block; margin-top: 12px; padding: 10px 14px;
  font-size: 12.5px; text-align: left; line-height: 1.9;
  background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 12px; color: #fde68a;
}
.state code { background: rgba(255,255,255,0.1); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto;
  border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-b);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.count-chip { font-size: 12.5px; color: var(--text-dim); margin: 2px 4px 12px; }

.foot { margin-top: 26px; text-align: center; font-size: 12px; color: var(--text-dim); }

/* ---------- 管理后台 ---------- */
.admin-card { max-width: 560px; margin: 40px auto 0; padding: 30px 28px; }
.admin-card h2 { font-size: 18px; margin-bottom: 6px; }
.admin-card .desc { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; line-height: 1.7; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 7px; }
.input {
  width: 100%; padding: 12px 14px; font-size: 14px;
  color: var(--text); border-radius: 12px;
  border: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.06);
  outline: none; transition: border-color 0.2s, background 0.2s;
}
.input:focus { border-color: var(--accent-a); background: rgba(255, 255, 255, 0.09); }
.btn {
  width: 100%; margin-top: 16px; padding: 12px;
  font-size: 14.5px; font-weight: 600; color: #fff;
  border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  transition: transform 0.15s, opacity 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.msg { margin-top: 14px; font-size: 13px; line-height: 1.7; border-radius: 10px; padding: 10px 13px; display: none; }
.msg.ok { display: block; background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.4); color: #86efac; }
.msg.err { display: block; background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5; }

.dropzone {
  margin-top: 6px; padding: 30px 16px; text-align: center;
  border: 1.5px dashed rgba(255, 255, 255, 0.25); border-radius: 14px;
  color: var(--text-dim); font-size: 13.5px; line-height: 1.9;
  cursor: pointer; transition: all 0.2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent-b); background: rgba(34, 211, 238, 0.06); color: var(--text); }
.dropzone .big { font-size: 30px; display: block; margin-bottom: 4px; }

/* ---------- v2：头部与广告语轮播 ---------- */
.header { flex-direction: column; align-items: stretch; gap: 14px; }
.header-top { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; }
.ads {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: #67e8f9;
}
#ads-text { font-size: 13px; line-height: 1.6; color: #a5f3fc; opacity: 0; transition: opacity 0.25s; }
#ads-text.show { opacity: 1; }

/* ---------- v2：后台清单列表 ---------- */
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.toolbar .mini { flex-shrink: 0; }
.batch-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
}
.batch-card .qr {
  width: 92px; height: 92px; flex-shrink: 0;
  border-radius: 12px; background: #fff; padding: 6px;
}
.b-info { flex: 1; min-width: 0; }
.b-info h3 { font-size: 16px; font-weight: 700; }
.b-excel { font-size: 12.5px; color: var(--text-dim); margin-top: 5px; word-break: break-all; }
.b-meta { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.b-url { font-size: 11.5px; color: #64748b; margin-top: 4px; word-break: break-all; }
.b-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }

.mini {
  padding: 7px 14px; font-size: 12.5px; border-radius: 9px;
  border: 1px solid var(--stroke); background: var(--glass);
  color: var(--text); cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  white-space: nowrap;
}
.mini:hover { background: var(--glass-strong); transform: translateY(-1px); }
.mini.primary { background: linear-gradient(135deg, var(--accent-a), var(--accent-b)); border: none; color: #fff; }
.mini.primary:hover { box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45); }
.mini.danger { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.mini.danger:hover { background: rgba(239, 68, 68, 0.12); }

.btn.ghost {
  background: transparent; border: 1px solid var(--stroke);
  box-shadow: none; color: var(--text-dim);
}
.btn.ghost:hover { color: var(--text); background: var(--glass); }

.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.field + .field { margin-top: 0; }

/* ---------- 头部动作按钮与弹窗 ---------- */
.header-actions { display: flex; align-items: center; gap: 10px; }
button.admin-link { font-family: inherit; cursor: pointer; }

.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 7, 18, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-mask[hidden] { display: none; }
.modal-card { width: 100%; max-width: 430px; padding: 28px 26px; animation: modalIn 0.18s ease-out; }
.modal-card h2 { font-size: 18px; margin-bottom: 4px; }
.modal-card .desc { font-size: 12.5px; color: var(--text-dim); margin-bottom: 18px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 620px) {
  .container { padding: 18px 12px 40px; }
  .header { padding: 18px; }
  .header-top { flex-direction: column; align-items: flex-start; }
  .item { gap: 11px; padding: 13px 13px; }
  .play-btn { width: 42px; height: 42px; }
  .idx { display: none; }
  .name { font-size: 14px; }
  .batch-card { flex-wrap: wrap; }
  .b-actions { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}
