:root {
  --bg-primary: #000000;
  --bg-secondary: #121212;
  --bg-card: #1A1A1A;
  --bg-elevated: #242424;
  --bg-input: rgba(255,255,255,0.08);

  --pink: #FE2C55;
  --pink-light: #FF6B8A;
  --pink-soft: rgba(254,44,85,0.12);
  --pink-glow: rgba(254,44,85,0.3);

  --cyan: #25F4EE;
  --cyan-soft: rgba(37,244,238,0.1);

  --gold: #FFD700;
  --gold-light: #FFE566;

  --text-primary: #FFFFFF;
  --text-secondary: rgba(255,255,255,0.65);
  --text-muted: rgba(255,255,255,0.4);

  --border: rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.12);

  --success: #00D26A;
  --danger: #FE2C55;
  --live-red: #FE2C55;

  --accent-orange: #FF9500;
  --accent-purple: #BF5AF2;
  --accent-teal: #25F4EE;
  --accent-pink: #FE2C55;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --font: -apple-system,'SF Pro Display','PingFang SC','Hiragino Sans GB','Microsoft YaHei',system-ui,sans-serif;
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-pink: 0 4px 20px var(--pink-glow);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { width:100%; max-width:100%; overflow-x:hidden; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
input, button, select, textarea { font: inherit; color: inherit; }
a { color: var(--pink); text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; background: none; border: none; }

.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.svg-icon svg { width: 100%; height: 100%; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
  width: 100%;
  padding-bottom: 68px;
}

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  height: 52px;
  display: flex; align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.topbar__back {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-primary);
}
.topbar__back:active { background: var(--bg-elevated); }
.topbar__title {
  flex: 1; text-align: center;
  font-size: 17px; font-weight: 600;
}
.topbar__right { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 28px;
  border-radius: var(--radius);
  font-size: 16px; font-weight: 700;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  cursor: pointer; border: none;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn--block { width: 100%; }
.btn--blue, .btn--gold {
  background: var(--pink);
  color: #FFFFFF;
  box-shadow: var(--shadow-pink);
}
.btn--blue:active, .btn--gold:active { opacity: .85; }
.btn--ghost {
  background: transparent;
  color: var(--pink);
  border: 1.5px solid rgba(254,44,85,0.4);
}
.btn--sm { height: 36px; padding: 0 16px; font-size: 13px; border-radius: var(--radius-sm); }
.btn--danger { background: var(--danger); color: #fff; }

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}

.field { display: block; margin-bottom: 20px; }
.field__label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.input {
  width: 100%; height: 50px;
  padding: 0 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-soft);
  background: rgba(255,255,255,0.05);
}
.input::placeholder { color: var(--text-muted); }

.msg {
  text-align: center; padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: 13px;
  display: none;
  font-weight: 500;
}
.msg-err { background: var(--pink-soft); color: var(--pink); display: block; }
.msg-ok { background: rgba(0,210,106,0.1); color: var(--success); display: block; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 480px; margin: 0 auto;
  height: 64px;
  background: rgba(18,18,18,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 2px 0 12px;
  z-index: 100;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  text-decoration: none;
  color: var(--text-muted);
  transition: color .2s;
}
.nav-item .nav-icon {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.nav-item .nav-icon .svg-icon { width: 26px; height: 26px; }
.nav-item .nav-label { font-size: 10px; font-weight: 500; }
.nav-item.active { color: #FFFFFF; }
.nav-item.center-btn { margin-top: 0; }
.nav-item.center-btn .nav-icon {
  width: 44px; height: 28px;
  background: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #000;
  position: relative;
}
.nav-item.center-btn .nav-icon .svg-icon { width: 20px; height: 20px; position: relative; z-index: 3; }
.nav-item.center-btn .nav-label { display: none; }

.badge-live {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  background: var(--live-red);
  color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 4px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.badge-live::before {
  content: ''; width: 6px; height: 6px;
  background: #fff; border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(0.7); } }

.badge-count {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.9);
  font-size: 11px; font-weight: 500;
  border-radius: 4px;
}
.badge-count .svg-icon { width: 14px; height: 14px; }

.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center; justify-content: center;
  padding: 24px;
}
.modal.show { display: flex; }
.modal__box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 320px;
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
  animation: modalUp .3s cubic-bezier(.4,0,.2,1);
}
.modal__title {
  font-size: 18px; font-weight: 600;
  text-align: center; margin-bottom: 12px;
}
.modal__body {
  font-size: 14px; color: var(--text-secondary);
  text-align: center; line-height: 1.7;
  margin-bottom: 20px;
}

@keyframes modalUp { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }

.fade-in { animation: fadeIn .35s ease both; }
.fade-up { animation: fadeUp .4s cubic-bezier(.4,0,.2,1) both; }

.empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty__icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  color: var(--text-muted);
  opacity: .25;
}
.empty__icon .svg-icon { width: 56px; height: 56px; }
.empty__text { font-size: 14px; }

.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid rgba(255,255,255,0.1);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.divider { height: 1px; background: var(--border); margin: 0; border: none; }

::-webkit-scrollbar { width: 0; height: 0; }
button, a, .nav-item, .card { touch-action: manipulation; }

.status-offline {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  font-size: 10px; font-weight: 600;
  border-radius: 4px;
}

.loading-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 0;
}

@media (min-width: 481px) and (max-width: 768px) {
  .app { box-shadow: 0 0 80px rgba(0,0,0,0.5); }
}

@media (min-width: 769px) {
  .app {
    max-width: 100%;
    padding-bottom: 0;
    padding-left: 200px;
  }
  .bottom-nav {
    position: fixed; left: 0; top: 0; bottom: 0; right: auto;
    width: 200px; max-width: 200px;
    height: 100vh;
    flex-direction: column;
    padding: 0;
    gap: 0;
    border-top: none;
    border-right: 1px solid rgba(255,255,255,0.06);
    background: #0a0a0a;
    justify-content: flex-start;
    overflow-y: auto;
  }
  .bottom-nav::before {
    content: '星耀直播';
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    padding: 20px 20px 28px;
    letter-spacing: -0.5px;
  }
  .nav-item {
    flex: 0;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 13px 20px;
    border-radius: 0;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
  }
  .nav-item:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.8); }
  .nav-item.active { background: rgba(254,44,85,0.06); color: #fff; border-left-color: var(--pink); }
  .nav-item .nav-label { font-size: 15px; font-weight: 600; display: block; }
  .nav-item .nav-icon { width: 22px; height: 22px; }
  .nav-item .nav-icon .svg-icon { width: 22px; height: 22px; }
  .nav-item.center-btn .nav-icon {
    width: 22px; height: 22px;
    background: none; border-radius: 0; color: inherit;
  }
  .nav-item.center-btn .nav-label { display: block; }
  .nav-item.center-btn .nav-label::after { content: '开播'; }

  .topbar { padding-left: 24px; padding-right: 24px; }
  .page-header { padding: 0 24px; }
}
