/* 站酷快乐体（ZCOOL KuaiLe）：自托管，避免 Google Fonts 被墙导致中文卡通字体不生效 */
@font-face {
  font-family: "ZCOOL KuaiLe";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ZCOOLKuaiLe.ttf") format("truetype");
}

:root {
  --bg0: #070518;
  --bg1: #0d0a2e;
  --glass: rgba(19, 16, 46, 0.6);
  --glass-2: rgba(32, 27, 68, 0.72);
  --border: rgba(150, 128, 255, 0.18);
  --accent: #8b6cff;
  --accent-2: #3fd0ff;
  --pink: #ff5c8a;
  --grad: linear-gradient(135deg, #ff5c8a 0%, #b44bff 60%, #7c5cff 100%);
  --text: #ece9ff;
  --muted: #9d97c7;
  --danger: #ff5c8a;
  --ok: #4be0a0;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "ZCOOL KuaiLe", "Comic Sans MS", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1000px 720px at 88% 8%, rgba(255, 92, 138, 0.14) 0%, transparent 55%),
    radial-gradient(1200px 800px at 72% -10%, #221350 0%, transparent 60%),
    radial-gradient(900px 700px at 8% 108%, #122052 0%, transparent 55%),
    linear-gradient(160deg, var(--bg1), var(--bg0));
  background-attachment: fixed;
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 导航（悬浮胶囊条） ---------- */
.nav {
  position: sticky;
  top: 10px;
  z-index: 20;
}
.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 8px 10px 8px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 18px;
  background: rgba(13, 10, 34, 0.72);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-icon { font-size: 21px; filter: drop-shadow(0 0 8px var(--accent)); }
.nav-links { display: flex; gap: 4px; margin-left: 4px; }
.nav-links a {
  color: var(--muted); font-size: 14px; position: relative;
  padding: 7px 14px; border-radius: 999px; transition: 0.15s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; background: rgba(139, 108, 255, 0.14); }
.nav-links a.active { color: #fff; background: var(--grad); box-shadow: 0 4px 14px rgba(180, 75, 255, 0.35); }
.nav-search { display: flex; align-items: center; gap: 6px; flex: 1; max-width: 300px; margin-left: auto; }
.nav-search input {
  flex: 1; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: rgba(8, 6, 24, 0.6); color: var(--text); font-size: 13px; font-family: inherit;
}
.nav-search input:focus { outline: none; border-color: var(--accent); }
.nav-search button {
  width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--grad); color: #fff; font-size: 13px; flex-shrink: 0;
}
.nav-user { display: flex; align-items: center; gap: 10px; }
/* 面包屑 */
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin: 14px 2px 4px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs .sep { opacity: 0.5; }
.nav-badge {
  position: absolute; top: -7px; right: -10px; min-width: 17px; height: 17px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #ff3b5c; color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  border-radius: 9px; box-shadow: 0 0 0 2px var(--bg, #0d0a1f);
}
.nav-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--border);
  background: var(--glass-2);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.15s;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: var(--grad); border: none; color: #fff; font-weight: 600; }
.btn.primary:hover { box-shadow: 0 6px 20px rgba(255, 92, 138, 0.4); }
.btn.danger { background: linear-gradient(135deg, #ff5c8a, #ff3b6b); border: none; color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

/* ---------- 布局 ---------- */
.app { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 26px 18px 60px; }
.foot { position: relative; z-index: 1; text-align: center; color: var(--muted); padding: 26px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.foot .copyright { font-size: 12px; opacity: 0.85; letter-spacing: 0.3px; }

.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* ---------- Hero 横幅 ---------- */
.hero-banner {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    radial-gradient(620px 340px at 82% 30%, rgba(255, 92, 138, 0.4) 0%, transparent 60%),
    radial-gradient(760px 420px at 65% 0%, rgba(139, 108, 255, 0.5) 0%, transparent 65%),
    linear-gradient(120deg, #0c0930 0%, #171048 45%, #2a1560 72%, #3a1a6b 100%);
  padding: 64px 46px 96px;
  margin: 16px 0 8px;
  box-shadow: var(--shadow);
}
.hero-banner .hb-body { position: relative; z-index: 3; max-width: 560px; }
.hero-banner .hb-title {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", "STSong", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 54px;
  line-height: 1.1;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 4px 26px rgba(124, 92, 255, 0.65);
}
.hero-banner .hb-sub { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.hero-banner .hb-desc { color: rgba(233, 231, 255, 0.78); font-size: 14px; line-height: 1.8; margin: 0 0 14px; }
.hero-banner .hb-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.hero-banner .hb-chips span {
  font-size: 12px; color: rgba(233, 231, 255, 0.85);
  padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
}
.hero-banner .actions { display: flex; gap: 12px; flex-wrap: wrap; }
/* 装饰：右侧带环行星 */
.hero-banner .hb-planet {
  position: absolute; right: 7%; top: 16%; width: 150px; height: 150px;
  border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 32% 30%, #cfd3ff 0%, #7f8cf0 32%, #4a4fb8 62%, #2a2c74 100%);
  box-shadow: 0 0 60px rgba(127, 140, 240, 0.55), inset -18px -14px 40px rgba(20, 16, 60, 0.55);
}
.hero-banner .hb-planet::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 230px; height: 74px; border-radius: 50%;
  border: 3px solid rgba(236, 220, 255, 0.55);
  border-top-color: rgba(236, 220, 255, 0.15);
  transform: translate(-50%, -50%) rotate(-18deg);
}
.hero-banner .hb-moon {
  position: absolute; left: 46%; top: 14%; width: 34px; height: 34px; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 35% 30%, #e8ecff, #6f7ce8 70%);
  box-shadow: 0 0 22px rgba(127, 140, 240, 0.7);
}
.hero-banner .hb-spark { position: absolute; z-index: 1; color: #ffe9a8; text-shadow: 0 0 12px rgba(255, 233, 168, 0.9); animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.5; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.15); } }
/* 装饰：底部山峦剪影 */
.hero-banner .hb-mountains {
  position: absolute; left: 0; right: 0; bottom: -2px; height: 110px; z-index: 2;
  background: #0a0725;
  clip-path: polygon(0 100%, 0 62%, 7% 38%, 14% 60%, 22% 30%, 30% 58%, 39% 24%, 47% 56%, 55% 34%, 63% 60%, 72% 40%, 80% 64%, 88% 44%, 95% 66%, 100% 52%, 100% 100%);
  opacity: 0.92;
}
.hero-banner .hb-glowline { position: absolute; left: 8%; right: 8%; bottom: 108px; height: 1px; z-index: 2; background: linear-gradient(90deg, transparent, rgba(120, 220, 180, 0.5), transparent); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 34px 0 16px; font-size: 19px; }
.section-title .st-ico {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 17px;
  background: rgba(255, 92, 138, 0.14); border: 1px solid rgba(255, 92, 138, 0.32);
}
.section-title .st-txt { font-weight: 700; }
.section-title .st-sub { color: var(--muted); font-size: 13px; font-weight: 400; }
.section-title .line { flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(255, 92, 138, 0.55), rgba(180, 75, 255, 0.22), transparent); }
.sh-more {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
  color: var(--text); background: var(--glass-2); border: 1px solid var(--border); transition: 0.15s;
}
.sh-more:hover { border-color: var(--pink); color: #fff; text-decoration: none; transform: translateX(2px); }

/* ---------- 星球网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.planet-card {
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--glass);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: 0.18s;
  display: flex;
  flex-direction: column;
}
.planet-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 14px 34px rgba(124, 92, 255, 0.22); }
.planet-card .pc-art {
  position: relative; height: 96px;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(140px 70px at 50% 118%, color-mix(in srgb, var(--pc, #7c5cff) 55%, transparent) 0%, transparent 75%),
    linear-gradient(180deg, rgba(124, 92, 255, 0.16), rgba(10, 8, 30, 0.4));
  border-bottom: 1px solid rgba(150, 128, 255, 0.12);
}
.planet-card .pc-orb {
  font-size: 40px; line-height: 1;
  filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--pc, #7c5cff) 60%, transparent));
  transform: translateY(6px);
}
.planet-card .pc-go {
  position: absolute; right: 10px; bottom: -14px; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-2); border: 1px solid var(--border); color: var(--muted); font-size: 14px;
  transition: 0.15s;
}
.planet-card:hover .pc-go { background: var(--grad); color: #fff; border-color: transparent; }
.planet-card .pc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.planet-card .pc-head { display: flex; align-items: center; gap: 12px; }
.planet-card .pc-name { font-size: 16px; font-weight: 700; }
.planet-card .pc-desc {
  color: var(--muted); font-size: 13px; min-height: 38px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.planet-card .pc-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; margin-top: auto; }
.planet-card .glow { position: absolute; top: -40px; right: -40px; width: 120px; height: 120px; border-radius: 50%; filter: blur(28px); opacity: 0.55; pointer-events: none; }
.badge-private { background: rgba(255,92,138,0.18); color: var(--danger); padding: 2px 8px; border-radius: 20px; font-size: 11px; }

/* ---------- 排行榜卡片 ---------- */
.lb-card {
  padding: 18px 14px; text-align: center; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--glass); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  position: relative; transition: 0.18s; text-decoration: none; color: var(--text);
}
.lb-card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.lb-card .lb-rank { position: absolute; top: 10px; right: 12px; font-size: 18px; }
.lb-card .lb-name { font-weight: 700; font-size: 15px; }
.lb-card.top1 .lb-name { color: #c9b6ff; text-shadow: 0 0 14px rgba(180, 120, 255, 0.8); }
.lb-card .lb-pts { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #ffd76a; }
.lb-card .lb-role {
  font-size: 11px; padding: 3px 12px; border-radius: 999px; color: #e6ddff;
  background: linear-gradient(135deg, rgba(139, 108, 255, 0.35), rgba(255, 92, 138, 0.3));
  border: 1px solid rgba(180, 120, 255, 0.4);
}

/* ---------- 文章卡片 ---------- */
.article-card {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--glass);
  cursor: pointer;
  transition: 0.15s;
  margin-bottom: 12px;
}
.article-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(124, 92, 255, 0.16); }
.article-card h3 { margin: 0 0 6px; font-size: 17px; }
.article-card h3:hover { color: #fff; }
.article-card .excerpt { color: var(--muted); font-size: 13px; line-height: 1.5; }
.article-card .meta { display: flex; gap: 12px; color: var(--muted); font-size: 12px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12px; }

/* ---------- 头像 ---------- */
.avatar { border-radius: 50%; object-fit: cover; background: #2a2350; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.avatar.md { width: 46px; height: 46px; font-size: 18px; }
.avatar.lg { width: 88px; height: 88px; font-size: 32px; }

/* ---------- 用户菜单 ---------- */
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 30px; border: 1px solid var(--border); background: var(--glass-2); }
.dropdown { position: absolute; right: 0; top: 46px; min-width: 180px; background: var(--glass-2); border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); display: none; z-index: 30; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; background: none; border: none; color: var(--text); cursor: pointer; font-size: 14px; }
.dropdown a:hover, .dropdown button:hover { background: rgba(139,108,255,0.2); }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(3, 1, 12, 0.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-mask[hidden] { display: none; }
/* 全局兜底：hidden 属性必须生效，防止显式 display 盖掉 display:none（表单/徽标等） */
[hidden] { display: none !important; }
.modal { width: 100%; max-width: 440px; padding: 22px; position: relative; max-height: 90vh; overflow: auto; }
.modal.lg { max-width: 1120px; }
.modal.small { max-width: 340px; }
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.modal h3 { margin: 0 0 16px; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab { flex: 1; padding: 10px; background: var(--glass-2); border: 1px solid var(--border); border-radius: 10px; color: var(--muted); cursor: pointer; }
.tab.active { background: var(--grad); color: #fff; border: none; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form input, .form select, .form textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(10, 8, 28, 0.7);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.form .row.end { justify-content: flex-end; }
.form label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.form label.checkbox { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
.form label.full { width: 100%; }
.hint { color: var(--muted); font-size: 12px; text-align: center; }
.switch-hint { margin-top: 14px; font-size: 13px; }
.switch-hint a { color: var(--accent-2); cursor: pointer; }

/* ---------- 星球图标选择器 ---------- */
.icon-picker { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: rgba(10, 8, 28, 0.5); }
.icon-opt { width: 34px; height: 34px; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--glass-2); cursor: pointer; transition: transform .08s ease, border-color .12s ease, box-shadow .12s ease; }
.icon-opt:hover { transform: translateY(-1px); border-color: var(--accent); }
.icon-opt.selected { border-color: var(--accent); background: var(--grad); box-shadow: 0 0 0 2px rgba(124, 92, 255, .35); }

/* ---------- 好友聊天 ---------- */
.chat-view { display: flex; flex-direction: column; gap: 14px; height: calc(100vh - 195px); min-height: 540px; }
.chat-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.chat-tab {
  flex: 1; min-width: 120px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--glass); color: var(--text); cursor: pointer; font-size: 14px; transition: 0.15s; position: relative;
}
.chat-tab:hover { border-color: var(--accent); }
.chat-tab.active { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; }

.chat-layout { display: grid; grid-template-columns: 320px 1fr; gap: 14px; flex: 1; min-height: 0; }
.chat-sidebar { padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.chat-main { padding: 0; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

.chat-sidebar-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 15px; }
.chat-sidebar-head small { color: var(--muted); font-weight: 400; }
.chat-head-actions { display: flex; gap: 6px; }
.chat-head-actions .btn.icon { padding: 4px 8px; font-size: 13px; }
.chat-search {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(10, 8, 28, 0.7); color: var(--text); font-size: 13px;
}
.chat-search:focus { outline: none; border-color: var(--accent); }

.chat-list { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.chat-friend {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer; transition: 0.12s; position: relative;
}
.chat-friend:hover { background: rgba(139, 108, 255, 0.12); border-color: var(--border); }
.chat-friend.active { background: rgba(139, 108, 255, 0.22); border-color: var(--accent); }
.chat-friend-info { flex: 1; min-width: 0; }
.chat-friend-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.chat-friend-meta { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px rgba(75, 224, 160, 0.25); }
.tab-badge, .friend-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #ff3b5c; color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  border-radius: 9px; box-shadow: 0 0 0 2px var(--glass);
}
.tab-badge { position: absolute; top: 4px; right: 8px; }
.friend-badge { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); }

/* 数量为 0 时 JS 会设置 hidden 属性；显式 display 会盖掉 hidden 的 display:none，这里补回 */
.nav-badge[hidden], .tab-badge[hidden], .friend-badge[hidden] { display: none !important; }

.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); gap: 10px; }
.chat-empty.small { padding: 24px 0; }
.chat-empty-icon { font-size: 52px; opacity: 0.55; }
.chat-empty-title { font-size: 16px; color: var(--text); font-weight: 600; }
.chat-empty-sub { font-size: 13px; }

.chat-main-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.chat-header-user { display: flex; align-items: center; gap: 10px; }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 80%; }
.chat-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-bubble {
  background: var(--glass-2); border: 1px solid var(--border); border-radius: 14px; border-bottom-left-radius: 4px;
  padding: 10px 13px; min-width: 60px;
}
.chat-msg.me .chat-msg-bubble { background: linear-gradient(135deg, rgba(75, 224, 160, 0.22), rgba(75, 224, 160, 0.08)); border-color: rgba(75, 224, 160, 0.35); border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.chat-msg-sender { font-size: 11px; color: var(--accent-2); margin-bottom: 3px; }
.chat-msg-content { font-size: 14px; line-height: 1.5; word-break: break-word; }
.chat-msg-time { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: right; }
.chat-msg-img { max-width: 240px; max-height: 220px; border-radius: 10px; cursor: pointer; display: block; }
.chat-msg-bubble.image { background: transparent !important; border: none !important; padding: 0; }

.chat-inputbar { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; flex-shrink: 0; position: relative; }
.chat-tool { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--glass-2); cursor: pointer; font-size: 17px; display: flex; align-items: center; justify-content: center; transition: 0.12s; }
.chat-tool:hover { border-color: var(--accent); background: rgba(139, 108, 255, 0.2); }
.chat-input { flex: 1; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(10, 8, 28, 0.7); color: var(--text); font-size: 14px; }
.chat-input:focus { outline: none; border-color: var(--accent); }

.emoji-panel { position: absolute; left: 16px; bottom: 64px; width: 280px; max-height: 220px; overflow-y: auto; background: var(--glass-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px; display: flex; flex-wrap: wrap; gap: 4px; z-index: 10; }
.emoji-btn { width: 28px; height: 28px; border: none; background: transparent; font-size: 17px; cursor: pointer; border-radius: 6px; }
.emoji-btn:hover { background: rgba(139, 108, 255, 0.25); }

.chat-msg-red {
  display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  border-radius: 12px; padding: 10px 14px; min-width: 180px; cursor: pointer; color: #fff; box-shadow: 0 4px 14px rgba(255, 107, 107, 0.25); transition: 0.12s;
}
.chat-msg-red:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255, 107, 107, 0.35); }
.chat-red-icon { font-size: 34px; }
.chat-red-title { font-weight: 600; font-size: 14px; }
.chat-red-sub { font-size: 12px; opacity: 0.9; margin-top: 2px; }

.red-detail-head { text-align: center;  padding: 6px 0 16px; border-bottom: 1px dashed var(--border); }
.red-detail-icon { font-size: 56px; margin-bottom: 4px; }
.red-detail-from { font-size: 15px; font-weight: 600; }
.red-detail-msg { color: var(--muted); font-size: 13px; margin-top: 4px; }
.red-detail-status { text-align: center; padding: 14px 0; }
.red-detail-amount { font-size: 30px; color: var(--ok); font-weight: 700; }
.red-detail-amount small { font-size: 14px; color: var(--muted); }
.red-detail-count { color: var(--muted); font-size: 12px; margin-top: 4px; }
.red-detail-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.red-claim-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,0.04); }
.red-claim-amount { margin-left: auto; font-weight: 700; color: var(--ok); }

.chat-requests { display: flex; flex-direction: column; height: 100%; }
.chat-request-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-request { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,0.03); }
.chat-request-actions { display: flex; gap: 6px; margin-left: auto; }

.chat-record-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-record-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.03); }
.chat-record-ic { font-size: 28px; }
.chat-record-info { flex: 1; }
.chat-record-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.chat-record-amount { font-weight: 700; color: var(--ok); font-size: 16px; }

@media (max-width: 860px) {
  .chat-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .chat-sidebar { max-height: 220px; }
}

/* ---------- 编辑器 ---------- */
.editor-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.editor-bar .hint { font-size: 12px; color: var(--muted); }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 420px; }
.editor-pane { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.editor-head { padding: 7px 12px; background: var(--glass-2); font-size: 12px; color: var(--muted); }
.editor textarea { border: none; border-radius: 0; min-height: 420px; resize: vertical; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; line-height: 1.6; flex: 1; }
.md-preview { padding: 12px 14px; min-height: 420px; overflow: auto; font-size: 14px; flex: 1; }

/* ---------- 文章详情 ---------- */
.article-layout { display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
.article-view { min-width: 0; padding: 22px 26px; }
.article-view .a-head { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin-bottom: 8px; flex-wrap: wrap; }
.article-view h1 { margin: 6px 0 14px; }
.article-actions { display: flex; gap: 8px; margin: 18px 0; }
/* 右侧活动栏 */
.a-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; }
.a-side .card { padding: 16px; }
.a-side h4 { margin: 0 0 12px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.a-side .as-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px; font-size: 13px; color: var(--muted); }
.a-side .as-row b { color: var(--text); }
.a-side .as-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.a-side .as-btns .btn { width: 100%; }
.a-side .as-author { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); }
.a-side .as-author .aa-info { display: flex; flex-direction: column; min-width: 0; }
.a-side .as-author .aa-name { font-weight: 700; font-size: 14px; color: var(--text); }
.a-side .as-author .aa-sub { font-size: 12px; color: var(--muted); }
@media (max-width: 960px) { .article-layout { grid-template-columns: 1fr; } .a-side { position: static; } }

/* ---------- 管理后台 ---------- */
.admin-grid { display: grid; gap: 18px; }
.panel { padding: 18px; }
.panel h3 { margin: 0 0 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; }
.role-tag { padding: 2px 8px; border-radius: 6px; font-size: 11px; }
.role-super_admin { background: rgba(63,208,255,0.2); color: var(--accent-2); }
.role-admin { background: rgba(139,108,255,0.25); color: var(--accent); }
.role-user { background: rgba(255,255,255,0.08); color: var(--muted); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--glass-2); border: 1px solid var(--border); padding: 12px 20px; border-radius: 30px; z-index: 80; box-shadow: var(--shadow); }
.toast.err { border-color: var(--danger); color: #ffd0dd; }
.toast.ok { border-color: var(--ok); color: #c8ffe9; }

.empty { text-align: center; color: var(--muted); padding: 40px; }

/* ---------- 顶部加载进度条 ---------- */
.top-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 100;
  background: var(--grad); transform-origin: 0 50%;
  transform: scaleX(0); opacity: 0;
  transition: transform .25s ease-out, opacity .3s ease;
  box-shadow: 0 0 10px rgba(180, 75, 255, 0.6);
}
.top-progress.on { opacity: 1; animation: tp-run 1.1s ease-in-out forwards; }
@keyframes tp-run {
  0% { transform: scaleX(0); }
  60% { transform: scaleX(0.7); }
  100% { transform: scaleX(0.92); }
}
.top-progress.done { transform: scaleX(1); opacity: 0; transition: transform .3s ease, opacity .5s ease .1s; }

/* ---------- 骨架屏 ---------- */
@keyframes sk-shimmer {
  0% { background-position: -420px 0; }
  100% { background-position: 420px 0; }
}
.sk {
  background: linear-gradient(90deg,
    rgba(124, 92, 255, 0.10) 22%,
    rgba(180, 120, 255, 0.22) 38%,
    rgba(255, 92, 138, 0.16) 52%,
    rgba(124, 92, 255, 0.10) 68%);
  background-size: 420px 100%;
  animation: sk-shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}
.sk-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--glass); overflow: hidden; }
.sk-art { height: 96px; border-radius: 0; }
.sk-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.sk-line { height: 12px; }
.sk-row {
  display: flex; gap: 14px; padding: 16px 18px; margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--glass); align-items: flex-start;
}
.sk-row .sk-thumb { width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0; }
.sk-row .sk-main { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.sk-lb {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--glass);
  padding: 18px 14px 22px; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.sk-avatar { width: 88px; height: 88px; border-radius: 50%; }
.sk-page { display: flex; flex-direction: column; gap: 14px; }
.sk-tr { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 2fr; gap: 10px; align-items: center; padding: 4px 0; }
@media (max-width: 720px) { .sk-tr { grid-template-columns: 2fr 1fr 1fr; } .sk-tr > :nth-child(n+4) { display: none; } }
.split { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.split > * { flex: 1; min-width: 280px; }

/* ---------- 评论 ---------- */
.comments { padding: 18px; margin-top: 18px; }
.comments > .section-title { margin-top: 0; }
.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: none; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.comment .c-name { color: var(--text); font-weight: 600; }
.comment .c-time { margin-left: auto; }
.comment .c-text { color: var(--text); font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.comment-del { background: none; border: none; cursor: pointer; font-size: 14px; opacity: 0.5; align-self: flex-start; transition: 0.15s; }
.comment-del:hover { opacity: 1; }
.comment-login { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
#commentInput { min-height: 70px; resize: vertical; font-family: inherit; }
.c-actions { margin-top: 6px; }
.comment-reply { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--accent-2); opacity: 0.85; padding: 0; }
.comment-reply:hover { opacity: 1; text-decoration: underline; }
.replies { margin-top: 8px; padding-left: 16px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.comment.reply { border-bottom: none; padding: 8px 0; }
.comment.reply:last-child { padding-bottom: 0; }
.reply-to { color: var(--muted); font-size: 13px; margin-right: 4px; }
.reply-to b { color: var(--accent-2); font-weight: 600; }
.reply-form { margin-top: 8px; }
.reply-form textarea { min-height: 46px; resize: vertical; font-family: inherit; font-size: 13px; }
.empty.small { padding: 18px; font-size: 13px; }

/* ---------- 危险操作区 ---------- */
.danger-zone {
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.danger-zone .dz-title { font-size: 13px; font-weight: 700; color: var(--danger); }
.danger-zone .dz-desc { font-size: 12px; color: var(--muted); line-height: 1.6; }
.warn-note {
  margin: -6px 0 14px; padding: 10px 12px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.6; color: #ffd0dd;
  background: rgba(255, 92, 138, 0.12); border: 1px solid rgba(255, 92, 138, 0.32);
}

/* ---------- 写文章页 ---------- */
.write-page { display: flex; flex-direction: column; gap: 10px; }
.wp-label { font-size: 14px; font-weight: 700; margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.wp-planets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.wp-planet {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px 12px; border-radius: 12px; cursor: pointer; text-align: center;
  border: 1px solid var(--border); background: var(--glass); transition: 0.15s;
  font-size: 13px; line-height: 1.4;
}
.wp-planet:hover { border-color: var(--accent); transform: translateY(-2px); }
.wp-planet.selected {
  border-color: var(--pink); background: rgba(255, 92, 138, 0.10);
  box-shadow: 0 0 0 1px var(--pink), 0 6px 18px rgba(255, 92, 138, 0.16);
}
.wp-planet .wp-ico { font-size: 26px; }
.wp-planet .wp-name { font-weight: 600; color: var(--text); }
.wp-planet .badge-private { position: absolute; top: 6px; right: 6px; }
.wp-title {
  width: 100%; padding: 13px 16px; font-size: 17px; font-weight: 600;
  border-radius: 12px; border: 1px solid var(--border);
  background: rgba(10, 8, 28, 0.7); color: var(--text); font-family: inherit;
}
.wp-title:focus { outline: none; border-color: var(--accent); }
.wp-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--glass-2);
}
.wp-toolbar button, .wp-toolbar select {
  padding: 6px 10px; font-size: 13px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: rgba(10, 8, 28, 0.55);
  color: var(--text); font-family: inherit;
}
.wp-toolbar button:hover { border-color: var(--accent); background: rgba(139, 108, 255, 0.18); }
.wp-toolbar .wp-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

/* ---------- 小黑屋 ---------- */
.br-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.br-card { padding: 16px 18px; }
.br-top { display: flex; align-items: center; gap: 10px; }
.br-who { flex: 1; min-width: 0; }
.br-name { font-weight: 600; font-size: 14.5px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.br-un { font-size: 12px; font-weight: 400; color: var(--muted); }
.br-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.br-tag {
  flex: 0 0 auto; padding: 3px 10px; border-radius: 20px; font-size: 11.5px;
  background: rgba(124, 92, 255, 0.18); color: var(--accent-2); border: 1px solid rgba(124, 92, 255, 0.35);
}
.br-tag.perm { background: rgba(255, 92, 138, 0.16); color: var(--danger); border-color: rgba(255, 92, 138, 0.35); }
.br-row { display: flex; gap: 10px; margin-top: 10px; font-size: 13px; line-height: 1.6; }
.br-k { flex: 0 0 42px; color: var(--muted); }
.br-v { flex: 1; color: var(--text); word-break: break-word; }
.ban-form { display: flex; gap: 8px; flex-wrap: wrap; }
.ban-form select, .ban-form input {
  flex: 1 1 120px; min-width: 110px; padding: 8px 10px; border-radius: 8px; font-size: 13px;
  border: 1px solid var(--border); background: rgba(10, 8, 28, 0.7); color: var(--text); font-family: inherit;
}
.ban-dur { display: flex; gap: 6px; flex: 0 0 auto; }
.ban-dur input { flex: 0 0 76px; width: 76px; min-width: 0; }
.ban-dur select { flex: 0 0 84px; width: 84px; min-width: 0; }
.ban-form .btn { flex: 0 0 auto; }
.ban-hint { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ---------- 个人主页 ---------- */
.user-page { max-width: 820px; margin: 0 auto; }
.user-header { text-align: center; padding: 26px; margin-top: 14px; }
.author-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.author-link:hover { text-decoration: none; color: var(--accent-2); }
.author-card-link:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ---------- Markdown 渲染 ---------- */
.markdown-body { line-height: 1.75; font-size: 15px; color: var(--text); word-wrap: break-word; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1.1em 0 0.5em; line-height: 1.3; }
.markdown-body h1 { font-size: 1.7em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.4em; }
.markdown-body h3 { font-size: 1.15em; }
.markdown-body p { margin: 0.6em 0; }
.markdown-body a { color: var(--accent-2); }
.markdown-body code {
  background: rgba(139,108,255,0.18); padding: 2px 6px; border-radius: 6px;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.88em;
}
.markdown-body pre {
  background: rgba(8,6,24,0.8); border: 1px solid var(--border);
  padding: 14px 16px; border-radius: 10px; overflow: auto; margin: 0.8em 0;
}
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote {
  border-left: 3px solid var(--accent); margin: 0.8em 0; padding: 4px 14px;
  color: var(--muted); background: rgba(139,108,255,0.08); border-radius: 0 8px 8px 0;
}
.markdown-body ul, .markdown-body ol { padding-left: 1.4em; margin: 0.6em 0; }
.markdown-body img { max-width: 100%; border-radius: 10px; margin: 0.5em 0; }
.markdown-body table { border-collapse: collapse; width: 100%; margin: 0.8em 0; font-size: 0.9em; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.markdown-body th { background: rgba(139,108,255,0.15); }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 1.2em 0; }

@media (max-width: 720px) {
  .editor { grid-template-columns: 1fr; }
  .nav-inner { flex-wrap: wrap; row-gap: 8px; }
  .nav-search { display: none; }
  .nav-links a { padding: 6px 10px; font-size: 13px; }
  .hero-banner { padding: 40px 22px 72px; }
  .hero-banner .hb-title { font-size: 34px; }
  .hero-banner .hb-planet { width: 90px; height: 90px; right: 4%; top: 8%; opacity: 0.8; }
  .hero-banner .hb-planet::after { width: 140px; height: 46px; }
  .hero-banner .hb-moon { display: none; }
}
