/* ==================================================================
 * XDUCube · 魔方主题（回归 9/17 00:24 视觉风格）
 * 保留：3D 旋转魔方、全部功能、日间 / 夜间切换
 * 兼容旧变量体系（--panel / --line / --text-dim …）与新体系别名
 * ================================================================== */

:root {
  /* ---------- 魔方六色 ---------- */
  --c-white: #f4f5f7;
  --c-yellow: #ffd500;
  --c-red: #c41e3a;
  --c-orange: #ff5800;
  --c-blue: #0051ba;
  --c-green: #009e60;

  /* ---------- 品牌与语义色 ---------- */
  --primary: #0051ba;
  --primary-deep: #003b8a;
  --accent: #ffd500;
  --success: #009e60;
  --danger: #c41e3a;
  --warn: #ff5800;

  /* ---------- 背景 / 面板 / 文字 ---------- */
  --bg: #070b16;
  --bg-2: #0d1426;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eaf0ff;
  --text-dim: #9aa8c7;
  --text-soft: #6f7d9c;

  /* ---------- 形状 ---------- */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 12px 32px rgba(0, 81, 186, 0.35);

  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* ---------- 新体系别名（供新写的代码使用） ---------- */
  --bg-base: var(--bg-2);
  --bg-container: var(--panel);
  --bg-elevated: rgba(255, 255, 255, 0.1);
  --bg-hover: rgba(255, 255, 255, 0.06);
  --border: var(--line);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text-1: var(--text);
  --text-2: var(--text-dim);
  --text-3: var(--text-soft);
  --text-disabled: #4c5872;
  --primary-hover: #0a63d8;
  --primary-active: var(--primary-deep);
  --primary-bg: rgba(0, 81, 186, 0.2);
  --primary-text: #a8cbff;
  --success-bg: rgba(0, 158, 96, 0.16);
  --success-text: #8ff0bd;
  --warning: var(--warn);
  --warning-bg: rgba(255, 88, 0, 0.16);
  --warning-text: #ffb27a;
  --danger-bg: rgba(196, 30, 58, 0.16);
  --danger-text: #ffa8b8;
  --purple: #7b52ff;
  --purple-bg: rgba(123, 82, 255, 0.16);
  --purple-text: #cfbcff;

  --r: 10px;
  --r-xs: 4px;
  --r-xl: 16px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --h-sm: 30px; --h: 36px; --h-lg: 42px;
  --fs-xs: 12px; --fs-sm: 13px; --fs: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 24px;

  --sh-1: 0 6px 18px rgba(0, 0, 0, 0.32);
  --sh-2: 0 12px 30px rgba(0, 0, 0, 0.4);
  --sh-3: var(--shadow);

  --bg-nav: rgba(7, 11, 22, 0.72);
  --bg-cube: #0a1020;
  --glow-1: #16305c;
  --glow-2: #1c2a52;
}

/* ---------- 日间模式（同一套魔方风格，浅色化） ---------- */
[data-theme='light'] {
  --bg: #f2f4f9;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-2: rgba(0, 0, 0, 0.03);
  --line: rgba(20, 40, 80, 0.12);
  --text: #17203a;
  --text-dim: #5a6a8a;
  --text-soft: #8a94a8;
  --shadow: 0 14px 34px rgba(20, 40, 80, 0.12);
  --shadow-glow: 0 10px 24px rgba(0, 81, 186, 0.18);

  --bg-base: #f2f4f9;
  --bg-container: #ffffff;
  --bg-elevated: rgba(20, 40, 80, 0.05);
  --bg-hover: rgba(20, 40, 80, 0.04);
  --border: rgba(20, 40, 80, 0.12);
  --border-strong: rgba(20, 40, 80, 0.2);
  --text-1: #17203a;
  --text-2: #5a6a8a;
  --text-3: #8a94a8;
  --primary-text: #0051ba;
  --success-text: #0a7a42;
  --warning-text: #b35a00;
  --danger-text: #b32346;
  --purple-text: #5a3ec8;
  --bg-nav: rgba(255, 255, 255, 0.85);
  --bg-cube: #e9ecf3;
  --glow-1: #dce6f8;
  --glow-2: #eaf0fb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.6;
  color: var(--text);
  background: radial-gradient(1200px 700px at 15% -10%, var(--glow-1) 0%, transparent 55%),
    radial-gradient(900px 600px at 88% 0%, var(--glow-2) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 45%, var(--bg) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #101010; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--c-blue), var(--c-red));
  border-radius: 8px; border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-track { background: rgba(128, 128, 128, 0.08); }

/* ========================= 布局 ========================= */

.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.section { padding: 42px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-title { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.section-title::before {
  content: ""; width: 22px; height: 22px; border-radius: 5px; flex: none;
  background: conic-gradient(var(--c-red) 0 25%, var(--c-blue) 0 50%, var(--c-yellow) 0 75%, var(--c-green) 0 100%);
  box-shadow: 0 4px 14px rgba(0, 81, 186, 0.5);
}
.section-sub { color: var(--text-dim); font-size: 14px; }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) { .grid-3 { grid-template-columns: 1fr; } }

/* ========================= 导航 ========================= */

.nav {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(14px) saturate(150%);
  background: linear-gradient(180deg, var(--bg-nav), var(--bg-nav));
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 18px; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--text-dim); font-weight: 500; letter-spacing: 2px; display: block; line-height: 1; }
.nav-links { display: flex; gap: 6px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-link {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--text-dim);
  transition: 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-link:hover { color: var(--text); background: var(--panel-2); transform: translateY(-1px); }
.nav-link.active {
  color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: var(--shadow-glow);
}
/* 顶栏右侧操作区：称号 / 主题切换 / 头像 / 昵称角色 / 退出 */
.nav-actions { display: flex; align-items: center; gap: 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.nav-actions-info { line-height: 1.25; }
.nav-actions-info b { display: block; font-size: 13.5px; }
.nav-actions-info span { font-size: 11px; color: var(--text-dim); }
/* 移动端抽屉内的用户信息（桌面隐藏） */
.nav-drawer-user { display: none; align-items: center; gap: 10px; padding: 4px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.nav-drawer-user b { display: block; font-size: 14px; }
.nav-drawer-user span { font-size: 11.5px; color: var(--text-dim); }
.nav-avatar {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #0b1020;
  background: linear-gradient(135deg, var(--accent), var(--c-orange));
  box-shadow: 0 6px 16px rgba(255, 213, 0, 0.28);
}
.nav-toggle { display: none; margin-left: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; color: var(--text-dim); }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 12px 20px; gap: 4px; display: none;
  }
  .nav-links.open { display: flex; }
  /* 顶栏只保留图标级操作，昵称/角色移入抽屉 */
  .nav-actions { margin-left: auto; gap: 6px; padding-left: 0; border-left: none; }
  .nav-actions-info { display: none; }
  .nav-drawer-user { display: flex; }
  .brand-sub { display: none; }
  .nav-actions .theme-toggle { width: 30px; height: 30px; }
  .nav-actions .nav-avatar { width: 28px; height: 28px; font-size: 12px; }
  .nav-actions .level-badge.sm { padding: 2px 7px; font-size: 11.5px; }
  /* 自定义称号过长时省略，避免撑破顶栏 */
  .nav-actions .level-badge { max-width: 92px; }
  .nav-actions .level-badge b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-logout-btn { height: 30px; padding: 0 10px; font-size: 12.5px; }
}

/* ========================= 魔方元素（保留当前版本样式） ========================= */

.cube-stage { perspective: 900px; }
.cube {
  position: relative; width: 120px; height: 120px; transform-style: preserve-3d;
  animation: cube-spin 24s linear infinite;
}
.cube.soft { animation-duration: 26s; }
.cube-face {
  position: absolute; inset: 0; padding: 6px;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 4px;
  border-radius: var(--r); background: var(--bg-cube);
}
/* 标准三阶魔方配色：白↔黄、绿↔蓝、红↔橙（相对面） */
.cube-face .q { border-radius: 2px; background: currentColor; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.face-front { color: var(--c-green); transform: translateZ(60px); }
.face-back { color: var(--c-blue); transform: rotateY(180deg) translateZ(60px); }
.face-right { color: var(--c-red); transform: rotateY(90deg) translateZ(60px); }
.face-left { color: var(--c-orange); transform: rotateY(-90deg) translateZ(60px); }
.face-top { color: var(--c-white); transform: rotateX(90deg) translateZ(60px); }
.face-bottom { color: var(--c-yellow); transform: rotateX(-90deg) translateZ(60px); }
@keyframes cube-spin {
  0% { transform: rotateX(-20deg) rotateY(0deg); }
  100% { transform: rotateX(-20deg) rotateY(360deg); }
}

.mini-cube {
  width: 22px; height: 22px; flex: none;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 1.5px;
}
.mini-cube i { border-radius: 1px; display: block; }

.cube-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.cube-grid i { display: block; aspect-ratio: 1/1; border-radius: 4px; background: rgba(128, 128, 128, 0.2); transition: 0.3s; }
.cube-grid i.on { background: linear-gradient(135deg, var(--accent), var(--c-orange)); }

.loader-cube { width: 48px; height: 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.loader-cube i { border-radius: 5px; animation: blip 1.4s ease-in-out infinite; }
.loader-wrap { display: grid; place-items: center; gap: 12px; padding: 48px 0; color: var(--text-dim); font-size: 13px; }
@keyframes blip {
  0%, 100% { transform: scale(0.72) rotate(0); opacity: 0.35; }
  50% { transform: scale(1) rotate(90deg); opacity: 1; }
}

/* ========================= 卡片 / 按钮 / 标签 ========================= */

.card {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.card-pad { padding: 20px; }

.btn {
  --bg-btn: linear-gradient(135deg, var(--primary), var(--primary-deep));
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: 11px; cursor: pointer; font-weight: 700; font-size: 14px;
  background: var(--bg-btn); color: #fff; letter-spacing: 0.3px;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s, filter 0.18s;
  box-shadow: 0 8px 20px rgba(0, 81, 186, 0.28);
}
.btn:hover { transform: translateY(-2px) scale(1.02); filter: brightness(1.08); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: grayscale(0.4); }
.btn.ghost { background: var(--panel-2); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.btn.gold { background: linear-gradient(135deg, var(--accent), var(--c-orange)); color: #1a1a1a; box-shadow: 0 8px 22px rgba(255, 160, 0, 0.3); }
.btn.danger { background: linear-gradient(135deg, var(--c-red), #8a1226); }
.btn.green { background: linear-gradient(135deg, var(--success), #04713f); }
.btn.sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-dim);
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--primary); }
.tag.blue { color: var(--primary-text); } .tag.blue::before { background: var(--c-blue); }
.tag.green { color: var(--success-text); } .tag.green::before { background: var(--c-green); }
.tag.gold { color: var(--warning-text); } .tag.gold::before { background: var(--c-yellow); }
.tag.red { color: var(--danger-text); } .tag.red::before { background: var(--c-red); }
.tag.purple { color: var(--purple-text); } .tag.purple::before { background: var(--purple); }

/* ========================= 表单 ========================= */

.input, .textarea, .select {
  width: 100%; padding: 11px 14px; border-radius: 11px; background: rgba(128, 128, 128, 0.08);
  border: 1px solid var(--line); color: var(--text); outline: none; transition: 0.2s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 81, 186, 0.22); }
.input::placeholder, .textarea::placeholder { color: var(--text-soft); }
.textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
.select option { background: var(--bg-2); color: var(--text); }

.field { margin-bottom: 16px; }
.field > label { display: flex; align-items: center; font-size: 13px; color: var(--text-dim); margin-bottom: 7px; font-weight: 700; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.hint { font-size: 12px; color: var(--text-soft); margin-top: 6px; line-height: 1.6; }

/* ========================= 表格 ========================= */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { color: var(--text-dim); font-size: 12.5px; font-weight: 700; letter-spacing: 0.5px; }
.table tbody tr:hover { background: rgba(128, 128, 128, 0.06); }
.table-wrap { overflow-x: auto; }

.empty { text-align: center; padding: 54px 20px; color: var(--text-dim); font-size: 14px; }
.empty b { display: block; font-weight: 700; margin-bottom: 4px; }

/* ========================= 统计卡 ========================= */

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 800px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  padding: 16px 18px; border-radius: var(--r-md);
  background: linear-gradient(160deg, var(--panel-2), transparent);
  border: 1px solid var(--line); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -22px; top: -22px; width: 76px; height: 76px;
  border-radius: 18px; opacity: 0.17; background: currentColor; transform: rotate(28deg);
}
.stat-num { font-size: 30px; font-weight: 900; line-height: 1.1; letter-spacing: -1px; }
.stat-label { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }
.stat-card.c-red { color: var(--c-red); }
.stat-card.c-blue { color: var(--c-blue); }
.stat-card.c-green { color: var(--c-green); }
.stat-card.c-gold { color: var(--c-yellow); }
.stat-num span.u { font-size: 13px; font-weight: 700; color: var(--text-dim); margin-left: 3px; }

/* ========================= Toast / 页脚 ========================= */

#toast-root {
  position: fixed; z-index: 999; top: 78px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none;
}
.toast {
  padding: 11px 20px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px;
  animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.toast.ok::before { background: var(--success); }
.toast.err::before { background: var(--c-red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(0.9); } to { opacity: 1; transform: none; } }

.footer { margin-top: 60px; border-top: 1px solid var(--line); padding: 30px 0 40px; color: var(--text-soft); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer-cubes { display: flex; gap: 5px; }
.footer-cubes i { width: 11px; height: 11px; border-radius: 3px; display: block; animation: foot 3s ease-in-out infinite; }
@keyframes foot { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(45deg); } }

/* ========================= 首页 Hero ========================= */

.hero { padding: 56px 0 26px; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 30px; align-items: center; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .hero-stage { display: none; } }
.hero h1 { font-size: clamp(30px, 4.6vw, 50px); font-weight: 900; line-height: 1.18; letter-spacing: -1px; }
.hero h1 em {
  font-style: normal; background: linear-gradient(100deg, var(--c-yellow), var(--c-orange));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--text-dim); margin: 16px 0 24px; max-width: 46ch; font-size: 15px; }
.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.hero-stage { display: grid; place-items: center; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
  padding: 8px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 700; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--text-dim); transition: 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--primary); }
.chip.on { background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }
.search-box { position: relative; margin-left: auto; }
.search-box .input { padding-left: 38px; width: 230px; }
.search-box::before { content: "🔍"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: 0.6; }
@media (max-width: 620px) { .search-box { margin-left: 0; width: 100%; } .search-box .input { width: 100%; } }

/* ========================= 活动卡片 ========================= */

.act-card { display: flex; flex-direction: column; overflow: hidden; transition: transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.26s; }
.act-card:hover { transform: translateY(-6px); box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55); }
.act-cover { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-cube); }
.act-cover img { width: 100%; height: 100%; object-fit: cover; }
.cube-face-flat {
  position: absolute; inset: 0; display: grid;
  grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 6px; padding: 12px;
}
.cube-face-flat i { border-radius: 8px; box-shadow: inset 0 -4px 10px rgba(0, 0, 0, 0.25), inset 0 3px 8px rgba(255, 255, 255, 0.3); transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.act-card:hover .cube-face-flat i { transform: rotate(12deg) scale(0.94); }
.act-phase { position: absolute; left: 12px; top: 12px; z-index: 2; }
.act-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.act-title { font-size: 17px; font-weight: 800; line-height: 1.4; }
.act-summary { font-size: 13.5px; color: var(--text-dim); min-height: 40px; }
.act-meta { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
.act-meta div { display: flex; align-items: baseline; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-k { color: var(--text-soft); font-size: 12px; width: 28px; flex: none; }
/* 桌面显示完整时间，移动端切换为紧凑格式 */
.time-short { display: none; }
.act-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px dashed var(--line); padding-top: 12px; margin-top: auto; }
.act-seats { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-dim); }
.seat-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; width: 74px; }
.seat-grid i { height: 7px; border-radius: 2px; background: rgba(128, 128, 128, 0.2); }
.seat-grid i.on { background: linear-gradient(90deg, var(--accent), var(--c-orange)); }
.act-price { color: var(--accent); font-weight: 800; font-size: 12.5px; white-space: nowrap; }

/* ========================= 活动详情 ========================= */

.detail-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
@media (max-width: 940px) { .detail-wrap { grid-template-columns: 1fr; } }
.detail-title { font-size: clamp(24px, 3.4vw, 34px); font-weight: 900; line-height: 1.25; }
.detail-cover { border-radius: var(--r-md); overflow: hidden; margin: 18px 0; height: 260px; position: relative; background: var(--bg-cube); }
.detail-info { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 4px 0 18px; }
@media (max-width: 560px) { .detail-info { grid-template-columns: 1fr; } }
.info-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.info-item label { display: block; font-size: 12px; color: var(--text-soft); margin-bottom: 3px; }
.info-item b { font-size: 15px; font-weight: 700; }
.detail-desc { white-space: pre-wrap; color: var(--text-dim); line-height: 1.85; font-size: 14.5px; }

.side-card { position: sticky; top: 86px; }
.code-box { display: flex; gap: 8px; justify-content: center; margin: 14px 0 6px; }
.code-digit {
  width: 46px; height: 56px; border-radius: 10px; display: grid; place-items: center; font-size: 26px; font-weight: 900;
  background: linear-gradient(160deg, rgba(128, 128, 128, 0.18), rgba(128, 128, 128, 0.06));
  border: 1px solid var(--line); box-shadow: inset 0 -4px 12px rgba(0, 0, 0, 0.3);
  animation: digit-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
@keyframes digit-pop { from { opacity: 0; transform: translateY(-10px) rotateX(90deg); } to { opacity: 1; transform: none; } }

.step-list { display: grid; gap: 12px; }
.step-item { display: flex; gap: 12px; align-items: flex-start; }
.step-no {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-soft);
}
.step-item.done .step-no { background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: #fff; box-shadow: var(--shadow-glow); }
.step-item b { display: block; font-size: 14.5px; }
.step-item p { font-size: 13.5px; color: var(--text-dim); }

.record-line { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.record-line:last-child { border-bottom: none; }
.record-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--c-green); flex: none; }
.record-main { flex: 1; min-width: 0; }
.record-main b { display: block; font-size: 14.5px; }
.record-main span { font-size: 12.5px; color: var(--text-dim); }

/* ========================= 表单页 / 登录 ========================= */

.form-shell { max-width: 780px; margin: 0 auto; }
.form-shell.narrow { max-width: 460px; }
.auth-box { padding: 30px; }
.auth-title { font-size: 24px; font-weight: 900; text-align: center; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--text-dim); font-size: 13.5px; margin-bottom: 22px; }
.switch-tab { display: flex; gap: 6px; padding: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 20px; }
.switch-tab button { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 9px; cursor: pointer; font-weight: 700; color: var(--text-dim); transition: 0.2s; }
.switch-tab button.on { background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: #fff; box-shadow: var(--shadow-glow); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-soft); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.require-dot { color: var(--c-red); margin-left: 3px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.text-dim { color: var(--text-dim); }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ========================= 称号 ========================= */

.level-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--panel-2); border: 1px solid var(--lv-border); color: var(--lv);
}
.level-badge.sm { padding: 2px 8px; font-size: 11.5px; }
.level-badge i { font-style: normal; font-size: 11px; }

.level-card { padding: 16px 18px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); }
.level-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.level-num { font-size: 12.5px; color: var(--text-dim); }
.level-num b { color: var(--lv); font-size: 19px; margin-left: 3px; }
.level-bar { height: 6px; border-radius: 999px; background: rgba(128, 128, 128, 0.18); overflow: hidden; margin: 12px 0 8px; }
.level-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--lv), var(--accent)); transition: width 0.4s; }
.level-tip { font-size: 12.5px; color: var(--text-dim); }
.level-tip b { color: var(--text); }
.level-desc { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

/* ========================= 小问号 / 阶级 / 定位 ========================= */

.help-tip {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%; flex: none; margin-left: 6px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-dim); font-size: 11px; cursor: help;
}
.help-tip:hover .help-pop, .help-tip:focus .help-pop { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.help-pop {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translate(-50%, 6px); width: 260px; z-index: 40;
  padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 12.5px; font-weight: 400; line-height: 1.75; color: var(--text-dim); text-align: left;
  opacity: 0; visibility: hidden; transition: 0.2s; pointer-events: none;
}
.help-pop b { color: var(--text); }
.help-pop::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--bg-2); }

.tier-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.level-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tier-opt {
  padding: 14px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; text-align: center; transition: 0.2s;
}
.tier-opt:hover { transform: translateY(-2px); border-color: var(--primary); }
.tier-opt.on { border-color: var(--accent); background: linear-gradient(160deg, rgba(255, 213, 0, 0.16), rgba(255, 88, 0, 0.08)); box-shadow: 0 8px 22px rgba(255, 180, 0, 0.2); }
.tier-cube { width: 34px; height: 34px; margin: 0 auto 6px; display: grid; gap: 2px; border-radius: 6px; padding: 3px; background: rgba(128, 128, 128, 0.16); }
.tier-cube.t1 { grid-template-columns: repeat(1, 1fr); grid-template-rows: repeat(1, 1fr); }
.tier-cube.t2 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }
.tier-cube.t3 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.tier-cube i { border-radius: 2px; background: var(--text-dim); display: block; }
.tier-opt.on .tier-cube i { background: linear-gradient(135deg, var(--accent), var(--c-orange)); }
.tier-name { font-weight: 800; font-size: 14px; }
.tier-growth { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }

.geo-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.geo-row .input { flex: 1; min-width: 120px; }
.geo-status { font-size: 12.5px; color: var(--text-dim); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.geo-status.ok { color: var(--success-text); }
.geo-status.err { color: var(--danger-text); }
.proxy-box { border: 1px dashed var(--line); border-radius: 12px; padding: 14px; margin-top: 12px; }

/* ========================= 礼品兑换 ========================= */

.brain-num { font-size: 34px; font-weight: 900; color: var(--accent); line-height: 1.2; margin-top: 4px; }
.brain-num .u { font-size: 14px; font-weight: 600; color: var(--text-dim); margin-left: 4px; }
.brain-cube { width: 54px; height: 54px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 4px; border-radius: 10px; background: rgba(255, 255, 255, .08); flex: none; }
.brain-cube i { border-radius: 4px; }

.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.gift-card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); overflow: hidden; display: flex; flex-direction: column; transition: .2s; }
.gift-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.gift-img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: rgba(255, 255, 255, .06); display: block; }
.gift-img-ph { aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: 44px; background: rgba(255, 255, 255, .05); }
.gift-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.gift-name { font-weight: 800; font-size: 15.5px; line-height: 1.4; }
.gift-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.65; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gift-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gift-cost { font-weight: 800; color: var(--accent); font-size: 14.5px; }

/* ========================= HELP 悬浮球 ========================= */

.help-ball { position: fixed; right: 24px; bottom: 24px; z-index: 200; }
.help-ball-btn {
  width: 46px; height: 46px; border-radius: 14px; cursor: pointer;
  display: grid; place-items: center;
  background: var(--bg-container); border: 1px solid var(--border);
  box-shadow: var(--sh-2); transition: transform 0.2s, border-color 0.2s;
}
.help-ball-btn:hover { transform: rotate(-10deg) scale(1.06); border-color: var(--primary); }
.help-panel {
  position: absolute; right: 0; bottom: 58px; width: 300px; max-height: 62vh; overflow-y: auto;
  padding: 16px; border-radius: var(--r-lg);
  background: var(--bg-container); border: 1px solid var(--border); box-shadow: var(--sh-3);
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: 0.2s;
}
.help-panel.open { opacity: 1; visibility: visible; transform: none; }
.help-panel-head { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.help-q { font-size: 13px; font-weight: 600; margin-top: 12px; }
.help-a { font-size: 12.5px; color: var(--text-dim); line-height: 1.7; }
.help-mail { color: var(--primary-text); text-decoration: underline; word-break: break-all; }

/* ========================= 成长度详情弹层 ========================= */

.growth-pop {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px);
}
.growth-pop-box {
  width: min(420px, 92vw); padding: 20px; border-radius: var(--r-lg);
  background: var(--bg-container); border: 1px solid var(--border); box-shadow: var(--sh-3);
}
.growth-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.growth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.growth-row:last-child { border-bottom: none; }
.growth-row b { color: var(--text); }
.growth-tiers { margin-top: 12px; font-size: 12.5px; color: var(--text-dim); line-height: 1.8; }
.level-badge.clickable { cursor: pointer; }

/* ========================= 封面上传 ========================= */

.cover-preview {
  aspect-ratio: 16/9; max-width: 420px;
  border-radius: var(--r); border: 1px dashed var(--line);
  background: rgba(128, 128, 128, 0.08);
  display: grid; place-items: center; overflow: hidden;
  color: var(--text-soft); font-size: 13px; text-align: center; padding: 12px;
}
.cover-preview.has-img { border-style: solid; padding: 0; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ========================= 日间 / 夜间切换 ========================= */

.theme-toggle {
  width: 34px; height: 34px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text-dim); cursor: pointer; transition: 0.2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--primary); transform: translateY(-1px); }
.theme-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ========================= 移动端适配 ========================= */
/* 目标：手机端活动列表保持两列，触摸目标舒适，信息密度更适合小屏 */

@media (max-width: 620px) {
  /* ---------- 容器与间距 ---------- */
  .container { width: calc(100% - 20px); }
  .section { padding: 20px 0; }
  .grid { gap: 10px; }
  .section-head { margin-bottom: 12px; }
  .section-title { font-size: 17px; }
  .section-title::before { width: 12px; height: 12px; }

  /* ---------- 活动列表：两列 ---------- */
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .act-card { border-radius: var(--r); }
  .act-cover { aspect-ratio: 4/3; }
  .cube-face-flat { padding: 8px; gap: 4px; }
  .cube-face-flat i { border-radius: 4px; }
  .act-phase { left: 6px; top: 6px; }
  .act-body { padding: 8px 10px 10px; gap: 5px; }
  .act-title {
    font-size: 14px; line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* 两列下简介空间有限，隐藏以保证卡片整齐 */
  .act-summary { display: none; }
  .act-meta { font-size: 11.5px; gap: 1px; margin-top: 0; }
  .act-meta div { white-space: nowrap; }
  .meta-k { width: 22px; font-size: 11px; }
  .time-full { display: none; }
  .time-short { display: inline; }
  .act-foot { padding-top: 8px; gap: 6px; flex-direction: column; align-items: flex-start; }
  .act-seats { font-size: 11px; gap: 5px; }
  .seat-grid { width: 45px; }
  .seat-grid i { height: 5px; }
  .act-price { font-size: 11px; }
  .act-card .btn.block { height: 32px; font-size: 12.5px; padding: 0 8px; }

  .tag { height: 20px; font-size: 11px; padding: 0 6px; }
  .tag::before { width: 5px; height: 5px; }

  /* ---------- 顶部导航 ---------- */
  .nav-inner { gap: 10px; }
  .brand { font-size: 16px; gap: 8px; }
  .brand-sub { font-size: 10px; }
  .nav-links { padding: 8px 16px 12px; gap: 0; }
  .nav-link { height: 44px; font-size: 15px; border-radius: var(--r-sm); padding: 0 12px; }
  .nav-actions { gap: 5px; }
  .nav-actions .theme-toggle { width: 28px; height: 28px; }
  .nav-actions .level-badge.sm { padding: 2px 6px; font-size: 11px; }
  .nav-avatar { width: 28px; height: 28px; font-size: 12px; }
  .nav-logout-btn { height: 28px; padding: 0 8px; font-size: 12px; }
  .nav-drawer-user { padding-top: 8px; }

  /* ---------- Hero ---------- */
  .hero { padding: 24px 0 12px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 14px; margin: 10px 0 18px; }
  .hero .btn-row { gap: 8px; }
  .hero .btn-row .btn { flex: 1 1 44%; }
  .hero-badges { margin-bottom: 14px; }

  /* ---------- 筛选与搜索 ---------- */
  .filter-bar { gap: 6px; }
  .chip { height: 34px; padding: 0 12px; font-size: 12.5px; }
  .search-box { width: 100%; }
  .search-box .input { width: 100%; }

  /* ---------- 统计卡 ---------- */
  .stat-grid { gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-num { font-size: 20px; }
  .stat-label { font-size: 11px; }

  /* ---------- 详情 ---------- */
  .detail-wrap { gap: 16px; }
  .side-card { position: static; }
  .detail-title { font-size: 20px; }
  .detail-cover { height: 170px; margin: 12px 0; }
  .detail-info { gap: 8px; margin-bottom: 12px; }
  .info-item { padding: 10px 12px; }
  .info-item b { font-size: 14px; }
  .detail-desc { font-size: 14px; }
  .side-card .btn-row { display: grid; grid-template-columns: 1fr; }
  .side-card .btn-row .btn,
  .side-card .btn-row a.btn { width: 100%; }
  .code-digit { width: 34px; height: 42px; font-size: 18px; }
  .code-box { gap: 5px; }
  .step-item p { font-size: 12px; }
  .record-line { flex-wrap: wrap; gap: 8px; }
  .record-line .btn-row { flex: 0 0 100%; }
  .proxy-box { padding: 12px; }

  /* ---------- 表格 ---------- */
  .table th { height: 36px; padding: 0 8px; font-size: 11.5px; }
  .table td { padding: 8px; font-size: 13px; }

  /* ---------- 表单（16px 字号避免 iOS 聚焦缩放） ---------- */
  .input, .select { height: 44px; font-size: 16px; }
  .textarea { font-size: 16px; }
  .btn { height: 40px; padding: 0 16px; }
  .btn.sm { height: 32px; padding: 0 10px; }
  .form-shell.narrow { max-width: 100%; }
  .auth-box { padding: 20px 16px; }
  .switch-tab { flex-wrap: wrap; }
  .switch-tab button { min-width: 88px; height: 40px; }
  .field-row { gap: 0; }
  .tier-pick { gap: 6px; }
  .level-pick { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .tier-opt { padding: 10px 4px; }
  .tier-name { font-size: 13px; }
  .level-pick .tier-name { font-size: 12.5px; }
  .cover-preview { max-width: 100%; }
  .geo-row .input { min-width: 100%; }

  /* ---------- 悬浮球与弹层 ---------- */
  .help-ball { right: 14px; bottom: 14px; }
  .help-ball-btn { width: 42px; height: 42px; border-radius: 12px; }
  .help-panel {
    width: min(300px, calc(100vw - 28px));
    right: 0; bottom: 52px; max-height: 50vh;
  }
  .growth-pop-box { padding: 16px; }
  #toast-root { top: 60px; width: calc(100% - 24px); }
  .toast { max-width: 100%; font-size: 13px; }
  .footer { padding: 20px 0 28px; }
}

/* 超小屏：进一步压缩，保证两列仍可读 */
@media (max-width: 380px) {
  .container { width: calc(100% - 16px); }
  .grid { gap: 8px; }
  .act-title { font-size: 13px; }
  .act-meta { font-size: 11px; }
  .hero h1 { font-size: 23px; }
}
