/* ============ 趣玩HG —— 现代简约浅色 ============ */
:root {
  /* 背景 */
  --bg: #f5f6f8;
  --bg-deep: #eceef2;
  --card: #ffffff;
  --card-soft: #f7f8fa;

  /* 文字 */
  --ink: #171a23;
  --ink-2: #8a90a0;
  --ink-3: #c2c7d1;

  /* 主色：靛蓝 */
  --accent: #4a6cf7;
  --accent-deep: #3554d6;
  --accent-soft: #eef2ff;
  --accent-glow: rgba(74, 108, 247, 0.30);

  /* 辅助色 */
  --chip: #18b89a;
  --chip-soft: #e6f7f2;
  --amber: #f0a020;
  --violet: #7a5cf0;

  /* 线条与阴影 */
  --line: rgba(23, 26, 35, 0.06);
  --line-strong: rgba(23, 26, 35, 0.14);
  --shadow-sm: 0 1px 2px rgba(23, 26, 35, 0.04), 0 2px 10px -3px rgba(23, 26, 35, 0.08);
  --shadow: 0 2px 6px rgba(23, 26, 35, 0.05), 0 16px 36px -18px rgba(23, 26, 35, 0.22);
  --radius: 18px;
  --radius-sm: 12px;

  /* 字体：现代无衬线 */
  --font-brand: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", sans-serif;
  --font-display: var(--font-brand);
  --font-body: var(--font-brand);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(900px 480px at 50% -12%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(640px 400px at 108% 2%, #e8ecf5 0%, rgba(232, 236, 245, 0) 56%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 20px 56px;
  animation: pageIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
  background: rgba(245, 246, 248, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.brand { display: flex; align-items: center; gap: 12px; }

.chip-logo {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #6d8bff, var(--accent-deep));
  box-shadow: 0 8px 18px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-text b {
  font-family: var(--font-brand);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink);
}

.brand-text small {
  display: block;
  color: var(--ink-2);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  max-width: 160px;
  transition: transform 0.15s ease, background 0.2s ease;
}

.user-chip:active { transform: scale(0.97); }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6d8bff, var(--accent));
  overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 11px;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.icon-btn:active { transform: scale(0.94); }

/* ---------- 海报 ---------- */
.poster {
  position: relative;
  height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, #2b3245, #15192a);
  box-shadow: var(--shadow);
  cursor: pointer;
  margin-bottom: 18px;
  isolation: isolate;
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  transition: transform 0.6s ease;
}

.poster:hover img { transform: scale(1.04); }

.poster-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.poster-ph {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.18em;
  padding-left: 0.18em;
}

/* ---------- 按钮 ---------- */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 26px; }
.actions .btn.primary { grid-column: 1 / -1; }

.admin-quick {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.nfc-hint {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 16px;
  border-radius: 20px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 55%),
    linear-gradient(120deg, #f1edff 0%, #eef5ff 55%, #fff0f7 100%);
  border: 1px solid rgba(124, 108, 245, 0.12);
  box-shadow: 0 10px 24px -18px rgba(108, 92, 231, 0.35);
}

.nfc-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1.2px;
  background: linear-gradient(90deg, #5d6bff 0%, #8a63f4 48%, #e879a6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.nfc-spark {
  font-size: 11px;
  color: #b7a6ff;
  opacity: 0.5;
  animation: twinkle 2.6s ease-in-out infinite;
}
.nfc-spark:last-child { animation-delay: 1.3s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.12); }
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #5f7dff, var(--accent));
  border-color: transparent;
  box-shadow: 0 12px 26px -12px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn.primary:not(:disabled):hover { box-shadow: 0 16px 30px -12px var(--accent-glow); }

.btn.ghost { background: var(--card); }
.btn.danger { color: #fff; background: linear-gradient(135deg, #e06060, #c43a3a); border-color: transparent; box-shadow: 0 10px 24px -12px rgba(196, 58, 58, 0.55); }

.btn-mini {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.14s ease;
}
.btn-mini:active { transform: scale(0.95); }
.btn-mini.danger { color: var(--accent-deep); border-color: rgba(74, 108, 247, 0.3); background: var(--accent-soft); }

/* ---------- 标签列表 ---------- */
.tag-section { margin-top: 2px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.head-actions { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-2); }

.checkall { display: flex; align-items: center; gap: 6px; cursor: pointer; }

.tag-list { display: flex; flex-direction: column; gap: 10px; }

.tag-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  animation: rise 0.4s ease both;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.tag-row:active { transform: scale(0.99); }

.tag-row:nth-child(1) { animation-delay: 0.03s; }
.tag-row:nth-child(2) { animation-delay: 0.06s; }
.tag-row:nth-child(3) { animation-delay: 0.09s; }
.tag-row:nth-child(4) { animation-delay: 0.12s; }
.tag-row:nth-child(5) { animation-delay: 0.15s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.checkbox { flex: none; }

.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

.tag-info { flex: 1; min-width: 0; cursor: pointer; }

.tag-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-uid {
  margin-top: 2px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-uid.primary {
  margin-top: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.tag-rename {
  flex: none;
  height: 36px;
  padding: 0 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.tag-rename:active { background: var(--bg-deep); }

.tag-identity {
  background: var(--bg-deep);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 15px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
}

.tag-identity b {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
}

.more {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card-soft);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s ease;
}

.more:active { background: var(--bg-deep); }

/* ---------- 表单 ---------- */
.form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow);
}

.form-card h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 16px; }

.field { display: block; margin-bottom: 15px; }

.field > span {
  display: block;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.field input:disabled { background: var(--bg-deep); color: var(--ink-2); }

/* 密码可见切换 */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 46px; }
.pwd-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.pwd-toggle:hover { background: var(--bg-deep); }
.pwd-toggle.on { color: var(--accent); }
.pwd-toggle svg { display: block; }

.hint { font-size: 12.5px; color: var(--ink-2); margin: 8px 0 14px; line-height: 1.7; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-3);
  font-size: 12px;
  margin: 16px 0;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* 登录 tab */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--bg-deep); padding: 4px; border-radius: 13px; }
.tab {
  flex: 1;
  padding: 9px 0;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink-2);
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease;
}
.tab.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- 类型选择 ---------- */
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }

.type-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 15px 4px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  transition: transform 0.14s ease, border-color 0.2s ease, background 0.2s ease;
}

.type-item:active { transform: scale(0.96); }
.type-item.active { border-color: var(--accent); background: var(--accent-soft); }

.type-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--chip);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.type-item:nth-child(2) .type-badge { background: var(--accent); }
.type-item:nth-child(3) .type-badge { background: var(--amber); }
.type-item:nth-child(4) .type-badge { background: var(--violet); }

.file-area { min-height: 60px; margin-bottom: 16px; }

.type-item.uploaded { border-color: rgba(31, 175, 107, 0.38); background: #f2fbf6; }
.uploaded-tag { font-size: 11px; font-weight: 600; color: #1faf6b; }

.file-list { display: flex; flex-direction: column; gap: 10px; }

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.file-type {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.file-type.video { background: #eef2ff; color: var(--accent); }
.file-type.audio { background: #fff6e6; color: #c98400; }
.file-type.record { background: #f3efff; color: var(--violet); }

.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

.file-del {
  border: none;
  background: transparent;
  color: #c43a3a;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.file-del:active { background: #fdeeee; }

.file-edit {
  border: none;
  background: transparent;
  color: var(--accent-deep);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.file-edit:active { background: var(--accent-soft); }

.file-preview {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: 13px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  font-size: 13px;
}

.file-preview img { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; }

.file-preview .re { margin-left: auto; color: var(--accent); cursor: pointer; font-size: 12.5px; font-weight: 600; }

.recorder { text-align: center; }
.recorder audio { width: 100%; margin-top: 12px; }

/* ---------- 写卡清单 ---------- */
.write-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* 播放验证开关 */
.file-head-right { display: flex; align-items: center; gap: 12px; }
.verify-toggle { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.switch {
  width: 40px;
  height: 22px;
  padding: 2px;
  border: 0;
  border-radius: 99px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background 0.22s ease;
}
.switch i {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(23, 26, 35, 0.22);
  transition: transform 0.22s ease;
}
.switch.on { background: var(--accent); }
.switch.on i { transform: translateX(18px); }

/* 播放验证页 */
.verify-card { text-align: center; }
.verify-mark {
  width: 52px;
  height: 52px;
  margin: 2px auto 12px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: linear-gradient(135deg, #f2efff, #eaf2ff);
  border: 1px solid rgba(124, 108, 245, 0.14);
}
.verify-card h3 { margin-bottom: 8px; }
.verify-question {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 18px;
}
.verify-card .field { text-align: left; }

.write-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.write-row:last-child { border-bottom: none; padding-bottom: 4px; }

.write-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.write-uid {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.write-state { font-size: 12px; color: var(--ink-2); }
.write-state.ok { color: var(--chip); }

.write-url {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--ink);
  cursor: pointer;
}

.write-actions { display: flex; gap: 8px; margin-top: 8px; }

.notice {
  margin-top: 16px;
  padding: 16px;
  border-radius: 15px;
  background: var(--accent-soft);
  border: 1px solid rgba(74, 108, 247, 0.16);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.9;
}

.notice h3 { font-size: 14px; color: var(--ink); margin-bottom: 6px; }
.notice p { margin: 0; }

/* ---------- 授权管理 ---------- */
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.7;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  outline: none;
  resize: vertical;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.admin-search {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  outline: none;
  margin-bottom: 6px;
}

.admin-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.admin-row { padding: 13px 0; border-bottom: 1px solid var(--line); }
.admin-row:last-child { border-bottom: none; padding-bottom: 4px; }

.admin-meta { font-size: 12px; color: var(--ink-2); line-height: 1.7; }

.status-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.status-pill.on { color: #0f8f77; background: var(--chip-soft); }
.status-pill.off { color: #8a90a0; background: var(--bg-deep); }

.unauth-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  color: #b2791f;
  background: #fdf4e4;
}

.unauth-text { color: #c43a3a; font-weight: 600; }

/* 播放页本人管理条 */
.manage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  margin-bottom: 12px;
  border-radius: 13px;
  background: var(--accent-soft);
  border: 1px solid rgba(74, 108, 247, 0.16);
  font-size: 13px;
  color: var(--accent-deep);
}

/* ---------- 播放页 ---------- */
.player-stage {
  border-radius: var(--radius);
  overflow: hidden;
  background: #141926;
  margin: 6px 0 16px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.media-img { width: 100%; display: block; }
.media-video { width: 100%; display: block; background: #000; }

.audio-card {
  width: 100%;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #fff;
}

.audio-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: #fff;
  background: radial-gradient(circle at 32% 28%, #24c7a8, var(--chip));
  box-shadow: 0 0 0 8px rgba(24, 184, 154, 0.16);
}

.audio-name { font-size: 15px; color: rgba(255, 255, 255, 0.85); }

.media-audio { width: 100%; }

.player-toolbar { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 10px; margin-bottom: 12px; }

.loop-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 18px;
  cursor: pointer;
}
.loop-toggle input { width: 18px; height: 18px; accent-color: var(--chip); }

.playlist { display: flex; flex-direction: column; gap: 8px; }

.pl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.2s ease;
}

.pl-item:active { transform: scale(0.99); }
.pl-item.active { border-color: var(--chip); box-shadow: inset 0 0 0 1px var(--chip); }

.pl-icon {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--chip);
}

.pl-name { flex: 1; font-size: 14px; }
.pl-dur { font-size: 12px; color: var(--ink-3); }

/* ---------- 上传页：播放主题选择 ---------- */
.theme-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  cursor: pointer;
  user-select: none;
}
.theme-head-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.theme-head-main h3 { margin: 0; }
.theme-current {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theme-chevron {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card-soft);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
  transition: transform .25s ease;
}
.theme-card.open .theme-chevron { transform: rotate(180deg); }
.theme-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .3s ease, opacity .2s ease;
}
.theme-card.open .theme-panel { max-height: 1600px; opacity: 1; }
.theme-panel-inner { padding-top: 2px; }
.theme-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.theme-chips::-webkit-scrollbar { display: none; }
.theme-chip {
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.theme-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}
.theme-chip:disabled { opacity: .6; cursor: default; }
.theme-hint { line-height: 1.6; }
.theme-bg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.theme-bg {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-deep);
  cursor: pointer;
  text-align: left;
}
.theme-bg picture, .theme-bg img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}
.theme-bg > span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 10px 9px;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(180deg, rgba(8, 10, 16, 0), rgba(8, 10, 16, .62));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theme-bg.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.theme-bg.active::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.theme-bg:disabled { cursor: default; opacity: .75; }

/* 上传完成后、服务端压缩中的不确定进度动画 */
#progressFill.is-compressing {
  width: 35% !important;
  transition: none;
  animation: compressSlide 1.1s ease-in-out infinite;
}
@keyframes compressSlide {
  0%, 100% { margin-left: 0; }
  50% { margin-left: 65%; }
}

/* ---------- 播放页（蓝灰沉浸式） ---------- */
body.play-mode { overflow: hidden; }
body.play-mode #app { animation: none; }

.play-page {
  position: fixed;
  inset: 0;
  z-index: 50;
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  padding: calc(8px + env(safe-area-inset-top)) 20px calc(8px + env(safe-area-inset-bottom));
  color: #fff;
  overflow: hidden;
  overflow: clip;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 70% at 12% -6%, #a9c0d6 0%, rgba(169, 192, 214, 0) 58%),
    radial-gradient(90% 60% at 108% 8%, #7e96ad 0%, rgba(126, 150, 173, 0) 60%),
    linear-gradient(180deg, #70879d 0%, #556a81 42%, #3a4759 78%, #2b3543 100%);
}

.play-page button { font-family: var(--font-body); }
.play-page.has-theme { background: transparent; }

/* 主题背景独立为全屏固定层：延伸到 iOS Safari 底部工具栏之后，避免出现色差条 */
.play-theme-backdrop {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  z-index: 40;
  background: #10131a;
  pointer-events: none;
}
@media (min-width: 521px) {
  .play-theme-backdrop {
    left: 50%;
    right: auto;
    width: 480px;
    transform: translateX(-50%);
  }
}

.play-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.play-orb { position: absolute; border-radius: 50%; filter: blur(46px); pointer-events: none; }
.orb-a { width: 240px; height: 240px; background: rgba(196, 219, 240, 0.38); top: -80px; right: -60px; }
.orb-b { width: 200px; height: 200px; background: rgba(26, 36, 50, 0.55); bottom: 120px; left: -90px; }
.play-theme-media { position: absolute; inset: 0; display: block; }
.play-theme-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(1.05) saturate(1.03);
}
.play-page.has-theme .play-meta .play-title { text-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
.play-page.has-theme .play-meta .play-sub { color: rgba(255, 255, 255, .78); }
.play-page.has-theme .play-top { text-shadow: 0 1px 10px rgba(0, 0, 0, .5); }
.play-page.has-theme .play-top .play-top-mid small { color: rgba(255, 255, 255, .8); }
/* 自定义主题下减少媒体舞台的深色底，让照片留白处露出主题背景 */
.play-page.has-theme .play-hero {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 18px 40px -30px rgba(9, 15, 24, .35), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.play-page.has-theme .play-cover-img { background: transparent; }

/* 浅色主题图使用深色文字与控件，避免白字白底看不清 */
.play-page.tone-dark { color: #1f2a37; }
.play-page.tone-dark .play-top { text-shadow: none; }
.play-page.tone-dark .play-top-mid span { color: #1f2a37; }
.play-page.tone-dark .play-top-mid small { color: rgba(31, 42, 55, .66); }
.play-page.tone-dark .play-icon-btn {
  color: #1f2a37;
  background: rgba(255, 255, 255, .55);
  border-color: rgba(31, 42, 55, .15);
}
.play-page.tone-dark .play-manage {
  color: #1f2a37;
  background: rgba(255, 255, 255, .55);
  border-color: rgba(31, 42, 55, .14);
}
.play-page.tone-dark .play-meta .play-title {
  color: #1f2a37;
  text-shadow: 0 1px 8px rgba(255, 255, 255, .35);
}
.play-page.tone-dark .play-meta .play-sub { color: rgba(31, 42, 55, .7); }
.play-page.tone-dark .play-progress input[type="range"] { background: rgba(31, 42, 55, .22); }
.play-page.tone-dark .play-progress input[type="range"]::-webkit-slider-thumb {
  background: #1f2a37;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.play-page.tone-dark .play-progress input[type="range"]::-moz-range-thumb { background: #1f2a37; }
.play-page.tone-dark .play-times { color: rgba(31, 42, 55, .65); }
.play-page.tone-dark .play-ctrl { color: #1f2a37; }
.play-page.tone-dark .play-loop {
  color: #1f2a37;
  border-color: rgba(31, 42, 55, .18);
  background: rgba(255, 255, 255, .5);
}
.play-page.tone-dark .play-loop.active { background: #1f2a37; color: #fff; border-color: #1f2a37; }
.play-page.tone-dark .playlist-head { color: rgba(31, 42, 55, .82); }
.play-page.tone-dark .playlist-head small { color: rgba(31, 42, 55, .55); }
.play-page.tone-dark .pl-card {
  color: #1f2a37;
  background: rgba(255, 255, 255, .55);
  border-color: rgba(31, 42, 55, .12);
}
.play-page.tone-dark .pl-card.active {
  background: rgba(255, 255, 255, .8);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(74, 108, 247, .25);
}
.play-page.tone-dark .pl-sub { color: rgba(31, 42, 55, .6); }
.play-page.tone-dark .play-empty { color: rgba(31, 42, 55, .6); }
.play-page.tone-dark .play-empty-cover { color: rgba(31, 42, 55, .62); }
.play-page.tone-dark .play-empty-icon {
  background: rgba(255, 255, 255, .5);
  border-color: rgba(31, 42, 55, .12);
}
.play-page.tone-dark .disc-wave i { background: rgba(31, 42, 55, .45); }

/* 覆盖 has-theme 下优先级更高的白色文字规则 */
.play-page.has-theme.tone-dark .play-top { text-shadow: none; }
.play-page.has-theme.tone-dark .play-top .play-top-mid small { color: rgba(31, 42, 55, .66); }
.play-page.has-theme.tone-dark .play-meta .play-title {
  color: #1f2a37;
  text-shadow: 0 1px 8px rgba(255, 255, 255, .35);
}
.play-page.has-theme.tone-dark .play-meta .play-sub { color: rgba(31, 42, 55, .7); }
.play-page > *:not(.play-bg) { position: relative; z-index: 1; }

.play-top { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 8px; }
.play-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.play-avatar { overflow: hidden; font-size: 14px; font-weight: 600; }
.play-avatar img { width: 100%; height: 100%; object-fit: cover; }
.play-icon-btn svg { width: 20px; height: 20px; display: block; }
.play-top-mid { flex: 1; text-align: center; }
.play-top-mid span { display: block; font-size: 13px; font-weight: 600; letter-spacing: 1.5px; }
.play-top-mid small { display: block; margin-top: 2px; font-size: 10px; letter-spacing: 0.6px; color: rgba(255, 255, 255, 0.55); }

.play-manage {
  flex: 0 0 auto;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.play-manage .btn-mini { background: #fff; color: #33404f; border: none; }

.play-hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 150px;
  margin: 2px 0 10px;
  border-radius: 26px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 30px 70px -34px rgba(9, 15, 24, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
}
.play-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(8, 12, 18, 0.35);
  display: block;
}
.play-cover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b0f16;
  display: block;
}

.play-disc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.disc-ring {
  width: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #44536a 0%, #232c3a 58%, #10151d 100%);
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.05), 0 18px 40px -18px rgba(0, 0, 0, 0.7), inset 0 0 50px rgba(0, 0, 0, 0.55);
  animation: discSpin 9s linear infinite;
  animation-play-state: paused;
}
.disc-ring span {
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f1f6fc, #b9cbdd);
  color: #33404f;
  font-size: 20px;
  font-weight: 700;
}
.disc-ring span svg { width: 27px; height: 27px; display: block; }
.play-page.is-playing .disc-ring { animation-play-state: running; }
@keyframes discSpin { to { transform: rotate(360deg); } }

.disc-wave { display: flex; align-items: flex-end; gap: 4px; height: 26px; opacity: 0.85; }
.disc-wave i {
  width: 4px;
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.62);
  animation: waveBar 1.1s ease-in-out infinite;
  animation-play-state: paused;
}
.play-page.is-playing .disc-wave i { animation-play-state: running; }
@keyframes waveBar {
  0%, 100% { height: 8px; opacity: 0.35; }
  50% { height: 30px; opacity: 0.95; }
}

.play-empty-cover { display: flex; flex-direction: column; align-items: center; gap: 12px; color: rgba(255, 255, 255, 0.62); font-size: 14px; }
.play-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.play-meta { flex: 0 0 auto; padding: 0 4px; }
.play-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.play-sub {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-progress { flex: 0 0 auto; margin: 10px 4px 0; }
.play-progress input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}
.play-progress input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.play-progress input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: #fff;
}
.play-times { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: rgba(255, 255, 255, 0.55); }

.play-controls {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin: 4px 0 10px;
  transform: translateX(-30px);
}
.play-ctrl { border: none; background: transparent; color: rgba(255, 255, 255, 0.82); padding: 10px; display: grid; place-items: center; }
.play-ctrl svg { width: 25px; height: 25px; display: block; }
.play-ctrl-main {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #33404f;
  display: grid;
  place-items: center;
  box-shadow: 0 16px 34px -14px rgba(0, 0, 0, 0.6);
}
.play-ctrl-main svg { width: 26px; height: 26px; display: block; }
.play-ctrl-main:disabled { opacity: 0.45; }
.play-loop {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  display: grid;
  place-items: center;
}
.play-loop svg { width: 19px; height: 19px; display: block; }
.play-loop.active { background: #fff; color: #33404f; border-color: #fff; }

.play-playlist-wrap { flex: 0 0 auto; margin-top: 0; }
.playlist-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 6px; font-size: 12px; color: rgba(255, 255, 255, 0.70); }
.playlist-head small { color: rgba(255, 255, 255, 0.45); }
.play-playlist { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.play-playlist::-webkit-scrollbar { display: none; }
.pl-card {
  flex: 0 0 104px;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pl-card.active { background: rgba(255, 255, 255, 0.20); border-color: rgba(255, 255, 255, 0.85); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }
.pl-thumb {
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #1f2a37;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 8px rgba(31, 42, 55, .08);
}
.pl-thumb.image { background: linear-gradient(135deg, #b8f0e2, #63d3b7); }
.pl-thumb.video { background: linear-gradient(135deg, #c7d8ff, #7d9cf7); }
.pl-thumb.audio { background: linear-gradient(135deg, #ffe3ae, #f7b84b); }
.pl-thumb.record { background: linear-gradient(135deg, #ddd0ff, #a98bf5); }
.pl-title { display: block; margin-top: 5px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-sub { display: block; margin-top: 1px; font-size: 9.5px; color: rgba(255, 255, 255, 0.58); }
.play-empty { color: rgba(255, 255, 255, 0.55); font-size: 13px; padding: 10px 4px; }

/* ---------- 我的页 ---------- */
.me-card { text-align: center; }

.avatar-big {
  width: 88px;
  height: 88px;
  margin: 4px auto 12px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6d8bff, var(--accent));
  box-shadow: 0 12px 28px -12px var(--accent-glow);
}

.avatar-big img { width: 100%; height: 100%; object-fit: cover; }

.badge {
  display: inline-block;
  padding: 4px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--chip);
  margin: 6px 0 12px;
}

.me-card .btn { width: 100%; margin-bottom: 10px; }

/* ---------- 空状态 / 加载 ---------- */
.empty, .loading {
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
  padding: 38px 16px;
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 18, 28, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 0.18s ease both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  animation: pop 0.26s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes pop { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }

.modal-card h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.modal-card p { font-size: 13.5px; color: var(--ink-2); margin-bottom: 16px; }
.modal-card input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  outline: none;
  margin-bottom: 16px;
}
.modal-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(20px);
  z-index: 10001;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(23, 26, 35, 0.94);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 14px 32px -12px rgba(0, 0, 0, 0.5);
  max-width: 82vw;
  text-align: center;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (min-width: 600px) {
  #app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); box-shadow: 0 0 60px -30px rgba(23, 26, 35, 0.3); }
  .topbar { margin-left: -1px; margin-right: -1px; }
}
