:root {
  --bg: #161823;
  --bg-2: #1e2030;
  --card: #23263a;
  --card-hover: #2a2e45;
  --text: #eef0f6;
  --text-dim: #9aa0b4;
  --accent: #fe2c55;      /* 抖音红 */
  --accent-soft: rgba(254, 44, 85, 0.14);
  --live: #ff4d4f;
  --dot: #fe2c55;
  --green: #25c26e;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 14px;
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(22, 24, 35, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; }
.brand-icon { font-size: 20px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-2);
  color: var(--text); font-size: 18px; cursor: pointer;
  display: grid; place-items: center; transition: transform .2s;
}
.icon-btn:active { transform: rotate(180deg); }

.chip {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--border); background: var(--bg-2);
  color: var(--text); font-size: 13px; cursor: pointer;
}
.login-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); }
.chip.logged-in .login-dot { background: var(--green); }

/* ---------- 主播列表 ---------- */
.view { flex: 1; overflow-y: auto; }

.streamer-list { padding: 12px 12px 0; }

.streamer {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 10px;
  cursor: pointer; transition: background .15s;
}
.streamer:active { background: var(--card-hover); }

.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; background: var(--bg-2);
}
.streamer-info { flex: 1; min-width: 0; }
.nickname { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

.badges { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.live-badge {
  background: var(--live); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dot); }
.dot.off { background: transparent; }

.del-btn {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: transparent; border: none; color: var(--text-dim);
  font-size: 13px; cursor: pointer; opacity: 0.55; line-height: 1;
}
.del-btn:active { color: var(--live); opacity: 1; }

/* ---------- 动态详情 ---------- */
.detail-body { margin-top: 4px; max-height: 62vh; overflow-y: auto; }
.event-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 4px; border-bottom: 1px solid var(--border);
}
.event-type { font-size: 12px; font-weight: 600; color: var(--accent); }
.event-desc { font-size: 14px; color: var(--text); line-height: 1.45; }
.event-time { font-size: 12px; color: var(--text-dim); }

.empty-state { text-align: center; padding: 60px 30px; color: var(--text-dim); }
.empty-emoji { font-size: 46px; margin-bottom: 12px; }
.empty-sub { font-size: 13px; margin-top: 8px; line-height: 1.6; }
.last-updated { text-align: center; color: var(--text-dim); font-size: 12px; padding: 14px 0 20px; }

/* ---------- 弹层 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 520px;
  background: var(--bg-2); border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
  animation: slideup .25s ease;
}
@keyframes slideup { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-tall { max-height: 82vh; display: flex; flex-direction: column; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h2 { font-size: 17px; }
.close-btn { background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; padding: 4px; }
.hint { color: var(--text-dim); font-size: 13px; margin: 4px 0 14px; }

input[type="text"] {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: 14px; outline: none;
}
input[type="text"]:focus { border-color: var(--accent); }

.primary-btn {
  width: 100%; height: 46px; margin-top: 12px; border: none; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.primary-btn:disabled { opacity: .5; }
.text-btn { background: none; border: none; color: var(--accent); font-size: 13px; cursor: pointer; }
.sheet-foot { margin-top: 16px; text-align: center; }

/* ---------- 登录二维码 ---------- */
.qr-box {
  width: 220px; height: 220px; margin: 8px auto 14px;
  background: #fff; border-radius: 12px; padding: 10px;
  display: grid; place-items: center; position: relative;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-placeholder { position: absolute; color: #666; font-size: 13px; }
.login-status { text-align: center; color: var(--text-dim); font-size: 13px; }

/* ---------- 关注列表（多选导入） ---------- */
.follow-list { flex: 1; overflow-y: auto; margin-top: 4px; }
.follow-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 6px; border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.follow-item .avatar { width: 40px; height: 40px; }
.follow-item .info { flex: 1; min-width: 0; }
.follow-item .nickname { font-size: 14px; }
.follow-check {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--text-dim); display: grid; place-items: center;
  color: transparent; font-size: 13px; line-height: 1; transition: all .15s;
}
.follow-item.selected .follow-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.follow-badge { font-size: 12px; color: var(--text-dim); flex-shrink: 0; }
.follow-item.is-monitored { cursor: default; opacity: .5; }
.follow-loading { text-align: center; color: var(--text-dim); padding: 30px; }
.follow-foot {
  display: flex; align-items: center; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.follow-count { flex: 1; font-size: 13px; color: var(--text-dim); }
.follow-import { flex: 1; margin-top: 0; height: 42px; }

/* ---------- 底部栏 ---------- */
.bottombar {
  display: flex; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.nav-btn {
  flex: 1; height: 46px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-2);
  color: var(--text); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.nav-btn .nav-icon { font-size: 16px; }
.nav-btn.primary { background: var(--accent); border-color: var(--accent); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.82); color: #fff; padding: 10px 18px;
  border-radius: 999px; font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60; max-width: 86%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
