.install-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 2rem;
  overflow-y: auto;
}

.install-header {
  text-align: center;
  padding: 3rem 1rem;
}

.install-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.install-header .subtitle {
  font-size: 1.2rem;
  color: #a0a0a0;
}

.install-instructions {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

.instruction-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.instruction-card h3 {
  font-size: 1.5rem;
  margin: 1rem 0;
  color: #667eea;
}

.instruction-card ol {
  padding-left: 1.5rem;
  line-height: 2;
}

.instruction-card li {
  margin-bottom: 0.5rem;
}

.instruction-card strong {
  color: #667eea;
}

.card-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 1rem;
}

.share-icon, .menu-icon {
  display: inline-block;
  background: rgba(102, 126, 234, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.tip {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  font-size: 0.9rem;
  color: #a0a0a0;
}

.install-btn {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: bold;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.install-hint {
  text-align: center;
  color: #a0a0a0;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.install-benefits {
  max-width: 600px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.install-benefits h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: #667eea;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.benefit-icon {
  font-size: 1.5rem;
}

.benefit-text {
  font-size: 1rem;
  color: #fff;
}

.install-success {
  text-align: center;
  padding: 4rem 2rem;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
}

.install-success h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.install-success p {
  color: #a0a0a0;
}

.install-footer {
  text-align: center;
  padding: 2rem;
}

.back-btn {
  padding: 0.8rem 2rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.desktop .card-icon {
  font-size: 4rem;
}

.desktop-tip {
  color: #a0a0a0;
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .install-header h1 {
    font-size: 1.8rem;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
  }
}
#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(ellipse at center, 
    #0a0a15 0%, 
    #05050a 30%, 
    #020205 70%, 
    #000000 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeOut 0.8s ease-out 2.2s forwards;
}

#splash-screen .splash-content {
  width: 75vw;
  max-width: 75vh;
  height: 75vw;
  max-height: 75vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.5s forwards;
}

.splash-title {
  position: absolute;
  bottom: 15vh;
  text-align: center;
  opacity: 0;
  animation: fadeInUp 1s ease-out 1.2s forwards;
}

.splash-title h1 {
  font-size: 3rem;
  font-weight: bold;
  background: linear-gradient(135deg, #A78BFA, #7F77DD, #534AB7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 40px rgba(127, 119, 221, 0.5);
}

.splash-title p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.3em;
}

.galaxy-container {
  width: 100%;
  height: 100%;
  position: relative;
  animation: rotateGalaxy 6s linear infinite;
  border-radius: 50%;
  mask: radial-gradient(farthest-side, transparent 20%, #fff 22%);
  -webkit-mask: radial-gradient(farthest-side, transparent 20%, #fff 22%);
}

.galaxy-arm {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: 50%;
  transform-origin: center;
}

.galaxy-arm:nth-child(1) {
  background: radial-gradient(ellipse at 30% 50%, 
    rgba(100, 100, 200, 0.15) 0%, 
    rgba(120, 100, 180, 0.1) 30%, 
    rgba(150, 120, 200, 0.05) 50%, 
    rgba(180, 150, 220, 0.02) 70%, 
    transparent 85%);
  transform: rotate(0deg) scaleX(0.35) scaleY(1);
  filter: blur(8px);
}

.galaxy-arm:nth-child(2) {
  background: radial-gradient(ellipse at 70% 50%, 
    rgba(80, 180, 200, 0.15) 0%, 
    rgba(100, 180, 200, 0.1) 30%, 
    rgba(120, 200, 220, 0.05) 50%, 
    rgba(150, 220, 240, 0.02) 70%, 
    transparent 85%);
  transform: rotate(180deg) scaleX(0.35) scaleY(1);
  filter: blur(8px);
}

.galaxy-arm:nth-child(3) {
  background: radial-gradient(ellipse at 50% 30%, 
    rgba(200, 120, 160, 0.15) 0%, 
    rgba(200, 150, 180, 0.1) 30%, 
    rgba(220, 180, 200, 0.05) 50%, 
    rgba(240, 200, 220, 0.02) 70%, 
    transparent 85%);
  transform: rotate(90deg) scaleX(1) scaleY(0.35);
  filter: blur(8px);
}

.galaxy-arm:nth-child(4) {
  background: radial-gradient(ellipse at 50% 70%, 
    rgba(120, 200, 160, 0.15) 0%, 
    rgba(150, 200, 180, 0.1) 30%, 
    rgba(180, 220, 200, 0.05) 50%, 
    rgba(200, 240, 220, 0.02) 70%, 
    transparent 85%);
  transform: rotate(270deg) scaleX(1) scaleY(0.35);
  filter: blur(8px);
}

.galaxy-arm:nth-child(5) {
  background: radial-gradient(ellipse at 20% 20%, 
    rgba(200, 160, 120, 0.12) 0%, 
    rgba(200, 180, 150, 0.08) 35%, 
    rgba(220, 200, 180, 0.04) 55%, 
    rgba(240, 220, 200, 0.02) 75%, 
    transparent 90%);
  transform: rotate(45deg) scaleX(0.3) scaleY(0.85);
  filter: blur(10px);
}

.galaxy-arm:nth-child(6) {
  background: radial-gradient(ellipse at 80% 80%, 
    rgba(160, 200, 120, 0.12) 0%, 
    rgba(180, 200, 150, 0.08) 35%, 
    rgba(200, 220, 180, 0.04) 55%, 
    rgba(220, 240, 200, 0.02) 75%, 
    transparent 90%);
  transform: rotate(225deg) scaleX(0.3) scaleY(0.85);
  filter: blur(10px);
}

.galaxy-arm:nth-child(7) {
  background: radial-gradient(ellipse at 80% 20%, 
    rgba(120, 160, 200, 0.12) 0%, 
    rgba(150, 180, 200, 0.08) 35%, 
    rgba(180, 200, 220, 0.04) 55%, 
    rgba(200, 220, 240, 0.02) 75%, 
    transparent 90%);
  transform: rotate(135deg) scaleX(0.3) scaleY(0.85);
  filter: blur(10px);
}

.galaxy-arm:nth-child(8) {
  background: radial-gradient(ellipse at 20% 80%, 
    rgba(160, 120, 200, 0.12) 0%, 
    rgba(180, 150, 200, 0.08) 35%, 
    rgba(200, 180, 220, 0.04) 55%, 
    rgba(220, 200, 240, 0.02) 75%, 
    transparent 90%);
  transform: rotate(315deg) scaleX(0.3) scaleY(0.85);
  filter: blur(10px);
}

.galaxy-star {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, rgba(255, 255, 255, 0.8) 50%, transparent 100%);
  animation: twinkle 2s ease-in-out infinite;
}

.galaxy-star.small {
  width: 2px;
  height: 2px;
  box-shadow: 0 0 4px #ffffff, 0 0 8px #ffffff;
}

.galaxy-star.medium {
  width: 3px;
  height: 3px;
  box-shadow: 0 0 6px #ffffff, 0 0 12px #ffffff, 0 0 18px #ffffaa;
}

.galaxy-star.large {
  width: 4px;
  height: 4px;
  box-shadow: 0 0 8px #ffffff, 0 0 16px #ffffff, 0 0 24px #ffff88;
}

.galaxy-star.blue {
  background: radial-gradient(circle, #88ffff 0%, rgba(136, 255, 255, 0.8) 50%, transparent 100%);
  box-shadow: 0 0 6px #88ffff, 0 0 12px #88ffff, 0 0 18px #44cccc;
}

.galaxy-star.pink {
  background: radial-gradient(circle, #ff88cc 0%, rgba(255, 136, 204, 0.8) 50%, transparent 100%);
  box-shadow: 0 0 6px #ff88cc, 0 0 12px #ff88cc, 0 0 18px #cc66aa;
}

.galaxy-star.yellow {
  background: radial-gradient(circle, #ffff88 0%, rgba(255, 255, 136, 0.8) 50%, transparent 100%);
  box-shadow: 0 0 6px #ffff88, 0 0 12px #ffff88, 0 0 18px #cccc66;
}

.galaxy-star.purple {
  background: radial-gradient(circle, #cc88ff 0%, rgba(204, 136, 255, 0.8) 50%, transparent 100%);
  box-shadow: 0 0 6px #cc88ff, 0 0 12px #cc88ff, 0 0 18px #aa66cc;
}

.galaxy-core-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 125px;
  height: 125px;
  border-radius: 50%;
  background: radial-gradient(circle, 
    transparent 0%, 
    rgba(100, 100, 150, 0.3) 40%, 
    rgba(50, 50, 100, 0.5) 70%, 
    rgba(20, 20, 50, 0.8) 100%);
  box-shadow: 
    inset 0 0 30px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(100, 100, 200, 0.3),
    0 0 80px rgba(100, 100, 200, 0.2),
    0 0 120px rgba(100, 100, 200, 0.1);
  animation: corePulse 4s ease-in-out infinite;
}

.galaxy-tunnel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 125px;
  height: 125px;
  border-radius: 50%;
  background: radial-gradient(circle, 
    #000000 0%, 
    #020208 20%, 
    #050510 40%, 
    #080815 60%, 
    #0a0a1a 80%, 
    #05050f 100%);
  box-shadow: 
    inset 0 0 30px rgba(0, 0, 0, 0.9),
    inset 0 0 50px rgba(20, 20, 40, 0.5),
    inset 0 0 80px rgba(10, 10, 30, 0.3);
  animation: tunnelPulse 3s ease-in-out infinite;
}

.tunnel-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(100, 100, 200, 0.3);
  animation: tunnelRing 4s linear infinite;
}

.tunnel-ring:nth-child(1) {
  width: 60px;
  height: 60px;
  animation-delay: 0s;
}

.tunnel-ring:nth-child(2) {
  width: 80px;
  height: 80px;
  animation-delay: 0.5s;
}

.tunnel-ring:nth-child(3) {
  width: 100px;
  height: 100px;
  animation-delay: 1s;
}

.tunnel-ring:nth-child(4) {
  width: 120px;
  height: 120px;
  animation-delay: 1.5s;
}

@keyframes rotateGalaxy {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(180deg);
  }
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes corePulse {
  0%, 100% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

@keyframes tunnelPulse {
  0%, 100% {
    opacity: 0.8;
    box-shadow: 
      inset 0 0 20px rgba(50, 50, 100, 0.5),
      inset 0 0 40px rgba(30, 30, 60, 0.3);
  }
  50% {
    opacity: 1;
    box-shadow: 
      inset 0 0 30px rgba(80, 80, 150, 0.6),
      inset 0 0 60px rgba(50, 50, 100, 0.4);
  }
}

@keyframes tunnelRing {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    pointer-events: none;
  }
}* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 默认暗色主题（会被 applyTheme 覆盖） */
  --bg-primary: #0D0D1A;
  --bg-secondary: #141428;
  --bg-tertiary: #1A1A38;
  --accent: #7F77DD;
  --accent-hover: #9B93EE;
  --text-primary: #E0E0E0;
  --text-secondary: #9E9CB8;
  --border: rgba(127, 119, 221, 0.15);
  --surface: #1A1A2E;
  --success: #1D9E75;
  --warning: #BA7517;
  --user-msg-bg: rgba(83, 74, 183, 0.35);
  --assistant-msg-bg: rgba(26, 26, 56, 0.75);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 100%;
  margin: 0 auto;
}

.main-content {
  flex: 1;
  padding-bottom: 70px;
  overflow-y: auto;
  position: relative;
  min-height: calc(100vh - 70px);
}

.page {
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  min-height: 100%;
}

/* 市场/万界/自创页需要内部padding（已由各自header提供） */
.market-page {
  padding: 0;
}

/* 其他页面维持原有内边距 */
.games-page,
.plugins-page,
.profile-page,
.worldbook-detail-page {
  padding: 16px;
}

/* 桌面端居中 + 移动端宽度约束 */
.market-page-container {
  max-width: 480px;
  margin: 0 auto;
}

.profile-page {
  color: var(--text-primary);
  background-color: transparent;
}

.page-header {
  margin-bottom: 20px;
  text-align: center;
  position: relative;
}

.page-header h1 {
  font-size: 24px;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

.update-btn {
  position: absolute;
  left: calc(100% / 6 - 15px);
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  background-color: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  color: var(--text-primary);
  transition: transform 0.3s ease;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.update-btn::after {
  content: "";
  width: 22px;
  height: 22px;
  border: 3px solid var(--text-primary);
  border-top-color: transparent;
  border-radius: 50%;
  position: absolute;
}

.update-btn:hover {
  transform: translateY(-50%) rotate(180deg);
  background: transparent;
}

.update-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@keyframes spin-update {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

.update-modal .version-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.update-modal .version-item {
  text-align: center;
}

.update-modal .version-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.update-modal .version-value {
  font-size: 18px;
  font-weight: bold;
}

.update-modal .version-value.current {
  color: var(--text-primary);
}

.update-modal .version-value.latest {
  color: var(--accent-color);
}

.update-modal .version-arrow {
  font-size: 20px;
  color: var(--accent-color);
}

.update-modal .changelog {
  background: var(--surface);
  border-radius: 8px;
  padding: 12px;
}

.update-modal .changelog-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.update-modal .changelog-content {
  font-size: 14px;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.update-modal .update-message {
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.update-modal .version-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 世界书分组样式 */
.worldbook-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background-color: var(--bg-tertiary);
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
  font-size: inherit;
  color: inherit;
}

.group-header:hover {
  background-color: var(--bg-secondary);
  border-color: var(--border);
}

.group-header:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.group-arrow {
  font-size: 12px;
  color: var(--text-secondary);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.group-header.expanded .group-arrow {
  transform: rotate(90deg);
}

.group-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex-grow: 1;
  text-align: left;
}

.group-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.group-count {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* 收藏按钮样式 */
.favorite-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: all 0.2s;
  flex-shrink: 0;
}

.favorite-btn:hover {
  color: #f5a623;
  transform: scale(1.1);
}

.favorite-btn.favorited {
  color: #f5a623;
}

.favorite-btn::before {
  content: "☆";
}

.favorite-btn.favorited::before {
  content: "★";
}

/* 世界书卡片标题行 */
.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 4px;
}

.card-title-row .card-title {
  margin: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.4;
}

/* 世界书卡片收藏按钮 — 浮动在封面右上角 */
.card-favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(4px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  transition: all 0.2s;
  padding: 0;
  z-index: 2;
}

.card-favorite-btn:hover {
  color: #f5a623;
  background: rgba(0,0,0,0.4);
  transform: scale(1.1);
}

.card-favorite-btn.favorited {
  color: #f5a623;
  background: rgba(245,166,35,0.2);
}

.card-favorite-btn::before {
  content: "☆";
}

.card-favorite-btn.favorited::before {
  content: "★";
}

/* 收藏页面网格布局 */
.favorites-grid {
  display: grid;
  grid-template-columns: repeat(3, 120px);
  gap: 16px;
  justify-content: center;
  padding: 0 20px;
}

.favorite-card {
  width: 120px;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.favorite-card:hover {
  border-color: var(--accent-color);
}

.favorite-card.expanded {
  width: calc(360px + 32px);
  grid-column: span 3;
  margin: 0 auto;
}

.favorite-cover {
  width: 100%;
  height: 120px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.favorite-emoji {
  font-size: 28px;
}

.favorite-info {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.favorite-header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.favorite-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.favorite-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.favorite-remove {
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  color: #f5a623;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.favorite-remove:hover {
  color: #e59500;
  transform: scale(1.2);
}

.favorite-arrow {
  font-size: 12px;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.favorite-card.expanded .favorite-arrow {
  transform: rotate(180deg);
}

.favorite-conversations {
  background-color: var(--bg-secondary);
  padding: 8px;
  border-top: 1px solid var(--border);
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.conv-item:hover {
  background-color: var(--bg-tertiary);
}

.conv-item.selected {
  background-color: var(--accent-color);
  color: white;
}

.conv-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.conv-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.conv-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.conv-title {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
}

.conv-date {
  font-size: 10px;
  color: var(--text-secondary);
}

.no-conv {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  gap: 4px;
}

.no-conv-icon {
  font-size: 20px;
}

.no-conv-text {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 展开的卡片容器 - 带左侧树状线 */
.group-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 8px;
  margin-left: 6px;
  border-left: 0.5px solid var(--border);
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 游戏存档列表 - 新设计 ===== */

.games-list-view {
  padding: 0;
}

.games-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 4px;
}

.games-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.games-section {
  padding: 8px 16px 0;
}

.games-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.games-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.games-search-input {
  width: 140px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.games-search-input:focus {
  border-color: var(--accent);
}

/* 最近游玩卡片 */
.game-recent-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(127,119,221,0.15), rgba(83,74,183,0.08));
  border: 1px solid rgba(127,119,221,0.2);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.game-recent-card:active {
  background: linear-gradient(135deg, rgba(127,119,221,0.25), rgba(83,74,183,0.12));
  transform: scale(0.98);
}

.game-recent-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
}
.game-recent-icon .game-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-recent-info {
  flex: 1;
  min-width: 0;
}
.game-recent-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-recent-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.game-recent-arrow {
  font-size: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* 存档卡片 - 新设计 */
.games-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background-color: var(--bg-tertiary);
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.game-card:active {
  background-color: var(--bg-secondary);
  transform: scale(0.98);
}
.game-card.edit-mode {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.game-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
}

.game-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.game-info {
  flex: 1;
  min-width: 0;
}
.game-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-card-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0;
}

.game-card-star {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.game-card-star:hover {
  color: #f5a623;
}

/* 编辑操作按钮组 */
.edit-actions {
  position: absolute;
  top: -1px;
  right: -1px;
  display: flex;
  gap: 6px;
  z-index: 10;
  padding: 6px;
  background: var(--bg-primary);
  border-radius: 0 12px 0 10px;
  border: 1px solid var(--accent);
  border-top: none;
  border-right: none;
}
.edit-actions button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.edit-actions button:active {
  transform: scale(0.95);
}
.edit-actions .delete-btn {
  border-color: rgba(255,68,68,0.4);
  color: #ff4444;
}
.edit-actions .rename-btn {
  color: var(--accent);
}
.edit-actions .avatar-btn {
  color: var(--text-secondary);
}
.edit-actions .cancel-edit-btn {
  color: var(--text-secondary);
  border-color: var(--border);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}
.empty-state p {
  margin: 4px 0;
}
.empty-state .hint {
  font-size: 12px;
  opacity: 0.6;
}

/* ===== /游戏存档列表 ===== */

.favorites-btn {
  padding: 8px 12px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-primary);
  transition: all 0.2s;
  white-space: nowrap;
}

.favorites-btn:hover {
  background-color: var(--bg-secondary);
  border-color: var(--accent-color);
}

.favorites-btn.active {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.sub-nav {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-primary);
}

.sub-nav-item {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.sub-nav-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, #7F77DD, #534AB7);
}

.sub-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.wanjie-container {
  padding: 0 0 20px;
}

.wanjie-header {
  display: flex;
  justify-content: flex-end;
  padding: 8px 0;
}

.btn-post {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background-color: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-post:hover {
  opacity: 0.85;
}

.wanjie-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wanjie-post {
  background-color: var(--bg-tertiary);
  border-radius: 14px;
  padding: 16px;
  transition: all 0.2s;
}

.wanjie-post.is-review {
  border-left: 3px solid var(--accent);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.post-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.post-avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.post-author {
  font-weight: 600;
  color: var(--text-primary);
}

.post-type-badge {
  font-size: 11px;
  color: var(--accent);
  background-color: rgba(233, 69, 96, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.post-time {
  color: var(--text-secondary);
  font-size: 12px;
  margin-left: auto;
}

.post-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text-primary);
}

.post-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0 0 8px;
  white-space: pre-wrap;
}

.post-rating {
  font-size: 14px;
  color: #fbbf24;
  margin-bottom: 8px;
}

.post-actions {
  display: flex;
  gap: 8px;
}

.like-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.like-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.like-btn.liked {
  color: #ef4444;
}

.post-modal {
  max-height: 90vh;
  border-radius: 20px !important;
}

.post-modal label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  margin-top: 12px;
}

.post-modal input,
.post-modal textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  box-sizing: border-box;
}

.post-modal textarea {
  resize: vertical;
  font-family: inherit;
}

.post-modal select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  box-sizing: border-box;
}

.post-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  box-sizing: border-box;
  resize: vertical;
  font-family: inherit;
}

/* 通知系统 */
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}

.notification-modal {
  max-width: 400px;
  max-height: 500px;
}

.notification-modal .modal-content {
  max-height: 350px;
  overflow-y: auto;
}

.notification-list {
  max-height: 350px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.notification-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}

.notification-time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 8px;
}

.empty-notification {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
}

.post-detail-modal {
  max-height: 85vh;
  border-radius: 20px !important;
  display: flex;
  flex-direction: column;
}

.detail-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

.detail-modal-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text-primary);
}

.detail-modal-content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  margin-bottom: 16px;
}

.detail-modal-comments {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: auto;
}

.detail-modal-comments h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text-primary);
}

.no-comments {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

.comment-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.comment-author {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  margin-right: 8px;
}

.comment-time {
  font-size: 11px;
  color: var(--text-secondary);
}

.comment-content {
  font-size: 14px;
  color: var(--text-primary);
  margin: 4px 0 0;
  line-height: 1.5;
}

.comment-input-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.comment-input-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
}

.comment-input-row button {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.zichuang-container .delete-btn {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: transparent;
  color: #ef4444;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.zichuang-container .delete-btn:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

/* ===== 自创 - 新建世界书卡片 ===== */
.zichuang-create-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(127, 119, 221, 0.12), rgba(99, 102, 241, 0.08));
  border: 1.5px dashed rgba(127, 119, 221, 0.4);
  cursor: pointer;
  transition: all 0.25s;
}
.zichuang-create-card:hover {
  background: linear-gradient(135deg, rgba(127, 119, 221, 0.2), rgba(99, 102, 241, 0.14));
  border-color: var(--primary);
}
.zichuang-create-card:active {
  transform: scale(0.98);
}
.zichuang-create-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  font-size: 24px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.zichuang-create-text {
  flex: 1;
}
.zichuang-create-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.zichuang-create-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px 0 0;
}

/* ===== 自创 - 世界书卡片操作栏 ===== */
.worldbook-card-group {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.worldbook-card-group .worldbook-card {
  border: none;
  border-radius: 0;
  margin-bottom: 0;
}
.card-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.card-action-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.card-action-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.card-action-btn.plugin-btn {
  color: var(--primary);
  border-color: rgba(127, 119, 221, 0.3);
}
.card-action-btn.plugin-btn:hover,
.card-action-btn.plugin-btn.active {
  background: rgba(127, 119, 221, 0.12);
}
.card-action-btn.delete-btn {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ===== 插件管理面板 ===== */
.plugin-panel {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-tertiary);
  animation: pluginPanelIn 0.25s ease;
}
@keyframes pluginPanelIn {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 600px; }
}
.plugin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.plugin-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.plugin-panel-sub {
  font-size: 11px;
  color: var(--text-secondary);
}
.plugin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plugin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  gap: 10px;
}
.plugin-item-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.plugin-item-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg-tertiary);
}
.plugin-item-info {
  flex: 1;
  min-width: 0;
}
.plugin-item-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.plugin-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.plugin-item-price {
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  background: rgba(127, 119, 221, 0.1);
  padding: 1px 8px;
  border-radius: 6px;
}
.plugin-item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 4px 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plugin-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-secondary);
}
.plugin-status-badge {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.plugin-status-badge.on {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}
.plugin-status-badge.off {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
}
.plugin-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.plugin-action-btn {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.plugin-action-btn:hover {
  background: var(--bg-tertiary);
}
.plugin-action-btn.on {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}
.plugin-action-btn.off {
  color: var(--primary);
  border-color: rgba(127, 119, 221, 0.3);
}
.plugin-action-btn.danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.plugin-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
}
.plugin-empty p {
  margin: 0;
  font-size: 13px;
}
.plugin-empty-sub {
  font-size: 11px !important;
  margin-top: 4px !important;
  opacity: 0.7;
}
.plugin-add-btn {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  border: 1.5px dashed rgba(127, 119, 221, 0.4);
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.plugin-add-btn:hover {
  background: rgba(127, 119, 221, 0.08);
  border-color: var(--primary);
}

/* ===== 插件编辑弹窗 ===== */
.plugin-modal {
  border-radius: 20px !important;
}
.plugin-form-icon-picker {
  margin-bottom: 12px;
}
.plugin-form-icon-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.plugin-icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.plugin-icon-option {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-tertiary);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}
.plugin-icon-option:hover {
  background: rgba(127, 119, 221, 0.1);
  border-color: rgba(127, 119, 221, 0.3);
}
.plugin-icon-option.selected {
  border-color: var(--primary);
  background: rgba(127, 119, 221, 0.2);
  box-shadow: 0 0 0 2px rgba(127, 119, 221, 0.15);
}
.plugin-price-input {
  display: flex;
  align-items: center;
  gap: 8px;
}
.plugin-price-input input {
  width: 80px !important;
  text-align: center;
}
.plugin-price-unit {
  font-size: 13px;
  color: var(--text-secondary);
}

.edit-modal {
  max-height: 90vh;
  border-radius: 20px !important;
}

.edit-modal label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  margin-top: 12px;
}

.edit-modal input,
.edit-modal textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  box-sizing: border-box;
}

.edit-modal textarea {
  resize: vertical;
  font-family: inherit;
}

.edit-content-textarea {
  min-height: 200px;
  font-family: monospace !important;
  font-size: 13px !important;
  line-height: 1.5;
  white-space: pre-wrap;
}

.edit-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.edit-modal-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border) !important;
}

.btn-secondary:hover {
  background-color: var(--border);
}

/* ===== 底部导航栏 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  min-height: 44px;
  min-width: 44px;
  background: none;
  border: none;
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.nav-item.active {
  background: rgba(127, 119, 221, 0.12);
  color: #CECBF6;
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  opacity: 0.5;
}

.nav-item.active .nav-icon svg {
  opacity: 1;
}

.nav-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.5;
}

.nav-item.active .nav-label {
  opacity: 1;
  font-weight: 600;
}

/* 共创圆形 FAB */
.nav-item.cocreate-btn {
  position: relative;
  top: -8px;
}

.nav-item.cocreate-btn .nav-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7F77DD, #A78BFA, #534AB7, #7F77DD);
  background-size: 300% 300%;
  animation: cocreateFlow 4s ease-in-out infinite;
  box-shadow: 0 4px 16px rgba(127, 119, 221, 0.40);
  transition: transform 0.15s, box-shadow 0.15s;
}

@keyframes cocreateFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.nav-item.cocreate-btn .nav-icon svg {
  width: 20px;
  height: 20px;
  stroke: #FFFFFF;
  opacity: 1;
}

.nav-item.cocreate-btn:active .nav-icon {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(127, 119, 221, 0.25);
}

.nav-item.cocreate-btn .nav-label {
  margin-top: -2px;
}

.nav-item.clicking {
  /* keep for backward compat but no glow animation */
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* ===== 魔法阵加载动画 ===== */
.magic-loader {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
}

.magic-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid transparent;
}

.ring-outer {
  border-top: 2px solid #a78bfa;
  border-right: 2px solid rgba(167, 139, 250, 0.3);
  animation: magicSpin 3s linear infinite;
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.5));
}

.ring-mid {
  top: 15%;
  left: 15%;
  width: 70%;
  height: 70%;
  border-top: 2px solid #667eea;
  border-left: 2px solid rgba(102, 126, 234, 0.3);
  animation: magicSpin 2s linear infinite reverse;
  filter: drop-shadow(0 0 4px rgba(102, 126, 234, 0.5));
}

.ring-inner {
  top: 30%;
  left: 30%;
  width: 40%;
  height: 40%;
  border: 1px solid rgba(118, 75, 162, 0.6);
  border-bottom: 2px solid #764ba2;
  animation: magicSpin 1.5s linear infinite;
  filter: drop-shadow(0 0 3px rgba(118, 75, 162, 0.5));
}

@keyframes magicSpin {
  to { transform: rotate(360deg); }
}

/* 飘散粒子 */
.magic-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #a78bfa;
  animation: particleFloat 2s ease-in-out infinite;
}

.magic-particle.p1 { top: 0; left: 50%; animation-delay: 0s; }
.magic-particle.p2 { top: 50%; right: 0; animation-delay: 0.5s; background: #667eea; }
.magic-particle.p3 { bottom: 0; left: 50%; animation-delay: 1s; background: #764ba2; }
.magic-particle.p4 { top: 50%; left: 0; animation-delay: 1.5s; background: #f093fb; }

@keyframes particleFloat {
  0%, 100% {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translate(var(--tx, 10px), var(--ty, -10px)) scale(1);
  }
}

.magic-particle.p1 { --tx: 0px; --ty: -15px; }
.magic-particle.p2 { --tx: 15px; --ty: 0px; }
.magic-particle.p3 { --tx: 0px; --ty: 15px; }
.magic-particle.p4 { --tx: -15px; --ty: 0px; }

/* 中心图标 */
.magic-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  animation: corePulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.8));
}

@keyframes corePulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1;
  }
}

/* 文字动画 */
.hint-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  animation: fadeInUp 0.6s ease-out both;
}

.hint-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.empty-state .hint {
  font-size: 12px;
  margin-top: 8px;
}

.search-bar {
  margin-bottom: 16px;
}

.search-bar input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
}

.search-bar input::placeholder {
  color: var(--text-secondary);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
}

.tags-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.tags-filter::-webkit-scrollbar {
  display: none;
}

.tag-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-chip.active {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ===== 灵感工坊 ===== */
.inspiration-workshop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #0A0E27 0%, #141838 45%, #0D1035 100%);
  overflow: hidden;
  touch-action: none;
  animation: bgShift 8s ease-in-out infinite alternate, workshopEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes workshopEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes bgShift {
  0% { background: linear-gradient(135deg, #0A0E27 0%, #141838 45%, #0D1035 100%); }
  100% { background: linear-gradient(135deg, #0D1035 0%, #1A1240 45%, #0A0E27 100%); }
}

/* 层1: 背景色相微移 */

/* 层2: 星空层 — 80+ 闪烁星点 */
.inspiration-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 5% 8%, rgba(255,255,255,0.9), transparent),
    radial-gradient(0.8px 0.8px at 12% 15%, rgba(200,210,255,0.7), transparent),
    radial-gradient(1.2px 1.2px at 18% 5%, rgba(255,255,255,0.85), transparent),
    radial-gradient(0.6px 0.6px at 22% 22%, rgba(180,200,255,0.5), transparent),
    radial-gradient(1px 1px at 28% 10%, rgba(255,255,255,0.75), transparent),
    radial-gradient(0.7px 0.7px at 33% 28%, rgba(200,220,255,0.55), transparent),
    radial-gradient(1.3px 1.3px at 38% 7%, rgba(255,255,255,0.9), transparent),
    radial-gradient(0.5px 0.5px at 42% 18%, rgba(180,210,255,0.4), transparent),
    radial-gradient(1px 1px at 48% 4%, rgba(255,255,255,0.7), transparent),
    radial-gradient(0.9px 0.9px at 52% 25%, rgba(200,200,255,0.65), transparent),
    radial-gradient(0.7px 0.7px at 58% 12%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1.1px 1.1px at 63% 20%, rgba(200,220,255,0.8), transparent),
    radial-gradient(0.6px 0.6px at 68% 6%, rgba(180,200,255,0.45), transparent),
    radial-gradient(1px 1px at 73% 16%, rgba(255,255,255,0.7), transparent),
    radial-gradient(0.8px 0.8px at 78% 27%, rgba(200,210,255,0.6), transparent),
    radial-gradient(1.2px 1.2px at 82% 9%, rgba(255,255,255,0.85), transparent),
    radial-gradient(0.5px 0.5px at 87% 22%, rgba(180,200,255,0.4), transparent),
    radial-gradient(1px 1px at 92% 14%, rgba(255,255,255,0.75), transparent),
    radial-gradient(0.7px 0.7px at 96% 8%, rgba(200,220,255,0.5), transparent),
    radial-gradient(0.9px 0.9px at 8% 35%, rgba(180,210,255,0.55), transparent),
    radial-gradient(1px 1px at 15% 42%, rgba(255,255,255,0.7), transparent),
    radial-gradient(0.6px 0.6px at 24% 52%, rgba(200,200,255,0.45), transparent),
    radial-gradient(1.1px 1.1px at 35% 38%, rgba(255,255,255,0.8), transparent),
    radial-gradient(0.8px 0.8px at 45% 48%, rgba(180,220,255,0.55), transparent),
    radial-gradient(1px 1px at 55% 40%, rgba(255,255,255,0.65), transparent),
    radial-gradient(0.7px 0.7px at 65% 55%, rgba(200,210,255,0.5), transparent),
    radial-gradient(1.2px 1.2px at 75% 35%, rgba(255,255,255,0.85), transparent),
    radial-gradient(0.5px 0.5px at 85% 50%, rgba(180,200,255,0.4), transparent),
    radial-gradient(0.9px 0.9px at 95% 42%, rgba(200,220,255,0.6), transparent),
    radial-gradient(1px 1px at 3% 60%, rgba(255,255,255,0.7), transparent),
    radial-gradient(0.6px 0.6px at 18% 68%, rgba(180,210,255,0.45), transparent),
    radial-gradient(1.3px 1.3px at 28% 62%, rgba(255,255,255,0.9), transparent),
    radial-gradient(0.8px 0.8px at 40% 72%, rgba(200,200,255,0.55), transparent),
    radial-gradient(1px 1px at 52% 65%, rgba(255,255,255,0.7), transparent),
    radial-gradient(0.7px 0.7px at 62% 75%, rgba(180,220,255,0.5), transparent),
    radial-gradient(1.1px 1.1px at 72% 58%, rgba(255,255,255,0.8), transparent),
    radial-gradient(0.5px 0.5px at 82% 70%, rgba(200,210,255,0.4), transparent),
    radial-gradient(0.9px 0.9px at 92% 62%, rgba(255,255,255,0.65), transparent),
    radial-gradient(1px 1px at 10% 82%, rgba(180,200,255,0.6), transparent),
    radial-gradient(0.7px 0.7px at 22% 88%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1.2px 1.2px at 35% 78%, rgba(200,220,255,0.8), transparent),
    radial-gradient(0.6px 0.6px at 48% 92%, rgba(180,210,255,0.4), transparent),
    radial-gradient(1px 1px at 58% 85%, rgba(255,255,255,0.7), transparent),
    radial-gradient(0.8px 0.8px at 68% 80%, rgba(200,200,255,0.55), transparent),
    radial-gradient(1.1px 1.1px at 78% 90%, rgba(255,255,255,0.75), transparent),
    radial-gradient(0.5px 0.5px at 88% 82%, rgba(180,220,255,0.35), transparent),
    radial-gradient(0.9px 0.9px at 98% 78%, rgba(200,210,255,0.6), transparent);
  animation: twinkleLayer1 5s ease-in-out infinite alternate;
}

/* 层2伪元素: 15颗亮星带十字光晕 */
.inspiration-workshop::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(2px 2px at 15% 20%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2.5px 2.5px at 35% 12%, rgba(200,220,255,0.9), transparent),
    radial-gradient(2px 2px at 55% 25%, rgba(255,255,255,0.85), transparent),
    radial-gradient(3px 3px at 72% 18%, rgba(200,200,255,0.95), transparent),
    radial-gradient(2px 2px at 88% 22%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2.5px 2.5px at 10% 65%, rgba(180,220,255,0.9), transparent),
    radial-gradient(2px 2px at 30% 55%, rgba(255,255,255,0.85), transparent),
    radial-gradient(3px 3px at 48% 70%, rgba(200,210,255,0.95), transparent),
    radial-gradient(2px 2px at 65% 50%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2.5px 2.5px at 82% 68%, rgba(180,200,255,0.9), transparent),
    radial-gradient(2px 2px at 95% 45%, rgba(255,255,255,0.85), transparent),
    radial-gradient(2px 2px at 20% 88%, rgba(200,220,255,0.8), transparent),
    radial-gradient(3px 3px at 42% 85%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 60% 90%, rgba(180,210,255,0.85), transparent),
    radial-gradient(2.5px 2.5px at 78% 82%, rgba(255,255,255,0.8), transparent);
  animation: twinkleLayer2 4.5s ease-in-out infinite alternate;
}

/* 层3伪元素: 上升粒子流 */
.inspiration-workshop::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 35px,
      rgba(127, 119, 221, 0.04) 36px,
      transparent 37px
    ),
    repeating-linear-gradient(
      15deg,
      transparent,
      transparent 50px,
      rgba(167, 139, 250, 0.03) 51px,
      transparent 52px
    );
  animation: particleRise 12s linear infinite;
}

@keyframes twinkleLayer1 {
  0% { opacity: 0.55; }
  50% { opacity: 0.9; }
  100% { opacity: 0.7; }
}
@keyframes twinkleLayer2 {
  0% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 0.85; transform: translateY(-6px); }
  100% { opacity: 0.5; transform: translateY(0); }
}
@keyframes particleRise {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 -100px, 0 -200px; }
}

.inspiration-bubbles {
  position: absolute;
  inset: 0;
  padding: 80px 16px 120px;
}

.inspiration-bubble {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), rgba(120,80,255,0.2) 50%, rgba(60,40,180,0.15));
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow:
    0 0 15px rgba(120,80,255,0.15),
    inset 0 -5px 15px rgba(0,0,0,0.2),
    inset 0 5px 15px rgba(255,255,255,0.05);
  cursor: pointer;
  animation: float linear infinite;
  transition: transform 0.15s, opacity 0.3s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: visible;
}

/* 色系变体 */
.inspiration-bubble.purple {
  background: radial-gradient(circle at 30% 30%, rgba(200,180,255,0.3), rgba(127,119,221,0.25) 50%, rgba(83,74,183,0.15));
  border-color: rgba(167,139,250,0.25);
  box-shadow: 0 0 18px rgba(127,119,221,0.2), inset 0 -6px 18px rgba(83,74,183,0.25), inset 0 6px 18px rgba(200,180,255,0.06);
}
.inspiration-bubble.blue {
  background: radial-gradient(circle at 30% 30%, rgba(160,200,255,0.3), rgba(96,165,250,0.25) 50%, rgba(37,99,235,0.15));
  border-color: rgba(96,165,250,0.25);
  box-shadow: 0 0 18px rgba(96,165,250,0.2), inset 0 -6px 18px rgba(37,99,235,0.25), inset 0 6px 18px rgba(160,200,255,0.06);
}
.inspiration-bubble.gold {
  background: radial-gradient(circle at 30% 30%, rgba(255,230,160,0.3), rgba(251,191,36,0.25) 50%, rgba(217,119,6,0.15));
  border-color: rgba(251,191,36,0.25);
  box-shadow: 0 0 18px rgba(251,191,36,0.2), inset 0 -6px 18px rgba(217,119,6,0.25), inset 0 6px 18px rgba(255,230,160,0.06);
}
.inspiration-bubble.pink {
  background: radial-gradient(circle at 30% 30%, rgba(255,180,220,0.3), rgba(244,114,182,0.25) 50%, rgba(190,24,93,0.15));
  border-color: rgba(244,114,182,0.25);
  box-shadow: 0 0 18px rgba(244,114,182,0.2), inset 0 -6px 18px rgba(190,24,93,0.25), inset 0 6px 18px rgba(255,180,220,0.06);
}

.inspiration-bubble:active {
  transform: scale(1.3);
  opacity: 0;
}

/* 炸裂动画 */
.inspiration-bubble.exploding {
  animation: bubbleExplode 0.5s ease-out forwards !important;
  pointer-events: none;
}
@keyframes bubbleExplode {
  0% { transform: scale(1); opacity: 1; }
  30% { transform: scale(1.5); opacity: 0.7; }
  100% { transform: scale(0); opacity: 0; }
}

/* 炸裂粒子 */
.inspiration-bubble.exploding::before,
.inspiration-bubble.exploding::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
  animation: particleFly 0.6s ease-out forwards;
}
.inspiration-bubble.exploding::before {
  animation-delay: 0s;
}
.inspiration-bubble.exploding::after {
  animation-delay: 0.08s;
}
@keyframes particleFly {
  0% { transform: translate(0, 0) scale(1); opacity: 0.9; }
  100% { transform: translate(var(--px, 30px), var(--py, -30px)) scale(0.2); opacity: 0; }
}

.inspiration-bubble.purple.exploding::before  { --px: 20px;  --py: -25px; color: #C4B5FD; }
.inspiration-bubble.purple.exploding::after   { --px: -18px; --py: -20px; color: #7F77DD; }
.inspiration-bubble.blue.exploding::before    { --px: 22px;  --py: -28px; color: #93C5FD; }
.inspiration-bubble.blue.exploding::after     { --px: -20px; --py: -15px; color: #60A5FA; }
.inspiration-bubble.gold.exploding::before    { --px: 18px;  --py: -22px; color: #FDE68A; }
.inspiration-bubble.gold.exploding::after     { --px: -22px; --py: -25px; color: #FBBF24; }
.inspiration-bubble.pink.exploding::before    { --px: 25px;  --py: -20px; color: #FBCFE8; }
.inspiration-bubble.pink.exploding::after     { --px: -16px; --py: -28px; color: #F472B6; }

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

.bubble-text {
  color: rgba(255,255,255,0.9);
  text-shadow: 0 0 8px rgba(120,80,255,0.5);
  pointer-events: none;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 1px;
}

.inspiration-hint {
  position: absolute;
  bottom: 45%;
  left: 50%;
  transform: translate(-50%, 50%);
  text-align: center;
  color: rgba(255,255,255,0.25);
  font-size: 14px;
  pointer-events: none;
  animation: hintFadeIn 1s ease-out;
}
@keyframes hintFadeIn {
  from { opacity: 0; transform: translate(-50%, 60%); }
  to { opacity: 1; transform: translate(-50%, 50%); }
}
.inspiration-hint-sub {
  font-size: 12px;
  margin-top: 6px;
  opacity: 0.5;
}

.inspiration-memory {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(12,14,36,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px 20px 0 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  z-index: 10;
  animation: memorySlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.inspiration-memory::before {
  content: '';
  display: block;
  margin: 0 auto 10px;
  width: 40px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(127,119,221,0.5), transparent);
}
@keyframes memorySlideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.memory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.memory-title {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
  letter-spacing: 0.5px;
}
.memory-clear-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.memory-clear-btn:hover {
  border-color: rgba(244,114,182,0.3);
  color: rgba(244,114,182,0.7);
}

.memory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}
.memory-tag {
  padding: 5px 12px;
  border-radius: 14px;
  background: rgba(127,119,221,0.12);
  color: rgba(206,203,246,0.85);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(127,119,221,0.22);
  letter-spacing: 0.5px;
  animation: tagBounceIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes tagBounceIn {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* 召唤灵感按钮 */
.inspiration-generate-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(251,191,36,0.18);
  border-radius: 12px;
  background: rgba(20,18,50,0.8);
  color: rgba(251,191,36,0.7);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}
.inspiration-generate-btn:not(:disabled) {
  animation: summonPulse 3s ease-in-out infinite;
}
.inspiration-generate-btn:not(:disabled):hover {
  background: linear-gradient(135deg, rgba(127,119,221,0.3), rgba(83,74,183,0.4));
  border-color: rgba(167,139,250,0.5);
  color: #E8E4FF;
  box-shadow: 0 0 24px rgba(127,119,221,0.35);
}
.inspiration-generate-btn:disabled {
  opacity: 0.5;
  cursor: default;
  border-color: rgba(127,119,221,0.15);
}
@keyframes summonPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(127,119,221,0); }
  50% { box-shadow: 0 0 20px rgba(127,119,221,0.2), 0 0 40px rgba(167,139,250,0.1); }
}

/* 生成中魔法阵动画 */
.inspiration-generate-btn.summoning {
  color: #CECBF6;
  border-color: rgba(127,119,221,0.35);
  background: rgba(30,26,60,0.8);
}
.inspiration-generate-btn .summon-ring {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(167,139,250,0.5);
  border-top-color: #A78BFA;
  border-radius: 50%;
  animation: summonRingSpin 1s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes summonRingSpin {
  to { transform: rotate(360deg); }
}

.inspiration-prompt {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #1A1638 0%, #1E1A42 50%, #1A1638 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px 20px 0 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  z-index: 10;
  animation: promptSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.inspiration-prompt::before {
  content: '';
  display: block;
  margin: 0 auto 10px;
  width: 40px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(127,119,221,0.5), transparent);
}
/* 装饰线 */
.inspiration-prompt::after {
  content: '✦  ·  ·  ·  ✦  ·  ·  ·  ✦';
  display: block;
  text-align: center;
  font-size: 10px;
  color: rgba(167,139,250,0.4);
  margin-top: 10px;
  letter-spacing: 3px;
}
@keyframes promptSlideUp {
  from { transform: translateY(60px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.prompt-title {
  font-size: 13px;
  color: rgba(206,203,246,0.7);
  font-weight: 500;
  letter-spacing: 0.5px;
}
.prompt-copy-btn {
  background: rgba(127,119,221,0.15);
  border: 1px solid rgba(127,119,221,0.25);
  color: rgba(167,139,250,0.8);
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.prompt-copy-btn:hover {
  background: rgba(127,119,221,0.25);
  border-color: rgba(167,139,250,0.5);
}

.prompt-text {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(224,224,235,0.88);
  white-space: pre-wrap;
  font-family: 'Georgia', 'Noto Serif SC', serif;
  letter-spacing: 0.3px;
}

.inspiration-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(167,139,250,0.25);
  background: rgba(30,40,100,0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: rgba(206,203,246,0.7);
  font-size: 14px;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}
.inspiration-close:hover {
  border-color: rgba(167,139,250,0.6);
  color: #E8E4FF;
  box-shadow: 0 0 16px rgba(127,119,221,0.35);
  transform: rotate(90deg);
}
/* ============================================================
   市场页全新设计 — Brand Header / 搜索 / Pills / Banner / 卡片 / 最近在玩
   ============================================================ */

/* --- 品牌 Header --- */
.market-brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 4px;
  gap: 12px;
}
.brand-title-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.brand-main-title {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #A78BFA, #7F77DD, #534AB7, #7F77DD, #A78BFA);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
  animation: titleShine 3s ease-in-out infinite alternate;
}
@keyframes titleShine {
  0% { background-position: 0% center; filter: drop-shadow(0 0 4px rgba(167,139,250,0.3)); }
  100% { background-position: 100% center; filter: drop-shadow(0 0 8px rgba(127,119,221,0.5)); }
}
.brand-sub-line {
  font-size: 10px;
  color: var(--text-muted, #888790);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.brand-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon-btn {
  background: var(--bg-tertiary, rgba(255,255,255,0.08));
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  position: relative;
}
.brand-avatar-small {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7F77DD, #534AB7);
  color: white;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 12px rgba(127,119,221,0.35);
}

/* --- 搜索栏 - 胶囊形 --- */
.market-search-capsule {
  display: flex;
  align-items: center;
  margin: 12px 16px 10px;
  background: var(--bg-tertiary, rgba(255,255,255,0.06));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 24px;
  padding: 0 16px;
  height: 40px;
  transition: border-color 0.2s;
}
.market-search-capsule:focus-within {
  border-color: #7F77DD;
  box-shadow: 0 0 0 3px rgba(127,119,221,0.12);
}
.search-icon-inline {
  font-size: 14px;
  margin-right: 8px;
  opacity: 0.5;
}
.market-search-capsule input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
.market-search-capsule input::placeholder {
  color: var(--text-muted, #666);
}
.search-filter-badge {
  background: rgba(127,119,221,0.18);
  color: #A78BFA;
  border: none;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}

/* --- 分类 Pills --- */
.market-category-pills {
  display: flex;
  gap: 8px;
  padding: 4px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.market-category-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 16px;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  background: transparent;
  color: var(--text-secondary, #888);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-pill.active {
  background: rgba(127,119,221,0.2);
  border-color: #7F77DD;
  color: #CECBF6;
  font-weight: 500;
}
.cat-pill-more {
  color: var(--text-muted, #666);
  font-size: 12px;
}

/* --- Banner 轮播 --- */
.market-banner {
  margin: 0 16px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1A1638, #221D4A, #2A2058, #1E1A3C);
  background-size: 300% 300%;
  animation: bannerBgShift 6s ease-in-out infinite alternate;
  overflow: hidden;
  position: relative;
}
@keyframes bannerBgShift {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}
.market-banner-inner {
  display: flex;
  align-items: center;
  padding: 20px 20px 16px;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.market-banner-text {
  flex: 1;
}
.market-banner-text h2 {
  font-size: 18px;
  font-weight: 700;
  color: #E8E4FF;
  margin-bottom: 6px;
}
.market-banner-text p {
  font-size: 12px;
  color: rgba(206,203,246,0.65);
  margin-bottom: 4px;
  line-height: 1.5;
}
.market-banner-sub {
  font-size: 11px;
  color: rgba(206,203,246,0.4);
  margin-bottom: 12px;
}
.market-banner-btn {
  background: linear-gradient(135deg, #7F77DD, #534AB7);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(83,74,183,0.3);
}
.market-banner-visual {
  width: 90px;
  height: 90px;
  position: relative;
  flex-shrink: 0;
}
.banner-circle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167,139,250,0.5), transparent 70%);
}
.banner-circle-1 {
  width: 80px; height: 80px; top: 0; left: 0;
  animation: circleFloat1 4.5s ease-in-out infinite;
}
.banner-circle-2 {
  width: 50px; height: 50px; top: 10px; right: -5px; opacity: 0.6;
  animation: circleFloat2 5.5s ease-in-out infinite 0.8s;
}
.banner-circle-3 {
  width: 35px; height: 35px; bottom: 0; left: 20px; opacity: 0.4;
  animation: circleFloat3 3.8s ease-in-out infinite 1.5s;
}
@keyframes circleFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 1; }
  50% { transform: translate(6px, -8px) scale(1.08); opacity: 0.85; }
}
@keyframes circleFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-8px, 5px) scale(1.12); opacity: 0.5; }
}
@keyframes circleFloat3 {
  0%, 100% { transform: translate(0, 0); opacity: 0.4; }
  50% { transform: translate(4px, 8px); opacity: 0.6; }
}
.market-banner-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-bottom: 12px;
  position: relative;
  z-index: 1;
}
.banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}
.banner-dot.active {
  background: #7F77DD;
  width: 16px;
  border-radius: 3px;
  animation: dotPulseActive 2s ease-in-out infinite;
}
@keyframes dotPulseActive {
  0%, 100% { box-shadow: 0 0 0 rgba(127,119,221,0); }
  50% { box-shadow: 0 0 8px rgba(127,119,221,0.6); }
}

/* Banner 悬浮微粒 */
.market-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(2px 2px at 15% 25%, rgba(167,139,250,0.6), transparent),
    radial-gradient(1px 1px at 75% 20%, rgba(127,119,221,0.5), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(83,74,183,0.4), transparent),
    radial-gradient(1px 1px at 30% 80%, rgba(167,139,250,0.5), transparent),
    radial-gradient(1.5px 1.5px at 85% 60%, rgba(127,119,221,0.45), transparent),
    radial-gradient(2px 2px at 10% 55%, rgba(167,139,250,0.35), transparent);
  background-size: 200% 200%;
  animation: bannerParticleShift 7s ease-in-out infinite alternate;
}
@keyframes bannerParticleShift {
  0% { background-position: 0% 0%; opacity: 0.7; }
  100% { background-position: 100% 100%; opacity: 1; }
}

/* --- 区块标题 --- */
.market-section {
  padding: 0 16px 16px;
}
.market-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.market-section-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.section-more {
  font-size: 12px;
  color: var(--text-muted, #888);
  background: none;
  border: none;
  cursor: pointer;
}

/* --- 世界书卡片（新设计） --- */
.market-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.market-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-secondary, rgba(255,255,255,0.05));
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.market-card:active {
  transform: scale(0.97);
}
.market-card-cover {
  height: 110px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 8px;
  overflow: hidden;
}
.market-card-cover-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.market-card-cover-fallback {
  background: linear-gradient(135deg, #7F77DD, #534AB7);
  align-items: center;
  justify-content: center;
}
.market-card-emoji {
  font-size: 40px;
}
.market-card-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.market-card-badge.free {
  background: rgba(76,175,80,0.25);
  color: #81C784;
}
.market-card-badge.paid {
  background: rgba(255,167,38,0.25);
  color: #FFB74D;
}
.market-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.market-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.market-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.market-card-fav {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted, #666);
  padding: 2px;
  line-height: 1;
}
.market-card-fav.active {
  color: #FFB74D;
}
.market-card-author {
  font-size: 11px;
  color: var(--text-muted, #888);
  margin: 3px 0 6px;
}
.market-card-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted, #888);
  margin-bottom: 6px;
}
.market-card-size {
  color: #A78BFA;
}
.market-card-rating {
  color: #FFB74D;
}
.market-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.market-card-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(127,119,221,0.12);
  color: #A78BFA;
}
.market-card-play-btn {
  margin-top: auto;
  width: 100%;
  padding: 8px 0;
  border-radius: 10px;
  border: none;
  background: rgba(127,119,221,0.2);
  color: #CECBF6;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.market-card-play-btn:hover {
  background: rgba(127,119,221,0.35);
}
.market-card-play-btn.disabled {
  background: rgba(255,255,255,0.05);
  color: #666;
  cursor: not-allowed;
}

/* --- 最近在玩 --- */
.market-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.market-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-secondary, rgba(255,255,255,0.03));
  border: 1px solid var(--border, rgba(255,255,255,0.05));
  cursor: pointer;
  transition: background 0.2s;
}
.market-recent-item:active {
  background: rgba(127,119,221,0.08);
}
.market-recent-cover {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #7F77DD, #534AB7);
  display: flex;
  align-items: center;
  justify-content: center;
}
.market-recent-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.market-recent-emoji {
  font-size: 20px;
}
.market-recent-info {
  flex: 1;
  min-width: 0;
}
.market-recent-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-recent-meta {
  font-size: 11px;
  color: var(--text-muted, #888);
}
.market-recent-play {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 16px;
  border: none;
  background: rgba(127,119,221,0.25);
  color: #CECBF6;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.market-recent-play.disabled {
  background: rgba(255,255,255,0.05);
  color: #666;
  cursor: not-allowed;
}

/* 保留旧 market-sort-bar 以兼容万界/自创子标签 */
.market-sort-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.sort-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-tab.active {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
}

.filter-btn {
  margin-left: auto;
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.has-filter {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-modal {
  max-width: 420px;
}

.filter-section {
  margin-bottom: 16px;
}

.filter-section h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.filter-checkbox.checked {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
}

.filter-checkbox input {
  display: none;
}

.filter-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.worldbook-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 16px;
}

@media (min-width: 900px) {
  .worldbook-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1300px) {
  .worldbook-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


.worldbook-card {
  background-color: var(--bg-tertiary);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
  animation: cardEnter 0.45s ease-out both;
}
.worldbook-card:nth-child(1) { animation-delay: 0.05s; }
.worldbook-card:nth-child(2) { animation-delay: 0.1s; }
.worldbook-card:nth-child(3) { animation-delay: 0.15s; }
.worldbook-card:nth-child(4) { animation-delay: 0.2s; }
.worldbook-card:nth-child(5) { animation-delay: 0.25s; }
.worldbook-card:nth-child(6) { animation-delay: 0.3s; }
.worldbook-card:nth-child(n+7) { animation-delay: 0.35s; }

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.worldbook-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.worldbook-card.has-cover {
  background-color: var(--bg-tertiary);
  cursor: pointer;
}

.card-cover-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 110px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  cursor: pointer;
  transition: transform 0.3s, filter 0.3s;
}

.card-cover-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
}

.card-cover-bg:hover {
  transform: scale(1.08);
  filter: brightness(1.15);
}

.worldbook-card.has-cover .card-content {
  position: relative;
  z-index: 1;
  color: var(--text-primary);
  padding-top: 122px;
}

.worldbook-card.has-cover .card-cover-bg {
  height: 110px;
}

.worldbook-card.has-cover .card-content .card-author,
.worldbook-card.has-cover .card-content .card-desc,
.worldbook-card.has-cover .card-content .downloads {
  color: var(--text-secondary);
}

.card-cover {
  height: 110px;
  background: linear-gradient(135deg, #7F77DD 0%, #534AB7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cover-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-emoji {
  font-size: 40px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}

.card-content {
  padding: 12px 14px 14px;
}

/* 使用 flex column + order 将标签移到标题上方 */
.card-info {
  display: flex;
  flex-direction: column;
}

.card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  order: -1;
}

.card-tags .tag {
  font-size: 9px;
  padding: 1px 7px;
  background-color: var(--accent);
  border-radius: 10px;
  color: white;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.card-title {
  font-size: 14px;
  margin-bottom: 2px;
  font-weight: 600;
  line-height: 1.4;
}

.card-title-row {
  margin-bottom: 2px;
}

.card-author {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* 统一评分+下载+费用到一行 */
.card-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 11px;
}

.card-stats .rating {
  color: var(--warning);
}

.word-count {
  color: var(--text-secondary);
}

.star {
  opacity: 0.3;
  font-size: 12px;
}

.star.filled {
  opacity: 1;
}

.downloads {
  color: var(--text-secondary);
  margin-left: auto;
}

.worldbook-cost {
  color: var(--warning);
  font-weight: 600;
  font-size: 11px;
}

.worldbook-cost.insufficient {
  color: #ff4444;
}

.start-game-btn {
  width: 100%;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background-color: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.start-game-btn:hover {
  background-color: var(--accent-hover);
  transform: scale(1.02);
}

.start-game-btn:active {
  transform: scale(0.98);
}

.start-game-btn.disabled {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: not-allowed;
  border: 1px solid var(--border);
}

.start-game-btn.disabled:hover {
  background-color: var(--bg-secondary);
  transform: none;
}

/* 世界书类别标签（隐藏，信息已被 tags 覆盖） */
.world-category {
  display: none;
}

<omitted />

.game-view {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 70px);
  padding: 0;
  position: relative;
  background-color: var(--bg-primary);
  overflow: hidden;
}

.game-view.cover-background {
  background-color: transparent;
}

.cover-background-image {
  position: fixed !important;
  top: 70px; /* 底部导航栏高度 */
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: auto;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.75;
  z-index: 0;
  filter: brightness(0.8) saturate(1.1);
}

.game-view.cover-background::after {
  content: none;
}

.game-view.cover-background .game-header,
.game-view.cover-background .messages-container,
.game-view.cover-background .input-area {
  position: relative;
  z-index: 1;
  background: transparent !important;
  border-top-color: rgba(255, 255, 255, 0.06);
}

.game-view.cover-background .message {
  background-color: transparent;
}

.game-view.cover-background .message-content {
  background-color: rgba(30, 30, 42, var(--bubble-opacity, 0.25)) !important;
  color: #f0f0f0 !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.game-view.cover-background .message.user .message-content {
  background-color: rgba(120, 120, 135, var(--bubble-opacity, 0.25)) !important;
}

.game-view.cover-background .message.assistant .message-content {
  background-color: rgba(30, 30, 42, var(--bubble-opacity, 0.25)) !important;
  color: #f0f0f0 !important;
}

.game-view.cover-background .message-content p {
  color: #f0f0f0 !important;
}

.game-view.cover-background .message-avatar {
  background-color: rgba(232, 238, 244, 0.92);
  border: 1px solid rgba(255,255,255,0.15);
}

/* 引号内文字高亮样式 - 在两种模式下都生效 */
.quoted-text,
.game-view .quoted-text,
.game-view.cover-background .quoted-text,
.game-view .md-bold .quoted-text,
.game-view.cover-background .md-bold .quoted-text {
  color: #a855f7 !important;
  font-weight: 500;
}

/* 蓝色：地点、专有名词 - 「内容」 */
.quoted-place,
.game-view .quoted-place,
.game-view.cover-background .quoted-place,
.game-view .md-bold .quoted-place,
.game-view.cover-background .md-bold .quoted-place {
  color: #3b82f6 !important;
  font-weight: 500;
}

/* 橙色：强调、警告 - 『内容』 */
.quoted-warning,
.game-view .quoted-warning,
.game-view.cover-background .quoted-warning,
.game-view .md-bold .quoted-warning,
.game-view.cover-background .md-bold .quoted-warning {
  color: #f59e0b !important;
  font-weight: 600;
}

/* 绿色：技能、物品、系统提示 - 【内容】 */
.quoted-item,
.game-view .quoted-item,
.game-view.cover-background .quoted-item,
.game-view .md-bold .quoted-item,
.game-view.cover-background .md-bold .quoted-item {
  color: #22c55e !important;
  font-weight: 600;
}

/* 红色：危险、重要信息 - 〖内容〗 */
.quoted-danger,
.game-view .quoted-danger,
.game-view.cover-background .quoted-danger,
.game-view .md-bold .quoted-danger,
.game-view.cover-background .md-bold .quoted-danger {
  color: #ef4444 !important;
  font-weight: 700;
}

/* 金色：世界意志、旁白 - 〚内容〛 */
.quoted-narrator,
.game-view .quoted-narrator,
.game-view.cover-background .quoted-narrator,
.game-view .md-bold .quoted-narrator,
.game-view.cover-background .md-bold .quoted-narrator {
  color: #fbbf24 !important;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

/* ========== Markdown 格式样式 ========== */

/* 标题 - 金色 */
.game-view .md-title,
.game-view.cover-background .md-title {
  color: #fbbf24 !important;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.3);
  border-bottom: 1px solid rgba(251, 191, 36, 0.3);
  padding-bottom: 4px;
  margin-bottom: 8px;
}

/* 加粗 - 亮白色 */
.game-view .md-bold,
.game-view.cover-background .md-bold {
  color: #ffffff !important;
  font-weight: 700;
}

/* 斜体 - 淡灰色 */
.game-view .md-em,
.game-view.cover-background .md-em {
  color: #a0a0a0 !important;
  font-style: italic;
}

/* 列表 - 淡蓝色 */
.game-view .md-list,
.game-view.cover-background .md-list {
  color: #93c5fd !important;
}

.game-view .md-list-item,
.game-view.cover-background .md-list-item {
  color: #93c5fd !important;
}

/* 分隔线 */
.game-view .md-hr,
.game-view.cover-background .md-hr {
  border-color: rgba(251, 191, 36, 0.4);
  margin: 12px 0;
}

/* 段落 */
.game-view .md-paragraph,
.game-view.cover-background .md-paragraph {
  color: #e0e0e0 !important;
  line-height: 1.7;
}

.game-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ===== 全屏沉浸式聊天 ===== */
.game-view .game-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 14px 36px 8px;
  justify-content: flex-start;
}

.game-view .back-btn {
  font-size: 13px;
  color: rgba(206, 203, 246, 0.6);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(83, 74, 183, 0.15);
  border: none;
  cursor: pointer;
}

.game-view .game-title h2 {
  display: none;
}

.game-view .worldbook-tag {
  font-size: 10px;
  background: rgba(83, 74, 183, 0.22);
  color: #A78BFA;
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

.game-view .upload-btn,
.game-view .background-btn,
.game-view .model-btn {
  display: none !important;
}

.game-view .messages-container {
  padding-top: 48px;
  background: #0D0D18;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(127, 119, 221, 0.3), transparent),
    radial-gradient(1px 1px at 60% 50%, rgba(127, 119, 221, 0.2), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(127, 119, 221, 0.25), transparent),
    radial-gradient(1px 1px at 80% 20%, rgba(127, 119, 221, 0.15), transparent);
  flex: 1;
  min-height: 0; /* 关键：允许flex子元素收缩 */
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

/* 用户消息气泡 - 紫色半透明 */
.game-view .message.user .message-content {
  background: rgba(255, 255, 255, var(--bubble-opacity, 0.25));
  color: #1A1A1A;
  border-radius: 12px 4px 12px 12px;
}

/* GM/AI 消息气泡 - 深色 + 左侧紫色竖线 */
.game-view .message.assistant .message-content {
  background: rgba(30, 30, 45, var(--bubble-opacity, 0.25));
  border-left: 3px solid #7F77DD;
  color: #E8E8E8;
  border-radius: 4px 12px 12px 12px;
}

.game-view.cover-background .game-header {
  background-color: rgba(20, 20, 30, 0.5);
  border-bottom-color: rgba(255,255,255,0.06);
}

.back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
}

.game-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.game-title h2 {
  font-size: 16px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.worldbook-tag {
  font-size: 11px;
  color: var(--text-secondary);
  background-color: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.model-btn {
  padding: 4px 10px;
  border-radius: 8px;
  border: none;
  background-color: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.upload-btn {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-btn:active {
  background-color: var(--bg-primary);
}

.background-btn {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.background-btn:hover {
  background-color: var(--bg-secondary);
}

.background-btn:active {
  background-color: var(--bg-primary);
}

.upload-panel {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

.upload-panel-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-panel-content h3 {
  font-size: 14px;
  margin: 0;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.upload-panel input[type="file"] {
  font-size: 13px;
  color: var(--text-primary);
}

.uploading-text {
  font-size: 12px;
  color: var(--accent);
  margin: 0;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 全屏入场动画覆盖层 */
.game-intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 6, 22, 0.45);
  animation: overlayFadeIn 0.4s ease-out both;
}
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.game-start-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  min-height: 300px;
}

.game-start-hint p:first-child {
  font-size: 18px;
  margin-bottom: 8px;
}

.message {
  display: flex;
  gap: 8px;
  max-width: 95%;
  padding-right: 4px;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.assistant {
  align-self: flex-start;
  margin-left: 8px;
  max-width: 98%;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  margin-left: -4px;
}

.message-content {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.message.user .message-content {
  background-color: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
  background-color: rgba(100, 100, 100, 0.08);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.message-content p {
  white-space: pre-wrap;
}

.cursor {
  color: var(--accent);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* 思考中状态样式 */
.message.thinking .message-content {
  background-color: var(--bg-tertiary);
  border-bottom-left-radius: 4px;
}

.thinking-text {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
}

.loading-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.loading-dots .dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent);
  border-radius: 50%;
  animation: dotPulse 1.4s infinite ease-in-out both;
}

.loading-dots .dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots .dot:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-dots .dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes dotPulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(0.6);
  }
  40% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--bg-secondary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 添加思考中状态的特别标识 */
.message.thinking {
  animation: thinkingPulse 2s infinite ease-in-out;
}

@keyframes thinkingPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.input-area {
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.input-area textarea {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  min-height: 40px;
}

.input-area textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.input-area textarea::placeholder {
  color: var(--text-secondary);
}



.input-area button {
  padding: 10px 20px;
  border-radius: 20px;
  border: none;
  background-color: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.input-area button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.profile-page .profile-content {
  margin-bottom: 24px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background-color: var(--bg-tertiary);
  border-radius: 16px;
  margin-bottom: 12px;
}

.avatar-container {
  position: relative;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-avatar-btn {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid var(--bg-tertiary);
  transition: all 0.2s;
}

.upload-avatar-btn:hover,
.upload-avatar-btn:active {
  background-color: var(--accent-hover);
  transform: scale(1.1);
}

.avatar-input {
  display: none;
}

.default-avatar {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info {
  flex: 1;
}

.user-info h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.user-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

.logout-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.token-balance-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background-color: var(--bg-tertiary);
  border-radius: 16px;
}

.token-icon {
  font-size: 32px;
}

.token-info {
  flex: 1;
}

.token-info h3 {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: normal;
}

.token-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--warning);
}

.token-rmb {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.guest-balance {
  margin-bottom: 24px;
}

.model-cost-info {
  padding: 16px;
  background-color: var(--bg-tertiary);
  border-radius: 12px;
  margin-bottom: 24px;
}

.model-cost-info h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.cost-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cost-value {
  color: var(--accent);
  font-weight: 600;
}

.exchange-rate {
  font-size: 12px;
  color: var(--text-secondary);
}

.recharge-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background-color: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.login-prompt {
  text-align: center;
  padding: 40px 20px;
  background-color: var(--bg-tertiary);
  border-radius: 16px;
  margin-bottom: 24px;
}

.login-prompt .avatar {
  margin: 0 auto 16px;
}

.login-prompt p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.login-btn {
  padding: 12px 32px;
  border-radius: 12px;
  border: none;
  background-color: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-left: 4px;
}

.persona-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background-color: var(--bg-tertiary);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.persona-card:active {
  background-color: var(--bg-secondary);
}

.persona-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.persona-info {
  flex: 1;
}

.persona-info h4 {
  font-size: 16px;
  margin-bottom: 4px;
}

.persona-preview {
  font-size: 12px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.edit-hint {
  color: var(--text-secondary);
}

.theme-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background-color: var(--bg-tertiary);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-preview:active {
  background-color: var(--bg-secondary);
}

.theme-swatch {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.theme-preview span:first-of-type {
  flex: 1;
}

.settings-list {
  background-color: var(--bg-tertiary);
  border-radius: 12px;
  overflow: hidden;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item span {
  font-size: 14px;
}

.setting-item select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
}

.switch {
  position: relative;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-secondary);
  transition: 0.3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal {
  background-color: var(--bg-secondary);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
}

.modal h2 {
  font-size: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.modal-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.worldbook-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background-color: var(--bg-tertiary);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.worldbook-option:active {
  background-color: var(--bg-primary);
}

.background-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background-color: var(--bg-tertiary);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.background-option:active {
  background-color: var(--bg-primary);
}

.option-icon {
  font-size: 24px;
}

.close-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  margin-top: 16px;
}

.search-modal .search-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
}

.search-modal .search-input:focus {
  border-color: var(--primary);
}

.search-results {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-hint, .search-empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 20px;
  font-size: 14px;
}

.search-result-item {
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.search-result-item:active {
  background: var(--bg-primary);
}

.search-result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.search-result-preview {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-modal {
  max-width: 400px;
}

.avatar-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.preview-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.no-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
  border: 2px dashed var(--border);
}

.avatar-upload-input {
  display: none;
}

.avatar-upload-label {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px;
  border-radius: 10px;
  border: 2px dashed var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.avatar-upload-label:hover {
  border-color: var(--accent);
  background-color: rgba(42, 92, 170, 0.1);
}

.remove-avatar-btn {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #ff4444;
  background-color: rgba(255, 68, 68, 0.1);
  color: #ff4444;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.remove-avatar-btn:hover {
  background-color: rgba(255, 68, 68, 0.2);
}

.form-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-content input,
.form-content textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}

.form-content textarea {
  min-height: 80px;
  resize: vertical;
}

.form-content input:focus,
.form-content textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-content label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-content label span {
  font-size: 13px;
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.cancel-btn,
.confirm-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cancel-btn {
  border: 1px solid var(--border);
  background-color: transparent;
  color: var(--text-secondary);
}

.confirm-btn {
  border: none;
  background-color: var(--accent);
  color: white;
}

.confirm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.phone-code-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.phone-code-row input {
  flex: 1;
}

.send-code-btn {
  flex-shrink: 0;
  height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.send-code-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
}
.send-code-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-mode {
  text-align: center;
  color: var(--accent);
  font-size: 13px;
  margin-top: 16px;
  cursor: pointer;
}

.error-text {
  color: #ff4444;
  font-size: 13px;
  text-align: center;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background-color: var(--bg-tertiary);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.theme-option.active {
  border-color: var(--accent);
}

.theme-option:active {
  background-color: var(--bg-primary);
}

.theme-color-preview {
  width: 100%;
  height: 40px;
  border-radius: 8px;
}

.theme-option span:last-child {
  font-size: 12px;
  color: var(--text-secondary);
}

.persona-modal .form-content label {
  margin-bottom: 4px;
}

.recharge-modal {
  max-width: 400px;
}

.recharge-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qrcode-container {
  display: flex;
  justify-content: center;
  padding: 16px;
  background-color: var(--bg-tertiary);
  border-radius: 12px;
}

.qrcode-image {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border-radius: 8px;
}

.recharge-info {
  text-align: center;
}

.recharge-rate {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.recharge-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.recharge-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recharge-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
}

.option-rmb {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.option-coins {
  font-size: 13px;
  color: var(--warning);
}

.user-list, .worldbook-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-info .username {
  font-size: 14px;
  font-weight: 500;
}

.user-info .email {
  font-size: 12px;
  color: var(--text-secondary);
}

.user-balance {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-balance .balance {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

.copy-id-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  background-color: var(--bg-secondary);
  cursor: pointer;
  font-size: 12px;
}

.ban-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background-color: rgba(244, 67, 54, 0.2);
  color: #F44336;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.ban-btn:hover {
  background-color: rgba(244, 67, 54, 0.3);
}

.ban-btn.unban {
  background-color: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
}

.ban-btn.unban:hover {
  background-color: rgba(76, 175, 80, 0.3);
}

.username.banned {
  color: #F44336;
}

.ban-badge {
  margin-left: 8px;
  font-size: 11px;
  color: #F44336;
  background-color: rgba(244, 67, 54, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-form .file-upload-row {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.upload-form .file-upload-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-form .file-upload-item label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-form .file-name {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 8px;
  background-color: var(--bg-secondary);
  border-radius: 4px;
}

.upload-form input[type="file"] {
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background-color: var(--bg-tertiary);
}

.upload-form input[type="text"],
.upload-form input[type="number"] {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 13px;
}

.rating-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating-input input {
  width: 80px;
}

.upload-form button {
  padding: 12px;
  border: none;
  border-radius: 8px;
  background-color: var(--accent);
  color: white;
  font-size: 14px;
  cursor: pointer;
  margin-top: 8px;
}

.worldbook-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  gap: 12px;
}

.worldbook-cover {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.cover-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.worldbook-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.book-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.book-info .book-name {
  font-size: 14px;
  font-weight: 500;
}

.book-info .book-author,
.book-info .book-tokens {
  font-size: 12px;
  color: var(--text-secondary);
}

.book-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.book-actions .status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
}

.book-actions .status.active {
  background-color: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
}

.book-actions .status.inactive {
  background-color: rgba(158, 158, 158, 0.2);
  color: #9E9E9E;
}

.book-actions .delete-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background-color: rgba(244, 67, 54, 0.1);
  color: #F44336;
  font-size: 12px;
  cursor: pointer;
}

.book-actions .update-cover-btn {
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.book-actions .update-cover-btn:hover {
  background-color: rgba(99, 102, 241, 0.2);
}

.edit-cover-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.edit-cover-form input[type="file"] {
  padding: 4px;
  font-size: 11px;
}

.cancel-edit-btn {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.empty-hint {
  text-align: center;
  color: var(--text-secondary);
  padding: 20px;
  font-size: 14px;
}

.error-text {
  color: #F44336;
  font-size: 13px;
  margin: 8px 0;
}

.plugin-icon-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plugin-icon-upload label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.icon-preview-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.icon-preview {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-icon {
  font-size: 28px;
}

.icon-upload-input {
  display: none;
}

.icon-upload-label {
  padding: 10px 16px;
  border-radius: 8px;
  border: 2px dashed var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-upload-label:hover {
  border-color: var(--accent);
  background-color: rgba(42, 92, 170, 0.1);
}

.remove-icon-btn {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ff4444;
  background-color: rgba(255, 68, 68, 0.1);
  color: #ff4444;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.remove-icon-btn:hover {
  background-color: rgba(255, 68, 68, 0.2);
}

.save-icon-btn {
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background-color: var(--accent);
  color: white;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.save-icon-btn:hover {
  background-color: var(--accent-hover);
}

.price-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 8px;
  background-color: rgba(42, 92, 170, 0.1);
  border-radius: 4px;
}

.price-tag.free {
  color: var(--success);
  background-color: rgba(76, 175, 80, 0.1);
}

/* 管理员面板插件相关样式 */
.market-plugin-price-info {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.market-plugin-price-info .price-tag {
  font-size: 11px;
  padding: 2px 6px;
}

.market-plugin-price-info .usage-tag {
  font-size: 11px;
  padding: 2px 6px;
  background-color: rgba(158, 158, 158, 0.1);
  color: var(--text-secondary);
  border-radius: 4px;
}

.market-plugin-edit-form {
  background-color: var(--bg-tertiary);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.market-plugin-edit-form h4 {
  margin-bottom: 12px;
  font-size: 14px;
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.plugin-price-input,
.plugin-usage-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plugin-price-input span,
.plugin-usage-input span {
  font-size: 12px;
  color: var(--text-secondary);
}

.plugin-price-input input,
.plugin-usage-input input {
  width: 150px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--bg-secondary);
  font-size: 13px;
}

.admin-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.cancel-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

/* 移动端适配样式 */
@media (max-width: 768px) {
  :root {
    font-size: 14px;
  }

  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .page {
    padding: 12px;
  }

  .page-header h1 {
    font-size: 20px;
  }

  .subtitle {
    font-size: 12px;
  }

  .nav-item {
    padding: 4px 8px;
  }

  .nav-icon {
    font-size: 22px;
  }

  .nav-label {
    font-size: 11px;
  }

  .search-bar input {
    padding: 10px 14px;
    font-size: 13px;
  }

  .tag-chip {
    padding: 5px 10px;
    font-size: 11px;
  }

  .sort-tab,
  .filter-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  .market-sort-bar {
    gap: 6px;
  }

  .filter-btn {
    margin-left: 0;
  }

  .worldbook-card {
    border-radius: 12px;
  }

  .card-cover {
    height: 90px;
    position: relative;
    overflow: hidden;
  }

  .card-cover-bg {
    height: 90px;
  }

  .worldbook-card.has-cover .card-content {
    padding-top: 102px;
  }

  .cover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .cover-emoji {
    font-size: 36px;
  }

  .cover-emoji.hidden {
    display: none;
  }

  .card-content {
    padding: 10px 12px 12px;
  }

  .card-title {
    font-size: 13px;
  }

  .card-desc {
    font-size: 11px;
  }

  .card-tags .tag {
    font-size: 8px;
    padding: 1px 6px;
  }

  .start-game-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .game-card {
    padding: 12px;
    gap: 10px;
  }

  .game-icon {
    width: 40px;
    height: 40px;
    font-size: 28px;
  }

  .game-card-subtitle {
    font-size: 11px;
  }

  .game-info h3 {
    font-size: 15px;
  }

  .game-header {
    padding: 10px 12px;
    gap: 10px;
  }

  .back-btn {
    font-size: 13px;
  }

  .game-title h2 {
    font-size: 15px;
  }

  .model-btn {
    padding: 4px 8px;
    font-size: 10px;
  }

  .upload-btn {
    padding: 4px 8px;
    font-size: 10px;
  }

  .upload-panel {
    padding: 10px 12px;
  }

  .messages-container {
    padding: 12px;
    gap: 12px;
  }

  .game-start-hint {
    padding: 30px 16px;
  }

  .game-start-hint p:first-child {
    font-size: 16px;
  }

  .message {
    max-width: 95%;
    gap: 8px;
  }

  .message-avatar {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .message-content {
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    width: 100%;
  }

  .input-area {
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    gap: 8px;
  }

  .input-area textarea {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 40px;
    max-height: 80px;
  }

  .input-area button {
    padding: 10px 18px;
    font-size: 13px;
    border-radius: 18px;
  }

  .user-card {
    padding: 16px;
    gap: 12px;
  }

  .avatar {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .upload-avatar-btn {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .user-info h2 {
    font-size: 16px;
  }

  .user-info p {
    font-size: 12px;
  }

  .logout-btn {
    padding: 4px 10px;
    font-size: 11px;
  }

  .token-balance-card {
    padding: 16px;
    gap: 12px;
  }

  .token-icon {
    font-size: 28px;
  }

  .token-amount {
    font-size: 24px;
  }

  .persona-card {
    padding: 12px;
    gap: 12px;
  }

  .persona-avatar {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .persona-info h4 {
    font-size: 14px;
  }

  .persona-preview {
    font-size: 11px;
  }

  .theme-preview {
    padding: 12px;
    gap: 10px;
  }

  .theme-swatch {
    width: 36px;
    height: 36px;
  }

  .setting-item {
    padding: 12px 14px;
  }

  .setting-item span {
    font-size: 13px;
  }

  .modal {
    padding: 20px;
  }

  .modal h2 {
    font-size: 18px;
    margin-bottom: 16px;
  }

  .worldbook-option {
    padding: 12px;
    gap: 10px;
  }

  .option-icon {
    font-size: 22px;
  }

  .form-content input,
  .form-content textarea {
    padding: 10px 12px;
    font-size: 13px;
  }

  .cancel-btn,
  .confirm-btn {
    padding: 10px;
    font-size: 13px;
  }

  .theme-option {
    padding: 10px;
  }

  .theme-color-preview {
    height: 36px;
  }

  .user-item,
  .worldbook-item {
    padding: 10px;
  }

  .user-info .username,
  .book-info .book-name {
    font-size: 13px;
  }

  .user-info .email,
  .book-info .book-author,
  .book-info .book-tokens {
    font-size: 11px;
  }

  .upload-form input[type="text"],
  .upload-form input[type="number"] {
    padding: 8px 10px;
    font-size: 12px;
  }

  .upload-form button {
    padding: 10px;
    font-size: 13px;
  }
}

/* ===== 插件市场 ===== */
.plugins-page {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 搜索栏 */
.plugin-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 44px;
  border-radius: 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.plugin-search-bar:focus-within {
  border-color: var(--accent);
}

.plugin-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.plugin-search-bar input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1;
}

.plugin-search-bar input::placeholder {
  color: var(--text-secondary);
}

/* 分类 Tab */
.plugin-categories {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-bottom: 16px;
}

.plugin-categories::-webkit-scrollbar {
  display: none;
}

.plugin-cat-btn {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.plugin-cat-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* 推荐卡片 */
.plugin-featured {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 130px;
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #1a3a6e);
  margin-bottom: 20px;
  cursor: pointer;
  transition: transform 0.2s;
  overflow: hidden;
  position: relative;
}

.plugin-featured:active {
  transform: scale(0.98);
}

.plugin-featured-info {
  flex: 1;
  min-width: 0;
  z-index: 1;
}

.plugin-featured-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.plugin-featured-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.plugin-featured-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.plugin-featured-btn:active {
  background: rgba(255, 255, 255, 0.3);
}

.plugin-featured-btn.installed {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.plugin-featured-icon {
  font-size: 56px;
  line-height: 1;
  margin-left: 16px;
  z-index: 1;
}

/* 卡片网格 */
.plugin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.plugin-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}

.plugin-card:active {
  transform: scale(0.97);
}

.plugin-card-cover {
  height: 72px;
  background: linear-gradient(135deg, #2a5caa, #1a3a6e);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plugin-card-cover-emoji {
  font-size: 32px;
}

.plugin-card-price-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.plugin-card-price-tag.free {
  color: var(--success);
}

.plugin-card-tags {
  display: flex;
  gap: 4px;
  padding: 8px 10px 0;
  flex-wrap: wrap;
}

.plugin-tag-pill {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg-tertiary);
  color: var(--accent);
}

.plugin-card-body {
  padding: 6px 10px 0;
  flex: 1;
}

.plugin-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plugin-card-author {
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.plugin-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.plugin-card-rating {
  font-size: 10px;
  color: var(--text-secondary);
}

.plugin-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

.plugin-usage-text {
  font-size: 10px;
  color: var(--text-secondary);
}

.plugin-card-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.plugin-card-btn:active {
  background: var(--bg-tertiary);
}

.plugin-card-btn.installed {
  border-color: var(--success);
  color: var(--success);
  background: rgba(76, 175, 80, 0.08);
}

.plugin-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.plugin-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.plugin-empty p {
  font-size: 14px;
}

.plugin-empty-sub {
  font-size: 12px;
  margin-top: 4px;
  color: var(--text-secondary);
}

.plugins-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: var(--text-secondary);
}

.plugins-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: plugin-spin 0.7s linear infinite;
}

@keyframes plugin-spin {
  to { transform: rotate(360deg); }
}

.plugin-detail-modal {
  max-width: 380px;
  width: 88%;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.plugin-detail-cover {
  height: 100px;
  background: linear-gradient(135deg, var(--accent), #1a3a6e);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.plugin-detail-cover-emoji {
  font-size: 48px;
}

.plugin-detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.plugin-detail-body {
  padding: 18px;
}

.plugin-detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.plugin-detail-author {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.plugin-detail-rating {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.plugin-detail-desc {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 18px;
}

.plugin-detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.plugin-detail-info-item {
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.plugin-detail-info-item .detail-label {
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plugin-detail-info-item .detail-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.plugin-detail-info-item .detail-value.free {
  color: var(--success);
}

.plugin-detail-system-prompt {
  margin-bottom: 16px;
}

.plugin-detail-system-prompt .detail-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.plugin-detail-system-prompt pre {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  max-height: 160px;
  overflow-y: auto;
}

.plugin-detail-footer {
  display: flex;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
}

.modal-btn-secondary {
  flex: 1;
  padding: 11px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.modal-btn-primary {
  flex: 2;
  padding: 11px 0;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.modal-btn-primary.installed {
  background: var(--success);
}

@media (max-width: 640px) {
  .plugin-search-bar {
    height: 40px;
  }

  .plugin-featured {
    height: 110px;
    padding: 16px;
  }

  .plugin-featured-name {
    font-size: 16px;
  }

  .plugin-featured-icon {
    font-size: 44px;
  }

  .plugin-card-cover {
    height: 62px;
  }

  .plugin-card-cover-emoji {
    font-size: 26px;
  }
}

/* 触摸友好的交互样式 */
@media (max-width: 768px) {
  /* 禁用文本选择，避免误触 */
  .nav-item,
  .tag-chip,
  .worldbook-card,
  .start-game-btn,
  .game-card,
  .back-btn,
  .model-btn,
  .upload-btn,
  .input-area button,
  .user-card,
  .upload-avatar-btn,
  .logout-btn,
  .recharge-btn,
  .login-btn,
  .persona-card,
  .theme-preview,
  .setting-item,
  .close-btn,
  .cancel-btn,
  .confirm-btn,
  .toggle-mode,
  .theme-option,
  .tab-btn,
  .token-form button,
  .copy-id-btn,
  .ban-btn,
  .upload-form button,
  .book-actions button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    touch-action: manipulation;
  }

  /* 输入框需要正常的触摸操作，禁用touch-action限制 */
  .search-bar input,
  .input-area textarea,
  .form-content input,
  .form-content textarea {
    touch-action: auto;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
  }

  /* 优化按钮点击区域 - 确保最小44px点击区域 */
  .tag-chip,
  .start-game-btn,
  .back-btn,
  .input-area button,
  .login-btn,
  .confirm-btn,
  .cancel-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 触摸状态效果 */
  .nav-item:active:not(.active),
  .tag-chip:active:not(.active),
  .worldbook-card:active,
  .start-game-btn:active:not(.disabled),
  .game-card:active,
  .back-btn:active,
  .model-btn:active,
  .upload-btn:active,
  .input-area button:active:not(:disabled),
  .upload-avatar-btn:active,
  .logout-btn:active,
  .recharge-btn:active,
  .login-btn:active,
  .persona-card:active,
  .theme-preview:active,
  .close-btn:active,
  .confirm-btn:active:not(:disabled),
  .cancel-btn:active,
  .toggle-mode:active,
  .theme-option:active:not(.active),
  .tab-btn:active:not(.active),
  .token-form button:active,
  .copy-id-btn:active,
  .ban-btn:active,
  .upload-form button:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
  }

  /* 移除hover效果，添加active效果 */
  .nav-item:hover,
  .tag-chip:hover,
  .worldbook-card:hover,
  .worldbook-card:active,
  .start-game-btn:hover:not(.disabled),
  .game-card:hover,
  .back-btn:hover,
  .model-btn:hover,
  .upload-btn:hover,
  .input-area button:hover:not(:disabled),
  .upload-avatar-btn:hover,
  .logout-btn:hover,
  .recharge-btn:hover,
  .login-btn:hover,
  .persona-card:hover,
  .theme-preview:hover,
  .close-btn:hover,
  .confirm-btn:hover:not(:disabled),
  .cancel-btn:hover,
  .toggle-mode:hover,
  .theme-option:hover:not(.active),
  .tab-btn:hover:not(.active),
  .token-form button:hover,
  .copy-id-btn:hover,
  .ban-btn:hover,
  .upload-form button:hover {
    background-color: inherit;
  }

  .worldbook-card:hover {
    box-shadow: none;
    transform: none;
  }

  .start-game-btn:hover:not(.disabled) {
    transform: none;
  }

  .card-favorite-btn:hover {
    transform: none;
  }

  /* 优化输入框触摸体验 */
  .search-bar input,
  .input-area textarea,
  .form-content input,
  .form-content textarea,
  .setting-item select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }

  /* ========== 世界书详情页样式 - 小说平台风格 ========== */
.worldbook-detail-page {
  min-height: 100vh;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.back-btn {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
}

.back-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.detail-header .placeholder {
  width: 60px;
}

.detail-content {
  padding-bottom: 20px;
}

.detail-cover-wrapper {
  width: 100%;
  position: relative;
  background: linear-gradient(180deg, rgba(100, 80, 120, 0.4) 0%, rgba(30, 25, 40, 0.9) 100%);
}

.detail-cover-bg {
  width: 100%;
  height: 320px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.detail-cover-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.8) 100%);
}

.detail-cover-area {
  position: relative;
  display: flex;
  gap: 20px;
  padding: 0 24px;
  margin-top: -100px;
}

.detail-cover {
  width: 140px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-cover {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3a3a5c 0%, #2a2a4a 100%);
}

.no-cover .cover-emoji {
  font-size: 56px;
}

.detail-info {
  flex: 1;
  padding: 12px 0;
  min-width: 0;
}

.detail-title {
  font-size: 26px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
  line-height: 1.3;
}

.detail-author {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
}

.detail-author::before {
  content: '✍️ ';
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-tag {
  padding: 4px 14px;
  background: linear-gradient(135deg, rgba(100, 80, 140, 0.6) 0%, rgba(80, 60, 120, 0.4) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
}

.detail-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.stat-item .star.filled {
  color: #ffd700;
}

.stat-item .star {
  color: rgba(255, 255, 255, 0.3);
}

.detail-price-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.detail-cost {
  font-size: 22px;
  font-weight: 700;
  color: #ffd700;
}

.detail-cost.insufficient {
  color: #ff6b6b;
}

.detail-balance {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.detail-start-btn {
  flex: 1;
  padding: 14px 24px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.detail-start-btn:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.detail-start-btn.disabled {
  background: linear-gradient(135deg, #4a4a6a 0%, #5a5a7a 100%);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
}

.detail-divider {
  height: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
}

.detail-content-section {
  padding: 24px;
}

.detail-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 2px;
}

.detail-description {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  text-align: justify;
}

.detail-stats-card {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  flex: 1;
  background-color: var(--bg-tertiary);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.stat-card-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.detail-reviews {
  margin-top: 8px;
}

.detail-reviews h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-reviews h3::before {
  content: '';
  width: 4px;
  height: 16px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: 2px;
}

.loading-text,
.no-reviews {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  padding: 32px;
}

.reviews-list {
  margin-bottom: 24px;
}

.review-item {
  background-color: var(--bg-tertiary);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.review-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.review-rating {
  font-size: 14px;
}

.review-rating .star.filled {
  color: #ffd700;
}

.review-rating .star {
  color: var(--border);
}

.review-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.review-date {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.6;
}

.review-form {
  background-color: var(--bg-tertiary);
  border-radius: 12px;
  padding: 16px;
}

.review-rating-input {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.review-rating-input span {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.star-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--border);
  transition: transform 0.1s;
}

.star-btn:hover {
  transform: scale(1.1);
}

.star-btn.filled {
  color: #ffd700;
}

.review-textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  resize: none;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.review-textarea:focus {
  outline: none;
  border-color: #6366f1;
}

.review-textarea::placeholder {
  color: var(--text-secondary);
}

.review-error {
  font-size: 12px;
  color: #ff6b6b;
  margin-bottom: 12px;
  display: block;
}

.review-submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.review-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.review-submit-btn:disabled {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* 优化滚动体验 */
  .messages-container,
  .conversations-list,
  .worldbook-list,
  .user-list {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
}

/* 小屏手机适配 */
@media (max-width: 480px) {
  .page {
    padding: 8px;
  }

  .nav-label {
    font-size: 10px;
  }

  .card-cover {
    height: 72px;
  }

  .card-cover-bg {
    height: 72px;
  }

  .worldbook-card.has-cover .card-content {
    padding-top: 84px;
  }

  .cover-emoji {
    font-size: 28px;
  }

  .message-content {
    padding: 8px 10px;
    font-size: 12px;
  }

  .input-area {
    padding: 8px 10px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .input-area textarea {
    padding: 8px 10px;
    font-size: 12px;
  }

  .input-area button {
    padding: 8px 14px;
    font-size: 12px;
  }
}

/* PWA安装按钮样式 */
.install-section {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
  border-radius: 16px;
  padding: 16px;
  border: 2px solid rgba(99, 102, 241, 0.2);
}

.install-section h3 {
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-left: 0;
}

.install-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background-color: var(--accent);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.install-entry:active {
  transform: scale(0.98);
  background-color: #4f46e5;
}

.install-icon {
  font-size: 24px;
}

.install-entry span:nth-child(2) {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: white;
}

.install-hint {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
}

.install-description {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0;
}

/* 新的PWA安装卡片样式 */
.pwa-install-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
  border-radius: 20px;
  border: 2px solid rgba(99, 102, 241, 0.3);
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.pwa-install-icon {
  font-size: 40px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  padding: 12px;
  border-radius: 16px;
}

.pwa-install-content {
  flex: 1;
}

.pwa-install-content h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.pwa-install-content p {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.pwa-install-btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.pwa-install-btn.primary {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.pwa-install-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.pwa-install-btn.primary:active {
  transform: translateY(0);
}

.pwa-install-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
  border: 2px solid var(--accent);
}

.pwa-install-btn.secondary:hover {
  background: rgba(99, 102, 241, 0.1);
}

@media (max-width: 768px) {
  .install-section {
    padding: 14px;
  }
  
  .install-entry {
    padding: 12px 14px;
  }
  
  .install-icon {
    font-size: 22px;
  }
  
  .install-entry span:nth-child(2) {
    font-size: 14px;
  }
  
  .install-description {
    font-size: 11px;
  }
}

/* 游戏结束样式 */
.game-ended-badge {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.game-ended-message {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.game-ended-card {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.2);
}

.game-ended-card h3 {
  font-size: 24px;
  margin: 0 0 12px 0;
  color: #ef4444;
}

.game-ended-card p {
  margin: 0 0 24px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.life-summary {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.life-summary h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
}

.life-summary p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.8;
}

.game-ended-footer {
  padding: 16px 20px;
  background: rgba(239, 68, 68, 0.05);
  border-top: 1px solid rgba(239, 68, 68, 0.2);
  text-align: center;
}

.game-ended-footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

/* 生涯总结样式 */
.life-summaries-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.life-summaries-empty p {
  margin: 8px 0;
}

.life-summaries-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 我的插件样式 */
.my-plugins-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.my-plugin-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.my-plugin-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.my-plugin-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.my-plugin-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.my-plugin-details {
  flex: 1;
  min-width: 0;
}

.my-plugin-details h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
}

.my-plugin-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.my-plugin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.my-plugin-usage {
  color: var(--accent);
  font-weight: 500;
}

.uninstall-plugin-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: rgba(244, 67, 54, 0.1);
  color: #F44336;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.uninstall-plugin-btn:hover {
  background: rgba(244, 67, 54, 0.2);
}

.my-plugin-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.add-to-conversation-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: rgba(42, 92, 170, 0.1);
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.add-to-conversation-btn:hover {
  background: rgba(42, 92, 170, 0.2);
}

.plugin-to-conversation-modal {
  max-width: 90%;
  width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.plugin-info-preview {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-bottom: 16px;
}

.plugin-preview-icon {
  font-size: 40px;
}

.plugin-preview-details h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
}

.plugin-preview-details p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.modal-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.conversation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.conversation-item:hover:not(.already-added) {
  background: rgba(42, 92, 170, 0.1);
}

.conversation-item.selected {
  border-color: var(--accent);
  background: rgba(42, 92, 170, 0.1);
}

.conversation-item.already-added {
  opacity: 0.6;
  cursor: not-allowed;
}

.conversation-info h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
}

.conversation-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.worldbook-tag {
  background: rgba(42, 92, 170, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--accent);
}

.message-count {
  color: var(--text-secondary);
}

.add-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
}

.already-added-badge {
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
}

.selected-badge {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

/* My Worldbooks */
.my-worldbooks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.my-worldbook-cover {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.my-worldbook-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.my-worldbook-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.my-worldbook-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.my-worldbook-info {
  flex: 1;
  min-width: 0;
}

.my-worldbook-info h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.my-worldbook-author,
.my-worldbook-tokens {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 2px 0;
}

.my-worldbook-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.my-worldbook-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.edit-worldbook-btn,
.delete-worldbook-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.edit-worldbook-btn {
  background: rgba(42, 92, 170, 0.1);
  color: var(--accent);
}

.edit-worldbook-btn:hover {
  background: rgba(42, 92, 170, 0.2);
}

.delete-worldbook-btn {
  background: rgba(244, 67, 54, 0.08);
  color: #ef4444;
}

.delete-worldbook-btn:hover {
  background: rgba(244, 67, 54, 0.15);
}

.edit-worldbook-modal {
  max-width: 500px;
  width: 90%;
}

.edit-worldbook-modal .form-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 16px 0;
}

.edit-worldbook-modal .form-content label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.edit-worldbook-modal .form-content input,
.edit-worldbook-modal .form-content textarea {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.edit-worldbook-modal .form-content textarea {
  min-height: 200px;
}

.edit-worldbook-modal .form-content input:focus,
.edit-worldbook-modal .form-content textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.life-summary-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.life-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.life-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.life-summary-title {
  flex: 1;
}

.life-summary-title h4 {
  margin: 0 0 4px 0;
  color: var(--text);
  font-size: 16px;
}

.life-summary-worldbook {
  display: inline-block;
  background: rgba(102, 126, 234, 0.2);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.life-summary-actions {
  display: flex;
  gap: 8px;
}

.life-summary-view-btn,
.life-summary-delete-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.life-summary-view-btn {
  background: var(--accent);
  color: white;
}

.life-summary-view-btn:hover {
  opacity: 0.9;
}

.life-summary-delete-btn {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.life-summary-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.life-summary-preview {
  margin: 0 0 8px 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.life-summary-date {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.life-summary-modal {
  max-width: 500px;
}

.life-summary-modal-worldbook {
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 8px;
  text-align: center;
}

.life-summary-modal-title {
  text-align: center;
  margin: 0 0 20px 0;
  color: var(--text);
}

.life-summary-modal-content {
  max-height: 400px;
  overflow-y: auto;
  padding: 20px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  margin-bottom: 16px;
}

.life-summary-modal-content p {
  margin: 0;
  color: var(--text);
  line-height: 1.8;
  font-size: 15px;
}

.life-summary-modal-date {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 20px;
}

/* 新人引导样式 */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.onboarding-modal {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-radius: 24px;
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.onboarding-header {
  text-align: center;
  margin-bottom: 24px;
}

.onboarding-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.onboarding-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--text-primary);
}

.onboarding-content {
  margin-bottom: 24px;
}

.onboarding-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
  text-align: center;
}

.onboarding-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
}

.progress-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

.progress-dot.completed {
  background: var(--success);
}

.onboarding-actions {
  display: flex;
  gap: 12px;
}

.btn-skip,
.btn-next {
  flex: 1;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-skip {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border);
}

.btn-skip:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-next {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 69, 96, 0.5);
}

.btn-next:active {
  transform: translateY(0);
}

@media (max-width: 480px) {
  .onboarding-modal {
    padding: 24px 20px;
  }

  .onboarding-icon {
    font-size: 48px;
  }

  .onboarding-header h2 {
    font-size: 20px;
  }

  .onboarding-content p {
    font-size: 14px;
  }

  .btn-skip,
  .btn-next {
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* 用户反馈按钮样式 */
.page-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.feedback-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.feedback-btn:hover {
  background-color: rgba(99, 102, 241, 0.2);
}

.feedback-btn:active {
  transform: scale(0.97);
}

/* 反馈弹窗样式 */
.feedback-modal {
  max-width: 450px;
}

.feedback-hint {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 16px;
}

.feedback-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 100px;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.feedback-textarea::placeholder {
  color: var(--text-secondary);
}

.char-count {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.feedback-message {
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 13px;
}

.feedback-message.success {
  background-color: rgba(74, 222, 128, 0.1);
  color: var(--success);
}

.feedback-message.error {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* 最高优先级的引号高亮样式，确保在任何情况下都生效 */
body .quoted-text,
body .message-content .quoted-text,
body .game-view .quoted-text,
body .game-view.cover-background .quoted-text,
body .message-content p .quoted-text,
body .game-view .message-content .quoted-text,
body .game-view.cover-background .message-content .quoted-text {
  color: #a855f7 !important;
  font-weight: 500 !important;
}

/* cocreate-btn moved to bottom-nav section above */

/* ===== 共创 Studio ===== */

.cocreate-dashboard {
  min-height: calc(100vh - 70px);
  background: transparent;
  padding: 0;
}

.cocreate-dashboard-hero {
  text-align: center;
  padding: 60px 24px 40px;
  position: relative;
  overflow: hidden;
}

.cocreate-dashboard-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(118, 75, 162, 0.08) 0%, transparent 50%);
  animation: cocreateHeroGlow 8s ease-in-out infinite alternate;
}

@keyframes cocreateHeroGlow {
  from { transform: translate(0, 0); }
  to { transform: translate(-3%, -3%); }
}

.cocreate-hero-character {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
}

.cocreate-hero-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7F77DD, #534AB7);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 0 40px rgba(127, 119, 221, 0.3);
  position: relative;
}

.cocreate-hero-avatar::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(127, 119, 221, 0.3), rgba(83, 74, 183, 0.3));
  z-index: -1;
  animation: cocreatePulse 3s ease-in-out infinite;
}

@keyframes cocreatePulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.cocreate-hero-avatar-text {
  font-size: 32px;
  color: white;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.cocreate-hero-title {
  font-size: 26px;
  font-weight: 700;
  color: white;
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #A78BFA, #7F77DD);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cocreate-hero-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  position: relative;
  z-index: 1;
  max-width: 280px;
  margin: 0 auto 24px;
  line-height: 1.5;
}

.cocreate-hero-btn {
  position: relative;
  z-index: 1;
  background: linear-gradient(
    135deg,
    #7F77DD, #A78BFA, #F472B6, #A78BFA,
    #534AB7, #7F77DD, #A78BFA, #F472B6
  );
  background-size: 400% 400%;
  animation: heroBtnFlow 3s ease-in-out infinite;
  color: white;
  border: none;
  padding: 14px 36px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 20px rgba(127, 119, 221, 0.4), 0 0 30px rgba(244, 114, 182, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

/* 光泽扫过 */
.cocreate-hero-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.12) 45%,
    rgba(255,255,255,0.28) 50%,
    rgba(255,255,255,0.12) 55%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: heroBtnShine 2.5s ease-in-out infinite;
  pointer-events: none;
  border-radius: 30px;
}

.cocreate-hero-btn > * {
  position: relative;
  z-index: 1;
}

@keyframes heroBtnFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes heroBtnShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.cocreate-hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(127, 119, 221, 0.6), 0 0 50px rgba(244, 114, 182, 0.4);
}

.cocreate-hero-btn-icon {
  font-size: 20px;
  font-weight: 300;
}

/* Modes Grid */
.cocreate-modes-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 24px;
  position: relative;
  z-index: 1;
}

.cocreate-mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.cocreate-mode-card:hover:not(.cocreate-mode-card-disabled) {
  background: rgba(127, 119, 221, 0.12);
  border-color: rgba(127, 119, 221, 0.4);
  transform: translateX(4px);
}

.cocreate-mode-card-active {
  border-color: rgba(127, 119, 221, 0.5);
  background: rgba(127, 119, 221, 0.1);
}

.cocreate-mode-card-disabled {
  opacity: 0.5;
  cursor: default;
}

.cocreate-mode-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.cocreate-mode-info {
  flex: 1;
}

.cocreate-mode-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: white;
  margin-bottom: 2px;
}

.cocreate-mode-info p {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.cocreate-mode-badge {
  font-size: 11px;
  color: rgba(102, 126, 234, 0.8);
  background: rgba(102, 126, 234, 0.15);
  padding: 3px 10px;
  border-radius: 10px;
}

/* ===== 灵感右上角按钮 — 星芒印记 ===== */
.cocreate-inspiration-top-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 7px 16px;
  border-radius: 18px;
  background: rgba(30, 40, 100, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(127, 119, 221, 0.3);
  font-size: 12px;
  color: #CECBF6;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  z-index: 10;
  transition: all 0.3s ease;
  box-shadow: 0 0 12px rgba(127, 119, 221, 0.28);
  animation: inspirationBtnGlow 2.5s ease-in-out infinite;
}
.cocreate-inspiration-top-btn .star-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  transition: transform 0.3s ease;
}
.cocreate-inspiration-top-btn:hover {
  background: rgba(30, 40, 100, 0.75);
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 22px rgba(127, 119, 221, 0.45);
}
.cocreate-inspiration-top-btn:hover .star-icon {
  transform: rotate(15deg) scale(1.15);
}
@keyframes inspirationBtnGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(127, 119, 221, 0.28); }
  50% { box-shadow: 0 0 24px rgba(127, 119, 221, 0.45), 0 0 40px rgba(167, 139, 250, 0.2); }
}

/* ===== 线性三步流程 ===== */
.cocreate-linear-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 16px 24px;
  position: relative;
  z-index: 1;
}

.cocreate-linear-step-wrap {
  display: flex;
  gap: 14px;
  position: relative;
}

.cocreate-linear-step-wrap::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 30px;
  width: 1.2px;
  height: calc(100% + 4px);
  background: rgba(127, 119, 221, 0.25);
}
.cocreate-linear-step-wrap:last-child::before {
  display: none;
}

.cocreate-step-indicator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  z-index: 1;
  background: transparent;
  border: 2px solid #7F77DD;
  color: #CECBF6;
  box-shadow: 0 0 12px rgba(127, 119, 221, 0.30);
}

.cocreate-linear-step-card {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 14px;
}
.cocreate-linear-step-card:hover {
  background: rgba(127, 119, 221, 0.12);
  border-color: rgba(127, 119, 221, 0.35);
  transform: translateX(4px);
}

.cocreate-linear-step-card .step-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.cocreate-linear-step-card .step-card-number {
  font-size: 11px;
  font-weight: 700;
  color: #A78BFA;
  background: rgba(127, 119, 221, 0.18);
  padding: 2px 8px;
  border-radius: 10px;
}
.cocreate-linear-step-card .step-card-title {
  font-size: 15px;
  font-weight: 600;
  color: white;
}
.cocreate-linear-step-card .step-card-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
  margin-bottom: 10px;
}
.cocreate-linear-step-card .step-card-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #A78BFA;
  font-weight: 500;
}

.cocreate-linear-step-card.cocreate-step-locked {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: auto;
}
.cocreate-linear-step-card.cocreate-step-locked:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  transform: none;
}
.cocreate-linear-step-card.cocreate-step-locked .step-card-action {
  color: rgba(255,255,255,0.35);
}

.cocreate-mode-coming {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.05);
  padding: 3px 10px;
  border-radius: 10px;
}

/* Past Sessions */
.cocreate-past-sessions {
  padding: 0 16px 24px;
  position: relative;
  z-index: 1;
}

.cocreate-section-title {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cocreate-section-icon {
  font-size: 16px;
}

.cocreate-drafts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cocreate-draft-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.cocreate-draft-item:hover {
  background: rgba(255,255,255,0.08);
}

.cocreate-draft-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.cocreate-draft-info {
  flex: 1;
  min-width: 0;
}

.cocreate-draft-info h4 {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cocreate-draft-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

.cocreate-draft-delete {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,68,68,0.1);
  color: rgba(255,68,68,0.6);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.cocreate-draft-delete:hover {
  background: rgba(255,68,68,0.2);
  color: #ff4444;
}

.cocreate-empty-hint {
  text-align: center;
  padding: 40px 16px;
  position: relative;
  z-index: 1;
}

.cocreate-empty-hint p {
  font-size: 14px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 4px;
}

.cocreate-empty-sub {
  font-size: 12px !important;
  color: rgba(255,255,255,0.2) !important;
}

/* ===== Studio View ===== */
.cocreate-studio {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: transparent;
  position: relative;
}

.cocreate-studio-header {
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(15,12,41,0.98) 0%, rgba(26,26,62,0.95) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.cocreate-studio-top {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 10px;
}

.cocreate-back-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.cocreate-back-btn:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

.cocreate-studio-title-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cocreate-studio-badge {
  font-size: 10px;
  color: rgba(102, 126, 234, 0.8);
  background: rgba(102, 126, 234, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.cocreate-studio-title-input {
  background: transparent;
  border: none;
  color: white;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  min-width: 60px;
  outline: none;
  padding: 2px 0;
}

.cocreate-studio-title-input::placeholder {
  color: rgba(255,255,255,0.3);
}

.cocreate-studio-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cocreate-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cocreate-icon-btn:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}

.cocreate-export-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cocreate-export-btn:hover {
  filter: brightness(1.1);
}

.cocreate-export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Step Progress */
.cocreate-step-progress {
  display: flex;
  padding: 8px 16px 12px;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cocreate-step-progress::-webkit-scrollbar {
  display: none;
}

.cocreate-step-item {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0.3;
  transition: all 0.3s;
  min-width: 0;
}

.cocreate-step-completed {
  opacity: 0.6;
}

.cocreate-step-clickable {
  cursor: pointer;
}

.cocreate-step-clickable:hover {
  opacity: 1;
}

.cocreate-step-clickable:hover .cocreate-step-dot {
  box-shadow: 0 0 12px rgba(102,126,234,0.5);
}

.cocreate-step-current {
  opacity: 1;
}

.cocreate-step-dot {
  display: flex;
  align-items: center;
  position: relative;
}

.cocreate-step-icon {
  font-size: 13px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
  transition: all 0.3s;
  border: 2px solid rgba(255,255,255,0.1);
}

.cocreate-step-completed .cocreate-step-icon {
  background: rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.4);
}

.cocreate-step-current .cocreate-step-icon {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-color: transparent;
  box-shadow: 0 0 16px rgba(102, 126, 234, 0.5);
  transform: scale(1.08);
}

.cocreate-step-label {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  margin-right: 10px;
  white-space: nowrap;
  transition: color 0.3s;
}

.cocreate-step-current .cocreate-step-label {
  color: rgba(255,255,255,0.9);
}

.cocreate-step-completed .cocreate-step-label {
  color: rgba(255,255,255,0.6);
}

.cocreate-step-line {
  width: 24px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  margin: 0 4px 0 2px;
  flex-shrink: 0;
  border-radius: 1px;
  transition: background 0.3s;
}

.cocreate-step-completed .cocreate-step-line {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.5), rgba(118, 75, 162, 0.3));
}

/* Character Bar */
.cocreate-character-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 10px;
  background: rgba(255,255,255,0.03);
  border-top: 1px solid rgba(255,255,255,0.04);
}

.cocreate-character-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.cocreate-character-info {
  flex: 1;
  min-width: 0;
}

.cocreate-character-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  display: block;
}

.cocreate-character-title {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  display: block;
}

.cocreate-character-stats {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cocreate-character-stats span {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}

/* Messages */
.cocreate-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.cocreate-message {
  display: flex;
  gap: 10px;
  max-width: 92%;
  animation: cocreateMessageIn 0.3s ease-out;
}

@keyframes cocreateMessageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.cocreate-message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.cocreate-message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.cocreate-user-avatar-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  font-weight: 700;
}

.cocreate-assistant-avatar-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.cocreate-message-body {
  flex: 1;
  min-width: 0;
}

.cocreate-message-role-label {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 4px;
  padding-left: 4px;
}

.cocreate-message.user .cocreate-message-role-label {
  text-align: right;
  padding-right: 4px;
}

.cocreate-message-content {
  padding: 12px 16px;
  border-radius: 14px;
  line-height: 1.6;
  font-size: 14px;
}

.cocreate-message.user .cocreate-message-content {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(99, 102, 241, 0.35));
  color: rgba(255,255,255,0.95);
  border-radius: 14px 14px 4px 14px;
}

.cocreate-message.assistant .cocreate-message-content {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
  border-radius: 14px 14px 14px 4px;
}

.cocreate-message-content p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.cocreate-message-wordcount {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-top: 4px;
  display: inline-block;
  padding-left: 4px;
}

.cocreate-message.user .cocreate-message-wordcount {
  text-align: right;
  display: block;
  padding-right: 4px;
}

.cocreate-message-tokencost {
  font-size: 10px;
  color: #f5c842;
  margin-top: 4px;
  display: inline-block;
  padding-left: 8px;
  font-weight: 600;
}

.cocreate-token-balance {
  font-size: 11px;
  color: #f5c842 !important;
  font-weight: 600;
}

.cocreate-session-cost {
  font-size: 10px;
  color: rgba(245,200,66,0.5);
}

.cocreate-balance-warning {
  padding: 6px 12px;
  background: rgba(245,200,66,0.1);
  border: 1px solid rgba(245,200,66,0.3);
  border-radius: 8px;
  font-size: 12px;
  color: #f5c842;
  margin-bottom: 8px;
  text-align: center;
}

.cocreate-balance-low {
  padding: 4px 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 4px;
  text-align: center;
}

/* Typing Indicator */
.cocreate-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.cocreate-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(102, 126, 234, 0.6);
  animation: cocreateTyping 1.4s ease-in-out infinite;
}

.cocreate-typing span:nth-child(2) { animation-delay: 0.2s; }
.cocreate-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes cocreateTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Quick Actions */
.cocreate-quick-actions {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}

.cocreate-quick-actions::-webkit-scrollbar {
  display: none;
}

.cocreate-quick-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cocreate-quick-action-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  border-color: rgba(102, 126, 234, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.cocreate-quick-action-btn:active:not(:disabled) {
  transform: translateY(0);
}

.cocreate-quick-action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cocreate-quick-action-icon {
  font-size: 15px;
  line-height: 1;
}

/* Input Area */
.cocreate-input-area {
  display: flex;
  gap: 10px;
  padding: 8px 16px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.4);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.cocreate-input-area textarea {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: white;
  font-size: 14px;
  resize: none;
  min-height: 42px;
  max-height: 100px;
  line-height: 1.4;
  outline: none;
}

.cocreate-input-area textarea:focus {
  border-color: rgba(102, 126, 234, 0.5);
  background: rgba(255,255,255,0.1);
}

.cocreate-input-area textarea::placeholder {
  color: rgba(255,255,255,0.3);
}

.cocreate-send-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.cocreate-send-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.cocreate-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Toast */
.cocreate-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(34, 197, 94, 0.9);
  color: white;
  padding: 10px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  animation: cocreateToastIn 0.3s ease-out;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

@keyframes cocreateToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.export-modal .export-details {
  margin: 16px 0;
  padding: 12px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
}

.export-modal .detail-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.export-modal .detail-item:last-child {
  border-bottom: none;
}

.export-modal .detail-item strong {
  color: var(--accent);
}

.export-modal .export-warning {
  background-color: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  padding: 12px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
}

.export-progress {
  text-align: center;
}

.export-progress .progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.export-progress .progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ===== 导出加载动画 ===== */
.export-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.export-loading-content {
  text-align: center;
  color: #fff;
}

.export-spinner {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
}

.spinner-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-ring-inner {
  width: 70%;
  height: 70%;
  top: 15%;
  left: 15%;
  border-top-color: #764ba2;
  animation-duration: 0.8s;
  animation-direction: reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.export-loading-text h3 {
  font-size: 20px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #667eea, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.export-loading-text p {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  margin: 0;
}

.loading-dots {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #667eea;
  animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

.export-loading-bar {
  width: 240px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  overflow: hidden;
  margin: 24px auto 8px;
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #a78bfa);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.export-loading-percent {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

/* ===== 世界书结果卡片 ===== */
.worldbook-result-modal {
  max-width: 380px !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.worldbook-result-card {
  padding: 0;
}

.result-card-cover {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.result-card-cover::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(118, 75, 162, 0.15) 0%, transparent 50%);
  animation: coverGlow 6s ease-in-out infinite alternate;
}

@keyframes coverGlow {
  from { transform: translate(0, 0); }
  to { transform: translate(-5%, -5%); }
}

.result-cover-emoji {
  font-size: 48px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.4));
}

.result-cover-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  margin: 0;
}

.result-card-body {
  padding: 16px 20px;
}

.result-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  line-height: 1.5;
}

.result-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.result-card-tags .tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.result-card-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.enter-game-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  font-size: 15px !important;
  padding: 10px 24px !important;
}

.enter-game-btn:hover {
  filter: brightness(1.15) !important;
}

/* ==== Step Footer & Summary ==== */
.cocreate-step-footer {
  flex-shrink: 0;
  padding: 8px 16px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.cocreate-step-hint {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  min-width: 0;
}

.cocreate-step-hint-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.cocreate-step-footer-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cocreate-next-btn {
  padding: 8px 18px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cocreate-next-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.cocreate-next-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cocreate-export-final-btn {
  padding: 8px 18px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  animation: cocreatePulseGreen 2s ease-in-out infinite;
}

@keyframes cocreatePulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50% { box-shadow: 0 0 20px 4px rgba(34,197,94,0.2); }
}

.cocreate-export-final-btn:hover {
  filter: brightness(1.15);
}

/* Summary Confirm */
.cocreate-summary-confirm {
  background: rgba(102,126,234,0.08);
  border: 1px solid rgba(102,126,234,0.3);
  border-radius: 14px;
  padding: 16px;
  margin: 8px 0;
  animation: cocreateMessageIn 0.3s ease-out;
}

.cocreate-summary-confirm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(102,126,234,0.9);
  margin-bottom: 10px;
}

.cocreate-summary-confirm-icon {
  font-size: 18px;
}

.cocreate-summary-confirm-content {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  margin-bottom: 14px;
  max-height: 300px;
  overflow-y: auto;
}

.cocreate-summary-confirm-content p {
  margin-bottom: 6px;
  white-space: pre-wrap;
}

.cocreate-summary-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cocreate-summary-cancel {
  padding: 7px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.cocreate-summary-cancel:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}

.cocreate-summary-confirm-btn {
  padding: 7px 20px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cocreate-summary-confirm-btn:hover {
  filter: brightness(1.1);
}

/* Summarizing animation */
.cocreate-summarizing {
  background: rgba(102,126,234,0.08) !important;
  border-color: rgba(102,126,234,0.3) !important;
}

.cocreate-summarizing-bar {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.cocreate-summarizing-fill {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
  animation: cocreateSummarize 1.5s ease-in-out infinite;
}

@keyframes cocreateSummarize {
  0% { transform: translateX(-100%); width: 30%; }
  50% { width: 60%; }
  100% { transform: translateX(300%); width: 30%; }
}

/* Message step tag */
.cocreate-message-step-tag {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  margin-left: 4px;
}

/* Locked step */
.cocreate-step-locked {
  opacity: 0.2 !important;
}

/* Export Modal */
.cocreate-export-modal {
  max-width: 420px !important;
}

.cocreate-export-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.cocreate-export-scales {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cocreate-export-scale-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  background: var(--bg-tertiary);
}

.cocreate-export-scale-card:hover {
  border-color: var(--accent);
  background: rgba(42,92,170,0.05);
}

.cocreate-export-scale-card.selected {
  border-color: var(--accent);
  background: rgba(42,92,170,0.1);
}

.cocreate-export-scale-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.cocreate-export-scale-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.cocreate-export-scale-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.cocreate-export-scale-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cocreate-export-scale-chars {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.7;
}

.cocreate-export-scale-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.export-chapter-progress {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
}

.export-loading-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-top: 8px;
}

/* ===== Template Center ===== */
.template-center-header {
  text-align: center;
  padding: 40px 24px 20px;
  position: relative;
}

.template-center-back {
  position: absolute;
  left: 20px;
  top: 40px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.template-center-back:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.template-center-header h2 {
  font-size: 24px;
  margin: 0 0 6px;
  color: var(--text-primary);
}

.template-center-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin: 0;
}

.template-categories {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.template-cat-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.template-cat-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.template-cat-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 8px 24px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.template-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.template-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.template-card-icon {
  font-size: 36px;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
}

.template-card-body {
  flex: 1;
  min-width: 0;
}

.template-card-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.template-card-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin: 0 0 10px;
  line-height: 1.4;
}

.template-card-meta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.template-difficulty {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.template-difficulty.简单 { background: rgba(76,175,80,0.15); color: #81c784; }
.template-difficulty.中等 { background: rgba(255,193,7,0.15); color: #ffd54f; }
.template-difficulty.复杂 { background: rgba(244,67,54,0.15); color: #ef9a9a; }

.template-popularity {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

/* ===== 万界论坛 ===== */
.community-page {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.community-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 6px;
  flex-shrink: 0;
}

.community-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.community-title {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.community-online-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.community-online-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.12);
  color: #4ADE80;
  font-size: 11px;
  font-weight: 500;
}

.community-online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 4px rgba(74, 222, 128, 0.6);
  animation: communityPulse 2s ease-in-out infinite;
}

@keyframes communityPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.community-header-stats {
  font-size: 11px;
  color: rgba(255,255,255,0.28);
}

.community-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.community-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(127,119,221,0.15);
  color: #CECBF6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  position: relative;
}

.community-icon-btn:hover {
  background: rgba(127,119,221,0.25);
}

.community-notify-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #F472B6;
  border: 1.5px solid #121218;
}

/* 热门话题横滑 */
.community-trending-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 8px;
  flex-shrink: 0;
}

.community-trending-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  flex-shrink: 0;
}

.community-trending-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
}

.community-trending-list::-webkit-scrollbar { display: none; }

.community-trending-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(127,119,221,0.08);
  border: 0.5px solid rgba(127,119,221,0.12);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.community-trending-item:active {
  background: rgba(127,119,221,0.15);
}

.community-trending-text {
  font-size: 12px;
  color: #CECBF6;
  font-weight: 500;
}

.community-trending-hot {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
}

.community-categories {
  display: flex;
  gap: 8px;
  padding: 0 16px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
}

.community-categories::-webkit-scrollbar { display: none; }

.community-category-chip {
  padding: 6px 14px;
  border-radius: 16px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  background: rgba(127,119,221,0.1);
  color: #CECBF6;
  transition: background 0.2s, color 0.2s;
}

.community-category-chip.active {
  background: #7F77DD;
  color: #fff;
}

.community-category-chip:hover:not(.active) {
  background: rgba(127,119,221,0.18);
}

.community-feed {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 80px;
  -webkit-overflow-scrolling: touch;
}

.community-post-card {
  background: rgba(255,255,255,0.03);
  border: 0.5px solid rgba(127,119,221,0.1);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.community-post-card:active {
  background: rgba(127,119,221,0.06);
  border-color: rgba(127,119,221,0.2);
}

.community-post-card.announcement {
  background: rgba(127,119,221,0.08);
  border: 0.5px solid rgba(127,119,221,0.25);
}

.community-post-card.pinned {
  background: rgba(251,191,36,0.05);
  border: 0.5px solid rgba(251,191,36,0.15);
}

.community-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.community-post-author {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.community-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.community-avatar-1 { background: linear-gradient(135deg, #F472B6, #FBBF24); }
.community-avatar-2 { background: linear-gradient(135deg, #60A5FA, #7F77DD); }
.community-avatar-3 { background: linear-gradient(135deg, #FBBF24, #F472B6); }
.community-avatar-4 { background: linear-gradient(135deg, #7F77DD, #60A5FA); }
.community-avatar-p0 { background: linear-gradient(135deg, #7F77DD, #F472B6); }
.community-avatar-p0b { background: linear-gradient(135deg, #FBBF24, #7F77DD); }
.community-avatar-5 { background: linear-gradient(135deg, #F472B6, #7F77DD); }

.community-author-name {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  gap: 4px;
}

.community-author-level {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  background: rgba(127,119,221,0.2);
  color: #AFA9EC;
}

.community-post-time {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-top: 1px;
}

.community-worldbook-tag {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.community-tag-purple { background: rgba(127,119,221,0.15); color: #CECBF6; }
.community-tag-blue   { background: rgba(96,165,250,0.15);  color: #93C5FD; }
.community-tag-gold   { background: rgba(251,191,36,0.12);  color: #FAC775; }
.community-tag-pink   { background: rgba(244,114,182,0.15); color: #F9A8D4; }

.community-post-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  line-height: 1.4;
}

.community-post-cover {
  height: 100px;
  border-radius: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.community-post-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.25));
}

.community-post-cover-icon {
  font-size: 32px;
  position: relative;
  z-index: 1;
  opacity: 0.8;
}

.community-post-content {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255,255,255,0.82);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.community-post-footer {
  display: flex;
  gap: 20px;
}

.community-footer-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.community-footer-btn:hover { color: rgba(255,255,255,0.5); }

.community-footer-btn.liked { color: #F472B6; }

/* FAB 悬浮发帖按钮 */
.community-fab {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #7F77DD, #534AB7);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(127,119,221,0.4);
  z-index: 15;
  transition: transform 0.15s, box-shadow 0.15s;
}

.community-fab:active {
  transform: scale(0.9);
  box-shadow: 0 2px 8px rgba(127,119,221,0.3);
}

/* 帖子详情 */
.community-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 0.5px solid rgba(127,119,221,0.08);
  flex-shrink: 0;
}

.community-back-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.05);
  color: #CECBF6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.community-detail-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
}

.community-detail-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

.community-detail-post {
  margin-bottom: 6px;
}

.community-follow-btn {
  padding: 4px 12px;
  border-radius: 14px;
  border: 0.5px solid rgba(127,119,221,0.3);
  background: rgba(127,119,221,0.12);
  color: #CECBF6;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.community-follow-btn.followed {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.35);
}

.community-detail-post-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  line-height: 1.45;
}

.community-detail-cover {
  height: 140px;
  border-radius: 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.community-detail-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.3));
}

.community-detail-content {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.8;
  color: rgba(255,255,255,0.86);
}

.community-detail-stats {
  display: flex;
  gap: 24px;
  padding: 12px 0;
  border-top: 0.5px solid rgba(127,119,221,0.08);
  border-bottom: 0.5px solid rgba(127,119,221,0.08);
  margin-bottom: 16px;
}

.community-detail-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.community-detail-stat.liked { color: #F472B6; }

.liked-count { color: #F472B6; }

.community-comments-section { margin-bottom: 20px; }

.community-comments-header {
  font-size: 13px;
  font-weight: 500;
  color: #CECBF6;
  margin-bottom: 14px;
}

.community-comment {
  margin-bottom: 14px;
}

.community-comment-main {
  display: flex;
  gap: 8px;
}

.community-comment-avatar,
.community-reply-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(127,119,221,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.community-reply-avatar {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.community-comment-body,
.community-reply-body {
  flex: 1;
  min-width: 0;
}

.community-comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.community-comment-author {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}

.community-author-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
  background: rgba(127,119,221,0.25);
  color: #AFA9EC;
}

.community-comment-level {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 500;
  background: rgba(127,119,221,0.15);
  color: rgba(175,169,236,0.8);
}

.community-comment-time {
  font-size: 10px;
  color: rgba(255,255,255,0.22);
}

.community-comment-content {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.75);
}

.community-comment-actions {
  display: flex;
  gap: 16px;
}

.community-comment-action {
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.25);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.community-comment-action:hover { color: rgba(255,255,255,0.45); }
.community-comment-action.liked { color: #F472B6; }
.community-comment-action.active { color: #AFA9EC; }

/* 嵌套回复 */
.community-replies {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 0.5px solid rgba(127,119,221,0.15);
}

.community-reply {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.community-reply:last-child { margin-bottom: 0; }

/* 评论输入框 */
.community-comment-input-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: rgba(18,18,24,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 0.5px solid rgba(127,119,221,0.1);
  flex-shrink: 0;
}

.community-reply-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: rgba(127,119,221,0.12);
  color: #CECBF6;
  font-size: 12px;
}

.community-reply-cancel {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.community-comment-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(127,119,221,0.15);
  border-radius: 24px;
}

.community-input-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(127,119,221,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.community-comment-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
  padding: 0;
}

.community-comment-input::placeholder {
  color: rgba(255,255,255,0.25);
}

.community-comment-submit {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #7F77DD;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.community-comment-submit:hover {
  background: #534AB7;
}

/* ===== 对话气泡透明度滑块 ===== */
.opacity-setting {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.opacity-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.opacity-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border, #333);
  outline: none;
  cursor: pointer;
}

.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent, #7F77DD);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(127, 119, 221, 0.5);
}

.opacity-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent, #7F77DD);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 6px rgba(127, 119, 221, 0.5);
}

.opacity-value {
  font-size: 13px;
  color: var(--text-secondary, #999);
  min-width: 40px;
  text-align: right;
}

/* ========================================
   世界 tab 新增区块样式
   ======================================== */

/* 今日精选 */
.daily-date {
  font-size: 12px;
  color: var(--text-muted, #888);
}
.daily-pick-card {
  display: flex;
  gap: 12px;
  background: var(--bg-secondary, #141428);
  border: 1px solid var(--border, rgba(127,119,221,0.15));
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.daily-pick-card:active {
  transform: scale(0.98);
}
.daily-pick-cover {
  width: 110px;
  min-height: 130px;
  flex-shrink: 0;
  background: var(--bg-tertiary, #1A1A38);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.daily-pick-cover-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.daily-pick-emoji {
  font-size: 36px;
}
.daily-pick-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--accent, #7F77DD);
  color: #fff;
  font-weight: 500;
}
.daily-pick-body {
  flex: 1;
  padding: 12px 12px 12px 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.daily-pick-body h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #E0E0E0);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.daily-pick-author {
  font-size: 12px;
  color: var(--text-muted, #888);
  margin: 2px 0 6px;
}
.daily-pick-desc {
  font-size: 12px;
  color: var(--text-secondary, #9E9CB8);
  line-height: 1.5;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.daily-pick-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted, #888);
  margin-bottom: 8px;
}
.daily-pick-btn {
  align-self: flex-start;
  padding: 5px 14px;
  border-radius: 16px;
  border: none;
  background: var(--accent, #7F77DD);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.daily-pick-btn:active {
  background: var(--accent-hover, #9B93EE);
}

/* 世界书排行榜 */
.rank-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border, rgba(127,119,221,0.15));
}
.rank-tab {
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-muted, #888);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.rank-tab.active {
  color: var(--accent, #7F77DD);
  border-bottom-color: var(--accent, #7F77DD);
  font-weight: 600;
}
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.rank-item:active {
  background: rgba(127, 119, 221, 0.08);
}
.rank-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.rank-num.rank-gold {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}
.rank-num.rank-silver {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
  color: #fff;
}
.rank-num.rank-bronze {
  background: linear-gradient(135deg, #CD7F32, #B87333);
  color: #fff;
}
.rank-num.rank-normal {
  background: var(--bg-tertiary, #1A1A38);
  color: var(--text-secondary, #9E9CB8);
}
.rank-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.rank-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #E0E0E0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-item-meta {
  font-size: 11px;
  color: var(--text-muted, #888);
}
.rank-item-heat {
  font-size: 12px;
  color: var(--text-muted, #888);
  flex-shrink: 0;
}

/* 主题合集 */
.theme-collection-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.theme-collection-scroll::-webkit-scrollbar {
  display: none;
}
.theme-collection-card {
  width: 130px;
  min-width: 130px;
  height: 100px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
  overflow: hidden;
}
.theme-collection-card:active {
  transform: scale(0.96);
}
.theme-collection-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
}
.theme-collection-emoji {
  font-size: 28px;
  position: relative;
  z-index: 1;
}
.theme-collection-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  position: relative;
  z-index: 1;
}
.theme-collection-count {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 1;
}
.theme-collection-card.active {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.6), 0 0 20px rgba(255,255,255,0.15);
}
.theme-collection-check {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 14px;
  color: #fff;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.theme-result-count {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}

/* 新书上架 */
.new-books-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.new-books-scroll::-webkit-scrollbar {
  display: none;
}
.new-book-card {
  width: 100px;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.2s;
}
.new-book-card:active {
  transform: scale(0.96);
}
.new-book-cover {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  background: var(--bg-tertiary, #1A1A38);
  border: 1px solid var(--border, rgba(127,119,221,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.new-book-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: #e74c3c;
  color: #fff;
}
.new-book-emoji {
  font-size: 32px;
}
.new-book-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary, #E0E0E0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.new-book-author {
  font-size: 11px;
  color: var(--text-muted, #888);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================
   自创 tab 新增区块样式
   ======================================== */

/* 创作活动 */
.creator-activity-banner {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border, rgba(127,119,221,0.15));
}
.activity-banner-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(127, 119, 221, 0.25), rgba(108, 92, 231, 0.15)), var(--bg-secondary, #141428);
}
.activity-banner-content {
  position: relative;
  z-index: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.activity-tag {
  align-self: flex-start;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  background: #e74c3c;
  color: #fff;
  font-weight: 500;
}
.activity-banner-content h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #E0E0E0);
  margin: 0;
}
.activity-banner-content > p {
  font-size: 12px;
  color: var(--text-secondary, #9E9CB8);
  margin: 0;
  line-height: 1.5;
}
.activity-meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted, #888);
}
.activity-join-btn {
  align-self: flex-start;
  margin-top: 4px;
  padding: 6px 16px;
  border-radius: 18px;
  border: none;
  background: var(--accent, #7F77DD);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.activity-join-btn:active {
  background: var(--accent-hover, #9B93EE);
}

/* 创作者推荐 V2 */
.creator-rec-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.creator-rec-scroll::-webkit-scrollbar { display: none; }

.section-sub-tip {
  font-size: 11px;
  color: var(--text-muted, #888);
}

.creator-rec-card-v2 {
  width: 148px;
  min-width: 148px;
  background: var(--bg-secondary, #141428);
  border: 1px solid var(--border, rgba(127,119,221,0.15));
  border-radius: 16px;
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  position: relative;
  transition: border-color 0.2s, transform 0.15s;
}
.creator-rec-card-v2:active { transform: scale(0.97); }
.creator-rec-card-v2.hot {
  border-color: rgba(253, 203, 110, 0.4);
  background: linear-gradient(160deg, #1A1428 0%, #1A1428 70%, rgba(253,203,110,0.06) 100%);
}

/* HOT 徽章 */
.creator-hot-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #f12711, #f5af19);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* 头像 — 彩色圆形文字 */
.creator-rec-avatar-v2 {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 2px;
}
.creator-rec-avatar-v2:hover {
  transform: scale(1.06);
  box-shadow: 0 0 16px var(--creator-color, rgba(127,119,221,0.5));
}

/* 等级徽章 */
.creator-level-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(127,119,221,0.12);
  border: 0.5px solid rgba(127,119,221,0.25);
  border-radius: 8px;
  padding: 2px 7px;
}
.creator-level-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent, #7F77DD);
}
.creator-level-title {
  font-size: 10px;
  color: var(--text-secondary, #AAAACC);
}

/* 名称 */
.creator-rec-name-v2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #E0E0E0);
  text-align: center;
}

/* 作品 & 粉丝数 */
.creator-rec-stats-v2 {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted, #888);
}
.creator-stats-dot { color: var(--border, rgba(127,119,221,0.3)); }

/* 代表作小条 */
.creator-best-work {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 4px 6px;
  width: 100%;
  margin-top: 2px;
}
.creator-best-label {
  font-size: 10px;
  color: var(--text-muted, #888);
  white-space: nowrap;
}
.creator-best-title {
  font-size: 11px;
  color: var(--text-secondary, #AAAACC);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.creator-best-rating {
  font-size: 10px;
  color: #FDCB6E;
  white-space: nowrap;
}

/* 关注按钮 V2 */
.creator-follow-btn-v2 {
  margin-top: 4px;
  width: 100%;
  padding: 6px 0;
  border-radius: 12px;
  border: 1px solid var(--accent, #7F77DD);
  background: rgba(127,119,221,0.1);
  color: var(--accent, #7F77DD);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.creator-follow-btn-v2:active { transform: scale(0.96); }
.creator-follow-btn-v2.followed {
  background: rgba(0,200,150,0.12);
  border-color: #00C896;
  color: #00C896;
}

/* ===================== 创作者个人主页弹窗 ===================== */
.creator-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.2s ease;
}
.creator-profile-sheet {
  width: 100%;
  max-height: 82vh;
  background: var(--bg-primary, #0D0D18);
  border-radius: 20px 20px 0 0;
  padding: 0 16px 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: slideUp 0.28s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.creator-profile-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  margin: 12px auto 16px;
}
.creator-profile-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 主页 Hero 区域 */
.creator-profile-hero {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.creator-profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.creator-profile-info { flex: 1; min-width: 0; }
.creator-profile-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.creator-profile-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #E0E0E0);
  margin: 0;
}
.creator-profile-level {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}
.creator-profile-desc {
  font-size: 12px;
  color: var(--text-muted, #888);
  line-height: 1.5;
  margin: 0;
}

/* 数据统计行 */
.creator-profile-stats-row {
  display: flex;
  align-items: center;
  background: rgba(127,119,221,0.07);
  border: 1px solid rgba(127,119,221,0.12);
  border-radius: 12px;
  padding: 12px 0;
  margin-bottom: 14px;
}
.creator-stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.creator-stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #E0E0E0);
}
.creator-stat-label {
  font-size: 11px;
  color: var(--text-muted, #888);
}
.creator-stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(127,119,221,0.2);
}

/* 主页关注按钮 */
.creator-profile-follow-btn {
  width: 100%;
  padding: 12px 0;
  border-radius: 14px;
  border: 1.5px solid var(--accent, #7F77DD);
  background: rgba(127,119,221,0.12);
  color: var(--accent, #7F77DD);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
}
.creator-profile-follow-btn:active { transform: scale(0.98); }
.creator-profile-follow-btn.followed {
  background: rgba(0,200,150,0.12);
  border-color: #00C896;
  color: #00C896;
}

/* 作品列表 */
.creator-profile-works { }
.creator-profile-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary, #AAAACC);
  margin: 0 0 10px;
}
.creator-work-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(127,119,221,0.08);
}
.creator-work-item:last-child { border-bottom: none; }
.creator-work-cover {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.creator-work-info { flex: 1; min-width: 0; }
.creator-work-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #E0E0E0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}
.creator-work-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.creator-work-rating { font-size: 11px; color: #FDCB6E; }
.creator-work-plays  { font-size: 11px; color: var(--text-muted, #888); }
.creator-work-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 5px;
}
.creator-work-tag-best { background: rgba(253,203,110,0.15); color: #FDCB6E; }
.creator-work-tag-hot  { background: rgba(241,39,17,0.12);   color: #FF7675; }
.creator-work-tag-new  { background: rgba(0,200,150,0.12);   color: #00C896; }
.creator-work-play-btn {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--accent, #7F77DD);
  background: rgba(127,119,221,0.1);
  color: var(--accent, #7F77DD);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
}
.creator-work-play-btn:active { transform: scale(0.95); }

/* 保留旧版兼容 */
.creator-follow-btn {
  margin-top: 6px;
  padding: 4px 16px;
  border-radius: 14px;
  border: 1px solid var(--accent, #7F77DD);
  background: rgba(127,119,221,0.1);
  color: var(--accent, #7F77DD);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.creator-follow-btn:active {
  background: var(--accent, #7F77DD);
  color: #fff;
}

/* 作品反馈 */
.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feedback-item {
  background: var(--bg-secondary, #141428);
  border: 1px solid var(--border, rgba(127,119,221,0.15));
  border-radius: 12px;
  padding: 12px;
}
.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.feedback-user {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent, #7F77DD);
}
.feedback-stars {
  font-size: 12px;
  color: #FFD700;
  letter-spacing: 1px;
}
.feedback-text {
  font-size: 13px;
  color: var(--text-secondary, #9E9CB8);
  line-height: 1.5;
  margin: 0 0 6px;
}
.feedback-target {
  font-size: 11px;
  color: var(--text-muted, #888);
}

/* 创作灵感 */
.inspiration-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.inspiration-card {
  background: var(--bg-secondary, #141428);
  border: 1px solid var(--border, rgba(127,119,221,0.15));
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inspiration-icon {
  font-size: 24px;
}
.inspiration-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #E0E0E0);
}
.inspiration-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.inspiration-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(127, 119, 221, 0.12);
  color: var(--accent, #7F77DD);
  cursor: pointer;
  transition: background 0.2s;
}
.inspiration-tag:active {
  background: rgba(127, 119, 221, 0.25);
}
.inspiration-desc {
  font-size: 12px;
  color: var(--text-secondary, #9E9CB8);
  line-height: 1.5;
  margin: 0;
}
.inspiration-link {
  align-self: flex-start;
  font-size: 12px;
  color: var(--accent, #7F77DD);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
}
.inspiration-link:active {
  opacity: 0.7;
}

/* 新增区块入场动画 */
@keyframes sectionFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.daily-pick-card,
.rank-list .rank-item,
.theme-collection-card,
.new-book-card,
.creator-activity-banner,
.creator-rec-card,
.feedback-item,
.inspiration-card {
  animation: sectionFadeIn 0.4s ease-out both;
}
.rank-list .rank-item:nth-child(2) { animation-delay: 0.05s; }
.rank-list .rank-item:nth-child(3) { animation-delay: 0.1s; }
.rank-list .rank-item:nth-child(4) { animation-delay: 0.15s; }
.rank-list .rank-item:nth-child(5) { animation-delay: 0.2s; }
.theme-collection-card:nth-child(2) { animation-delay: 0.05s; }
.theme-collection-card:nth-child(3) { animation-delay: 0.1s; }
.theme-collection-card:nth-child(4) { animation-delay: 0.15s; }
.theme-collection-card:nth-child(5) { animation-delay: 0.2s; }
.new-book-card:nth-child(2) { animation-delay: 0.05s; }
.new-book-card:nth-child(3) { animation-delay: 0.1s; }
.new-book-card:nth-child(4) { animation-delay: 0.15s; }
.new-book-card:nth-child(5) { animation-delay: 0.2s; }
.new-book-card:nth-child(6) { animation-delay: 0.25s; }
.creator-rec-card:nth-child(2) { animation-delay: 0.05s; }
.creator-rec-card:nth-child(3) { animation-delay: 0.1s; }
.creator-rec-card:nth-child(4) { animation-delay: 0.15s; }
.feedback-item:nth-child(2) { animation-delay: 0.05s; }
.feedback-item:nth-child(3) { animation-delay: 0.1s; }

/* ===== 社区通知弹窗 ===== */
.comm-notif-modal {
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 20px;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
}
.comm-notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.comm-notif-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}
.comm-notif-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.comm-notif-item {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: rgba(127, 119, 221, 0.1);
  border-radius: 8px;
  align-items: flex-start;
}
.comm-notif-icon {
  font-size: 16px;
}
.comm-notif-text {
  font-size: 14px;
  color: var(--text-primary);
}
.comm-notif-time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 8px;
}
.comm-notif-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 20px;
}
.comm-notif-clear {
  margin-top: 16px;
  width: 100%;
  padding: 10px;
  background: rgba(127, 119, 221, 0.2);
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
}
.comm-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #F472B6;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
}

/* ===== 世界书卡片标签叠加 ===== */
.market-card-tags-overlay {
  position: absolute;
  bottom: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.market-card-tag-badge {
  font-size: 9px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ========== 上传世界书表单 ========== */
.upload-book-form {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.upload-book-row {
  margin-bottom: 12px;
}

.upload-book-label {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
  font-weight: 500;
}

.upload-book-file {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  cursor: pointer;
}

.upload-book-file::-webkit-file-upload-button {
  background: linear-gradient(135deg, #6C5CE7, #A855F7);
  border: none;
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  margin-right: 10px;
  font-size: 13px;
  cursor: pointer;
}

.upload-book-input,
.upload-book-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
}

.upload-book-input:focus,
.upload-book-textarea:focus {
  border-color: #6C5CE7;
  background: rgba(255, 255, 255, 0.12);
}

.upload-book-textarea {
  resize: vertical;
  min-height: 50px;
}

.upload-book-progress {
  font-size: 13px;
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
}

.upload-book-progress.success {
  color: #00C896;
  background: rgba(0, 200, 150, 0.1);
}

.upload-book-progress.error {
  color: #FF7675;
  background: rgba(255, 118, 117, 0.1);
}

.upload-book-btn {
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #6C5CE7, #A855F7);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.upload-book-btn:hover {
  opacity: 0.9;
}

.upload-book-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.terms-checkbox {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  cursor: pointer;
}

.terms-checkbox input {
  margin-right: 6px;
}

.terms-link {
  color: var(--accent, #6C5CE7);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
}

.terms-link:hover {
  text-decoration: underline;
}

.terms-modal {
  background-color: var(--bg-secondary);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
}

.terms-content {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}

.terms-content p {
  margin-bottom: 12px;
}

.terms-content strong {
  color: var(--accent, #6C5CE7);
}

.code-input-row {
  display: flex;
  gap: 8px;
}

.code-input-row input {
  flex: 1;
}

.send-code-btn {
  flex-shrink: 0;
  padding: 0 12px;
  border: 1px solid var(--accent, #6C5CE7);
  border-radius: 8px;
  background: transparent;
  color: var(--accent, #6C5CE7);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.send-code-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== 世界书全屏编辑器 ===== */
.wb-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-primary, #0f0f1f);
  z-index: 300;
  display: flex;
  flex-direction: column;
}

.wb-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.wb-editor-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
  flex-shrink: 0;
}

.wb-editor-back {
  background: transparent;
  border: none;
  color: var(--text-secondary, #aaa);
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
}

.wb-editor-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.wb-editor-save {
  background: linear-gradient(135deg, #6C5CE7, #A855F7);
  border: none;
  color: #fff;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.wb-editor-save:disabled {
  opacity: 0.5;
}

.wb-editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.wb-editor-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.wb-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wb-field span {
  font-size: 12px;
  color: var(--text-secondary, #aaa);
}

.wb-field input,
.wb-field textarea {
  background: var(--bg-secondary, #1a1a38);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary, #fff);
  font-size: 14px;
  resize: vertical;
}

.wb-editor-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wb-section {
  background: var(--bg-secondary, #1a1a38);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 14px;
}

.wb-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.wb-section-icon {
  font-size: 18px;
}

.wb-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.wb-section-hint {
  font-size: 12px;
  color: var(--text-secondary, #888);
  margin: 0 0 8px;
}

.wb-section-textarea {
  width: 100%;
  min-height: 100px;
  background: var(--bg-primary, #0f0f1f);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary, #fff);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}

.wb-editor-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.1));
  flex-shrink: 0;
  font-size: 13px;
}

.wb-editor-count {
  color: var(--text-secondary, #888);
}

.wb-editor-msg {
  color: var(--accent, #6C5CE7);
}

.wb-cover-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg-secondary, #1a1a38);
  border: 1px dashed var(--border, rgba(255,255,255,0.2));
  border-radius: 10px;
  cursor: pointer;
}

.wb-cover-preview {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
}

.wb-cover-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--bg-primary, #0f0f1f);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim, #888);
  font-size: 12px;
  line-height: 1.2;
}

.wb-cover-hint {
  font-size: 12px;
  color: var(--text-secondary, #aaa);
}

.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px;
  background: var(--bg-tertiary, #2a2a3e);
  border-radius: 12px;
  margin-top: 8px;
  position: absolute;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  left: 0;
  top: 100%;
}

.avatar-picker-item {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.avatar-picker-item:hover {
  border-color: var(--accent, #6C5CE7);
  transform: scale(1.1);
}
/* ===== 万界门 全局设计 Token =====
 * 非色彩 Token — 不被 applyTheme() 动态覆盖
 * 色彩 Token — 仅作为初始默认值，实际由主题动态设置
 */

:root {
  /* 品牌色默认值（主题系统会覆盖 --accent） */
  --color-brand:         #7F77DD;
  --color-brand-light:   #EEEDFE;
  --color-brand-dark:    #534AB7;

  /* 语义色 */
  --color-success:       #1D9E75;
  --color-danger:        #D85A30;
  --color-warning:       #BA7517;

  /* 暗色主题背景（默认） */
  --bg-input:            rgba(20, 20, 40, 0.85);

  /* 边框与分割线 */
  --border-color:        rgba(127, 119, 221, 0.15);
  --border-color-strong: rgba(127, 119, 221, 0.30);

  /* 圆角体系 */
  --radius-xs:           4px;
  --radius-sm:           6px;
  --radius:              10px;
  --radius-lg:           16px;
  --radius-xl:           24px;
  --radius-full:         9999px;

  /* 间距体系 */
  --space-xs:            4px;
  --space-sm:            8px;
  --space-md:            12px;
  --space-lg:            16px;
  --space-xl:            24px;
  --space-2xl:           32px;

  /* 阴影 */
  --shadow-card:         0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-fab:          0 4px 16px rgba(127, 119, 221, 0.40);
  --shadow-nav:          0 -2px 12px rgba(0, 0, 0, 0.30);

  /* 字体 */
  --font-sans:           -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', sans-serif;
  --font-mono:           'Fira Code', 'Consolas', monospace;

  /* 向后兼容：让旧代码中的 --accent-color 总是指向 --accent */
  --accent-color:        var(--accent, #7F77DD);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .app {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 40vh;
  }

  .sidebar-header {
    padding: 12px 16px;
  }

  .logo {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .new-chat-btn {
    padding: 10px;
    font-size: 13px;
  }

  .token-balance {
    padding: 12px 16px;
    font-size: 13px;
  }

  .token-balance strong {
    font-size: 16px;
  }

  .conversations-list {
    padding: 12px;
    max-height: 150px;
  }

  .conversation-item {
    padding: 10px;
    margin-bottom: 6px;
  }
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--accent);
}

.new-chat-btn {
  width: 100%;
  padding: 12px;
  background-color: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.2s;
}

.new-chat-btn:hover {
  background-color: var(--accent-hover);
}

.token-balance {
  padding: 16px 20px;
  background-color: var(--bg-tertiary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.token-balance strong {
  color: var(--accent);
  font-size: 18px;
}

.conversations-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.conversations-list h3 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.conversation-item {
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background-color 0.2s;
}

.conversation-item:hover {
  background-color: var(--bg-tertiary);
}

.conversation-item.active {
  background-color: var(--bg-tertiary);
  border-left: 3px solid var(--accent);
}

.conv-title {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
}

.conv-worldbook {
  font-size: 12px;
  color: var(--text-secondary);
}

.no-conversations {
  color: var(--text-secondary);
  text-align: center;
  padding: 20px;
  font-size: 14px;
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
}

.chat-area.empty {
  justify-content: center;
  align-items: center;
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
}

.empty-state h2 {
  font-size: 28px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.empty-state p {
  margin-bottom: 8px;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-info h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.worldbook-tag {
  font-size: 12px;
  background-color: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.model-badge {
  font-size: 12px;
  background-color: var(--accent);
  padding: 4px 12px;
  border-radius: 20px;
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ai-disclaimer-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid rgba(127, 119, 221, 0.35);
  white-space: nowrap;
}

.ai-disclaimer-text {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.8;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 8px;
  max-width: 95%;
  align-items: flex-start;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.assistant {
  align-self: flex-start;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  flex-grow: 0;
  margin-left: -4px;
}

.message-content-wrapper {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.message-content {
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.5;
  word-break: break-all;
  overflow-wrap: break-word;
  max-width: calc(100% - 48px);
}

.message.user .message-content {
  background-color: var(--user-msg-bg);
  border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
  background-color: var(--assistant-msg-bg);
  border-bottom-left-radius: 4px;
}

.message-content p {
  white-space: pre-wrap;
}

.cursor {
  color: var(--accent);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.input-area textarea {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 48px;
  max-height: 120px;
}

.input-area textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.input-area button {
  padding: 12px 24px;
  background-color: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.2s;
}

.input-area button:hover:not(:disabled) {
  background-color: var(--accent-hover);
}

.input-area button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .chat-header {
    padding: 12px 16px;
  }

  .chat-info h2 {
    font-size: 16px;
  }

  .messages-container {
    padding: 12px;
    gap: 12px;
  }

  .message {
    max-width: 95%;
    gap: 8px;
  }

  .message-avatar {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .message-content {
    padding: 10px 14px;
    font-size: 14px;
  }

  .input-area {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  .input-area textarea {
    padding: 10px 14px;
    font-size: 13px;
    min-height: 44px;
    max-height: 100px;
  }

  .input-area button {
    padding: 10px 20px;
    font-size: 13px;
  }

  .panel-toggle {
    display: none;
  }

  .worldbook-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 70px;
    width: 100%;
    max-height: 60vh;
    border-radius: 16px 16px 0 0;
    padding: 16px;
  }

  /* 触摸友好的交互样式 */
  .new-chat-btn,
  .conversation-item,
  .input-area button,
  .worldbook-actions button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
    touch-action: manipulation;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .new-chat-btn:active,
  .conversation-item:active,
  .input-area button:active:not(:disabled),
  .worldbook-actions button:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
  }

  .messages-container {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  .input-area textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }
}

.panel-toggle {
  position: fixed;
  right: 20px;
  top: 20px;
  padding: 12px 20px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  z-index: 100;
  transition: background-color 0.2s;
}

.panel-toggle:hover {
  background-color: var(--bg-tertiary);
}

.worldbook-panel {
  position: fixed;
  right: 20px;
  top: 70px;
  width: 360px;
  max-height: calc(100vh - 100px);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  overflow-y: auto;
  z-index: 99;
}

.worldbook-panel h2 {
  font-size: 18px;
  margin-bottom: 16px;
}

.upload-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.upload-section input[type='file'] {
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.upload-progress {
  font-size: 13px;
}

.worldbook-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.worldbook-item {
  padding: 12px;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
}

.worldbook-info h4 {
  font-size: 14px;
  margin-bottom: 4px;
}

.worldbook-info p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.token-count {
  font-size: 11px;
  color: var(--accent);
}

.worldbook-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.worldbook-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s;
}

.worldbook-actions button:first-child {
  background-color: var(--accent);
  color: white;
}

.worldbook-actions button:first-child:hover {
  background-color: var(--accent-hover);
}

.worldbook-actions .delete-btn {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.worldbook-actions .delete-btn:hover {
  color: #ff4444;
  border-color: #ff4444;
}

.no-worldbooks {
  text-align: center;
  color: var(--text-secondary);
  padding: 20px;
  font-size: 14px;
}
