/* ============================================
   Loopa 设计令牌 (Design Tokens)
   ============================================ */
:root {
  /* 色板:夜间集市感的深墨绿黑 + 暖金(币感) + 洋红(打赏高亮) */
  --ink-950: #0A1512;
  --ink-900: #101F1A;
  --ink-800: #172A23;
  --surface: #1D3129;
  --line: rgba(255,255,255,0.08);

  --gold: #F2A93B;
  --gold-dim: #B87F2A;
  --magenta: #E23FA0;

  --ink-text: #F4F1EA;
  --ink-text-dim: rgba(244,241,234,0.62);
  --ink-text-faint: rgba(244,241,234,0.38);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --font-display: 'Space Grotesk', 'PingFang SC', 'Noto Sans SC', sans-serif;
  --font-body: 'Inter', 'PingFang SC', 'Noto Sans SC', sans-serif;
}

@font-face {
  font-family: 'Space Grotesk';
  src: local('Space Grotesk');
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--ink-950);
  color: var(--ink-text);
  font-family: var(--font-body);
  overscroll-behavior: none;
}

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  overflow: hidden;
  background: var(--ink-950);
}

.hidden { display: none !important; }

/* ============================================
   登录页
   ============================================ */
.screen--login {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 0 28px 56px;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(242,169,59,0.16), transparent 60%),
    linear-gradient(180deg, var(--ink-900) 0%, var(--ink-950) 70%);
}

.login-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226,63,160,0.28), transparent 70%);
  filter: blur(10px);
}

.login-content { position: relative; z-index: 1; width: 100%; }

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--gold);
  margin-bottom: 28px;
}

.login-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  max-width: 20ch;
}

.login-sub {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-text-dim);
  margin: 0 0 32px;
  max-width: 34ch;
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: #17130A;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:focus-visible {
  outline: 2px solid var(--ink-text);
  outline-offset: 2px;
}

.pi-glyph {
  font-family: var(--font-display);
  font-size: 18px;
}

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

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

.btn-secondary {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 13px 18px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--ink-text);
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-secondary:active { background: rgba(255,255,255,0.09); }
.btn-secondary:focus-visible {
  outline: 2px solid var(--ink-text);
  outline-offset: 2px;
}

.alt-ic {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  width: 20px;
  text-align: center;
}

.phone-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--ink-text);
  font-size: 15px;
  margin-bottom: 14px;
}
.phone-input::placeholder { color: var(--ink-text-faint); }

.login-foot {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--ink-text-faint);
  text-align: center;
}

/* ============================================
   Feed 主界面
   ============================================ */
.screen--feed {
  position: relative;
  height: 100%;
}

.feed-list {
  height: calc(100% - 64px);
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}

.feed-card {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.feed-card__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.feed-card__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,21,18,0) 40%, rgba(10,21,18,0.92) 100%);
  z-index: 1;
}

.feed-card__body {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 88px 28px 18px;
}

.creator-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.creator-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  flex-shrink: 0;
}

.creator-name {
  font-weight: 600;
  font-size: 14.5px;
}

.follow-pill {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-950);
  background: var(--gold);
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
}

.feed-caption {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-text);
  margin: 0 0 4px;
}

.feed-sound {
  font-size: 12.5px;
  color: var(--ink-text-dim);
}

/* 右侧操作栏 */
.action-rail {
  position: absolute;
  right: 12px;
  bottom: 100px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.action-btn {
  background: none;
  border: none;
  color: var(--ink-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  cursor: pointer;
}

.action-btn__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}

.action-btn--tip .action-btn__icon {
  background: linear-gradient(135deg, var(--magenta), #B32E77);
}

/* 底部导航 */
.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background: var(--ink-900);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 4;
}

.nav-item {
  background: none;
  border: none;
  color: var(--ink-text-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  cursor: pointer;
}
.nav-item.is-active { color: var(--gold); }
.nav-ic { font-size: 20px; }

.nav-item--create .nav-ic {
  width: 40px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--magenta));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-950);
  font-size: 18px;
  font-weight: 700;
}

/* ============================================
   打赏弹层
   ============================================ */
.tip-sheet {
  position: absolute;
  inset: 0;
  z-index: 10;
}
.tip-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,21,18,0.6);
}
.tip-sheet__panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--ink-900);
  border-radius: 22px 22px 0 0;
  padding: 10px 20px 28px;
  border-top: 1px solid var(--line);
}
.tip-sheet__handle {
  width: 36px; height: 4px;
  background: var(--line);
  border-radius: 999px;
  margin: 6px auto 16px;
}
.tip-sheet__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
}
.tip-currency-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.currency-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-text-dim);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
}
.currency-btn.is-active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(242,169,59,0.08);
}
.tip-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.amount-chip {
  padding: 12px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--ink-text);
  font-weight: 600;
  cursor: pointer;
}
.amount-chip.is-active {
  border-color: var(--magenta);
  background: rgba(226,63,160,0.12);
  color: var(--magenta);
}
.btn-tip-confirm {
  background: linear-gradient(135deg, var(--magenta), #B32E77);
  color: var(--ink-text);
}
/* ============================================
   聊天入口悬浮按钮
   ============================================ */
.chat-fab {
  position: absolute;
  top: 16px;
  right: 14px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  color: var(--ink-text);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chat-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--magenta);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   聊天列表 / 聊天详情 通用界面
   ============================================ */
.screen--chat {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--ink-950);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.chat-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.chat-header-spacer { flex: 1; }
.chat-back {
  background: none;
  border: none;
  color: var(--ink-text);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.conversation-item:active { background: rgba(255,255,255,0.04); }

.conversation-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--magenta));
}

.conversation-meta { flex: 1; min-width: 0; }
.conversation-name {
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 3px;
}
.conversation-last {
  font-size: 13px;
  color: var(--ink-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--magenta);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.4;
}
.message-bubble--in {
  align-self: flex-start;
  background: var(--ink-800);
  border-bottom-left-radius: 4px;
}
.message-bubble--out {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #17130A;
  border-bottom-right-radius: 4px;
}

.message-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.message-input {
  flex: 1;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--ink-800);
  color: var(--ink-text);
  font-size: 14px;
}
.message-input::placeholder { color: var(--ink-text-faint); }
.send-btn {
  padding: 0 18px;
  border-radius: 999px;
  border: none;
  background: var(--gold);
  color: #17130A;
  font-weight: 600;
  cursor: pointer;
}
