/* =========================================================
   星聚汇 · star-gather
   深色渐变 + 玻璃拟态 + 粉紫活泼渐变 · 移动端优先
   ========================================================= */
:root {
  --bg: #0b0716;
  --bg-2: #150f2c;
  --card: rgba(255, 255, 255, .055);
  --border: rgba(255, 255, 255, .10);
  --text: #f6f2ff;
  --text-dim: #bfb3dd;
  --text-faint: #8a7fa8;
  --pink: #ff5c9d;
  --purple: #a855f7;
  --indigo: #6d5ef2;
  --grad: linear-gradient(120deg, #ff6ec7, #a855f7 55%, #6d5ef2);
  --grad-soft: linear-gradient(120deg, rgba(255, 110, 199, .18), rgba(168, 85, 247, .18));
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px rgba(3, 1, 12, .55);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(168, 85, 247, .20), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(255, 92, 157, .14), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2) 55%, var(--bg));
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(255, 110, 199, .35); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, .35); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(168, 85, 247, .55); }

/* ---------- 背景光斑 ---------- */
.bg-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; animation: float 18s ease-in-out infinite; }
.orb-1 { width: 420px; height: 420px; background: #7c3aed; top: -140px; right: -100px; }
.orb-2 { width: 360px; height: 360px; background: #e11d74; bottom: -120px; left: -80px; animation-delay: -6s; }
.orb-3 { width: 280px; height: 280px; background: #4f46e5; top: 40%; left: 55%; opacity: .35; animation-delay: -11s; }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, -30px); } }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 7, 22, .72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px; height: 64px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 19px; letter-spacing: .5px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; box-shadow: 0 4px 14px rgba(255, 92, 157, .4);
}
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-link {
  color: var(--text-dim); text-decoration: none; padding: 8px 14px;
  border-radius: 999px; font-size: 14.5px; font-weight: 600; transition: all .2s ease;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.nav-link.active { color: #fff; background: var(--grad); box-shadow: 0 6px 16px rgba(168, 85, 247, .35); }
.nav-create { margin-left: 8px; }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px; margin-left: auto;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .3s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 视图 ---------- */
.app { min-height: calc(100vh - 64px); }
.view { max-width: 1200px; margin: 0 auto; padding: 0 16px 64px; animation: viewIn .4s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 999px; padding: 11px 20px;
  font: inherit; font-weight: 600; cursor: pointer; color: #fff;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--grad); box-shadow: 0 8px 24px rgba(168, 85, 247, .35); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 30px rgba(255, 92, 157, .45); transform: translateY(-1px); }
.btn-ghost { background: rgba(255, 255, 255, .08); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.btn-leave { background: rgba(255, 255, 255, .10); border: 1px solid var(--border); }
.btn-leave:hover { background: rgba(255, 92, 157, .25); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 54px 8px 26px; max-width: 760px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; padding: 6px 16px; border-radius: 999px;
  background: var(--grad-soft); border: 1px solid rgba(255, 110, 199, .3);
  color: #ffd7ec; font-size: 13px; letter-spacing: .5px;
}
.hero h1 { font-size: clamp(34px, 7vw, 60px); font-weight: 800; letter-spacing: -1px; margin: 18px 0 12px; line-height: 1.15; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-dim); font-size: clamp(15px, 2.5vw, 18px); }
.hero-stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.hero-stats span {
  background: var(--card); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; color: var(--text-dim);
}
.hero-stats b { color: var(--text); font-size: 18px; margin-right: 4px; }

/* ---------- 筛选栏 ---------- */
.filter-card { margin: 6px auto 30px; max-width: 960px; padding: 16px; }
.filter-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 12px; align-items: center; }

/* ---------- 表单控件 ---------- */
input, select, textarea {
  width: 100%; background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; color: var(--text); font: inherit; outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--purple); box-shadow: 0 0 0 3px rgba(168, 85, 247, .22);
  background: rgba(255, 255, 255, .09);
}
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23bfb3dd' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; padding-right: 34px;
}
option { background: #1d1537; color: #fff; }
textarea { resize: vertical; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- 列表头 ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.list-head h2 { font-size: 20px; }
.count-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--grad-soft); color: #ffd7ec; font-size: 12px; font-weight: 600; vertical-align: middle;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.event-card {
  position: relative; cursor: pointer; overflow: hidden;
  padding: 18px; display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.event-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: rgba(255, 110, 199, .35); }
.event-card:active { transform: translateY(-2px) scale(.995); }
.card-glow {
  position: absolute; left: -30%; right: -30%; bottom: -60%; height: 60%;
  background: var(--grad); filter: blur(60px); opacity: .18; pointer-events: none;
}
.card-top { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--border); color: var(--text-dim);
}
.chip-idol { background: rgba(255, 110, 199, .14); border-color: rgba(255, 110, 199, .3); color: #ffb3d6; }
.chip-city { background: rgba(168, 85, 247, .14); border-color: rgba(168, 85, 247, .3); color: #d4b5ff; }
.chip-full, .chip-past { background: rgba(255, 255, 255, .08); color: var(--text-faint); }
.card-title { font-size: 18px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; }
.card-when { font-size: 14px; color: var(--text-dim); margin-bottom: 6px; }
.card-place { font-size: 14px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 10px; }
.card-desc {
  font-size: 13.5px; color: var(--text-faint); margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.count { font-size: 12.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .6s ease; }
.card-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.card-status { font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.card-status.open { color: #9ef0c1; background: rgba(52, 211, 153, .12); }
.card-status.joined { color: #ffb3d6; background: rgba(255, 92, 157, .14); }
.card-status.full, .card-status.past { color: var(--text-faint); background: rgba(255, 255, 255, .06); }

/* ---------- 头像 ---------- */
.avatars { display: flex; align-items: center; }
.avatars .avatar { margin-left: -8px; }
.avatars .avatar:first-child { margin-left: 0; }
.avatar {
  --h: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, hsl(var(--h), 85%, 62%), hsl(calc(var(--h) + 60), 78%, 52%));
  border: 2px solid rgba(255, 255, 255, .18); flex: none;
}
.avatar-lg { width: 76px; height: 76px; font-size: 30px; border-width: 3px; }
.avatar.more { background: rgba(255, 255, 255, .14); color: var(--text-dim); font-size: 11px; }
.muted { font-size: 12.5px; color: var(--text-faint); }

/* ---------- 空状态 ---------- */
.empty {
  grid-column: 1 / -1; text-align: center; padding: 60px 20px;
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-ic { font-size: 48px; margin-bottom: 10px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--text-dim); margin-bottom: 18px; }

/* ---------- 活动详情 ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-dim); text-decoration: none; font-size: 14px; margin: 18px 0; transition: color .2s ease;
}
.back-link:hover { color: var(--pink); }
.detail-card { max-width: 860px; margin: 0 auto; padding: 30px; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.detail-head h1 { font-size: clamp(24px, 5vw, 34px); line-height: 1.3; margin-bottom: 12px; }
.detail-desc { color: var(--text-dim); font-size: 15px; }
.detail-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 22px 0; }
.info-item { display: flex; gap: 12px; align-items: flex-start; background: rgba(255, 255, 255, .05); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.info-ic { font-size: 20px; line-height: 1.4; }
.info-item b { display: block; font-size: 14.5px; word-break: break-word; }
.info-item small { color: var(--text-faint); }
.btn-map { width: 100%; margin-bottom: 20px; }
.join-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--grad-soft); margin-bottom: 26px;
}
.join-btn { flex: 1; min-width: 160px; }

/* ---------- 评论区 ---------- */
.comments h3 { margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.comment-list { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; max-height: 380px; overflow: auto; padding-right: 4px; }
.comment { display: flex; gap: 12px; }
.comment-body { flex: 1; background: rgba(255, 255, 255, .05); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.comment-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.comment-meta b { font-size: 13.5px; }
.comment-meta time { font-size: 12px; color: var(--text-faint); }
.comment-body p { font-size: 14px; color: var(--text-dim); word-break: break-word; }
.comment-empty { color: var(--text-faint); font-size: 14px; text-align: center; padding: 20px 0; }
.comment-form { display: flex; gap: 10px; }
.comment-form input { flex: 1; }

/* ---------- 我的活动 ---------- */
.mine-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 26px; margin-bottom: 24px; }
.mine-me { flex: 1; min-width: 200px; }
.mine-me h1 { font-size: 24px; margin-bottom: 4px; }
.mine-me p { color: var(--text-dim); font-size: 14px; }
.mine-me b { color: var(--pink); }
.mine-stats { display: flex; gap: 12px; }
.stat { text-align: center; background: rgba(255, 255, 255, .05); border: 1px solid var(--border); border-radius: 14px; padding: 12px 18px; min-width: 76px; }
.stat b { display: block; font-size: 22px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 12px; color: var(--text-faint); }
.tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.tab { border: 1px solid var(--border); background: rgba(255, 255, 255, .05); color: var(--text-dim); padding: 9px 18px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600; transition: all .2s ease; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(168, 85, 247, .35); }

/* ---------- 创建活动弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(6, 3, 16, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal {
  position: relative; width: min(560px, 100%); max-height: 90vh; overflow: auto;
  background: linear-gradient(180deg, #1d1537, #160f2e);
  border: 1px solid var(--border); border-radius: 22px; padding: 26px; box-shadow: var(--shadow);
  transform: translateY(16px) scale(.97); transition: transform .28s cubic-bezier(.2, .9, .3, 1.2);
}
.modal-mask.show .modal { transform: none; }
.modal h2 { font-size: 22px; margin-bottom: 18px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255, 255, 255, .08); border: none; width: 34px; height: 34px;
  border-radius: 50%; color: var(--text-dim); font-size: 15px; cursor: pointer; transition: all .2s ease;
}
.modal-close:hover { background: rgba(255, 92, 157, .3); color: #fff; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 6px; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100;
  transform: translate(-50%, 20px);
  background: rgba(28, 20, 52, .92); border: 1px solid var(--border);
  padding: 12px 22px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; box-shadow: var(--shadow);
  max-width: min(92vw, 420px); text-align: center;
  transition: all .3s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 页脚 ---------- */
.footer {
  text-align: center; padding: 26px 16px 34px; color: var(--text-faint);
  font-size: 13px; border-top: 1px solid var(--border); background: rgba(11, 7, 22, .5);
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .filter-row { grid-template-columns: 1fr 1fr; }
  .field-search { grid-column: 1 / -1; }
  .nav-toggle { display: flex; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: rgba(15, 10, 30, .96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border); padding: 12px 16px; display: none;
  }
  .nav.open { display: flex; animation: fadeIn .2s ease; }
  .nav-link { text-align: center; padding: 12px; }
  .nav-create { margin-left: 0; }
}

@media (max-width: 560px) {
  .filter-row { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .detail-card { padding: 20px; }
  .mine-hero { flex-direction: column; text-align: center; }
  .mine-stats { width: 100%; justify-content: center; }
  .join-bar { flex-direction: column; align-items: stretch; }
  .join-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
