:root {
  --bg: #0d1526;
  --surface: #16213a;
  --card: #162238;
  --card2: #1b2a48;
  --border: #22304f;
  --text: #eaf2ff;
  --muted: #8fa3c4;
  --accent: #5ad1c0;
  --accent2: #7ce0b8;
  --blue: #5aa7ff;
  --purple: #b18cff;
  --warn: #ffb454;
  --danger: #ff6b7a;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #1b2f57 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 720px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 14px; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(var(--bg), rgba(13,21,38,0));
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  font-size: 24px; background: linear-gradient(140deg, #2b4a7a, #173a5c);
  box-shadow: 0 4px 18px rgba(90,209,192,.18), inset 0 0 0 1px rgba(255,255,255,.08);
}
.brand h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.brand p { margin: 2px 0 0; font-size: 11px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }

/* 按钮 */
button { font-family: inherit; cursor: pointer; border: none; border-radius: 12px; color: var(--text); }
button:disabled { opacity: .4; cursor: not-allowed; }
.ghost { background: var(--card2); border: 1px solid var(--border); }
.ghost.icon { width: 40px; height: 40px; font-size: 17px; }
.primary {
  width: 100%; padding: 14px; font-size: 15px; font-weight: 600;
  background: linear-gradient(135deg, #3ecfae, #2aa7a0); color: #06211f;
}
.primary:hover { filter: brightness(1.06); }

/* 统计条 */
.stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.stat {
  flex: 1; min-width: 78px; text-align: center; padding: 10px 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
}
.stat b { display: block; font-size: 18px; font-weight: 700; }
.stat span { font-size: 11px; color: var(--muted); }

/* 列表 */
.list { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: linear-gradient(160deg, var(--card), var(--card2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: .7;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { font-size: 16px; font-weight: 600; line-height: 1.35; margin: 0; word-break: break-word; }
.badge {
  flex-shrink: 0; font-size: 11px; padding: 4px 10px; border-radius: 999px; font-weight: 600;
  background: var(--card2); border: 1px solid var(--border); white-space: nowrap;
}
.badge.uploading { color: var(--warn); border-color: rgba(255,180,84,.4); }
.badge.uploaded { color: var(--blue); border-color: rgba(90,167,255,.4); }
.badge.editing { color: var(--purple); border-color: rgba(177,140,255,.4); }
.badge.edited { color: var(--accent); border-color: rgba(90,209,192,.4); }
.badge.reviewed { color: var(--accent2); border-color: rgba(124,224,184,.4); }

.card-meta { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.card-meta b { color: var(--text); font-weight: 500; }
.card-notes {
  margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.6;
  background: rgba(255,180,84,.08); border: 1px dashed rgba(255,180,84,.35); color: #ffd9a8;
}
.card-notes b { color: var(--warn); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip {
  padding: 9px 12px; font-size: 13px; border-radius: 10px;
  background: var(--card2); border: 1px solid var(--border); color: var(--text);
}
.chip:active { transform: scale(.97); }
.chip.danger { color: var(--danger); border-color: rgba(255,107,122,.4); }
.chip.primary-c { color: var(--accent); border-color: rgba(90,209,192,.45); }

/* FAB */
.fab {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom));
  width: 60px; height: 60px; border-radius: 50%; font-size: 30px; font-weight: 300;
  background: linear-gradient(135deg, #3ecfae, #2aa7a0); color: #06211f;
  box-shadow: 0 8px 26px rgba(42,167,160,.45); z-index: 20;
}
.fab:active { transform: scale(.94); }

/* 弹层 */
.modal {
  position: fixed; inset: 0; background: rgba(6,10,20,.72); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
  padding: env(safe-area-inset-top) 0 0;
}
.hidden { display: none !important; }
.sheet, .player-sheet {
  width: 100%; max-width: 720px; background: var(--surface);
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
  max-height: 92vh; overflow-y: auto;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.sheet-body { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field span { font-size: 12.5px; color: var(--muted); }
input[type="text"], input[type="password"], textarea {
  width: 100%; padding: 13px; font-size: 15px; color: var(--text);
  background: var(--card2); border: 1px solid var(--border); border-radius: 12px; outline: none;
  font-family: inherit;
}
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }

.filebox {
  display: grid; place-items: center; padding: 34px 16px; text-align: center;
  background: var(--card2); border: 1.5px dashed var(--border); border-radius: 14px;
  font-size: 14.5px; color: var(--muted); cursor: pointer;
}
.filebox.has-file { border-color: var(--accent); color: var(--accent); }

.progress { display: flex; align-items: center; gap: 12px; }
.progress .bar { flex: 1; height: 10px; border-radius: 999px; background: var(--card2); overflow: hidden; }
.progress .bar i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width .2s;
}
.progress span { font-size: 13px; color: var(--accent); font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }

/* 播放 */
.player-sheet { padding-bottom: 16px; }
#player { width: 100%; border-radius: 14px; background: #000; max-height: 56vh; }
.player-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0; }
.hint.ok { color: var(--accent); }

/* 空态 */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 54px; margin-bottom: 12px; }
.empty p { margin: 0; font-size: 14px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #1d2b49; border: 1px solid var(--border); color: var(--text);
  padding: 11px 18px; border-radius: 12px; font-size: 14px; z-index: 99;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); max-width: 86vw;
}
.toast.err { border-color: rgba(255,107,122,.5); color: #ffc9ce; }

@media (min-width: 720px) {
  .modal { align-items: center; padding: 24px; }
  .sheet, .player-sheet { border-bottom: 1px solid var(--border); border-radius: 22px; max-height: 88vh; }
}
