:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-ink: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
}
.brand { font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.top-actions .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); }

.tabs {
  position: sticky; top: 52px; z-index: 19;
  display: flex; gap: 4px; padding: 8px 10px;
  background: var(--bg);
  overflow-x: auto;
}
.tab {
  flex: 1 0 auto;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 8px 12px; font-size: 13px;
  color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tab.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }

main { padding: 14px; max-width: 760px; margin: 0 auto; }
.panel { display: none; animation: fade .2s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.card h3 { margin: 0 0 10px; font-size: 15px; }

.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 9px 14px; font-size: 14px; cursor: pointer;
}
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.ghost { background: transparent; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

textarea, input, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; font-size: 15px; font-family: inherit; background: #fff; color: var(--ink);
  margin-top: 6px;
}
.capture textarea { resize: vertical; }
.capture-row { display: flex; gap: 8px; margin-top: 8px; }
.capture-row select { flex: 1; margin-top: 0; }
.capture-row .btn { flex: 0 0 auto; }

.filter-row { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.filter-row select { width: auto; flex: 1; margin-top: 0; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow);
}
.item .row1 { display: flex; align-items: flex-start; gap: 8px; }
.item .track-tag {
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: #eff6ff; color: var(--primary); white-space: nowrap;
}
.item .content { flex: 1; word-break: break-word; }
.item .src { font-size: 11px; color: var(--muted); margin-top: 4px; }
.item .src.hotspot { color: var(--warn); }
.item .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.item .actions .btn { padding: 6px 10px; font-size: 12px; }
.item.done .content { text-decoration: line-through; color: var(--muted); }
.status-dot { font-size: 12px; color: var(--muted); }

.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.msg { font-size: 13px; color: var(--ok); margin-left: 8px; }

/* 赛道卡片 */
.track-card { display: flex; flex-direction: column; gap: 8px; }
.track-head { display: flex; align-items: center; justify-content: space-between; }
.track-name { font-weight: 600; }
.track-pending { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 46px; height: 26px; }
.switch input { display: none; }
.switch .slider {
  position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; transition: .2s; cursor: pointer;
}
.switch .slider::before {
  content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.track-card .time-row { display: flex; align-items: center; gap: 8px; }
.track-card .time-row input { width: auto; flex: 0 0 110px; margin-top: 0; }
.track-card .save-track { align-self: flex-start; }

.hot-actions { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.hot-item .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hot-item a { color: var(--primary); text-decoration: none; font-size: 13px; }
.hot-item .extracted { font-size: 11px; color: var(--ok); }

#remindList .remind-card {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--primary);
  border-radius: var(--radius); padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.remind-card .rt { font-weight: 600; }
.remind-card .rb { color: var(--muted); font-size: 13px; margin-top: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

label { display: block; font-size: 13px; color: var(--muted); margin-top: 10px; }
label input { margin-top: 4px; }

/* ===== 摇一摇灵感球 ===== */
.hidden { display: none !important; }
.shake-filter { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.shake-filter select { width: auto; flex: 1; margin-top: 0; }

.ball-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 220px; padding: 12px 0; }
.ball {
  width: 150px; height: 150px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
  background: radial-gradient(circle at 32% 28%, #818cf8, #4338ca 70%);
  box-shadow: 0 10px 30px rgba(67, 56, 202, .35), inset 0 -8px 18px rgba(0,0,0,.25), inset 0 8px 18px rgba(255,255,255,.25);
  cursor: pointer; user-select: none;
}
.ball.shake-anim { animation: wobble .12s linear 0s 6; }
@keyframes wobble {
  0% { transform: rotate(0) translate(0,0); }
  25% { transform: rotate(-14deg) translate(-8px, 4px); }
  50% { transform: rotate(12deg) translate(8px, -4px); }
  75% { transform: rotate(-8deg) translate(-4px, 2px); }
  100% { transform: rotate(0) translate(0,0); }
}

.ball-reveal {
  width: 100%; max-width: 420px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px; box-shadow: var(--shadow);
}
.ball-reveal.pop-anim { animation: pop .35s cubic-bezier(.2,.8,.3,1.2); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.reveal-track { font-size: 13px; color: var(--primary); margin-bottom: 10px; }
.reveal-content { font-size: 20px; font-weight: 600; line-height: 1.5; word-break: break-word; margin-bottom: 18px; }

#shakeBtn.big { width: 100%; padding: 16px; font-size: 18px; margin-top: 6px; }
#shakeEmpty { text-align: center; margin-top: 14px; }

.remind-field { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.remind-field input { width: auto; flex: 1; margin-top: 0; }
.btn.small { padding: 6px 10px; font-size: 12px; }

.meta-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.remind-badge {
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: #fff7ed; color: var(--warn); border: 1px solid #fed7aa; white-space: nowrap;
}
