/* ========== 全局滚动条样式 ========== */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ========== 基础 ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg-0: #0a0a1f;
  --bg-1: #121234;
  --bg-2: #1a1a45;
  --pink: #ff6bb5;
  --pink-soft: #ffb8d9;
  --purple: #9b6bff;
  --blue: #6bb9ff;
  --cyan: #6bffe0;
  --text: #f2f2ff;
  --text-dim: #b8b8d9;
  --text-mute: #7a7aa8;
  --border: rgba(255, 107, 181, 0.18);
  --border-soft: rgba(155, 107, 255, 0.15);
  --card: rgba(30, 25, 70, 0.55);
  --card-hover: rgba(50, 35, 110, 0.75);
  --glow-pink: 0 0 24px rgba(255, 107, 181, 0.45);
  --glow-purple: 0 0 24px rgba(155, 107, 255, 0.45);
  --radius: 16px;
  --radius-sm: 10px;
}
html, body {
  min-height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; font-size: 15px; color: inherit; }

/* ========== 背景动画 ========== */
.bg-gradient {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(1000px 600px at 85% -10%, rgba(255, 107, 181, 0.25), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(155, 107, 255, 0.22), transparent 60%),
    radial-gradient(800px 500px at 60% 110%, rgba(107, 225, 255, 0.18), transparent 60%),
    linear-gradient(180deg, #0a0a1f 0%, #0d0b2a 50%, #0a0a1f 100%);
}
.bg-stars {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 80px 120px, #ffb8d9, transparent),
    radial-gradient(1.5px 1.5px at 200px 50px, #b8d9ff, transparent),
    radial-gradient(1px 1px at 300px 200px, #fff, transparent),
    radial-gradient(2px 2px at 420px 90px, #ffb8d9, transparent),
    radial-gradient(1px 1px at 550px 180px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 680px 300px, #d9b8ff, transparent),
    radial-gradient(1px 1px at 820px 60px, #fff, transparent);
  background-size: 900px 400px;
  opacity: 0.35;
  animation: starDrift 80s linear infinite;
}
@keyframes starDrift {
  0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: -900px 0, -900px 0, -900px 0, -900px 0, -900px 0, -900px 0, -900px 0, -900px 0; }
}
.bg-sakura { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sakura {
  position: absolute; top: -30px;
  color: #ffb8d9; font-size: 18px; opacity: 0.55;
  animation: sakuraFall linear infinite;
  filter: drop-shadow(0 0 4px rgba(255, 184, 217, 0.8));
}
@keyframes sakuraFall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.55; }
  100% { transform: translateY(115vh) rotate(720deg); opacity: 0; }
}

/* ========== 顶栏 ========== */
.topbar {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(10, 10, 31, 0.6);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.logo-icon {
  font-size: 22px;
  background: linear-gradient(135deg, var(--pink), var(--purple), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: iconGlow 3s ease-in-out infinite alternate;
}
@keyframes iconGlow {
  0% { filter: drop-shadow(0 0 8px var(--pink)); }
  100% { filter: drop-shadow(0 0 12px var(--purple)); }
}
.logo-text { font-size: 18px; letter-spacing: 1px; }
.logo-sub {
  font-size: 11px; color: var(--text-mute);
  border: 1px solid var(--border-soft);
  padding: 2px 8px; border-radius: 999px; letter-spacing: 2px;
}
.nav { display: flex; gap: 8px; align-items: center; }
.nav-link {
  padding: 8px 16px; border-radius: 999px; color: var(--text-dim);
  transition: all 0.25s ease; font-size: 14px;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-btn {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 107, 181, 0.25), rgba(155, 107, 255, 0.25));
  border: 1px solid rgba(255, 107, 181, 0.35);
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-btn:hover { box-shadow: var(--glow-pink); transform: translateY(-1px); }

/* ========== 视图容器 ========== */
.app { max-width: 1280px; margin: 0 auto; padding: 40px 28px 80px; min-height: calc(100vh - 70px); }
.view { animation: viewIn 0.4s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.view-head { margin-bottom: 32px; display: flex; flex-direction: column; gap: 12px; }
.view-title {
  font-size: 34px; font-weight: 800; letter-spacing: 1px; line-height: 1.2;
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, #fff 10%, var(--pink-soft) 55%, #b8d9ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.title-kana {
  font-size: 13px; color: var(--pink); letter-spacing: 4px; font-weight: 500;
  -webkit-text-fill-color: var(--pink);
  padding: 4px 10px; border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 107, 181, 0.08);
}
.view-desc { color: var(--text-dim); font-size: 14px; }

/* ========== 按钮 ========== */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff; border-radius: 999px; transition: all 0.25s ease;
  box-shadow: var(--glow-pink);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--glow-pink), 0 8px 20px rgba(255, 107, 181, 0.35); }
.btn-primary:active { transform: translateY(0); }
.btn-primary[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-lg { padding: 14px 30px; font-size: 15px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-icon { font-size: 16px; }
.btn-ghost {
  padding: 10px 18px; font-size: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  border-radius: 999px; color: var(--text-dim);
  transition: all 0.25s ease; display: inline-block;
}
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); border-color: var(--border); }

/* ========== 角色卡片网格 ========== */
.card-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 24px; cursor: pointer;
  transition: all 0.3s ease;
  position: relative; overflow: hidden;
  backdrop-filter: blur(12px);
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(400px 200px at 100% 0%, rgba(255, 107, 181, 0.15), transparent 60%);
  opacity: 0; transition: opacity 0.3s ease;
}
.card:hover { border-color: var(--border); background: var(--card-hover); transform: translateY(-4px); box-shadow: var(--glow-purple); }
.card:hover::before { opacity: 1; }
.card-avatar {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, rgba(255, 107, 181, 0.25), rgba(155, 107, 255, 0.25));
  border: 1px solid var(--border); margin-bottom: 14px;
}
.card-name { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.card-archetype { color: var(--text-dim); font-size: 13px; margin-bottom: 12px; }
.card-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px dashed var(--border-soft);
  color: var(--text-mute); font-size: 12px;
}
.card-action {
  color: var(--pink); font-weight: 600; opacity: 0.85;
  transition: all 0.2s ease;
}
.card:hover .card-action { opacity: 1; }
.card-delete {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-mute); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.card-delete:hover { background: rgba(255, 107, 181, 0.2); color: var(--pink); }

/* ========== 空状态 ========== */
.empty {
  text-align: center; padding: 80px 20px; color: var(--text-dim);
  border: 2px dashed var(--border-soft); border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}
.empty-emoji { font-size: 48px; margin-bottom: 14px; animation: iconGlow 3s ease infinite alternate; }
.empty h3 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.empty p { margin-bottom: 22px; font-size: 14px; }

/* ========== 表单 ========== */
.create-body { display: grid; grid-template-columns: 1fr; gap: 24px; max-width: 820px; }
.form-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 32px;
  backdrop-filter: blur(12px);
}
.form-section-title { font-size: 15px; font-weight: 600; color: var(--pink); margin: 24px 0 12px; padding-bottom: 6px; border-bottom: 1px solid rgba(255,120,150,0.2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.form-label > span { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.form-label em { color: var(--pink); font-style: normal; margin-left: 2px; }
.form-label input, .form-label textarea {
  width: 100%; padding: 12px 14px;
  background: rgba(10, 10, 31, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); color: var(--text);
  resize: vertical; transition: all 0.2s ease;
}
.form-label input:focus, .form-label textarea:focus {
  outline: none; border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 107, 181, 0.15);
  background: rgba(10, 10, 31, 0.8);
}
.form-label textarea { min-height: 80px; font-size: 14.5px; line-height: 1.7; }
.form-check { display: flex; align-items: center; gap: 10px; margin: 4px 0 24px; font-size: 14px; color: var(--text-dim); cursor: pointer; }
.form-check input { width: 16px; height: 16px; accent-color: var(--pink); cursor: pointer; }
.form-actions { display: flex; gap: 14px; align-items: center; margin-top: 8px; }

/* ========== 蒸馏动画 ========== */
.distilling, .distilled, .distill-error {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 48px 32px; text-align: center;
  backdrop-filter: blur(12px);
}
.distilling h3, .distilled h3 { font-size: 20px; margin: 20px 0 8px; color: var(--text); }
.distilling p, .distilled-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 18px; }
.flask {
  width: 80px; height: 100px; margin: 0 auto;
  position: relative;
}
.flask::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 30px; height: 20px; border: 3px solid var(--pink); border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.flask::after {
  content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 70px; height: 70px; border: 3px solid var(--pink);
  border-radius: 8px 8px 35px 35px;
  background: rgba(255, 107, 181, 0.08);
  overflow: hidden;
}
.flask-liquid {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 64px; height: 40px;
  background: linear-gradient(180deg, rgba(255, 107, 181, 0.5), rgba(155, 107, 255, 0.7));
  border-radius: 0 0 32px 32px;
  animation: liquidWave 2.5s ease-in-out infinite;
}
@keyframes liquidWave {
  0%, 100% { height: 38px; }
  50% { height: 48px; }
}
.flask-bubble {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(255, 107, 181, 0.3));
  animation: bubbleRise 2.2s linear infinite;
}
.flask-bubble.b1 { width: 8px; height: 8px; left: 38%; bottom: 8px; animation-delay: 0s; }
.flask-bubble.b2 { width: 6px; height: 6px; left: 48%; bottom: 8px; animation-delay: 0.7s; }
.flask-bubble.b3 { width: 10px; height: 10px; left: 58%; bottom: 8px; animation-delay: 1.3s; }
.flask-bubble.b4 { width: 5px; height: 5px; left: 32%; bottom: 8px; animation-delay: 1.8s; }
@keyframes bubbleRise {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(-55px) scale(1.2); opacity: 0; }
}
.loading-dots { display: inline-flex; gap: 6px; margin-top: 8px; }
.loading-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pink); animation: dotPulse 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { background: var(--purple); animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { background: var(--blue); animation-delay: 0.4s; }
@keyframes dotPulse { 0%, 100% { transform: scale(0.6); opacity: 0.5; } 50% { transform: scale(1.2); opacity: 1; } }

.skill-preview {
  text-align: left; margin: 20px 0;
  background: rgba(10, 10, 31, 0.7);
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.skill-preview summary {
  padding: 12px 16px; cursor: pointer; color: var(--pink);
  font-size: 13px; font-weight: 600;
}
.skill-preview pre {
  padding: 16px; font-size: 12.5px; line-height: 1.7;
  color: var(--text-dim); max-height: 320px; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
}

.distill-error { color: #ff8a8a; border-color: rgba(255, 138, 138, 0.3); background: rgba(255, 138, 138, 0.08); }
.distill-error h3 { color: #ff8a8a; margin-bottom: 8px; font-size: 18px; }
.distill-error p { color: var(--text-dim); font-size: 13.5px; }

/* ========== 聊天 ========== */
.chat-view { max-width: none; }
.chat-layout {
  display: grid; grid-template-columns: 280px 1fr; gap: 24px;
  height: calc(100vh - 150px); min-height: 600px;
}
.chat-side { display: flex; flex-direction: column; gap: 18px; }
.chat-character {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 28px 22px; text-align: center;
  backdrop-filter: blur(12px);
}
.chat-avatar {
  width: 96px; height: 96px; margin: 0 auto 16px;
  border-radius: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, rgba(255, 107, 181, 0.3), rgba(155, 107, 255, 0.3));
  border: 2px solid var(--border);
  box-shadow: var(--glow-pink);
}
.chat-character h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.chat-archetype { color: var(--text-dim); font-size: 13px; }
.chat-actions { display: flex; flex-direction: column; gap: 8px; }
.chat-actions .btn-ghost { text-align: center; }
.chat-tips {
  padding: 16px; background: rgba(255, 107, 181, 0.06);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-dim); line-height: 1.7;
}
.chat-tips p { margin-bottom: 6px; }
.chat-tips p:last-child { margin-bottom: 0; }

.chat-main {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); display: flex; flex-direction: column;
  overflow: hidden; backdrop-filter: blur(12px);
}
.chat-body {
  flex: 1; overflow-y: auto; padding: 28px 32px;
  display: flex; flex-direction: column; gap: 18px;
}
.chat-body::-webkit-scrollbar { width: 8px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }

.msg { display: flex; gap: 12px; max-width: 80%; }
.msg-role { font-size: 13px; color: var(--text-mute); margin-bottom: 4px; font-weight: 600; }
.msg-content {
  padding: 12px 18px; border-radius: 16px;
  font-size: 14.5px; line-height: 1.75; word-break: break-word;
  white-space: pre-wrap;
}

.msg.character { align-self: flex-start; flex-direction: column; }
.msg.character .msg-content {
  background: linear-gradient(135deg, rgba(155, 107, 255, 0.22), rgba(255, 107, 181, 0.18));
  border: 1px solid var(--border);
  color: var(--text);
  border-top-left-radius: 4px;
}

.msg.user { align-self: flex-end; flex-direction: column; align-items: flex-end; }
.msg.user .msg-content {
  background: linear-gradient(135deg, rgba(107, 225, 255, 0.18), rgba(107, 255, 224, 0.14));
  border: 1px solid rgba(107, 225, 255, 0.25);
  color: var(--text);
  border-top-right-radius: 4px;
}

.msg.typing .msg-content {
  padding: 14px 18px; color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 6px;
}
.msg.typing .msg-content span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--pink);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.msg.typing .msg-content span:nth-child(2) { background: var(--purple); animation-delay: 0.2s; }
.msg.typing .msg-content span:nth-child(3) { background: var(--blue); animation-delay: 0.4s; }

.chat-input {
  display: flex; gap: 12px; padding: 18px 22px 22px;
  border-top: 1px solid var(--border-soft);
  background: rgba(10, 10, 31, 0.4);
}
.chat-input textarea {
  flex: 1; padding: 12px 16px;
  background: rgba(10, 10, 31, 0.7);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); color: var(--text);
  resize: none; font-size: 14.5px; line-height: 1.6;
  transition: all 0.2s ease;
}
.chat-input textarea:focus {
  outline: none; border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 107, 181, 0.15);
}
.chat-send { border-radius: 14px; padding: 12px 20px; display: inline-flex; align-items: center; gap: 8px; }
.send-arrow { font-size: 16px; }

/* ========== 用户区域 ========== */
.user-area { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 107, 181, 0.12);
  border: 1px solid var(--border);
  font-size: 13px; transition: all 0.2s ease;
}
.user-chip:hover { background: rgba(255, 107, 181, 0.2); }
.user-credits { font-weight: 700; color: var(--pink-soft); }
.user-coin { color: var(--pink); }
.member-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: linear-gradient(135deg, #ffd700, #ff9500);
  color: #1a1a2e; font-weight: 700;
}
.user-name { color: var(--text-dim); }

/* ========== 弹窗 ========== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(5, 5, 15, 0.75);
  backdrop-filter: blur(6px);
}
.modal-box {
  position: relative; z-index: 1;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px; width: 90%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), var(--glow-purple);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 14px; right: 18px;
  font-size: 24px; color: var(--text-mute);
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.modal-close:hover { color: var(--pink); background: rgba(255, 107, 181, 0.1); }

/* 认证弹窗 */
.auth-tabs { display: flex; gap: 4px; margin-bottom: 24px; background: rgba(255,255,255,0.04); border-radius: 10px; padding: 4px; }
.auth-tab {
  flex: 1; padding: 10px; border-radius: 8px;
  color: var(--text-mute); font-size: 14px; font-weight: 600;
  transition: all 0.2s ease;
}
.auth-tab.active { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; }
.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-error {
  background: rgba(255, 138, 138, 0.12); border: 1px solid rgba(255, 138, 138, 0.3);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 16px;
  color: #ff8a8a; font-size: 13px;
}
.auth-hint { text-align: center; color: var(--text-mute); font-size: 12px; margin-top: 14px; }
.btn-block { width: 100%; justify-content: center; }

/* 付费墙 */
.paywall-box { text-align: center; max-width: 400px; }
.paywall-icon { font-size: 56px; margin-bottom: 16px; }
.paywall-box h2 { font-size: 22px; margin-bottom: 12px; }
.paywall-msg { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; line-height: 1.7; }
.paywall-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ========== 卡片扩展 ========== */
.card-stats {
  display: flex; gap: 14px; margin-bottom: 10px;
  font-size: 12px; color: var(--text-mute);
}
.card-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: rgba(107, 255, 224, 0.15); color: var(--cyan);
  border: 1px solid rgba(107, 255, 224, 0.25);
}
.card-badge.private { background: rgba(155, 107, 255, 0.15); color: var(--purple); border-color: rgba(155, 107, 255, 0.25); }

/* ========== 市场页 ========== */
.market-toolbar {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin-bottom: 28px; padding: 18px 22px;
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); backdrop-filter: blur(12px);
}
.market-search {
  flex: 1; min-width: 200px; padding: 10px 16px;
  background: rgba(10, 10, 31, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 999px; color: var(--text); font-size: 14px;
  transition: all 0.2s ease;
}
.market-search:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 107, 181, 0.15); }
.market-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-btn {
  padding: 6px 14px; border-radius: 999px; font-size: 12.5px;
  background: rgba(255,255,255,0.04); color: var(--text-dim);
  border: 1px solid transparent; transition: all 0.2s ease;
}
.cat-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.cat-btn.active { background: rgba(255, 107, 181, 0.15); color: var(--pink); border-color: var(--border); }
.market-sort { display: flex; gap: 4px; }
.sort-btn {
  padding: 6px 14px; border-radius: 8px; font-size: 12.5px;
  color: var(--text-mute); transition: all 0.2s ease;
}
.sort-btn:hover { color: var(--text); }
.sort-btn.active { background: rgba(155, 107, 255, 0.15); color: var(--purple); }
.market-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; }
.page-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(255,255,255,0.04); color: var(--text-dim);
  font-size: 13px; transition: all 0.2s ease;
}
.page-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.page-btn.active { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; }

/* ========== 角色详情 ========== */
.detail-view { max-width: 900px; }
.detail-header { display: flex; gap: 24px; align-items: center; margin-bottom: 28px; }
.detail-avatar {
  width: 100px; height: 100px; border-radius: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px;
  background: linear-gradient(135deg, rgba(255, 107, 181, 0.3), rgba(155, 107, 255, 0.3));
  border: 2px solid var(--border); box-shadow: var(--glow-pink);
  flex-shrink: 0;
}
.detail-info h1 { font-size: 28px; margin-bottom: 6px; }
.detail-archetype { color: var(--text-dim); font-size: 14px; margin-bottom: 10px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-mute); }
.detail-actions { display: flex; gap: 14px; margin-bottom: 28px; }
.detail-skill { margin-bottom: 28px; }
.detail-comments { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 24px; backdrop-filter: blur(12px); }
.detail-comments h3 { font-size: 17px; margin-bottom: 18px; }
.rate-form { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.rate-stars { display: flex; gap: 4px; font-size: 24px; cursor: pointer; }
.rate-stars span { color: var(--text-mute); transition: all 0.15s ease; }
.rate-stars span.hover, .rate-stars span.selected { color: #ffd700; text-shadow: 0 0 8px rgba(255, 215, 0, 0.5); }
.rate-form input {
  flex: 1; min-width: 180px; padding: 8px 14px;
  background: rgba(10, 10, 31, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 8px; color: var(--text); font-size: 13px;
}
.rate-form input:focus { outline: none; border-color: var(--pink); }
.comments-list { display: flex; flex-direction: column; gap: 14px; }
.comment-item { padding: 14px; background: rgba(255,255,255,0.03); border-radius: 10px; border: 1px solid var(--border-soft); }
.comment-head { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; font-size: 13px; }
.comment-user { font-weight: 600; color: var(--pink-soft); }
.comment-stars { color: #ffd700; font-size: 12px; }
.comment-date { color: var(--text-mute); font-size: 11px; margin-left: auto; }
.comment-text { color: var(--text-dim); font-size: 13.5px; line-height: 1.6; }

/* ========== 聊天扩展 ========== */
.chat-owner { font-size: 12px; color: var(--text-mute); margin-top: 6px; }
.chat-owner a { color: var(--pink-soft); }
.chat-credits { text-align: center; padding: 10px 14px; background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); font-size: 12.5px; }
.credits-member { color: #ffd700; font-weight: 600; }
.credits-info { color: var(--text-dim); }

/* ========== 用户中心 ========== */
.user-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; }
.user-sidebar { display: flex; flex-direction: column; gap: 16px; }
.user-card {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 28px 22px; text-align: center;
  backdrop-filter: blur(12px);
}
.uc-avatar {
  width: 72px; height: 72px; margin: 0 auto 14px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: var(--glow-pink);
}
.user-card h3 { font-size: 18px; margin-bottom: 8px; }
.uc-credits { font-size: 22px; font-weight: 700; color: var(--pink-soft); margin-bottom: 8px; }
.uc-member { font-size: 12px; color: var(--text-mute); margin-bottom: 16px; }
.free-badge { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(155, 107, 255, 0.15); color: var(--purple); }
.user-nav { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 8px; backdrop-filter: blur(12px); }
.user-nav-btn {
  padding: 12px 16px; border-radius: 10px; text-align: left;
  color: var(--text-dim); font-size: 14px; transition: all 0.2s ease;
}
.user-nav-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.user-nav-btn.active { background: linear-gradient(135deg, rgba(255, 107, 181, 0.2), rgba(155, 107, 255, 0.2)); color: var(--pink); }
.user-content { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 28px; min-height: 400px; backdrop-filter: blur(12px); }

/* 统计网格 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card { text-align: center; padding: 20px 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--border-soft); border-radius: 12px; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--pink-soft); margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-mute); }
.stat-section { margin-bottom: 28px; }
.stat-section h3 { font-size: 16px; margin-bottom: 14px; color: var(--text); }
.stat-line { color: var(--text-dim); font-size: 14px; margin-bottom: 12px; }
.progress-bar { width: 100%; height: 8px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--pink), var(--purple)); border-radius: 999px; transition: width 0.5s ease; }

/* 钱包 */
.wallet-summary { display: flex; justify-content: space-between; align-items: center; padding: 24px; background: linear-gradient(135deg, rgba(255, 107, 181, 0.1), rgba(155, 107, 255, 0.1)); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 24px; }
.wallet-balance { display: flex; flex-direction: column; gap: 4px; }
.wb-label { font-size: 12px; color: var(--text-mute); }
.wb-num { font-size: 32px; font-weight: 800; color: var(--pink-soft); }
.tx-list { display: flex; flex-direction: column; gap: 8px; }
.tx-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: rgba(255,255,255,0.03); border-radius: 10px; border: 1px solid var(--border-soft); }
.tx-info { display: flex; flex-direction: column; gap: 2px; }
.tx-desc { font-size: 14px; color: var(--text); }
.tx-date { font-size: 11px; color: var(--text-mute); }
.tx-amount { font-size: 16px; font-weight: 700; }
.tx-amount.positive { color: var(--cyan); }
.tx-amount.negative { color: var(--pink-soft); }

/* 创作者表格 */
.creator-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 13px; }
.creator-table th { text-align: left; padding: 10px 12px; color: var(--text-mute); border-bottom: 1px solid var(--border-soft); font-weight: 600; }
.creator-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--text-dim); }
.badge-public { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(107, 255, 224, 0.15); color: var(--cyan); }
.badge-private { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(155, 107, 255, 0.15); color: var(--purple); }
.trend-chart { display: flex; gap: 8px; align-items: flex-end; height: 80px; padding: 12px; background: rgba(255,255,255,0.03); border-radius: 10px; }
.trend-bar { flex: 1; background: linear-gradient(180deg, var(--pink), var(--purple)); border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.3s ease; }
.trend-labels { display: flex; gap: 8px; margin-top: 6px; }
.trend-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--text-mute); }

/* ========== 定价页 ========== */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-bottom: 48px; }
.pricing-card {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 36px 28px; text-align: center;
  backdrop-filter: blur(12px); position: relative; transition: all 0.3s ease;
}
.pricing-card:hover { transform: translateY(-4px); border-color: var(--border); }
.pricing-popular { border-color: var(--pink); box-shadow: var(--glow-pink); }
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  padding: 4px 16px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(155, 107, 255, 0.2); color: var(--purple);
  border: 1px solid var(--border-soft);
}
.pricing-badge.popular { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; }
.pricing-card h2 { font-size: 22px; margin: 16px 0 12px; }
.pricing-price { font-size: 40px; font-weight: 800; color: var(--pink-soft); margin-bottom: 24px; }
.pricing-price span { font-size: 14px; color: var(--text-mute); font-weight: 400; }
.pricing-features { list-style: none; text-align: left; margin-bottom: 28px; }
.pricing-features li { padding: 8px 0; font-size: 13.5px; color: var(--text-dim); border-bottom: 1px solid rgba(255,255,255,0.04); }
.pricing-faq { max-width: 700px; }
.pricing-faq h3 { font-size: 20px; margin-bottom: 18px; }
.pricing-faq details { padding: 14px 18px; background: var(--card); border: 1px solid var(--border-soft); border-radius: 10px; margin-bottom: 10px; }
.pricing-faq summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); }
.pricing-faq details p { margin-top: 10px; color: var(--text-dim); font-size: 13px; line-height: 1.7; }

/* ========== AI 智能助手 ========== */
.ai-assistant {
  background: linear-gradient(135deg, rgba(255, 107, 181, 0.08), rgba(155, 107, 255, 0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 28px;
  backdrop-filter: blur(12px);
  box-shadow: var(--glow-purple);
  position: relative;
  overflow: hidden;
}
.ai-assistant::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255, 107, 181, 0.06) 0%, transparent 50%);
  animation: ai-pulse 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ai-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}
.ai-assistant-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; position: relative;
}
.ai-assistant-title { display: flex; align-items: center; gap: 14px; }
.ai-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: var(--glow-pink);
  flex-shrink: 0;
}
.ai-assistant-title h3 { font-size: 17px; margin-bottom: 2px; }
.ai-assistant-title p { font-size: 12.5px; color: var(--text-mute); }
.ai-assistant-body { position: relative; }
.ai-material {
  width: 100%; padding: 14px 16px;
  background: rgba(10, 10, 31, 0.6);
  border: 1px solid var(--border-soft);
  border-radius: 12px; color: var(--text);
  font-size: 13.5px; line-height: 1.7;
  font-family: inherit; resize: vertical;
  min-height: 120px; transition: all 0.2s ease;
}
.ai-material:focus {
  outline: none; border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 107, 181, 0.15);
}
.ai-material::placeholder { color: var(--text-mute); font-size: 13px; }
.ai-assistant-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; gap: 14px; flex-wrap: wrap;
}
.ai-assistant-tips { display: flex; gap: 6px; flex-wrap: wrap; }
.tip-chip {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: rgba(107, 255, 224, 0.1); color: var(--cyan);
  border: 1px solid rgba(107, 255, 224, 0.2);
}
.ai-assistant-status {
  margin-top: 14px; padding: 10px 14px; border-radius: 10px;
  font-size: 13px; line-height: 1.6;
}
.ai-assistant-status.loading {
  background: rgba(107, 255, 224, 0.08); color: var(--cyan);
  border: 1px solid rgba(107, 255, 224, 0.2);
}
.ai-assistant-status.success {
  background: rgba(107, 255, 224, 0.1); color: var(--cyan);
  border: 1px solid rgba(107, 255, 224, 0.3);
}
.ai-assistant-status.error {
  background: rgba(255, 138, 138, 0.1); color: #ff8a8a;
  border: 1px solid rgba(255, 138, 138, 0.3);
}
.ai-loading-dots { display: inline-flex; gap: 3px; }
.ai-loading-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); animation: ai-dot 1.2s infinite ease-in-out;
}
.ai-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
/* 字段填充闪烁动画 */
.field-flash {
  animation: fieldFlash 1.2s ease;
}
@keyframes fieldFlash {
  0% { background: rgba(255, 107, 181, 0.25); border-color: var(--pink); }
  100% { background: rgba(10, 10, 31, 0.6); border-color: var(--border-soft); }
}

/* 星号网文流 · 消息格式 */
.msg-dialogue {
  font-weight: 500;
  color: var(--text);
  position: relative;
}
.msg-actions {
  margin-top: 8px;
}
.msg-action {
  font-style: italic;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.8;
  opacity: 0.85;
  border-left: 2px solid var(--border);
  padding-left: 10px;
  margin-left: 2px;
}
.msg-insight {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(155, 107, 255, 0.08);
  border: 1px dashed rgba(155, 107, 255, 0.3);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.msg-insight:hover { background: rgba(155, 107, 255, 0.14); }
.insight-header {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--purple);
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.insight-toggle { font-size: 10.5px; font-weight: 400; opacity: 0.7; }
.msg-insight .insight-body {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(155, 107, 255, 0.2);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-dim);
}
.msg-insight.expanded .insight-body { display: block; }
.msg-insight.expanded .insight-toggle { content: '收起 ↑'; }

/* 心之镜像面板 */
.psyche-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(155, 107, 255, 0.12), rgba(255, 107, 181, 0.12));
  border: 1px solid rgba(155, 107, 255, 0.25);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.psyche-btn:hover {
  background: linear-gradient(135deg, rgba(155, 107, 255, 0.22), rgba(255, 107, 181, 0.22));
  box-shadow: 0 4px 16px rgba(155, 107, 255, 0.15);
}
.psyche-btn.active {
  background: linear-gradient(135deg, rgba(155, 107, 255, 0.28), rgba(255, 107, 181, 0.28));
  border-color: var(--purple);
}
.psyche-btn-icon { font-size: 14px; color: var(--purple); }

.psyche-panel {
  background: linear-gradient(135deg, rgba(155, 107, 255, 0.08), rgba(255, 107, 181, 0.08));
  border: 1px solid rgba(155, 107, 255, 0.2);
  border-radius: 14px;
  padding: 18px;
}
.psyche-loading, .psyche-error {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 12px;
}
.psyche-hero {
  text-align: center;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(155, 107, 255, 0.25);
}
.psyche-emotion {
  font-size: 16px;
  font-weight: 600;
  color: var(--purple);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.psyche-mode {
  font-size: 11px;
  color: var(--text-mute);
}
.psyche-row {
  display: flex; gap: 10px; margin-bottom: 12px;
}
.psyche-row:last-child { margin-bottom: 0; }
.psyche-cell {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 10px;
}
.psyche-cell.psyche-full { flex: 1 1 100%; }
.psyche-label {
  font-size: 10.5px;
  color: var(--text-mute);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.psyche-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

/* 心理距离进度条 */
.psyche-distance { position: relative; padding-top: 4px; }
.distance-track {
  height: 4px;
  background: linear-gradient(90deg, rgba(155, 107, 255, 0.1), rgba(255, 107, 181, 0.25));
  border-radius: 2px;
  position: relative;
  margin: 8px 0 6px;
}
.distance-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  border-radius: 2px;
  transition: width 0.4s ease;
}
.distance-marker {
  position: absolute;
  top: -4px;
  transform: translateX(-50%);
  width: 12px; height: 12px;
  background: var(--pink);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--pink);
}
.distance-tooltip {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.distance-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-mute);
}

/* 情绪共振指数 */
.psyche-resonance { display: flex; align-items: center; gap: 10px; }
.resonance-track {
  flex: 1; height: 6px;
  background: rgba(107, 225, 255, 0.1);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.resonance-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #6be1ff);
  border-radius: 3px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(107, 225, 255, 0.4);
}
.resonance-num {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--blue);
  min-width: 36px;
  text-align: right;
}

/* 威胁信号 */
.psyche-threat { display: flex; align-items: center; justify-content: space-between; }
.threat-dots {
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--pink);
}
.threat-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
}

.psyche-hint {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(155, 107, 255, 0.25);
  font-size: 11.5px;
  color: var(--text-mute);
  line-height: 1.7;
}

/* 确保 assistant 类名也被正确样式化 */
.msg.assistant { align-self: flex-start; flex-direction: column; }
.msg.assistant .msg-content {
  background: linear-gradient(135deg, rgba(155, 107, 255, 0.22), rgba(255, 107, 181, 0.18));
  border: 1px solid var(--border);
  color: var(--text);
  border-top-left-radius: 4px;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-main { height: 70vh; min-height: 500px; }
  .form-row { grid-template-columns: 1fr; }
  .view-title { font-size: 28px; }
  .topbar-inner { padding: 12px 18px; flex-wrap: wrap; gap: 10px; }
  .app { padding: 28px 18px 60px; }
  .card-grid { grid-template-columns: 1fr; }
  .user-layout { grid-template-columns: 1fr; }
  .detail-header { flex-direction: column; text-align: center; }
  .nav { flex-wrap: wrap; }
  .market-toolbar { flex-direction: column; align-items: stretch; }
  .pricing-grid { grid-template-columns: 1fr; }
  .creator-table { font-size: 11px; }
  .creator-table th, .creator-table td { padding: 6px 8px; }
}
