/* =========================================================
  style.css — 数学脑 v8.0 · 莫兰迪高保真 UI
  设计方向：极简 / 现代 / 干净
  色彩方案：Morandi Palette（低饱和、哑光质感）
  排版层级清晰，微阴影，圆角设计
  ========================================================= */

:root {
  /* ═══ 莫兰迪色系 (Morandi Palette) ═══ */
  --morandi-bg:        #F0F2F5;   /* 极浅燕麦色/米灰 — 全局背景 */
  --morandi-card:      #FAFBFC;   /* 极淡冷灰白 — 卡片底色 */
  --morandi-card-warm: #F5F0E6;   /* 淡米黄 — 卡片杂色变体 */
  --morandi-card-cool: #EEF2F0;   /* 淡灰绿 — 卡片杂色变体 */
  --morandi-card-lilac:#F2EEF5;   /* 淡灰紫 — 卡片杂色变体 */

  --morandi-blue:      #A0B9D8;   /* 灰雾蓝 — 主色调 */
  --morandi-blue-deep: #8AA3C2;   /* 深雾蓝 — hover/active */
  --morandi-blue-light:#DCE6F0;   /* 极淡雾蓝 — 浅色背景 */
  --morandi-pink:      #DAB8B0;   /* 豆沙粉 — 辅助色 */
  --morandi-pink-light:#F2E4DF;   /* 极淡豆沙粉 */
  --morandi-green:     #B8D0C9;   /* 灰豆绿 — 辅助色 */
  --morandi-green-light:#E4EFEB;  /* 极淡灰豆绿 */
  --morandi-purple:    #C5CAD0;   /* 灰紫 — 个人中心 */
  --morandi-purple-deep:#AEB3B9;

  --morandi-text:      #4A4A4A;   /* 深岩灰 — 标题/正文 */
  --morandi-text-sub:  #999999;   /* 浅暖灰 — 辅助信息 */
  --morandi-text-muted:#B0B0B0;   /* 更浅灰 — 占位等 */
  --morandi-border:    #E8EAED;   /* 极淡灰边框 */
  --morandi-divider:   #EEEEEE;   /* 分割线 */

  /* ═══ 模块色（莫兰迪变体） ═══ */
  --module-discover:   #A0B9D8;
  --module-discover-light: #DCE6F0;
  --module-knowledge:  #B8D0C9;
  --module-knowledge-light:#E4EFEB;
  --module-life:       #DAB8B0;
  --module-life-light: #F2E4DF;
  --module-profile:    #C5CAD0;
  --module-profile-light:#EDEEF0;

  /* ═══ 旧 CSS 变量兼容 ═══ */
  --primary: #A0B9D8;
  --primary-dark: #8AA3C2;
  --primary-light: #DCE6F0;
  --shuren: #A0B9D8;
  --shuren-light: #DCE6F0;
  --shuren-gradient: linear-gradient(135deg, #A0B9D8, #8AA3C2);
  --shushuo: #B8D0C9;
  --shushuo-light: #E4EFEB;
  --shushuo-gradient: linear-gradient(135deg, #B8D0C9, #A0BBAF);
  --shusi: #DAB8B0;
  --shusi-light: #F2E4DF;
  --shusi-gradient: linear-gradient(135deg, #DAB8B0, #C9A39A);
  --mine: #C5CAD0;
  --mine-light: #EDEEF0;
  --mine-gradient: linear-gradient(135deg, #C5CAD0, #AEB3B9);
  --bg: #F0F2F5;
  --card: #FAFBFC;
  --text: #4A4A4A;
  --text-secondary: #999999;
  --text-muted: #B0B0B0;
  --border: #E8EAED;
  --sidebar-bg: #4A4A4A;
  --sidebar-text: #999999;
  --sidebar-active: #FAFBFC;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.06);
  --accent: var(--primary);
  --accent-light: var(--primary-light);
  --accent-gradient: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

/* ═══════════════════════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: #E2E5EA;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  color: var(--morandi-text);
  -webkit-tap-highlight-color: transparent;
}

/* 手机外壳模拟 */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: min(390px, 100vw);
  height: 100dvh;
  background: var(--morandi-bg);
  z-index: -1;
  box-shadow: 0 0 80px rgba(0,0,0,0.06);
}

/* ═══════════════════════════════════════════════════════════
   App Container
   ═══════════════════════════════════════════════════════════ */
.app-container {
  display: flex;
  flex-direction: column;
  width: min(390px, 100vw);
  max-width: 390px;
  height: 100dvh;
  overflow: hidden;
  background: var(--morandi-bg);
  position: relative;
}

/* ═══════════════════════════════════════════════════════════
   Top Bar
   ═══════════════════════════════════════════════════════════ */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 8px;
  background: var(--morandi-bg);
  z-index: 50;
}
.top-bar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-icon-sm {
  width: 28px; height: 28px;
  background: var(--morandi-blue);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(160,185,216,0.25), inset 0 -3px 0 rgba(0,0,0,0.08);
}
.brand-text-sm {
  font-size: 15px;
  font-weight: 700;
  color: var(--morandi-text);
  letter-spacing: 0.3px;
}
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--morandi-border);
  background: rgba(250, 251, 252, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--morandi-text-sub);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.icon-btn:active {
  background: var(--morandi-blue-light);
  border-color: var(--morandi-blue);
  color: var(--morandi-blue);
}

/* ═══════════════════════════════════════════════════════════
   Content Area
   ═══════════════════════════════════════════════════════════ */
.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--morandi-bg);
  display: flex;
  flex-direction: column;
}

/* Section Title Bar */
.section-title-bar {
  padding: 12px 16px 10px;
  background: var(--morandi-bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--morandi-text);
  letter-spacing: 0.2px;
}

/* Module Banner */
.module-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 0 12px 10px;
  border-radius: var(--radius);
  transition: all 0.3s;
}
.module-banner.shuren   { background: var(--morandi-blue-light); }
.module-banner.shushuo  { background: var(--morandi-green-light); }
.module-banner.shusi    { background: var(--morandi-pink-light); }
.module-banner.shuwu    { background: var(--module-profile-light); }
.banner-icon { font-size: 24px; flex-shrink: 0; opacity: 0.7; }
.banner-text { flex: 1; }
.banner-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
}
.module-banner.shuren  .banner-title { color: #6B8AAB; }
.module-banner.shushuo .banner-title { color: #7BA89A; }
.module-banner.shusi   .banner-title { color: #B8958A; }
.module-banner.shuwu   .banner-title { color: #8A8F94; }
.banner-sub { font-size: 11px; color: var(--morandi-text-sub); line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════
   Category Filter
   ═══════════════════════════════════════════════════════════ */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 10px;
}
.cat-btn {
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid var(--morandi-border);
  background: var(--morandi-card);
  font-size: 11px;
  font-weight: 500;
  color: var(--morandi-text-sub);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.cat-btn:active,
.cat-btn.active {
  border-color: var(--morandi-blue);
  background: var(--morandi-blue-light);
  color: var(--morandi-blue);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   存档面板 (Save Panel) — v8.3
   ═══════════════════════════════════════════════════════════ */
.save-panel-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(74, 74, 74, 0.45);
  z-index: 180;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.save-panel-overlay.show { display: flex; }
.save-panel {
  background: var(--morandi-bg);
  border-radius: var(--radius-xl);
  width: min(360px, 92vw);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}
.save-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--morandi-card);
  border-bottom: 1px solid var(--morandi-border);
  flex-shrink: 0;
}
.sp-back {
  border: none;
  background: var(--morandi-bg);
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--morandi-text-sub);
  cursor: pointer;
}
.sp-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--morandi-text);
  flex: 1;
}
.save-slots {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.save-slot {
  background: var(--morandi-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--morandi-border);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}
.save-slot:active { transform: scale(0.98); }
.save-slot.active {
  border-color: var(--morandi-blue);
  box-shadow: 0 2px 12px rgba(160,185,216,0.15);
}
.save-slot-empty {
  opacity: 0.5;
  justify-content: center;
  padding: 22px;
  color: var(--morandi-text-muted);
  font-size: 13px;
}
.save-slot-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.save-slot-info { flex: 1; min-width: 0; }
.save-slot-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--morandi-text);
  margin-bottom: 3px;
}
.save-slot-meta {
  font-size: 10px;
  color: var(--morandi-text-muted);
  display: flex;
  gap: 8px;
}
.save-slot-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.save-slot-btn {
  padding: 5px 10px;
  border: 1px solid var(--morandi-border);
  border-radius: 7px;
  background: var(--morandi-bg);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  color: var(--morandi-text-sub);
  white-space: nowrap;
  transition: all 0.15s;
}
.save-slot-btn.primary {
  background: var(--morandi-blue);
  color: #fff;
  border-color: transparent;
}
.save-slot-btn:active { transform: scale(0.95); }

/* ═══════════════════════════════════════════════════════════
   结局画廊 (Ending Gallery) — v8.3
   ═══════════════════════════════════════════════════════════ */
.gallery-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(74, 74, 74, 0.45);
  z-index: 180;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.gallery-overlay.show { display: flex; }
.gallery-panel {
  background: var(--morandi-bg);
  border-radius: var(--radius-xl);
  width: min(360px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}
.gallery-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--morandi-card);
  border-bottom: 1px solid var(--morandi-border);
  flex-shrink: 0;
}
.gallery-progress {
  font-size: 12px;
  font-weight: 600;
  color: var(--morandi-blue);
  white-space: nowrap;
}
.gallery-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.gallery-card {
  background: var(--morandi-card);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s;
}
.gallery-card.unlocked { cursor: pointer; }
.gallery-card.unlocked:active { transform: scale(0.96); }
.gallery-card.locked {
  opacity: 0.4;
  filter: grayscale(1);
}
.gallery-badge {
  font-size: 32px;
}
.gallery-card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--morandi-text);
}
.gallery-card-desc {
  font-size: 10px;
  color: var(--morandi-text-muted);
  line-height: 1.4;
}
.gallery-card-lock {
  font-size: 20px;
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════
   Search & Sub Nav
   ═══════════════════════════════════════════════════════════ */
.search-header {
  padding: 10px 14px 4px;
  background: var(--morandi-bg);
  position: sticky;
  top: 0;
  z-index: 25;
}
.search-bar-wrap {
  display: flex;
  align-items: center;
  background: var(--morandi-card);
  padding: 9px 14px;
  border-radius: 22px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid var(--morandi-border);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar-wrap:focus-within {
  border-color: var(--morandi-blue);
  box-shadow: 0 1px 8px rgba(160,185,216,0.15);
}
.search-icon { margin-right: 8px; font-size: 13px; opacity: 0.35; }
.search-bar-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--morandi-text);
}
.search-bar-wrap input::placeholder { color: var(--morandi-text-muted); }

.sub-nav {
  display: flex;
  gap: 22px;
  padding: 6px 16px 8px;
  background: var(--morandi-bg);
  border-bottom: 1px solid var(--morandi-border);
  margin-bottom: 10px;
}
.sub-nav-btn {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--morandi-text-sub);
  cursor: pointer;
  padding: 4px 0;
  position: relative;
  transition: color 0.2s;
  letter-spacing: 0.2px;
}
.sub-nav-btn:active { color: var(--morandi-text); }
.sub-nav-btn.active {
  color: var(--morandi-text);
  font-weight: 700;
}
.sub-nav-btn.active::after {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 3px;
  background: var(--morandi-blue);
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════
   Discipline Grid
   ═══════════════════════════════════════════════════════════ */
.discipline-grid-container {
  padding: 14px 14px 20px;
  animation: fadeIn 0.3s ease;
}
.grid-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--morandi-text);
  margin-bottom: 16px;
  letter-spacing: 0.2px;
}
.discipline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 10px;
}
.discipline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  padding: 16px 6px 12px;
  border-radius: var(--radius-lg);
  background: var(--morandi-card);
  box-shadow: var(--shadow-sm);
}
.discipline-item:active {
  transform: scale(0.95);
  box-shadow: var(--shadow);
}
.discipline-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  transition: all 0.2s;
}
.discipline-item:hover .discipline-icon-box {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.discipline-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--morandi-text);
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.discipline-active-header {
  padding: 10px 14px;
  background: var(--morandi-bg);
  border-bottom: 1px solid var(--morandi-border);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}
.back-to-grid {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--morandi-text);
  font-size: 14px;
  font-weight: 700;
  padding: 4px 0;
}
.back-icon {
  font-size: 16px;
  color: var(--morandi-blue);
}

/* ═══════════════════════════════════════════════════════════
   Video Grid (双列卡片)
   ═══════════════════════════════════════════════════════════ */
.video-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 12px 20px;
}
.video-card {
  background: var(--morandi-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}
.video-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow);
}

/* 封面区域 — 莫兰迪杂色底 */
.vc-cover {
  width: 100%;
  aspect-ratio: 16/10;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.vc-cover-placeholder {
  font-size: 28px;
  opacity: 0.18;
}
/* 时长徽章 */
.vc-duration {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(74, 74, 74, 0.55);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: 0.3px;
}

/* 内容区 */
.vc-content {
  padding: 8px 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.vc-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--morandi-text);
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
  letter-spacing: 0.1px;
}
.vc-info-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
}
.vc-author-avatar {
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #fff;
  flex-shrink: 0;
}
.vc-author-name {
  font-size: 10px;
  color: var(--morandi-text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.vc-stat {
  font-size: 10px;
  color: var(--morandi-text-muted);
  display: flex;
  align-items: center;
  gap: 2px;
}

/* 收藏按钮 */
.vc-fav {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(74,74,74,0.28);
  backdrop-filter: blur(3px);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, transform 0.15s;
  z-index: 2;
}
.video-card:hover .vc-fav,
.video-card:active .vc-fav { opacity: 1; }
.vc-fav.active {
  opacity: 1;
  background: rgba(160, 185, 216, 0.75);
}
.vc-fav:active { transform: scale(1.15); }

/* ═══════════════════════════════════════════════════════════
   Empty & Loading States
   ═══════════════════════════════════════════════════════════ */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 0;
  color: var(--morandi-text-muted);
}
.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--morandi-border);
  border-top-color: var(--morandi-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--morandi-text-muted);
}
.empty-state .icon { font-size: 40px; margin-bottom: 10px; opacity: 0.4; }
.empty-state h3 { font-size: 14px; color: var(--morandi-text-sub); margin-bottom: 4px; font-weight: 600; }
.empty-state p { font-size: 12px; }

/* ═══════════════════════════════════════════════════════════
   Knowledge Feed (数说 · 知识卡片)
   ═══════════════════════════════════════════════════════════ */

/* Hero 大横幅 */
.shushuo-hero {
  padding: 0 12px 14px;
  animation: fadeIn 0.3s ease;
}
.hero-card {
  background: linear-gradient(145deg, #C0CAD4 0%, #A8B8C8 60%, #B5C3D0 100%);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(192, 202, 212, 0.2);
}
.hero-card::before {
  content: "";
  position: absolute;
  top: -20px; right: -20px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.hero-card::after {
  content: "";
  position: absolute;
  bottom: -25px; left: -10px;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}
.hero-badge {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.hero-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}
.hero-desc {
  font-size: 11px;
  opacity: 0.72;
  line-height: 1.5;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.hero-stats {
  display: flex;
  gap: 16px;
  font-size: 10px;
  opacity: 0.55;
  position: relative;
  z-index: 1;
}

/* 横向话题标签 */
.shushuo-topics {
  padding: 0 12px 8px;
  overflow: hidden;
}
.topics-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.topics-scroll::-webkit-scrollbar { display: none; }
.topic-pill {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid var(--morandi-border);
  background: var(--morandi-card);
  font-size: 11px;
  font-weight: 500;
  color: var(--morandi-text-sub);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
}
.topic-pill:active,
.topic-pill.active {
  border-color: var(--morandi-green);
  background: var(--morandi-green-light);
  color: #7BA89A;
  font-weight: 600;
}

/* 知识卡片 Feed */
.shushuo-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 12px 20px;
  animation: fadeIn 0.4s ease;
}
.feed-card {
  background: var(--morandi-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s;
}
.feed-card:active { transform: scale(0.98); }
.feed-card-visual {
  width: 100%;
  height: 132px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.feed-card-icon {
  font-size: 42px;
  opacity: 0.22;
  z-index: 1;
}
.feed-card-question {
  position: absolute;
  bottom: 10px; left: 14px; right: 14px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
  line-height: 1.4;
}
.feed-card-body {
  padding: 10px 14px 14px;
}
.feed-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 5px;
  color: var(--morandi-text);
}
.feed-card-desc {
  font-size: 12px;
  color: var(--morandi-text-sub);
  line-height: 1.6;
  margin-bottom: 8px;
}
.feed-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}
.feed-card-topic {
  font-size: 10px;
  font-weight: 500;
}
.feed-card-time {
  font-size: 10px;
  color: var(--morandi-text-muted);
}
.feed-card-fav {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(74,74,74,0.2);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
  z-index: 2;
}
.feed-card-fav.active { background: rgba(160, 185, 216, 0.7); }
.feed-card-fav:active { transform: scale(1.15); }

/* ═══════════════════════════════════════════════════════════
   个人中心 (Profile) — 紧凑布局，完整显示
   ═══════════════════════════════════════════════════════════ */
.profile-page {
  padding: 6px 12px 20px;
  animation: fadeIn 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 用户信息面板 */
.profile-card {
  background: linear-gradient(135deg, #C5CAD0 0%, #B5C0CA 40%, #C0C8D0 100%);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  color: #fff;
  box-shadow: 0 6px 20px rgba(197, 202, 208, 0.2);
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity 0.15s;
}
.profile-card:active { opacity: 0.92; }
.profile-main {
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-avatar {
  width: 48px; height: 48px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.2);
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}
.profile-meta { flex: 1; min-width: 0; }
.profile-name {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 1px;
  letter-spacing: 0.2px;
}
.profile-id {
  font-size: 10px;
  opacity: 0.7;
  margin-bottom: 6px;
}
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.profile-tags span {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  font-size: 10px;
  font-weight: 500;
}
.profile-edit {
  margin-top: 8px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

/* 统计行 */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  flex-shrink: 0;
}
.profile-stat {
  background: var(--morandi-card);
  border-radius: var(--radius);
  padding: 10px 6px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--morandi-border);
  cursor: pointer;
  transition: transform 0.15s;
}
.profile-stat:active { transform: scale(0.96); }
.profile-stat-num {
  font-size: 17px;
  font-weight: 800;
  color: var(--morandi-blue);
  margin-bottom: 1px;
}
.profile-stat-label {
  font-size: 10px;
  color: var(--morandi-text-sub);
}

/* 功能列表（紧凑型） */
.profile-section {
  flex-shrink: 0;
}
.profile-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--morandi-text-sub);
  margin-bottom: 4px;
  padding: 0 2px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.profile-menu-card {
  background: var(--morandi-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.profile-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid var(--morandi-divider);
  cursor: pointer;
  transition: background 0.15s;
}
.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item:active { background: var(--morandi-bg); }
.profile-menu-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--morandi-text);
}
.menu-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--morandi-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--morandi-blue);
  font-size: 11px;
  font-weight: 700;
}
.menu-arrow {
  font-size: 14px;
  color: var(--morandi-text-muted);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════
   Bottom TabBar
   ═══════════════════════════════════════════════════════════ */
.bottom-tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--morandi-border);
  z-index: 60;
  box-shadow: 0 -4px 20px rgba(160, 185, 216, 0.06);
}
.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--morandi-text-muted);
  cursor: pointer;
  width: 78px;
  min-height: 48px;
  border-radius: 14px;
  transition: all 0.2s ease;
}
.tab-icon {
  width: 20px; height: 20px;
  position: relative;
  transition: transform 0.2s, opacity 0.2s;
  opacity: 0.6;
}
.tab-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.tab-btn.active {
  color: var(--morandi-blue);
  background: var(--morandi-blue-light);
}
.tab-btn.active .tab-icon {
  transform: translateY(-1px);
  opacity: 1;
}
.tab-btn.active .tab-label {
  font-weight: 700;
}

/* Tab 图标 — 简约线性风格 */
.tab-icon::before,
.tab-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}
.tab-icon-discover::before {
  inset: 3px;
  border: 1.8px solid currentColor;
  border-radius: 5px;
}
.tab-icon-discover::after {
  width: 4px; height: 8px;
  right: 5px; top: 7px;
  background: currentColor;
  border-radius: 2px;
}
.tab-icon-knowledge::before {
  left: 4px; right: 4px; bottom: 3px;
  height: 10px;
  border: 1.8px solid currentColor;
  border-top: none;
  border-radius: 1px 1px 4px 4px;
}
.tab-icon-knowledge::after {
  left: 6px; top: 2px;
  width: 10px; height: 10px;
  background: currentColor;
  clip-path: polygon(50% 0, 100% 40%, 100% 100%, 0 100%, 0 40%);
}
.tab-icon-life::before {
  left: 5px; right: 5px; top: 3px; bottom: 3px;
  border: 1.8px solid currentColor;
  border-radius: 3px 3px 7px 7px;
}
.tab-icon-life::after {
  left: 8px; right: 8px; top: 8px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.tab-icon-mine::before {
  width: 7px; height: 7px;
  left: 3px; top: 3px;
  background: currentColor;
  border-radius: 2px;
  box-shadow: 9px 0 0 currentColor, 0 9px 0 currentColor, 9px 9px 0 currentColor;
}

/* ═══════════════════════════════════════════════════════════
   AI Chat
   ═══════════════════════════════════════════════════════════ */
.chat-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(74, 74, 74, 0.35);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}
.chat-overlay.show { display: flex; }
.chat-panel {
  width: 380px;
  max-width: 93vw;
  height: 78vh;
  background: var(--morandi-card);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
  overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--morandi-border);
  font-weight: 700;
  font-size: 14px;
  color: var(--morandi-text);
}
.chat-header-left { display: flex; align-items: center; gap: 10px; }
.ai-avatar {
  width: 30px; height: 30px;
  background: var(--morandi-blue);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(160,185,216,0.3);
}
.chat-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--morandi-bg);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--morandi-text-sub);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--morandi-bg);
}
.chat-msg { display: flex; animation: msgIn 0.3s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg.assistant { justify-content: flex-start; }
.chat-msg.user { justify-content: flex-end; }
.msg-bubble {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-msg.assistant .msg-bubble {
  background: #fff;
  border-bottom-left-radius: 3px;
  box-shadow: var(--shadow-sm);
}
.chat-msg.user .msg-bubble {
  background: linear-gradient(135deg, #A0B9D8, #8AA3C2);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.quick-asks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 14px;
}
.quick-ask {
  padding: 5px 11px;
  border-radius: 12px;
  border: 1px solid var(--morandi-border);
  background: #fff;
  font-size: 11px;
  color: var(--morandi-text-sub);
  cursor: pointer;
  transition: all 0.15s;
}
.quick-ask:active {
  background: var(--morandi-blue-light);
  border-color: var(--morandi-blue);
  color: var(--morandi-blue);
}
.chat-input-area {
  display: flex;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--morandi-border);
  gap: 8px;
  background: #fff;
}
.chat-input-area input {
  flex: 1;
  padding: 9px 13px;
  border: 1px solid var(--morandi-border);
  border-radius: 18px;
  font-size: 13px;
  outline: none;
  background: var(--morandi-bg);
  transition: border-color 0.2s;
}
.chat-input-area input:focus { border-color: var(--morandi-blue); }
.send-btn {
  min-width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--morandi-blue);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(160,185,216,0.25);
}
.send-btn:active { transform: scale(0.93); }
.typing-indicator { display: flex; gap: 4px; padding: 3px 0; }
.typing-indicator span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--morandi-text-muted);
  animation: bounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ═══════════════════════════════════════════════════════════
   Video Modal
   ═══════════════════════════════════════════════════════════ */
.video-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(74, 74, 74, 0.5);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}
.video-modal.show { display: flex; }
.video-modal-content {
  width: 360px;
  max-width: 93vw;
  max-height: 86vh;
  background: var(--morandi-card);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.video-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--morandi-border);
}
.video-modal-header h3 { font-size: 14px; font-weight: 700; flex: 1; margin-right: 10px; line-height: 1.4; color: var(--morandi-text); }
.video-modal-header button {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: var(--morandi-bg); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--morandi-text-sub);
}
.video-player-area {
  background: #E8EBEF;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-placeholder { text-align: center; color: rgba(74,74,74,0.35); }
.play-icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(160,185,216,0.25);
  display: flex;
  align-items: center; justify-content: center; font-size: 20px;
  margin: 0 auto 8px;
}
.video-placeholder p { font-size: 11px; }
.video-info { padding: 12px 16px; }
.video-desc { font-size: 12px; line-height: 1.6; color: var(--morandi-text-sub); margin-bottom: 8px; }
.video-meta { font-size: 10px; color: var(--morandi-text-muted); display: flex; flex-wrap: wrap; gap: 10px; }
.video-actions { padding: 0 16px 16px; display: flex; gap: 8px; }
.btn-primary, .btn-secondary {
  flex: 1; padding: 9px; border-radius: 10px; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer; text-align: center;
  transition: transform 0.15s;
}
.btn-primary:active, .btn-secondary:active { transform: scale(0.97); }
.btn-primary { background: var(--morandi-blue); color: #fff; box-shadow: 0 2px 8px rgba(160,185,216,0.2); }
.btn-secondary { background: var(--morandi-bg); color: var(--morandi-text); }

/* ═══════════════════════════════════════════════════════════
   Visual Novel Engine
   ═══════════════════════════════════════════════════════════ */
.vn-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 12px;
}
.vn-chapter-badge {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--morandi-green);
  box-shadow: 0 2px 6px rgba(184, 208, 201, 0.3);
  letter-spacing: 0.3px;
}
.vn-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.stat-badge {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.vn-actions {
  display: flex;
  gap: 6px;
  padding: 0 12px;
}
.vn-btn {
  background: var(--morandi-card);
  border: 1px solid var(--morandi-border);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  color: var(--morandi-text-sub);
  font-weight: 600;
  transition: all 0.2s;
}
.vn-btn:active {
  background: var(--morandi-green-light);
  border-color: var(--morandi-green);
  color: #7BA89A;
}
.story-scene {
  background: var(--morandi-card);
  margin: 0 12px 12px;
  border-radius: var(--radius-lg);
  padding: 18px;
  min-height: 260px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.vn-background {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  border-radius: var(--radius-lg);
}
.vn-sprite {
  position: absolute;
  bottom: 0;
  right: 0;
  max-height: 75%;
  max-width: 55%;
  object-fit: contain;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.story-text-box {
  position: relative;
  z-index: 2;
  background: rgba(250, 251, 252, 0.94);
  backdrop-filter: blur(4px);
  padding: 12px;
  border-radius: 9px;
  border: 1px solid var(--morandi-border);
}
.story-character {
  font-weight: 800;
  color: var(--morandi-green);
  margin-bottom: 5px;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.story-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--morandi-text);
  min-height: 44px;
  white-space: pre-line;
}
.story-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 20px;
}
.choice-btn {
  background: var(--morandi-card);
  border: 1px solid var(--morandi-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--morandi-text);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 5px;
  animation: fadeInUp 0.3s ease both;
}
.choice-btn:hover {
  background: var(--morandi-green-light);
  border-color: var(--morandi-green);
}
.choice-btn:active {
  transform: scale(0.98);
  background: var(--morandi-green-light);
}
.choice-hint {
  font-size: 10px;
  color: #7BA89A;
  font-weight: 500;
}
.choice-text { line-height: 1.5; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
   Simulator
   ═══════════════════════════════════════════════════════════ */
.sim-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
  padding: 0 12px;
}
.sim-year-badge {
  align-self: flex-start;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.sim-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sim-stat-bar {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.sim-actions-top {
  display: flex;
  gap: 6px;
  padding: 0 12px 8px;
}
.sim-scene {
  background: var(--morandi-card);
  margin: 0 12px 12px;
  border-radius: var(--radius-lg);
  padding: 18px;
  min-height: 180px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.sim-character {
  font-weight: 800;
  color: var(--morandi-pink);
  margin-bottom: 8px;
  font-size: 13px;
  letter-spacing: 0.3px;
}
.sim-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--morandi-text);
  min-height: 54px;
  white-space: pre-line;
}
.sim-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 28px;
}
.sim-choice-btn {
  background: var(--morandi-card);
  border: 1px solid var(--morandi-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--morandi-text);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 5px;
  animation: fadeInUp 0.3s ease both;
}
.sim-choice-btn:hover {
  background: var(--morandi-pink-light);
  border-color: var(--morandi-pink);
}
.sim-choice-btn:active { transform: scale(0.98); }
.sim-hint {
  font-size: 10px;
  color: #B8958A;
  font-weight: 500;
}
.sim-hint-tip {
  font-size: 10px;
  color: var(--morandi-text-muted);
  font-weight: 400;
}
.sim-choice-text { line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════
   Ending Overlay
   ═══════════════════════════════════════════════════════════ */
.ending-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(74, 74, 74, 0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.ending-overlay.show { display: flex; }
.ending-card {
  background: var(--morandi-card);
  border-radius: var(--radius-xl);
  padding: 24px 22px;
  width: min(320px, 88vw);
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  animation: fadeInUp 0.4s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ending-badge { font-size: 44px; }
.ending-type {
  font-size: 12px;
  color: var(--morandi-text-muted);
  font-weight: 600;
  letter-spacing: 1px;
}
.ending-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--morandi-text);
}
.ending-scene {
  font-size: 12px;
  color: var(--morandi-text-sub);
  line-height: 1.7;
  background: var(--morandi-bg);
  border-radius: var(--radius);
  padding: 10px;
}

/* ═══════════════════════════════════════════════════════════
   Avatar Picker
   ═══════════════════════════════════════════════════════════ */
.avatar-picker-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(74, 74, 74, 0.45);
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
}
.avatar-picker-overlay.show { display: flex; }
.avatar-picker-card {
  background: var(--morandi-card);
  border-radius: var(--radius-xl);
  padding: 18px;
  width: min(320px, 88vw);
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.picker-title {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: var(--morandi-text);
}
.picker-emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}
.picker-emoji-btn {
  width: 34px; height: 34px;
  border: 1.5px solid var(--morandi-border);
  border-radius: 8px;
  background: var(--morandi-bg);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.picker-emoji-btn:active { transform: scale(0.9); }
.picker-color-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.picker-color-btn {
  width: 30px; height: 30px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s;
}
.picker-color-btn:active { transform: scale(0.85); }
.picker-actions {
  display: flex;
  gap: 8px;
}
.picker-btn {
  flex: 1;
  padding: 9px;
  border: 1px solid var(--morandi-border);
  border-radius: 10px;
  background: var(--morandi-bg);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  color: var(--morandi-text-sub);
}
.picker-btn.primary {
  background: var(--morandi-blue);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(160,185,216,0.2);
}

/* ═══════════════════════════════════════════════════════════
   Profile List Panel
   ═══════════════════════════════════════════════════════════ */
.profile-list-panel {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--morandi-bg);
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.plp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--morandi-card);
  border-bottom: 1px solid var(--morandi-border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.plp-back {
  border: none;
  background: var(--morandi-bg);
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--morandi-text-sub);
  cursor: pointer;
}
.plp-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--morandi-text);
}
.plp-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--morandi-card);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 7px;
  box-shadow: var(--shadow-sm);
}
.hi-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.hi-info { flex: 1; min-width: 0; }
.hi-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--morandi-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hi-meta {
  font-size: 10px;
  color: var(--morandi-text-muted);
  margin-top: 2px;
}
.hi-del {
  border: none;
  background: transparent;
  color: #DAB8B0;
  font-size: 15px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 5px;
  transition: background 0.2s;
}
.hi-del:hover { background: var(--morandi-pink-light); }

/* ═══════════════════════════════════════════════════════════
   Math Life Sub Nav
   ═══════════════════════════════════════════════════════════ */
.life-sub-nav {
  display: flex;
  gap: 4px;
  padding: 6px 12px;
  background: var(--morandi-card);
  border-bottom: 1px solid var(--morandi-border);
}
.life-sub-btn {
  flex: 1;
  padding: 7px 0;
  border: none;
  border-radius: 8px;
  background: var(--morandi-bg);
  font-size: 12px;
  font-weight: 600;
  color: var(--morandi-text-sub);
  cursor: pointer;
  transition: all 0.2s;
}
.life-sub-btn.active {
  background: var(--morandi-pink);
  color: #fff;
  box-shadow: 0 2px 6px rgba(218, 184, 176, 0.3);
}

/* ═══════════════════════════════════════════════════════════
   About Card
   ═══════════════════════════════════════════════════════════ */
.about-card {
  background: var(--morandi-card);
  border-radius: var(--radius);
  padding: 24px 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  margin: 0 12px;
}
.about-card .avatar {
  width: 56px; height: 56px;
  background: var(--morandi-blue);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin: 0 auto 12px; color: #fff;
  box-shadow: 0 3px 10px rgba(160,185,216,0.2), inset 0 -3px 0 rgba(0,0,0,0.08);
}
.about-card h2 { font-size: 16px; font-weight: 700; margin-bottom: 4px; color: var(--morandi-text); }
.about-card .subtitle { font-size: 11px; color: var(--morandi-blue); font-weight: 600; margin-bottom: 12px; }
.about-card .quote {
  font-size: 12px; color: var(--morandi-text-sub); line-height: 1.6;
  padding: 10px; background: var(--morandi-bg); border-radius: var(--radius-sm); margin-bottom: 10px;
}
.about-card .version { font-size: 10px; color: var(--morandi-text-muted); }

/* ═══════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 480px) {
  body::before,
  .app-container {
    border-radius: 34px;
  }
  body::before {
    top: 10px;
    height: calc(100dvh - 20px);
  }
  .app-container {
    margin-top: 10px;
    height: calc(100dvh - 20px);
    box-shadow: 0 20px 60px rgba(160, 185, 216, 0.12);
    border: 1px solid rgba(200, 208, 216, 0.4);
  }
}
@media (max-width: 420px) {
  body::before { display: none; }
  .app-container { width: 100%; max-width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   剧本广场 (Script Square) — v8.1
   ═══════════════════════════════════════════════════════════ */
.script-square {
  padding: 12px 12px 28px;
  animation: fadeIn 0.35s ease;
}

/* 分区标题 */
.ss-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--morandi-text-sub);
  margin: 18px 0 10px;
  padding: 0 2px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.ss-section-title:first-of-type {
  margin-top: 4px;
}

/* ═══ 快捷继续卡片 ═══ */
.ss-continue {
  margin-bottom: 4px;
}
.ss-continue-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--morandi-card);
  border: 1.5px solid var(--morandi-blue-light);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(160,185,216,0.12);
  transition: transform 0.15s, box-shadow 0.2s;
}
.ss-continue-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow);
}
.ss-continue-badge {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--morandi-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(160,185,216,0.25);
}
.ss-continue-info {
  flex: 1;
  min-width: 0;
}
.ss-continue-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--morandi-text);
  margin-bottom: 2px;
}
.ss-continue-sub {
  font-size: 11px;
  color: var(--morandi-text-muted);
}
.ss-continue-arrow {
  font-size: 20px;
  color: var(--morandi-blue);
  flex-shrink: 0;
}

/* ═══ 精选剧本大卡 ═══ */
.ss-hero-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ss-hero-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.ss-hero-card:active {
  transform: scale(0.98);
  box-shadow: 0 6px 22px rgba(0,0,0,0.1);
}

/* 大卡背景层 */
.ss-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.ss-hero-bg::before {
  content: "";
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.ss-hero-bg::after {
  content: "";
  position: absolute;
  bottom: -20px; left: 20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

/* 大卡内容层 */
.ss-hero-content {
  position: relative;
  z-index: 1;
  padding: 22px 18px;
  color: #fff;
}
.ss-hero-icon {
  font-size: 36px;
  margin-bottom: 10px;
  opacity: 0.85;
}
.ss-hero-name {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: 0.2px;
}
.ss-hero-desc {
  font-size: 12px;
  opacity: 0.78;
  line-height: 1.5;
  margin-bottom: 12px;
}
.ss-hero-meta {
  display: flex;
  gap: 14px;
  font-size: 10px;
  opacity: 0.55;
}
.ss-hero-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  font-size: 10px;
  font-weight: 600;
}

/* 各剧本配色 */
.ss-card-wuxia .ss-hero-bg {
  background: linear-gradient(145deg, #7BA89A 0%, #5C8F7E 50%, #8BB5A5 100%);
}
.ss-card-simulator .ss-hero-bg {
  background: linear-gradient(145deg, #C9A39A 0%, #B8958A 50%, #D4B5AC 100%);
}
.ss-card-mathbti .ss-hero-bg {
  background: linear-gradient(145deg, #8BA4C0 0%, #7A93B0 50%, #9CB5CD 100%);
}

/* ═══ 即将上线小卡（横向滚动） ═══ */
.ss-coming-cards {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 6px;
}
.ss-coming-cards::-webkit-scrollbar { display: none; }
.ss-coming-card {
  flex-shrink: 0;
  width: 130px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--morandi-card);
  box-shadow: var(--shadow-sm);
  opacity: 0.7;
  pointer-events: none;
}
.ss-coming-card-bg {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  opacity: 0.35;
}
.ss-coming-card-body {
  padding: 10px 12px 12px;
}
.ss-coming-card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--morandi-text);
  margin-bottom: 3px;
}
.ss-coming-card-desc {
  font-size: 10px;
  color: var(--morandi-text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ss-coming-badge {
  margin-top: 6px;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--morandi-purple-light);
  color: var(--morandi-purple);
  font-size: 9px;
  font-weight: 600;
}
