/* ============================================================
   灵语星球 LingChat — 全站样式（暗色奢华风 / 移动端优先）
   ============================================================ */
:root {
  --bg-deep: #0b0714;
  --bg-card: rgba(255, 255, 255, 0.045);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.09);
  --txt: #f2eef9;
  --txt-dim: #9d94b3;
  --gold: #e8b65a;
  --gold-soft: #f5d68a;
  --pink: #ff5e9c;
  --purple: #8b5cf6;
  --cyan: #22d3ee;
  --red: #ff4757;
  --green: #2fd573;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--txt);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---- 背景光效 ---- */
.bg-fx {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(139, 92, 246, 0.22), transparent 60%),
    radial-gradient(800px 480px at -10% 20%, rgba(255, 94, 156, 0.14), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(232, 182, 90, 0.10), transparent 60%),
    var(--bg-deep);
}
.bg-fx::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.35) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.05;
  animation: drift 26s linear infinite;
}
@keyframes drift { from { background-position: 0 0; } to { background-position: 340px 340px; } }

/* ---- 布局 ---- */
.wrap { max-width: 640px; margin: 0 auto; padding: 0 20px; }
.page { padding-bottom: 80px; }

/* ---- 顶部 ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: rgba(11, 7, 20, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: 1px; }
.brand-orb {
  width: 30px; height: 30px; border-radius: 50%;
  background: conic-gradient(from 210deg, var(--purple), var(--pink), var(--gold), var(--purple));
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.7);
  animation: spin 5s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.topbar .back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--txt-dim); font-size: 14px; cursor: pointer;
  background: none; border: none; padding: 6px 10px; border-radius: 10px;
}
.topbar .back-btn:hover { color: var(--txt); background: var(--bg-card); }
.topbar .badge-user {
  font-size: 12px; color: var(--gold-soft);
  border: 1px solid rgba(232,182,90,0.4); padding: 4px 12px; border-radius: 999px;
  background: rgba(232,182,90,0.08);
}

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; border-radius: 14px;
  font-size: 15px; font-weight: 600; padding: 13px 26px;
  color: #1a1026; background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  box-shadow: 0 8px 26px rgba(232, 182, 90, 0.3);
  transition: transform 0.15s ease, filter 0.2s ease;
  text-decoration: none; letter-spacing: 1px;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-pink { background: linear-gradient(135deg, #ff8ab5, var(--pink)); color: #fff; box-shadow: 0 8px 26px rgba(255, 94, 156, 0.32); }
.btn-purple { background: linear-gradient(135deg, #a78bfa, var(--purple)); color: #fff; box-shadow: 0 8px 26px rgba(139, 92, 246, 0.35); }
.btn-ghost { background: transparent; color: var(--txt); border: 1px solid var(--line); box-shadow: none; }
.btn-sm { padding: 9px 18px; font-size: 13px; border-radius: 11px; }

/* ---- 卡片 ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

/* ---- 中间页 Hero ---- */
.hero { text-align: center; padding: 46px 0 10px; }
.hero .kicker {
  display: inline-block; font-size: 12px; letter-spacing: 4px;
  color: var(--txt-dim); border: 1px solid var(--line);
  padding: 5px 16px; border-radius: 999px; margin-bottom: 18px;
  background: rgba(255,255,255,0.03);
}
.hero h1 { font-size: 34px; font-weight: 800; letter-spacing: 2px; line-height: 1.3; }
.hero h1 .grad {
  background: linear-gradient(90deg, var(--gold-soft), var(--pink), var(--purple));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.sub { color: var(--txt-dim); font-size: 14px; margin-top: 12px; max-width: 420px; margin-inline: auto; }
.hero .sub-title {
  font-size: 16.5px; font-weight: 600; color: var(--gold-soft);
  margin-top: 16px; letter-spacing: 1px; line-height: 1.6;
}
.footer .privacy-note {
  margin-top: 14px; font-size: 11px; line-height: 1.8;
  color: rgba(157, 148, 179, 0.62); letter-spacing: 0.5px; max-width: 400px; margin-inline: auto;
}

/* ---- 板块入口卡片（中间页核心） ---- */
.portal-list { margin-top: 34px; display: flex; flex-direction: column; gap: 18px; }
.portal {
  position: relative; display: block; text-decoration: none; color: var(--txt);
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 22px; padding: 24px 22px; overflow: hidden;
  transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease;
}
.portal:active { transform: scale(0.985); }
.portal::before {
  content: ""; position: absolute; top: -40%; right: -15%;
  width: 200px; height: 200px; border-radius: 50%; opacity: 0.16; filter: blur(6px);
}
.portal.p1::before { background: radial-gradient(circle, var(--purple), transparent 65%); }
.portal.p2::before { background: radial-gradient(circle, var(--gold), transparent 65%); }
.portal.p3::before { background: radial-gradient(circle, var(--pink), transparent 65%); }
.portal .p-head { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.portal .p-ico {
  width: 58px; height: 58px; border-radius: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  border: 1px solid var(--line);
}
.p1 .p-ico { background: rgba(139,92,246,0.16); box-shadow: 0 0 24px rgba(139,92,246,0.35) inset; }
.p2 .p-ico { background: rgba(232,182,90,0.14); box-shadow: 0 0 24px rgba(232,182,90,0.3) inset; }
.p3 .p-ico { background: rgba(255,94,156,0.14); box-shadow: 0 0 24px rgba(255,94,156,0.32) inset; }
.portal h3 { font-size: 21px; font-weight: 700; letter-spacing: 1px; }
.portal .p-desc { color: var(--txt-dim); font-size: 13px; margin-top: 3px; }
.portal .p-tag {
  display: inline-block; font-size: 11px; margin-top: 10px;
  padding: 3px 12px; border-radius: 999px; letter-spacing: 1px;
}
.p1 .p-tag { color: #c4b5fd; background: rgba(139,92,246,0.14); border: 1px solid rgba(139,92,246,0.35); }
.p2 .p-tag { color: var(--gold-soft); background: rgba(232,182,90,0.12); border: 1px solid rgba(232,182,90,0.35); }
.p3 .p-tag { color: #ffa8c7; background: rgba(255,94,156,0.12); border: 1px solid rgba(255,94,156,0.35); }
.portal .p-arrow {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 22px; color: var(--txt-dim); z-index: 1;
}

/* ---- 步骤条 ---- */
.steps { margin-top: 34px; }
.steps h4 { font-size: 14px; color: var(--txt-dim); letter-spacing: 3px; text-align: center; margin-bottom: 16px; }
.step-row { display: flex; gap: 10px; }
.step {
  flex: 1; text-align: center; padding: 16px 8px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px;
}
.step .n {
  width: 30px; height: 30px; margin: 0 auto 8px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #1a1026;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
}
.step .t { font-size: 12.5px; font-weight: 600; }
.step .s { font-size: 11px; color: var(--txt-dim); margin-top: 4px; }
.step .free-tag { display: inline-block; margin-top: 6px; font-size: 10px; color: var(--green); border: 1px solid rgba(47,213,115,0.4); border-radius: 999px; padding: 1px 8px; }

/* ---- 页脚 ---- */
.footer { text-align: center; color: var(--txt-dim); font-size: 11.5px; padding: 30px 20px 40px; letter-spacing: 1px; }
.footer .line { width: 60px; height: 1px; background: var(--line); margin: 0 auto 12px; }

/* ---- 聊天页 ---- */
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: rgba(11,7,20,0.8); backdrop-filter: blur(12px); position: sticky; top: 58px; z-index: 40; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: linear-gradient(135deg, #2a1b4d, #4a2d7a);
  border: 1px solid rgba(139,92,246,0.5);
  box-shadow: 0 0 16px rgba(139,92,246,0.4);
}
.chat-head .name { font-weight: 700; font-size: 15px; }
.chat-head .status { font-size: 11.5px; color: var(--green); display: flex; align-items: center; gap: 5px; }
.chat-head .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 1.8s infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.chat-box { padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; min-height: calc(100vh - 240px); }
.msg { display: flex; gap: 10px; max-width: 86%; }
.msg .bubble {
  padding: 11px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.65;
  border-bottom-left-radius: 5px;
}
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble {
  background: linear-gradient(135deg, #6d28d9, #9333ea);
  color: #fff; border-bottom-left-radius: 16px; border-bottom-right-radius: 5px;
  box-shadow: 0 4px 18px rgba(139,92,246,0.3);
}
.msg.ai .bubble { background: var(--bg-card); border: 1px solid var(--line); }
.msg .mini-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; font-size: 16px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2a1b4d, #4a2d7a); }
.typing .bubble::after {
  content: "•••"; animation: typing 1.2s infinite; letter-spacing: 3px; color: var(--txt-dim);
}
@keyframes typing { 50% { opacity: 0.3; } }
.chat-input {
  position: sticky; bottom: 0; padding: 12px 16px 18px;
  background: linear-gradient(transparent, var(--bg-deep) 30%);
  display: flex; gap: 10px; align-items: flex-end;
}
.chat-input input {
  flex: 1; background: var(--bg-card); border: 1px solid var(--line);
  color: var(--txt); border-radius: 14px; padding: 13px 16px; font-size: 15px; outline: none;
}
.chat-input input:focus { border-color: rgba(139,92,246,0.6); box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
.chat-input button {
  width: 48px; height: 48px; border-radius: 14px; border: none; cursor: pointer; font-size: 19px;
  background: linear-gradient(135deg, var(--purple), var(--pink)); color: #fff;
  box-shadow: 0 6px 20px rgba(139,92,246,0.4);
}
.chat-input button:active { transform: scale(0.94); }
.upgrade-banner {
  margin: 10px 16px; padding: 13px 16px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(232,182,90,0.12), rgba(255,94,156,0.12));
  border: 1px solid rgba(232,182,90,0.35);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.upgrade-banner .t { font-size: 13px; }
.upgrade-banner .t b { color: var(--gold-soft); }
.upgrade-banner a { font-size: 12.5px; color: var(--pink); font-weight: 700; white-space: nowrap; text-decoration: none; }

/* ---- 商城页 ---- */
.section-title { font-size: 19px; font-weight: 800; margin: 26px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title .deco { width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(180deg, var(--gold-soft), var(--pink)); }
.mall-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.prod {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  transition: transform 0.15s ease; cursor: pointer;
}
.prod:active { transform: scale(0.97); }
.prod .img {
  aspect-ratio: 1 / 1.05; display: flex; align-items: center; justify-content: center;
  font-size: 44px; position: relative;
}
.prod .img .lock {
  position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; font-size: 13px;
  backdrop-filter: blur(4px);
}
.prod .meta { padding: 12px 13px 14px; }
.prod .meta .name { font-size: 14px; font-weight: 600; line-height: 1.4; min-height: 40px; }
.prod .meta .row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.prod .meta .price { color: var(--gold-soft); font-weight: 800; font-size: 16px; }
.prod .meta .price small { font-size: 11px; color: var(--txt-dim); font-weight: 400; margin-right: 3px; }
.prod .meta .buy {
  font-size: 12px; padding: 6px 14px; border-radius: 999px; border: none; cursor: pointer; font-weight: 600;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #1a1026;
}
.prod .meta .buy:active { transform: scale(0.94); }
.mall-tip {
  margin-top: 18px; padding: 15px 17px; border-radius: 14px; font-size: 13px;
  background: rgba(139,92,246,0.1); border: 1px dashed rgba(139,92,246,0.4); color: #c4b5fd;
  display: flex; gap: 10px; align-items: flex-start;
}

/* ---- 私密房间 ---- */
.room-hero { text-align: center; padding: 34px 0 6px; }
.room-hero .door {
  width: 108px; height: 108px; margin: 0 auto 16px; border-radius: 26px;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.14), transparent 45%), linear-gradient(160deg, #3b0f2e, #17071c);
  border: 2px solid rgba(255,94,156,0.45);
  display: flex; align-items: center; justify-content: center; font-size: 46px;
  box-shadow: 0 0 44px rgba(255,94,156,0.35), inset 0 0 30px rgba(255,94,156,0.15);
  animation: pulse-door 2.4s ease-in-out infinite;
}
@keyframes pulse-door { 50% { box-shadow: 0 0 66px rgba(255,94,156,0.55), inset 0 0 30px rgba(255,94,156,0.2); } }
.room-hero h2 { font-size: 24px; font-weight: 800; letter-spacing: 2px; }
.room-hero p { color: var(--txt-dim); font-size: 13.5px; margin-top: 8px; }
.energy-bar {
  margin-top: 22px; padding: 18px; border-radius: 18px;
  background: var(--bg-card); border: 1px solid var(--line);
}
.energy-bar .row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--txt-dim); }
.energy-bar .row b { color: var(--gold-soft); font-size: 15px; }
.energy-bar .track { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.07); margin-top: 10px; overflow: hidden; }
.energy-bar .fill {
  height: 100%; border-radius: 999px; width: 100%;
  background: linear-gradient(90deg, var(--gold-soft), var(--pink), var(--purple));
  transition: width 0.5s ease; box-shadow: 0 0 14px rgba(255,94,156,0.5);
}
.energy-dots { display: flex; gap: 8px; margin-top: 12px; }
.energy-dots .dot {
  flex: 1; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.08);
  transition: background 0.3s ease;
}
.energy-dots .dot.on { background: linear-gradient(90deg, var(--gold-soft), var(--pink)); box-shadow: 0 0 10px rgba(255,94,156,0.45); }
.room-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.room-locked { text-align: center; padding: 30px 18px; }
.room-locked .big-emoji { font-size: 52px; margin-bottom: 14px; }
.room-locked .lt { font-size: 17px; font-weight: 700; }
.room-locked .ls { font-size: 13px; color: var(--txt-dim); margin: 10px 0 20px; }
.gift-3 { display: flex; gap: 10px; justify-content: center; margin: 16px 0 22px; }
.gift-3 .g { width: 64px; height: 72px; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 22px; }
.gift-3 .g span { font-size: 10px; color: var(--txt-dim); }
.gift-3 .g b { font-size: 13px; color: var(--gold-soft); }

/* ---- 充值页 ---- */
.pkg { display: flex; gap: 12px; margin-top: 14px; }
.pkg .p {
  flex: 1; text-align: center; padding: 16px 8px; border-radius: 16px; cursor: pointer;
  background: var(--bg-card); border: 2px solid var(--line); transition: border-color 0.2s, background 0.2s;
}
.pkg .p.sel { border-color: var(--gold); background: rgba(232,182,90,0.1); }
.pkg .p .amt { font-size: 20px; font-weight: 800; color: var(--gold-soft); }
.pkg .p .desc { font-size: 11px; color: var(--txt-dim); margin-top: 4px; }
.pkg .p .hot { position: absolute; margin: -28px auto 0; font-size: 10px; color: #fff; background: var(--pink); border-radius: 999px; padding: 1px 8px; }

/* ---- Toast ---- */
#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: rgba(20, 12, 32, 0.95); color: var(--txt);
  padding: 12px 22px; border-radius: 12px; font-size: 14px; z-index: 999;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all 0.25s ease; white-space: nowrap; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Modal ---- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.72);
  display: none; align-items: flex-end; justify-content: center; backdrop-filter: blur(6px);
}
.modal-mask.show { display: flex; }
.modal {
  width: 100%; max-width: 480px; background: #170e24;
  border: 1px solid var(--line); border-radius: 24px 24px 0 0;
  padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
  animation: slide-up 0.3s ease;
}
@keyframes slide-up { from { transform: translateY(60px); opacity: 0.4; } }
.modal h3 { font-size: 18px; text-align: center; }
.modal .m-sub { text-align: center; font-size: 12.5px; color: var(--txt-dim); margin-top: 6px; }
.modal .m-body { margin-top: 18px; }
.modal .close-x { position: absolute; right: 18px; top: 14px; font-size: 20px; color: var(--txt-dim); cursor: pointer; background: none; border: none; }

/* ---- 通用 ---- */
.hidden { display: none !important; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt20 { margin-top: 20px; }
.flex { display: flex; } .between { justify-content: space-between; } .items-center { align-items: center; }
.gap10 { gap: 10px; }
.dim { color: var(--txt-dim); }
.gold { color: var(--gold-soft); }
.pink { color: var(--pink); }
.fs13 { font-size: 13px; } .fs12 { font-size: 12px; }
