* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-0: #07030f;
  --bg-1: #0f0720;
  --bg-2: #1a0b30;
  --neon-pink: #ff2e9a;
  --neon-purple: #a855f7;
  --neon-cyan: #22d3ee;
  --neon-yellow: #facc15;
  --neon-red: #ff4444;
  --text: #e6e0ff;
  --text-dim: #8a82b3;
  --panel: rgba(20, 10, 40, 0.72);
  --panel-border: rgba(168, 85, 247, 0.3);
  --card-bg: rgba(15, 7, 32, 0.6);
}

html { scroll-behavior: smooth; }

body {
  min-height: 100%;
  background: radial-gradient(ellipse at top, var(--bg-2) 0%, var(--bg-1) 45%, var(--bg-0) 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  position: relative;
}

/* ── 装饰层 ── */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 46, 154, 0.04) 0px,
    rgba(255, 46, 154, 0.04) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: overlay;
  z-index: 2;
}
.grid-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 25%, transparent 80%);
  z-index: 1;
}
.stars { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.star {
  position: absolute;
  width: 2px; height: 2px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 0 6px var(--neon-cyan), 0 0 12px var(--neon-purple);
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ── 模态框 ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 3, 15, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(6px);
}
.modal-box {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 32px 28px;
  width: min(420px, 92vw);
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.4);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.reply-modal-box { width: min(560px, 94vw); max-height: 85vh; overflow-y: auto; }
.modal-title {
  font-size: 16px;
  letter-spacing: 3px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan);
  font-weight: 700;
}
.modal-desc { font-size: 13px; color: var(--text-dim); }
.modal-input {
  width: 100%;
  background: rgba(7, 3, 15, 0.7);
  border: 1px solid rgba(168, 85, 247, 0.5);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.modal-input:focus {
  border-color: var(--neon-pink);
  box-shadow: 0 0 0 3px rgba(255, 46, 154, 0.15), 0 0 14px rgba(255, 46, 154, 0.25);
}
.modal-hint { font-size: 12px; min-height: 16px; color: var(--neon-pink); letter-spacing: 1px; }
.modal-btn {
  padding: 12px;
  border: 2px solid var(--neon-pink);
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.25), rgba(168, 85, 247, 0.2));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 14px rgba(255, 46, 154, 0.4);
}
.modal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px var(--neon-pink), 0 0 30px rgba(168, 85, 247, 0.5);
}
.modal-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── 顶部导航 ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(7, 3, 15, 0.88);
  border-bottom: 1px solid rgba(168, 85, 247, 0.25);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.topbar-left { flex-shrink: 0; }
.logo { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.logo-main {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 900;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple), var(--neon-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 46, 154, 0.4));
}
.logo-sub {
  font-size: 10px;
  letter-spacing: 5px;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px var(--neon-cyan);
}
.topbar-center { flex: 1; display: flex; justify-content: center; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 7, 32, 0.7);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 999px;
  padding: 6px 14px;
  width: min(360px, 100%);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within {
  border-color: var(--neon-pink);
  box-shadow: 0 0 12px rgba(255, 46, 154, 0.2);
}
.search-icon { font-size: 14px; flex-shrink: 0; }
.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
}
.search-box input::placeholder { color: var(--text-dim); }
.search-clear {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  flex-shrink: 0;
}
.search-clear:hover { color: var(--neon-pink); }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-info { display: flex; align-items: center; gap: 8px; }
.user-name { font-size: 13px; color: var(--neon-cyan); letter-spacing: 1px; }
.logout-btn, .login-btn {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.logout-btn {
  background: rgba(255, 68, 68, 0.15);
  border: 1px solid var(--neon-red);
  color: var(--neon-red);
}
.logout-btn:hover { background: rgba(255, 68, 68, 0.3); }
.login-btn {
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid var(--neon-pink);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 46, 154, 0.3);
}
.login-btn:hover { box-shadow: 0 0 18px var(--neon-pink); }

/* ── 弹幕区 ── */
.danmaku-stage {
  position: relative;
  z-index: 5;
  margin: 16px auto 0;
  width: min(1100px, 94vw);
  height: 160px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.08), rgba(34, 211, 238, 0.04));
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.25), inset 0 0 30px rgba(255, 46, 154, 0.08);
  overflow: hidden;
}
.stage-label {
  position: absolute;
  top: 8px; left: 14px;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--neon-pink);
  text-shadow: 0 0 6px var(--neon-pink);
}
.danmaku-layer { position: absolute; inset: 0; }
.danmaku {
  position: absolute;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15, 7, 32, 0.6);
  border: 1px solid currentColor;
  animation-name: danmaku-fly;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  will-change: transform;
  pointer-events: none;
  opacity: 0.95;
}
.danmaku.color-pink { color: var(--neon-pink); text-shadow: 0 0 8px var(--neon-pink); box-shadow: 0 0 10px rgba(255, 46, 154, 0.3); }
.danmaku.color-purple { color: var(--neon-purple); text-shadow: 0 0 8px var(--neon-purple); box-shadow: 0 0 10px rgba(168, 85, 247, 0.3); }
.danmaku.color-cyan { color: var(--neon-cyan); text-shadow: 0 0 8px var(--neon-cyan); box-shadow: 0 0 10px rgba(34, 211, 238, 0.3); }
.danmaku.color-yellow { color: var(--neon-yellow); text-shadow: 0 0 8px var(--neon-yellow); box-shadow: 0 0 10px rgba(250, 204, 21, 0.3); }
@keyframes danmaku-fly {
  from { transform: translateX(0); }
  to { transform: translateX(var(--fly-distance)); }
}

/* ── 主容器 ── */
.main-container {
  position: relative;
  z-index: 5;
  width: min(1200px, 96vw);
  margin: 20px auto 0;
  display: grid;
  grid-template-columns: 280px 1fr 260px;
  gap: 20px;
  align-items: start;
  padding: 0 4px 40px;
}
@media (max-width: 1024px) {
  .main-container { grid-template-columns: 1fr 260px; }
  .sidebar { display: none; }
}
@media (max-width: 768px) {
  .main-container { grid-template-columns: 1fr; }
  .leaderboard { display: none; }
}

/* ── 侧边栏（左侧）── */
.sidebar { display: flex; flex-direction: column; gap: 16px; }

.input-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.2);
  backdrop-filter: blur(8px);
}
.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(168, 85, 247, 0.25);
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.red { background: var(--neon-pink); box-shadow: 0 0 8px var(--neon-pink); }
.dot.yellow { background: var(--neon-yellow); box-shadow: 0 0 8px var(--neon-yellow); }
.dot.green { background: var(--neon-cyan); box-shadow: 0 0 8px var(--neon-cyan); }
.panel-title { margin-left: 6px; font-size: 11px; letter-spacing: 2px; color: var(--neon-purple); }
#rantInput {
  margin-top: 12px;
  width: 100%;
  min-height: 100px;
  background: rgba(7, 3, 15, 0.6);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
#rantInput:focus {
  border-color: var(--neon-pink);
  box-shadow: 0 0 0 3px rgba(255, 46, 154, 0.12), 0 0 14px rgba(255, 46, 154, 0.2);
}
#rantInput:disabled { opacity: 0.5; cursor: not-allowed; }
.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.counter { font-size: 12px; color: var(--text-dim); }
.submit-btn {
  padding: 9px 18px;
  border: 2px solid var(--neon-pink);
  background: linear-gradient(135deg, rgba(255, 46, 154, 0.2), rgba(168, 85, 247, 0.2));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 12px rgba(255, 46, 154, 0.4);
}
.submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 20px var(--neon-pink);
}
.submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.hint { margin-top: 8px; min-height: 16px; font-size: 12px; color: var(--neon-cyan); letter-spacing: 1px; }
.hint.error { color: var(--neon-pink); }

.login-required {
  background: var(--panel);
  border: 1px dashed rgba(168, 85, 247, 0.4);
  border-radius: 14px;
  padding: 24px;
}
.login-required-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.lr-icon { font-size: 32px; }
.login-required-inner p { font-size: 13px; color: var(--text-dim); }
.login-btn-sm {
  padding: 8px 20px;
  border: 1px solid var(--neon-purple);
  background: rgba(168, 85, 247, 0.15);
  color: var(--neon-purple);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.login-btn-sm:hover { background: rgba(168, 85, 247, 0.3); box-shadow: 0 0 12px rgba(168, 85, 247, 0.4); }

.category-section {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
}
.section-label {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px var(--neon-cyan);
  margin-bottom: 12px;
}
.category-list { display: flex; flex-direction: column; gap: 6px; }
.cat-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  background: rgba(15, 7, 32, 0.5);
}
.cat-tag:hover { border-color: currentColor; opacity: 0.9; }
.cat-tag.active { border-color: currentColor; box-shadow: 0 0 8px currentColor; background: rgba(15, 7, 32, 0.8); }
.cat-tag-icon { font-size: 14px; }
.cat-tag-name { flex: 1; }
.cat-tag-count { font-size: 11px; opacity: 0.6; }

/* ── 吐槽列表 ── */
.feed { display: flex; flex-direction: column; gap: 12px; }
.feed-header { display: flex; align-items: center; gap: 12px; }
.feed-title {
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px var(--neon-cyan);
}
.feed-count { font-size: 11px; color: var(--text-dim); }

.rant-list { display: flex; flex-direction: column; gap: 10px; }
.rant-card {
  background: var(--card-bg);
  border: 1px solid rgba(168, 85, 247, 0.22);
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  animation: card-in 0.3s ease;
}
.rant-card:hover {
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.15);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.rant-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.rant-author { font-size: 12px; color: var(--neon-pink); font-weight: 600; letter-spacing: 1px; }
.rant-time { font-size: 11px; color: var(--text-dim); }
.rant-cat {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
}
.rant-content { font-size: 14px; line-height: 1.8; margin-bottom: 12px; word-break: break-all; }
.rant-actions { display: flex; align-items: center; gap: 16px; padding-top: 10px; border-top: 1px dashed rgba(168, 85, 247, 0.15); }
.action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
  font-family: inherit;
  letter-spacing: 1px;
}
.action-btn:hover { background: rgba(168, 85, 247, 0.15); color: var(--text); }
.action-btn.liked { color: var(--neon-pink); }
.action-btn.liked .action-icon { text-shadow: 0 0 8px var(--neon-pink); }
.action-icon { font-size: 14px; }

.loading { text-align: center; padding: 40px; color: var(--text-dim); font-size: 13px; letter-spacing: 2px; }
.loading-sm { text-align: center; padding: 20px; color: var(--text-dim); font-size: 12px; letter-spacing: 2px; }

/* ── 榜单 ── */
.leaderboard {
  position: sticky;
  top: 70px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.leaderboard-list { display: flex; flex-direction: column; gap: 8px; }
.rank-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  padding: 12px;
  transition: border-color 0.2s;
}
.rank-card:hover { border-color: rgba(168, 85, 247, 0.5); }
.rank-card.rank-1 { border-color: rgba(250, 204, 21, 0.5); box-shadow: 0 0 16px rgba(250, 204, 21, 0.15); }
.rank-card.rank-2 { border-color: rgba(168, 85, 247, 0.4); }
.rank-card.rank-3 { border-color: rgba(255, 107, 107, 0.4); }
.rank-num {
  font-size: 18px;
  font-weight: 900;
  width: 24px;
  flex-shrink: 0;
  text-align: center;
  line-height: 1.2;
}
.rank-1 .rank-num { color: var(--neon-yellow); text-shadow: 0 0 10px var(--neon-yellow); }
.rank-2 .rank-num { color: var(--neon-purple); text-shadow: 0 0 8px var(--neon-purple); }
.rank-3 .rank-num { color: var(--neon-red); text-shadow: 0 0 8px var(--neon-red); }
.rank-default .rank-num { color: var(--text-dim); }
.rank-body { flex: 1; min-width: 0; }
.rank-content { font-size: 13px; line-height: 1.5; margin-bottom: 6px; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rank-meta { display: flex; gap: 10px; align-items: center; }
.rank-likes { font-size: 11px; color: var(--neon-pink); }
.rank-cat { font-size: 10px; padding: 1px 8px; border-radius: 999px; font-weight: 600; }

/* ── 回复弹窗 ── */
.reply-target {
  background: rgba(15, 7, 32, 0.7);
  border-left: 3px solid var(--neon-purple);
  padding: 10px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.reply-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; max-height: 200px; overflow-y: auto; }
.reply-item { display: flex; gap: 8px; align-items: flex-start; }
.reply-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--panel); border: 1px solid var(--panel-border); display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; }
.reply-body { flex: 1; min-width: 0; }
.reply-author { font-size: 11px; color: var(--neon-pink); font-weight: 600; margin-right: 6px; }
.reply-time { font-size: 10px; color: var(--text-dim); }
.reply-text { font-size: 13px; line-height: 1.5; word-break: break-all; }
#replyInput {
  width: 100%;
  min-height: 70px;
  background: rgba(7, 3, 15, 0.7);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
#replyInput:focus { border-color: var(--neon-pink); }
.reply-footer { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.reply-close-btn {
  padding: 8px 16px;
  background: none;
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: var(--text-dim);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.reply-close-btn:hover { border-color: var(--neon-purple); color: var(--text); }

/* ── 页脚 ── */
.site-footer { position: relative; z-index: 5; text-align: center; padding: 24px 16px; font-size: 11px; letter-spacing: 2px; color: var(--text-dim); }
