/* ============================================================
   学员端
   ============================================================ */

body {
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(109, 94, 252, 0.22), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(34, 211, 238, 0.13), transparent 60%),
    radial-gradient(800px 700px at 50% 118%, rgba(109, 94, 252, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
}

.app { min-height: 100dvh; display: flex; flex-direction: column; }

.container { width: min(1120px, 100% - 48px); margin: 0 auto; }
.container-narrow { width: min(820px, 100% - 48px); margin: 0 auto; }

/* -------------------------------- 顶栏 -------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 100;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 20, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
}
.topbar-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15.5px; letter-spacing: 0.01em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #7c5cff, #22d3ee);
  color: #fff;
  box-shadow: 0 6px 18px rgba(109, 94, 252, 0.4);
  flex: none;
}
.brand small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); letter-spacing: 0.16em; line-height: 1.2; }

.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a {
  padding: 7px 12px; border-radius: 9px; font-size: 13px; color: var(--muted);
  transition: all 0.18s ease; font-weight: 500;
}
.topnav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.topnav a.active { color: var(--text); background: rgba(109, 94, 252, 0.16); }

.user-chip {
  display: flex; align-items: center; gap: 9px;
  height: 36px; padding: 0 10px 0 4px;
  border-radius: 99px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.user-chip:hover { border-color: rgba(109, 94, 252, 0.45); background: rgba(109, 94, 252, 0.1); }
.user-chip .u-chev { display: flex; color: var(--muted); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #7c5cff, #22d3ee);
  color: #fff; font-size: 12px; font-weight: 700; flex: none;
}
.user-chip .u-phone { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* 头像悬停气泡：简单个人信息 */
.user-chip-wrap { position: relative; }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 12px);
  width: 246px; padding: 14px; z-index: 70;
  background: #0e1526; border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px; box-shadow: 0 24px 56px rgba(0, 0, 0, 0.6);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  pointer-events: none;
}
.user-chip-wrap:hover .user-pop,
.user-chip-wrap:focus-within .user-pop {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
.user-pop::before {
  content: ''; position: absolute; top: -6px; right: 24px;
  width: 11px; height: 11px; background: #0e1526;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  transform: rotate(45deg);
}
.up-head { display: flex; align-items: center; gap: 10px; padding-bottom: 11px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.up-avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
  background: linear-gradient(140deg, #7c5cff, #22d3ee);
}
.up-head b { display: block; font-size: 13px; font-weight: 620; }
.up-head span { display: block; font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: 1px; }
.up-rows { display: flex; flex-direction: column; gap: 7px; padding: 11px 0; }
.up-rows div { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.up-rows span { color: var(--muted); }
.up-rows b { font-weight: 620; }
.up-actions { display: flex; gap: 8px; padding-top: 11px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.up-actions a {
  flex: 1; text-align: center; padding: 7px 0; border-radius: 9px;
  font-size: 12px; color: #c4beff;
  background: rgba(109, 94, 252, 0.16); border: 1px solid rgba(109, 94, 252, 0.3);
  transition: all 0.15s;
}
.up-actions a:hover { background: rgba(109, 94, 252, 0.28); color: #fff; }
.user-chip .icon-btn { width: 28px; height: 28px; }

/* -------------------------------- 登录页 -------------------------------- */

.auth { flex: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; min-height: 100dvh; }
.auth-left {
  position: relative; overflow: hidden;
  padding: 56px clamp(32px, 6vw, 88px);
  display: flex; flex-direction: column; justify-content: space-between;
  border-right: 1px solid var(--line);
}
.auth-left::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 420px at 20% 20%, rgba(109, 94, 252, 0.3), transparent 65%),
    radial-gradient(520px 460px at 80% 70%, rgba(34, 211, 238, 0.16), transparent 62%);
}
.auth-grid {
  position: absolute; inset: 0; z-index: -1; opacity: 0.35;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 30%, #000 20%, transparent 78%);
}
.auth-headline { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.22; font-weight: 760; letter-spacing: -0.02em; margin-top: 26px; }
.auth-headline .grad {
  background: linear-gradient(100deg, #a78bfa, #67e8f9 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-sub { color: var(--muted); font-size: 14.5px; max-width: 460px; margin-top: 16px; line-height: 1.85; }
.auth-points { display: flex; flex-direction: column; gap: 14px; margin-top: 34px; }
.auth-point { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); }
.auth-point .pt-ico {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: rgba(109, 94, 252, 0.16); color: #b9b0ff; border: 1px solid rgba(109, 94, 252, 0.28);
}
.auth-point b { display: block; color: var(--text); font-weight: 600; font-size: 13.5px; }
.auth-point span { color: var(--muted); font-size: 12.5px; }
.auth-foot { color: rgba(135, 148, 178, 0.65); font-size: 12px; }

.auth-right {
  position: relative;
  display: flex; align-items: center; justify-content: center; padding: 40px 24px;
  background:
    radial-gradient(620px 480px at 62% 34%, rgba(109, 94, 252, 0.16), transparent 66%),
    radial-gradient(520px 420px at 30% 82%, rgba(34, 211, 238, 0.08), transparent 68%);
}
.auth-card {
  width: min(392px, 100%);
  padding: 30px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: fade-up 0.4s ease;
}
.auth-card h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.auth-card .auth-desc { font-size: 13px; color: var(--muted); margin-top: 6px; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.phone-field { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 11px; transition: all 0.2s ease; background: rgba(255, 255, 255, 0.04); }
.phone-field:focus-within { border-color: rgba(109, 94, 252, 0.7); box-shadow: 0 0 0 3px rgba(109, 94, 252, 0.18); }
.phone-field .prefix { padding: 0 12px; color: var(--muted); font-size: 13.5px; border-right: 1px solid var(--line); line-height: 44px; }
.phone-field input { flex: 1; height: 44px; background: none; border: none; outline: none; color: var(--text); font-size: 14.5px; padding: 0 12px; font-family: inherit; letter-spacing: 0.02em; }
.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; letter-spacing: 0.4em; font-family: var(--mono); font-size: 15px; }
.code-btn { flex: none; min-width: 118px; height: 44px; }
.auth-note {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 18px; padding: 11px 12px;
  border-radius: 10px; background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.18);
  color: #e6c98a; font-size: 11.8px; line-height: 1.65;
}
.auth-error { color: #fca5a5; font-size: 12.5px; min-height: 18px; }

/* -------------------------------- 首页 -------------------------------- */

.page { flex: 1; padding: 40px 0 72px; animation: fade-up 0.35s ease; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; flex-wrap: wrap; }
.hero .eyebrow { font-size: 12px; letter-spacing: 0.18em; color: var(--brand-2); font-weight: 600; text-transform: uppercase; }
.hero h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 750; letter-spacing: -0.02em; margin-top: 8px; }
.hero p { color: var(--muted); font-size: 14px; margin-top: 8px; max-width: 540px; }
.hero-stats { display: flex; gap: 10px; }
.hero-stat { padding: 12px 18px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); min-width: 104px; }
.hero-stat b { display: block; font-size: 22px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: 11.5px; color: var(--muted); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { font-size: 15.5px; font-weight: 650; letter-spacing: 0.01em; }
.section-head .muted { font-size: 12.5px; color: var(--muted); }

.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.game-card {
  position: relative; overflow: hidden;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015) 55%);
  display: flex; flex-direction: column; gap: 16px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}
.game-card.is-last { border-color: rgba(124, 92, 255, 0.5); box-shadow: 0 18px 44px rgba(76, 63, 224, 0.18); }
.last-badge {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 600;
  color: #cfc8ff; background: rgba(109, 94, 252, 0.2); border: 1px solid rgba(124, 92, 255, 0.45);
}
.last-badge.inline {
  position: static; margin-left: 8px; padding: 1px 7px; font-size: 10px; vertical-align: middle;
  background: rgba(109, 94, 252, 0.16); border-color: rgba(124, 92, 255, 0.35);
}
.course-item.is-last { border-color: rgba(124, 92, 255, 0.45); background: rgba(109, 94, 252, 0.07); }
.game-card::after {
  content: ''; position: absolute; width: 260px; height: 260px; right: -90px; top: -110px;
  background: radial-gradient(circle, rgba(109, 94, 252, 0.35), transparent 68%);
  opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
.game-card:hover { transform: translateY(-3px); border-color: rgba(109, 94, 252, 0.45); box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4); }
.game-card:hover::after { opacity: 1; }
.game-top { display: flex; gap: 14px; align-items: center; }
.game-icon {
  width: 58px; height: 58px; border-radius: 16px; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(150deg, rgba(109, 94, 252, 0.28), rgba(34, 211, 238, 0.16));
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 22px; font-weight: 750; color: #dfe4ff;
}
.game-icon img { width: 100%; height: 100%; object-fit: cover; }
.game-card h3 { font-size: 17px; font-weight: 680; letter-spacing: -0.01em; }
.game-card .game-intro { font-size: 12.8px; color: var(--muted); line-height: 1.7; min-height: 44px; }
.game-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }
.quota-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.quota-pill b { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; }
.quota-pill.low b { color: var(--warn); }
.quota-pill.zero b { color: var(--err); }
.enter-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: #a9a2ff; transition: gap 0.2s ease; }
.game-card:hover .enter-link { gap: 9px; color: #c4beff; }

/* -------------------------------- 游戏详情 -------------------------------- */

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.8px; margin-bottom: 18px; transition: color 0.18s; }
.back-link:hover { color: var(--text); }

.game-hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(109, 94, 252, 0.16), rgba(255, 255, 255, 0.02) 55%);
  margin-bottom: 26px;
}
.game-hero .game-icon { width: 68px; height: 68px; border-radius: 18px; }
.game-hero h1 { font-size: 23px; font-weight: 750; letter-spacing: -0.02em; }
.game-hero p { color: var(--muted); font-size: 13px; margin-top: 4px; max-width: 560px; }
.game-hero .spacer { flex: 1; }
.quota-box { text-align: right; }
.quota-box .num { font-size: 30px; font-weight: 780; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.quota-box .lbl { font-size: 11.5px; color: var(--muted); }

.course-list { display: flex; flex-direction: column; gap: 12px; }
.course-item {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s ease;
  cursor: pointer;
}
.course-item:hover { border-color: rgba(109, 94, 252, 0.4); background: rgba(109, 94, 252, 0.07); transform: translateX(3px); }
.course-idx {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: rgba(109, 94, 252, 0.14); color: #b9b0ff;
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
}
.course-main { flex: 1; min-width: 0; }
.course-main h4 { font-size: 14.5px; font-weight: 640; }
.course-main p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.course-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.course-go { color: #a9a2ff; display: flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; flex: none; }

/* -------------------------------- 问答页 -------------------------------- */

.chat-shell {
  display: grid; grid-template-columns: 286px minmax(0, 1fr);
  height: calc(100dvh - 104px);
  width: min(1280px, 100% - 40px);
  margin: 20px auto;
  gap: 16px;
  transition: grid-template-columns 0.24s ease;
}
.chat-shell.collapsed { grid-template-columns: 64px minmax(0, 1fr); }
.chat-side {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  overflow: hidden;
}
.side-full { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }
.chat-rail { display: none; flex-direction: column; align-items: center; gap: 6px; }
.chat-shell.collapsed .chat-side { padding: 14px 8px; overflow: visible; }
.chat-shell.collapsed .side-full { display: none; }
.chat-shell.collapsed .chat-rail { display: flex; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-head .side-back { flex: 1; min-width: 0; }
.side-head .icon-btn { width: 28px; height: 28px; }

.rail-pop {
  position: absolute; left: 58px; top: 10px; z-index: 60;
  width: 268px; max-height: 72vh; overflow: auto;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #101a2d;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column; gap: 4px;
  animation: pop-in 0.18s ease;
}
.rail-pop-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 9px;
  border: none; background: none; color: var(--text-2);
  font-size: 12.5px; text-align: left; font-family: inherit; cursor: pointer;
}
.rail-pop-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.rail-pop-title { font-size: 10.5px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; padding: 8px 10px 2px; }
.side-back { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.side-back:hover { color: var(--text); }
.side-title { font-size: 16px; font-weight: 680; letter-spacing: -0.01em; line-height: 1.45; }
.side-game { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.side-quota {
  padding: 16px; border-radius: 14px;
  background: linear-gradient(140deg, rgba(109, 94, 252, 0.18), rgba(34, 211, 238, 0.07));
  border: 1px solid rgba(109, 94, 252, 0.25);
}
.side-quota .lbl { font-size: 11.5px; color: rgba(255, 255, 255, 0.62); }
.side-quota .num { font-size: clamp(22px, 2.2vw, 30px); font-weight: 780; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.side-quota .num small { font-size: 12.5px; font-weight: 500; color: rgba(255, 255, 255, 0.55); margin-left: 6px; letter-spacing: 0; }
.bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #7c5cff, #22d3ee); transition: width 0.4s ease; }
.side-tips { padding: 14px; border-radius: 13px; border: 1px dashed var(--line); background: rgba(255, 255, 255, 0.02); }
.side-tips h5 { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 9px; }
.side-tips li { font-size: 12px; color: var(--text-2); line-height: 1.6; padding-left: 13px; position: relative; margin-bottom: 7px; }
.side-tips li::before { content: ''; position: absolute; left: 0; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: rgba(109, 94, 252, 0.8); }
.side-tips li:last-child { margin-bottom: 0; }
.side-foot { margin-top: auto; font-size: 11px; color: rgba(135, 148, 178, 0.6); line-height: 1.7; flex: none; }

/* 对话历史 */
.conv-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase;
  margin: 2px 0 -4px;
}
.conv-count { background: rgba(255, 255, 255, 0.06); border-radius: 99px; padding: 0 7px; font-size: 10px; letter-spacing: 0; }
.conv-list {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -6px; padding: 2px 8px 8px 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.conv-list::-webkit-scrollbar { width: 6px; }
.conv-list::-webkit-scrollbar-track { background: transparent; }
.conv-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 3px; }
.conv-list::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); }
.rail-pop .conv-list { flex: none; max-height: 220px; }
.conv-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 9px; border: 1px solid transparent;
  background: none; color: var(--text-2); font-size: 12.5px; text-align: left;
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}
.conv-item:hover { background: rgba(255, 255, 255, 0.05); }
.conv-item.active { background: rgba(109, 94, 252, 0.14); border-color: rgba(109, 94, 252, 0.28); color: var(--text); }
.conv-del {
  flex: none; display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 6px;
  color: var(--muted); opacity: 0; transition: all 0.15s;
}
.conv-item:hover .conv-del { opacity: 1; }
.conv-del:hover { color: #fca5a5; background: rgba(248, 113, 113, 0.14); }
@media (max-width: 640px) {
  .conv-del { opacity: 0.5; }
}
.conv-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 10.5px; color: var(--muted); flex: none; }
.conv-empty { font-size: 11.5px; color: var(--muted); padding: 12px 4px; text-align: center; }
.token-tag {
  font-size: 10.5px; color: rgba(135, 148, 178, 0.85);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
  padding: 0 6px; border-radius: 5px; font-variant-numeric: tabular-nums;
}

.chat-main {
  display: flex; flex-direction: column; min-width: 0;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 18, 32, 0.85), rgba(9, 14, 26, 0.95));
  overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 20px; border-bottom: 1px solid var(--line); flex: none;
  background: rgba(255, 255, 255, 0.02);
}
.chat-head h2 { font-size: 14.5px; font-weight: 650; }
.chat-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.chat-head .right { display: flex; align-items: center; gap: 8px; }
.chat-title { flex: 1; min-width: 0; }
.chat-title h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-back { display: none; flex: none; }

.chat-scroll { flex: 1; overflow-y: auto; padding: 24px 22px 8px; scroll-behavior: smooth; }
.msg { display: flex; gap: 11px; margin-bottom: 20px; animation: fade-up 0.25s ease; }
.msg.user { justify-content: flex-end; }
.msg-avatar {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #7c5cff, #22d3ee);
  color: #fff; font-size: 12.5px; font-weight: 700;
  margin-top: 2px;
}
.bubble-col { max-width: min(78%, 720px); display: flex; flex-direction: column; gap: 6px; }
.msg.user .bubble-col { align-items: flex-end; }
.bubble {
  padding: 12px 15px; border-radius: 15px; font-size: 13.8px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-word;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-top-left-radius: 5px;
}
.msg.user .bubble {
  background: linear-gradient(135deg, #6d5efc, #5b7cfa);
  border: none; color: #fff;
  border-top-left-radius: 15px; border-top-right-radius: 5px;
  box-shadow: 0 8px 20px rgba(97, 90, 250, 0.25);
}

/* 富文本回答（轻量 Markdown） */
.bubble-rich { white-space: normal; }
.bubble-rich p { margin: 0 0 8px; }
.bubble-rich p:last-child { margin-bottom: 0; }
.bubble-rich .md-h { font-weight: 700; font-size: 14.5px; margin: 12px 0 6px; color: #fff; }
.bubble-rich .md-h:first-child { margin-top: 0; }
.bubble-rich .md-ul { margin: 0 0 8px; padding-left: 18px; list-style: disc; }
.bubble-rich .md-ul li { margin: 3px 0; }
.bubble-rich .md-ol { margin: 0 0 8px; padding-left: 20px; list-style: decimal; }
.bubble-rich .md-ol li { margin: 3px 0; }
.bubble-rich .md-hr { border: none; border-top: 1px solid rgba(255, 255, 255, 0.12); margin: 12px 0; }
.bubble-rich strong { color: #fff; font-weight: 700; }
.bubble-rich .md-gap { height: 7px; }

/* 表格 */
.bubble-rich .md-table-wrap {
  margin: 8px 0 12px; overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 10px;
}
.bubble-rich .md-table { border-collapse: collapse; width: 100%; font-size: 12.5px; min-width: 280px; }
.bubble-rich .md-table th,
.bubble-rich .md-table td {
  padding: 8px 11px; text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}
.bubble-rich .md-table th { background: rgba(255, 255, 255, 0.06); font-weight: 650; color: #fff; }
.bubble-rich .md-table tr:last-child td { border-bottom: none; }
.bubble-rich .md-table th:last-child,
.bubble-rich .md-table td:last-child { border-right: none; }
.bubble-rich .md-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }

/* 代码块 / 引用 */
.bubble-rich .md-pre {
  margin: 8px 0 12px; padding: 10px 12px; overflow-x: auto;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 9px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6;
}
.bubble-rich .md-pre code { background: none; padding: 0; font-size: inherit; }
.bubble-rich .md-quote {
  margin: 6px 0; padding: 7px 12px;
  border-left: 3px solid rgba(109, 94, 252, 0.65);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 7px 7px 0; color: var(--text-2);
}
.bubble-rich code {
  background: rgba(255, 255, 255, 0.08); border-radius: 4px;
  padding: 1px 5px; font-family: var(--mono); font-size: 12px;
}
.msg-meta { font-size: 11px; color: rgba(135, 148, 178, 0.75); display: flex; align-items: center; gap: 8px; }
.wait-secs { color: rgba(135, 148, 178, 0.7); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.ai-note {
  display: flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: rgba(135, 148, 178, 0.8);
  margin-top: -2px;
}
.ai-note .ico { opacity: 0.75; }
.speak-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  color: var(--muted); cursor: pointer; transition: all 0.18s ease;
}
.speaker-spin {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: var(--brand-2);
  animation: spin 0.8s linear infinite;
}
.speak-btn:hover { color: #b9b0ff; border-color: rgba(109, 94, 252, 0.45); background: rgba(109, 94, 252, 0.1); }
.speak-btn.active { color: #67e8f9; border-color: rgba(34, 211, 238, 0.45); background: rgba(34, 211, 238, 0.1); }
.speak-btn:disabled { opacity: 0.6; cursor: wait; }

.typing { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: #8b98b4; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.18s; }
.dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.sys-note { text-align: center; font-size: 11.5px; color: rgba(135, 148, 178, 0.7); margin: 4px 0 18px; }

.composer { flex: none; padding: 12px 18px 16px; border-top: 1px solid var(--line); background: rgba(8, 13, 24, 0.7); }
.composer-box {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 8px 8px 8px 14px;
  border-radius: 15px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.composer-box:focus-within { border-color: rgba(109, 94, 252, 0.6); box-shadow: 0 0 0 3px rgba(109, 94, 252, 0.14); }
.composer textarea {
  flex: 1; min-height: 26px; max-height: 132px; padding: 5px 0;
  border: none; background: none; outline: none; resize: none;
  color: var(--text); font-size: 14px; line-height: 1.6; font-family: inherit;
}
.composer textarea::placeholder { color: rgba(135, 148, 178, 0.75); }
.send-btn {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; border: none; cursor: pointer;
  background: linear-gradient(135deg, #7c5cff, #22d3ee); color: #fff;
  transition: all 0.2s ease;
}
.send-btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.send-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 11.5px; color: rgba(135, 148, 178, 0.8); }
.composer-foot .left { display: flex; align-items: center; gap: 8px; }
.kbd { font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); }

.blocked {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 40px; text-align: center;
}
.blocked .lock-ico {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center;
  background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.25); color: #fcd34d;
}
.blocked h3 { font-size: 18px; font-weight: 700; }
.blocked p { font-size: 13px; color: var(--muted); max-width: 380px; line-height: 1.8; }

.welcome-card {
  padding: 18px 20px; border-radius: 16px; margin-bottom: 22px;
  border: 1px solid rgba(109, 94, 252, 0.22);
  background: linear-gradient(120deg, rgba(109, 94, 252, 0.12), rgba(34, 211, 238, 0.05));
}
.welcome-card h4 { font-size: 14px; font-weight: 650; margin-bottom: 5px; display: flex; align-items: center; gap: 7px; }
.welcome-card p { font-size: 12.8px; color: var(--text-2); line-height: 1.8; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  font-size: 12px; padding: 5px 11px; border-radius: 99px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  color: var(--text-2); cursor: pointer; transition: all 0.18s ease;
}
.chip:hover { border-color: rgba(109, 94, 252, 0.45); color: #c4beff; background: rgba(109, 94, 252, 0.1); }

/* -------------------------------- 购买引导 -------------------------------- */

.qr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.qr-card {
  padding: 18px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03); text-align: center;
}
.qr-card h4 { font-size: 13.5px; font-weight: 650; margin-bottom: 12px; }
.qr-img {
  width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: #fff; display: grid; place-items: center; color: #9aa4bb;
}
.qr-img img { width: 100%; height: 100%; object-fit: contain; }
.qr-img.empty { background: rgba(255, 255, 255, 0.035); border: 1px dashed var(--line-strong); }
.qr-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; color: #8b98b4; text-align: center; }
.qr-empty small { font-size: 10.5px; color: rgba(139, 152, 180, 0.7); }
.contact-note {
  margin-top: 16px; padding: 12px 14px; border-radius: 11px;
  background: rgba(34, 211, 238, 0.07); border: 1px solid rgba(34, 211, 238, 0.2);
  font-size: 12.5px; color: #a5f3fc;
}

/* -------------------------------- 个人中心 -------------------------------- */

.profile-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.profile-card { padding: 24px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.035); }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 20px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #7c5cff, #22d3ee);
  color: #fff; font-size: 24px; font-weight: 750;
  margin-bottom: 14px;
}
.profile-card h2 { font-size: 19px; font-weight: 700; }
.profile-card .phone { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 3px; }
.profile-rows { margin-top: 20px; display: flex; flex-direction: column; }
.profile-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 12.8px; }
.profile-row:last-child { border-bottom: none; }
.profile-row span { color: var(--muted); }
.profile-row b { font-weight: 600; }

.rights-card { padding: 22px 24px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.035); }
.rights-card h3 { font-size: 14.5px; font-weight: 650; margin-bottom: 4px; }
.rights-card .hint { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.right-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.right-row:last-child { border-bottom: none; }
.right-row .game-mini { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgba(109, 94, 252, 0.14); overflow: hidden; flex: none; }
.right-row .game-mini img { width: 100%; height: 100%; object-fit: cover; }
.right-row .rmain { flex: 1; }
.right-row .rmain b { font-size: 13.5px; font-weight: 600; }
.right-row .rmain span { display: block; font-size: 11.5px; color: var(--muted); }
.right-row .rnum { text-align: right; font-variant-numeric: tabular-nums; }
.right-row .rnum b { font-size: 18px; font-weight: 720; }
.right-row .rnum span { display: block; font-size: 11px; color: var(--muted); }

/* 订单记录 */
.order-row {
  display: flex; align-items: center; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.order-row:last-child { border-bottom: none; }
.order-main { flex: 1; min-width: 0; }
.order-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; }
.order-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-family: var(--mono); letter-spacing: 0.01em; }
.order-amount { font-size: 15px; font-weight: 720; font-variant-numeric: tabular-nums; white-space: nowrap; }
.order-status { width: 60px; text-align: right; flex: none; }

/* 个人中心改版 / 充值 / 明细 */
.profile-cta { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 13px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.022);
  transition: all 0.16s; color: var(--text);
}
.quick-item:hover { border-color: rgba(109, 94, 252, 0.42); background: rgba(109, 94, 252, 0.07); transform: translateY(-1px); }
.quick-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #c4beff;
  background: rgba(109, 94, 252, 0.16); border: 1px solid rgba(109, 94, 252, 0.24);
}
.quick-item div { flex: 1; min-width: 0; }
.quick-item b { display: block; font-size: 13px; font-weight: 620; }
.quick-item span:not(.quick-ico) { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.quick-chev { color: var(--muted); flex: none; }

.quota-bar { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); margin-top: 7px; overflow: hidden; }
.quota-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7c5cff, #22d3ee); }
.right-actions { display: flex; gap: 7px; flex: none; }

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-card {
  padding: 16px 18px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.022);
}
.order-line { display: flex; align-items: center; gap: 14px; }
.order-line-sub { margin-top: 12px; padding-top: 11px; border-top: 1px dashed rgba(255, 255, 255, 0.08); }
.order-credit { flex: 1; font-size: 12.3px; color: var(--text-2); }
.order-actions { display: flex; gap: 8px; }

.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.plan-card {
  position: relative; text-align: left; padding: 20px 18px;
  border-radius: 16px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.024); color: var(--text);
  transition: all 0.18s;
}
.plan-card:hover { transform: translateY(-3px); border-color: rgba(109, 94, 252, 0.45); }
.plan-card.recommend {
  border-color: rgba(124, 92, 255, 0.6);
  background: linear-gradient(160deg, rgba(109, 94, 252, 0.16), rgba(34, 211, 238, 0.06));
  box-shadow: 0 16px 40px rgba(76, 63, 224, 0.22);
}
.plan-badge {
  position: absolute; right: 14px; top: 14px;
  padding: 2px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 650;
  background: linear-gradient(135deg, #7c5cff, #22d3ee); color: #fff;
}
.plan-tier { font-size: 26px; font-weight: 760; letter-spacing: -0.02em; }
.plan-tier small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.plan-price { margin-top: 6px; font-size: 17px; font-weight: 700; color: #c4beff; }
.plan-credit { margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.plan-credit em { font-style: normal; color: #6ee7b7; }
.plan-unit { margin-top: 6px; font-size: 11.5px; color: var(--muted); }

.pay-hint {
  margin-top: 18px; padding: 12px 14px; border-radius: 12px;
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; line-height: 1.75; color: var(--muted);
  background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line);
}
.pay-hint a { color: #c4beff; text-decoration: underline; }

.pay-order { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.pay-line { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; font-size: 12.8px; }
.pay-line span { color: var(--muted); }
.pay-line b { font-weight: 620; }
.pay-amount { font-size: 19px; color: #c4beff; }
.pay-line .mono { font-family: var(--mono); font-size: 11.5px; }
.qr-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.qr-tab {
  padding: 6px 16px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--text-2);
}
.qr-tab.on { border-color: rgba(124, 92, 255, 0.6); background: rgba(109, 94, 252, 0.16); color: #c4beff; }
.qr-box { display: grid; place-items: center; padding: 8px 0 4px; }
.qr-box img { width: 190px; height: 190px; border-radius: 12px; background: #fff; object-fit: contain; }
.proof-box { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.proof-preview { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }

.log-list { display: flex; flex-direction: column; }
.log-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.log-row:last-child { border-bottom: none; }
.log-main { flex: 1; min-width: 0; }
.log-title { font-size: 13px; display: flex; align-items: center; gap: 7px; }
.log-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.log-delta { font-size: 15px; font-weight: 720; font-variant-numeric: tabular-nums; }
.log-delta.up { color: #6ee7b7; }
.log-delta.down { color: #fca5a5; }
.log-rest { width: 92px; text-align: right; font-size: 11.8px; color: var(--muted); font-variant-numeric: tabular-nums; }
.log-foot { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; }

.contact-box { text-align: center; }
.contact-qr { width: 220px; height: 220px; border-radius: 14px; object-fit: contain; background: #fff; padding: 6px; }

/* -------------------------------- 响应式 -------------------------------- */

@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { min-height: 100dvh; }
  .game-grid { grid-template-columns: 1fr; }
  .chat-shell { grid-template-columns: 1fr; width: 100%; margin: 0; gap: 0; height: calc(100dvh - 64px); }
  .chat-page .topbar { display: none; }
  .chat-page .chat-shell { height: 100dvh; }
  .chat-side { display: none; }
  .chat-main { border-radius: 0; border-left: none; border-right: none; }
  .mobile-back { display: inline-flex; }
  .chat-head { padding: 12px 14px; }
  .chat-head h2 { font-size: 14px; }
  .profile-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .right-row { flex-wrap: wrap; }
  .right-actions { width: 100%; }
}

@media (max-width: 640px) {
  .container, .container-narrow { width: calc(100% - 32px); }
  .page { padding: 24px 0 56px; }
  .topnav { display: none; }
  .hero { gap: 16px; }
  .hero > div { min-width: 0; width: 100%; }
  .hero h1 { font-size: 22.5px; line-height: 1.35; }
  .hero-stats { width: 100%; }
  .hero-stat { flex: 1; min-width: 0; }
  .auth-card { padding: 24px 20px; border: none; background: none; box-shadow: none; }
  .qr-grid { grid-template-columns: 1fr; }
  .order-row { gap: 10px; }
  .order-amount { font-size: 14px; }
  .order-status { width: auto; }
  .order-sub { font-size: 10.5px; }
  .chat-scroll { padding: 16px 14px 0; }
  .bubble-col { max-width: 86%; }
  .composer { padding: 10px 12px 12px; }
  .composer-foot .kbd-hint { display: none; }
  .user-chip .u-phone { display: none; }
  .game-hero { padding: 18px; gap: 14px; }
  .quota-box { text-align: left; }
  .plan-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .order-line { flex-wrap: wrap; }
  .order-status { width: auto; margin-left: auto; }
  .log-rest { width: 76px; font-size: 11px; }
}

/* -------------------------------- 社区 / 视频 -------------------------------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-head .eyebrow { font-size: 11.5px; letter-spacing: 0.18em; color: var(--brand-2); font-weight: 600; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 6px; }
.page-head p { font-size: 13px; color: var(--muted); }

.game-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.game-chip {
  padding: 8px 15px; border-radius: 999px; font-size: 12.8px; font-weight: 550;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--text-2);
  transition: all 0.18s;
}
.game-chip:hover { border-color: rgba(109, 94, 252, 0.45); color: var(--text); }
.game-chip.on {
  background: linear-gradient(135deg, rgba(109, 94, 252, 0.9), rgba(34, 211, 238, 0.75));
  border-color: transparent; color: #fff; font-weight: 600;
}

.post-list { display: flex; flex-direction: column; gap: 12px; }
.post-card {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 18px 20px; border-radius: 16px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.022);
  transition: all 0.18s;
}
.post-card:hover { transform: translateY(-2px); border-color: rgba(109, 94, 252, 0.4); background: rgba(109, 94, 252, 0.06); }
.post-main { flex: 1; min-width: 0; }
.post-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-title-row h3 { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; }
.pin-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 600;
  color: #ffd7a1; background: rgba(255, 170, 60, 0.14); border: 1px solid rgba(255, 170, 60, 0.28);
}
.post-summary { margin-top: 7px; font-size: 12.8px; color: var(--muted); line-height: 1.75; }
.post-meta { margin-top: 10px; display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: rgba(135, 148, 178, 0.8); }
.post-meta span { display: inline-flex; align-items: center; gap: 4px; }
.post-thumb { width: 96px; height: 72px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: rgba(255, 255, 255, 0.05); }

.detail-card {
  padding: 26px 28px; border-radius: 18px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.022);
}
.detail-head .pin-badge { margin-bottom: 10px; }
.detail-head h1 { font-size: 22px; font-weight: 700; line-height: 1.45; letter-spacing: -0.015em; }
.detail-meta { margin-top: 10px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: rgba(135, 148, 178, 0.85); }
.detail-meta span { display: inline-flex; align-items: center; gap: 4px; }
.detail-content {
  margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 14px; line-height: 2; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
.detail-images { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.detail-images img { width: 100%; border-radius: 12px; object-fit: cover; background: rgba(255, 255, 255, 0.04); }

.react-bar { margin-top: 24px; display: flex; gap: 10px; }
.react-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--text-2);
  transition: all 0.16s;
}
.react-btn:hover { border-color: rgba(109, 94, 252, 0.45); color: var(--text); }
.react-btn.on { background: rgba(109, 94, 252, 0.16); border-color: rgba(124, 92, 255, 0.55); color: #c7c0ff; }

.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.video-card { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.022); transition: all 0.18s; }
.video-card:hover { transform: translateY(-3px); border-color: rgba(109, 94, 252, 0.42); box-shadow: 0 20px 44px rgba(0, 0, 0, 0.38); }
.video-cover { position: relative; aspect-ratio: 16 / 9; background: #0d1424; overflow: hidden; }
.video-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(135, 148, 178, 0.6); background: linear-gradient(135deg, #131c2f, #0b1120); }
.duration-badge {
  position: absolute; right: 9px; bottom: 9px;
  padding: 2px 7px; border-radius: 5px; font-size: 11px; font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.65); color: #e8eeff;
}
.play-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(10, 14, 24, 0.55); border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff; backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.18s;
}
.video-card:hover .play-badge { opacity: 1; }
.video-info { padding: 13px 15px 15px; }
.video-info h3 { font-size: 13.8px; font-weight: 620; line-height: 1.5; }
.video-info .post-meta { margin-top: 8px; }

.video-player-wrap { border-radius: 14px; overflow: hidden; background: #000; margin-bottom: 22px; }
.video-player { width: 100%; display: block; max-height: 62vh; background: #000; }

@media (max-width: 980px) {
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .page-head h1 { font-size: 22px; }
  .post-card { padding: 15px 16px; gap: 12px; }
  .post-thumb { width: 76px; height: 58px; }
  .detail-card { padding: 20px 18px; }
  .detail-head h1 { font-size: 19px; }
  .video-grid { grid-template-columns: 1fr; }

  /* 移动端保留导航（社区/视频入口），排到第二行并可横向滚动 */
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 0 8px; row-gap: 6px; }
  .topnav {
    display: flex; order: 3; width: 100%;
    gap: 6px; overflow-x: auto; padding-top: 8px;
    border-top: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { white-space: nowrap; padding: 6px 10px; font-size: 12.5px; }
  .page { padding-top: 28px; }
}
/* 通用次数提示 */
.shared-hint {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 0 14px; padding: 10px 13px; border-radius: 11px;
  background: rgba(109, 94, 252, 0.1); border: 1px solid rgba(109, 94, 252, 0.3);
  font-size: 12.5px; color: #cfc8ff;
}
.shared-hint b { font-size: 15px; }
.shared-hint em { font-style: normal; font-size: 11px; color: var(--muted); margin-left: auto; }

.recharge-note {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; padding: 10px 14px; border-radius: 11px;
  background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.25);
  font-size: 12.5px; color: #a5f3fc;
}

/* 头像气泡与头像之间的鼠标通道，避免移动时弹窗消失 */
.user-chip-wrap::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 16px;
}
/* 排队 / 取消 / 计费规则 */
.ai-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ai-cancel {
  padding: 4px 12px; border-radius: 999px; font-size: 11.5px;
  color: var(--text-2); border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.ai-cancel:hover { border-color: rgba(248, 113, 113, 0.45); color: #fca5a5; }
.ai-cancel-hint { font-size: 11px; color: var(--muted); }

.rule-block { padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; border: 1px solid var(--line); }
.rule-block h4 { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 8px; }
.rule-block ul { padding-left: 18px; list-style: disc; }
.rule-block li { font-size: 12.5px; color: var(--text-2); line-height: 1.8; }
.rule-block.free { background: rgba(52, 211, 153, 0.06); border-color: rgba(52, 211, 153, 0.25); }
.rule-block.free h4 { color: #6ee7b7; }
.rule-block.charged { background: rgba(248, 113, 113, 0.06); border-color: rgba(248, 113, 113, 0.22); }
.rule-block.charged h4 { color: #fca5a5; }

/* 注册页 / 邀请码 */
.auth-switch { margin-top: 14px; text-align: center; font-size: 12.5px; color: var(--muted); }
.auth-switch a { color: var(--brand-2); font-weight: 600; margin-left: 4px; }
.auth-switch a:hover { text-decoration: underline; }
.invite-code { letter-spacing: .08em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.mini-copy {
  margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px;
  border: 1px solid var(--line); color: var(--text-2); background: rgba(255, 255, 255, 0.04);
}
.mini-copy:hover { border-color: var(--brand-2); color: var(--brand-2); }

/* 登录方式切换 / 忘记密码 */
.auth-tabs {
  display: flex; gap: 6px; margin: 4px 0 16px; padding: 4px;
  border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
}
.auth-tabs button {
  flex: 1; padding: 8px 10px; border-radius: 9px; font-size: 12.5px;
  color: var(--muted); background: transparent; border: 0; cursor: pointer;
  transition: all .16s ease;
}
.auth-tabs button.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 600; }
.auth-forgot { margin-top: 10px; text-align: right; font-size: 12px; }
.auth-forgot a { color: var(--muted); }
.auth-forgot a:hover { color: var(--brand-2); }

/* 记住手机号 / 密码强度 */

.pwd-meter { display: flex; align-items: center; gap: 5px; margin-top: 7px; }
.pwd-meter i { flex: 1; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); transition: background .16s ease; }
.pwd-meter em { font-style: normal; font-size: 11px; min-width: 22px; text-align: right; }

/* 音色选择 */
.voice-list { display: flex; flex-direction: column; gap: 8px; }
.voice-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.02); transition: all .16s ease;
}
.voice-item.active { border-color: var(--brand-2); background: rgba(56, 189, 248, 0.08); }
.voice-item input { accent-color: var(--brand-2); width: 14px; height: 14px; }
.v-main { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.v-main b { font-size: 13px; }
.v-main em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.v-gender { font-size: 11px; color: var(--muted); }

/* 协议勾选 */
.agree-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin: 6px 0 2px; font-size: 12px; color: var(--muted); line-height: 1.7;
}
.agree-line input { accent-color: var(--brand-2); width: 14px; height: 14px; }
.agree-line a { color: var(--brand-2); text-decoration: none; }
.agree-line a:hover { text-decoration: underline; }

/* AI 离线提示 */
.ai-offline {
  display: flex; align-items: center; gap: 8px;
  margin: 0 18px 10px; padding: 9px 12px; border-radius: 10px;
  background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.28);
  color: #fcd34d; font-size: 12px;
}

/* ------------------------------ 免费课堂 ------------------------------ */
.article-section { margin-top: 26px; }
.article-section-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.article-list { display: flex; flex-direction: column; gap: 8px; }
.article-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.article-row:hover { border-color: var(--brand); transform: translateY(-1px); }
.article-index { width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.article-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.article-main b { font-size: 14px; font-weight: 600; }
.article-main em { font-style: normal; font-size: 12px; color: var(--muted); }
.article-detail { margin-top: 16px; padding: 28px 30px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.article-kicker { font-size: 12px; color: var(--brand-2); letter-spacing: .04em; margin-bottom: 8px; }
.article-detail h1 { font-size: 26px; line-height: 1.35; margin: 0 0 10px; }
.article-summary { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
.article-cover { width: 100%; max-height: 320px; object-fit: cover; border-radius: 14px; margin-bottom: 18px; }
.article-md { font-size: 14.5px; line-height: 1.9; color: var(--text-2); }
.article-md h3 { font-size: 20px; margin: 18px 0 8px; color: var(--text); }
.article-md h4 { font-size: 17px; margin: 16px 0 6px; color: var(--text); }
.article-md h5 { font-size: 15px; margin: 14px 0 6px; color: var(--text); }
.article-md p { margin: 6px 0; }
.article-md ul { margin: 6px 0 6px 22px; padding: 0; list-style: disc; }
.article-md li { margin: 4px 0; }
.article-md code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.article-md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.article-table-wrap { overflow-x: auto; margin: 12px 0; }
.article-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.article-table th, .article-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.article-table th { background: var(--surface-2); font-weight: 600; }
.article-nav { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 8px; }
.article-nav .btn { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ICP 备案 */
.icp-foot { margin: 26px 0 12px; text-align: center; font-size: 12px; color: var(--muted); }
.icp-foot a { color: var(--muted); text-decoration: none; }
.icp-foot a:hover { text-decoration: underline; }
