/* ============================================================
   InvestQuest MVP — 全局样式（暗色主题·移动端竖屏）
   ============================================================ */

:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #12171f;
  --bg-card: #1a1f2b;
  --bg-card-hover: #1f2633;
  --bg-input: #1a1f2b;
  --border: #2a3040;
  --border-light: #353d4f;

  --text-primary: #e6e8ec;
  --text-secondary: #8b95a5;
  --text-muted: #555e6e;

  --accent-gold: #d4a853;
  --accent-green: #4caf7d;
  --accent-red: #e0556a;
  --accent-blue: #5b9bd5;
  --accent-purple: #9b7ec4;

  --tag-asset: rgba(212, 168, 83, 0.15);
  --tag-asset-text: #d4a853;
  --tag-theme: rgba(91, 155, 213, 0.15);
  --tag-theme-text: #5b9bd5;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --nav-height: 56px;
  --bottom-nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-width: 440px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: #000;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  display: flex; justify-content: center;
}

/* 手机外框 — 始终竖屏、居中 */
.app-frame {
  width: 100%;
  max-width: var(--app-width);
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
  overflow-x: hidden;
}

/* --- 顶部导航栏 --- */
.top-nav {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  z-index: 100; width: 100%; max-width: var(--app-width);
  height: var(--nav-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  backdrop-filter: blur(20px);
}

.top-nav .logo {
  display: flex; align-items: center;
  height: 100%;
}

.top-nav .logo img {
  height: 30px; width: auto; display: block;
}

/* --- 顶部导航栏 · 市场按钮 --- */
.top-nav-market-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 10px;
  cursor: pointer; font-family: var(--font-sans);
  font-size: 0.78rem; color: var(--text-primary);
  transition: border-color 0.2s;
}

.top-nav-market-btn:hover { border-color: var(--accent-gold); }

.top-nav-market-btn .market-arrow {
  font-size: 0.65rem; color: var(--text-muted);
}

/* --- 市场选择下拉框（顶部按钮下方竖排） --- */
.market-popover {
  position: absolute; top: calc(var(--nav-height) - 4px); right: 16px; z-index: 300;
  width: 184px;
}

.market-popover-backdrop {
  position: fixed; inset: 0; z-index: -1;
  background: transparent;
}

.market-popover-content {
  position: relative;
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 0;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}

.market-popover-header {
  padding: 8px 12px 6px;
  font-size: 0.7rem; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.4px;
}

.market-popover-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer;
  transition: background 0.15s;
}

.market-popover-item:hover { background: var(--bg-card); }

.market-popover-item .mkt-flag { font-size: 1.1rem; }

.market-popover-item .mkt-name { font-size: 0.82rem; font-weight: 600; }

.market-popover-item .mkt-cn { font-size: 0.66rem; color: var(--text-muted); }

.market-popover-item .mkt-check {
  margin-left: auto; color: var(--accent-gold); font-weight: 700; font-size: 0.9rem;
}

/* --- 底部导航栏 · 市场 tab --- */
.bottom-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-muted);
  font-size: 0.7rem; font-family: var(--font-sans);
  gap: 3px; cursor: pointer; transition: color 0.2s;
  padding: 8px 0;
  position: relative;
}

.bottom-nav #bottom-market-btn .nav-icon {
  font-size: 1.1rem; padding: 2px 10px;
  border-radius: 10px;
  background: transparent;
  transition: background 0.2s;
}

.bottom-nav #bottom-market-btn.active .nav-icon {
  background: rgba(212, 168, 83, 0.15);
}

.bottom-nav #bottom-market-btn {
  font-size: 0.6rem;
}

.bottom-nav #bottom-market-label {
  font-size: 0.6rem;
  max-width: 48px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --- 主内容区 --- */
.main-content {
  padding-top: var(--nav-height);
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
  min-height: 100vh;
}

/* --- 底部导航栏 --- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  z-index: 100; width: 100%; max-width: var(--app-width);
  height: var(--bottom-nav-height);
  padding-bottom: var(--safe-bottom);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  backdrop-filter: blur(20px);
}

.bottom-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-muted);
  font-size: 0.7rem; font-family: var(--font-sans);
  gap: 3px; cursor: pointer; transition: color 0.2s;
  padding: 8px 0;
}

.bottom-nav button .nav-icon { font-size: 1.3rem; }

.bottom-nav button.active { color: var(--accent-gold); }

/* 底部市场 tab 特殊样式 */
.bottom-nav #bottom-market-btn .nav-icon {
  font-size: 1.1rem; padding: 2px 10px;
  border-radius: 10px;
  background: transparent;
  transition: background 0.2s;
}

.bottom-nav #bottom-market-btn.active .nav-icon {
  background: rgba(212, 168, 83, 0.15);
}

.bottom-nav #bottom-market-btn {
  font-size: 0.6rem;
}

.bottom-nav #bottom-market-label {
  font-size: 0.6rem;
  max-width: 48px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --- 通用卡片 --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
}

.card:hover { background: var(--bg-card-hover); border-color: var(--border-light); }

.card .card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}

.card .card-title { font-size: 0.95rem; font-weight: 600; line-height: 1.4; flex: 1; }

.card .card-summary {
  font-size: 0.82rem; color: var(--text-secondary);
  line-height: 1.5; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .card-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; font-size: 0.72rem; color: var(--text-muted);
  flex-wrap: wrap;
}

/* --- 标签 --- */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 4px;
  font-size: 0.68rem; font-weight: 500;
  white-space: nowrap;
}

.tag-asset { background: var(--tag-asset); color: var(--tag-asset-text); }
.tag-theme { background: var(--tag-theme); color: var(--tag-theme-text); }
.tag-moment { background: rgba(232, 137, 74, 0.15); color: #e8894a; }
.tag-macro { background: rgba(90, 156, 216, 0.16); color: #5a9cd8; }
.tag-signal { background: rgba(155, 126, 196, 0.15); color: var(--accent-purple); }
.tag-diff { background: rgba(140, 140, 140, 0.12); color: var(--text-secondary); }
.tag-hot { background: rgba(224, 85, 106, 0.15); color: var(--accent-red); }

/* --- 筛选条 --- */
.filter-bar {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 8px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.filter-bar .filter-chip {
  flex-shrink: 0; padding: 5px 11px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 500; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); transition: all 0.2s;
  white-space: nowrap;
}

.filter-bar .filter-chip:hover { border-color: var(--border-light); color: var(--text-primary); }

.filter-bar .filter-chip.active {
  background: var(--accent-gold); border-color: var(--accent-gold);
  color: var(--bg-primary); font-weight: 600;
}

.filter-bar .filter-label {
  flex-shrink: 0; display: flex; align-items: center;
  font-size: 0.7rem; color: var(--text-muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-right: 4px;
}

/* --- 页面标题 --- */
.page-header {
  padding: 20px 16px 12px;
}

.page-header h1 { font-size: 1.3rem; font-weight: 700; }

.page-header p { font-size: 0.82rem; color: var(--text-secondary); margin-top: 4px; }

/* --- 环球主要市场表现 · 资产类别 Tab 切换 --- */
.asset-tabs {
  display: flex; gap: 4px; margin-bottom: 10px;
  background: var(--bg-secondary); padding: 3px;
  border-radius: var(--radius-sm);
}

.asset-tab {
  flex: 1; text-align: center;
  padding: 5px 6px;
  font-size: 0.68rem; font-weight: 500;
  color: var(--text-muted);
  border-radius: 5px;
  cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
}

.asset-tab:hover { color: var(--text-secondary); }

.asset-tab.active {
  background: var(--accent-gold);
  color: var(--bg-primary);
  font-weight: 600;
}

/* --- 环球主要市场表现 · 标的卡片网格 --- */
.global-indices-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
}

.global-index-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 8px;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0; overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.global-index-card:hover {
  border-color: var(--accent-gold);
  background: var(--bg-card-hover);
}

.global-index-card.highlight {
  background: rgba(212, 168, 83, 0.08);
  border-color: rgba(212, 168, 83, 0.35);
}

.global-index-card .gic-top {
  display: flex; align-items: center; gap: 3px;
  white-space: nowrap; overflow: hidden;
}

.global-index-card .gic-flag { font-size: 0.68rem; flex-shrink: 0; }

.global-index-card .gic-name {
  font-size: 0.58rem; color: var(--text-secondary);
  font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.global-index-card .gic-bottom {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 3px;
}

.global-index-card .gic-value {
  font-family: var(--font-mono); font-size: 0.68rem;
  font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}

.global-index-card .gic-change {
  font-family: var(--font-mono); font-size: 0.6rem;
  font-weight: 600; flex-shrink: 0;
}

/* --- 市场页 · 当前市场速览卡 --- */
.speed-view-card {
  background: linear-gradient(135deg, #1a2030, #1a1f2b);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* --- 市场页 · 2x2 快速入口网格 --- */
.quick-entries-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  border-left: 1px solid rgba(255,255,255,0.08);
}

.quick-entry-2x2 {
  display: flex; flex-direction: column;
  background: transparent; cursor: pointer;
  transition: background 0.2s;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.quick-entry-2x2:hover { background: rgba(255,255,255,0.03); }

.quick-entry-2x2-top {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
}

.quick-entry-2x2-icon { font-size: 1.1rem; flex-shrink: 0; }

.quick-entry-2x2-info {
  display: flex; align-items: baseline; gap: 5px;
  min-width: 0; flex: 1; flex-wrap: wrap;
}

.quick-entry-2x2-label {
  font-size: 0.7rem; color: var(--text-secondary); font-weight: 500;
  flex-shrink: 0;
}

.quick-entry-2x2-val {
  font-family: var(--font-mono); font-size: 0.78rem;
  font-weight: 700; color: var(--accent-gold);
  flex-shrink: 0;
}

.quick-entry-2x2-val span {
  font-size: 0.58rem; color: var(--text-muted); font-weight: 400;
  margin-left: 2px;
}

/* 轮播小横条 — 每格独立背景，边界清晰 */
.qe-ticker {
  height: 26px;
  background: rgba(0,0,0,0.25);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center;
  padding: 0 10px;
  overflow: hidden;
}

.qe-ticker-text {
  font-size: 0.66rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  width: 100%;
  transition: opacity 0.3s ease;
}

.qe-ticker-text.fading { opacity: 0; }

/* 页面标题行（标题 + 右侧按钮） */
.page-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
}

.header-knowledge-btn {
  flex-shrink: 0; width: 36px; height: 36px;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-card); cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s;
}

.header-knowledge-btn:hover { border-color: var(--accent-gold); }

/* --- 返回按钮（幽灵样式，避免白底突兀） --- */
.back-btn {
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.back-btn:hover { color: var(--text-primary); border-color: var(--border-light); background: var(--bg-card-hover); }

/* --- 仪表盘 --- */
.dashboard-grid {
  display: grid; gap: 12px; padding: 0 16px;
  grid-template-columns: 1fr;
}

.dashboard-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  overflow: hidden;
}

.dashboard-card h3 {
  font-size: 0.8rem; color: var(--text-muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 12px;
}

.market-index {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}

.market-index:last-child { border-bottom: none; }

.market-index .idx-name { font-weight: 500; font-size: 0.85rem; }

.market-index .idx-value { font-family: var(--font-mono); font-size: 0.85rem; }

.market-index .idx-change { font-family: var(--font-mono); font-size: 0.78rem; }

.up { color: var(--accent-green); }
.down { color: var(--accent-red); }

.progress-bar-wrap {
  height: 6px; background: var(--border);
  border-radius: 3px; margin-top: 8px; overflow: hidden;
}

.progress-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent-gold), var(--accent-green));
  border-radius: 3px; transition: width 0.5s ease;
}

/* --- 知识入口按钮 --- */
.knowledge-entry {
  position: fixed; bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 20px);
  right: calc(50% - var(--app-width) / 2 + 16px);
  z-index: 90;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent-gold); border: none;
  color: var(--bg-primary); font-size: 1.3rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(212, 168, 83, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

@media (max-width: 440px) {
  .knowledge-entry { right: 16px; }
}

.knowledge-entry:hover { transform: scale(1.05); box-shadow: 0 6px 24px rgba(212, 168, 83, 0.4); }

.knowledge-entry .tooltip {
  position: absolute; right: 56px; white-space: nowrap;
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: 0.72rem; color: var(--text-secondary);
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
}

.knowledge-entry:hover .tooltip { opacity: 1; }

/* --- 详情页 --- */
.detail-view {
  padding: 16px;
}

.detail-view .back-btn {
  background: none; border: none; color: var(--text-secondary);
  font-size: 0.85rem; cursor: pointer; padding: 4px 0;
  margin-bottom: 16px; display: flex; align-items: center; gap: 4px;
}

.detail-view .back-btn:hover { color: var(--text-primary); }

.detail-view h1 { font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; line-height: 1.4; }

.detail-view .detail-body {
  font-size: 0.9rem; color: var(--text-secondary);
  line-height: 1.8; white-space: pre-line;
}

.detail-view .detail-actions {
  display: flex; gap: 8px; margin-top: 20px;
  padding-top: 16px; border-top: 1px solid var(--border);
}

.detail-view .detail-actions button {
  flex: 1; padding: 10px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-family: var(--font-sans);
  cursor: pointer; transition: all 0.2s;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary);
}

.detail-view .detail-actions button:hover {
  border-color: var(--accent-gold); color: var(--accent-gold);
}

.detail-view .detail-actions button.primary {
  background: var(--accent-gold); border-color: var(--accent-gold);
  color: var(--bg-primary); font-weight: 600;
}

/* --- 战绩（Portfolio）--- */
/* === 配置页 · 研究组件 === */
.study-tabs {
  display: flex; gap: 4px; margin-bottom: 10px;
  background: var(--bg-secondary); padding: 3px;
  border-radius: var(--radius-sm);
}

.study-tab {
  flex: 1; text-align: center;
  padding: 5px 6px;
  font-size: 0.68rem; font-weight: 500;
  color: var(--text-muted);
  border-radius: 5px;
  cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
}

.study-tab:hover { color: var(--text-secondary); }

.study-tab.active {
  background: var(--accent-gold);
  color: var(--bg-primary);
  font-weight: 600;
}

/* 研究卡片头部：标题 + 查看全部 */
.study-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.study-card-head h3 { margin-bottom: 0; }
.view-all-btn {
  flex-shrink: 0;
  background: none; border: none;
  color: var(--accent-gold);
  font-size: 0.7rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  padding: 2px 0;
}
.view-all-btn:hover { color: #ffd76e; }

.study-rows {
  display: flex; flex-direction: column; gap: 8px;
}

.study-row {
  display: flex; align-items: stretch; gap: 8px;
}

.study-row-label {
  flex-shrink: 0; width: 60px;
  display: flex; align-items: center;
  font-size: 0.7rem; color: var(--text-secondary);
  font-weight: 600;
  padding: 0 2px;
}

.study-row-cards {
  flex: 1; display: flex; gap: 5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.study-row-cards::-webkit-scrollbar { display: none; }

.study-card {
  flex-shrink: 0; width: 120px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  cursor: pointer; transition: all 0.2s;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 46px;
}

.study-card:hover {
  border-color: rgba(212, 168, 83, 0.4);
  background: rgba(212, 168, 83, 0.05);
}

.study-card-title {
  font-size: 0.65rem; color: var(--text-primary);
  font-weight: 500; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.study-card-meta {
  font-size: 0.55rem; color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* === 配置页 · 精简组合卡 === */
.alloc-compact-card {
  background: linear-gradient(135deg, #1a2030, #1a1f2b);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  overflow: hidden;
}

.alloc-compact-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px;
}

.alloc-compact-info .act-label {
  font-size: 0.65rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.alloc-compact-info .act-value {
  font-family: var(--font-mono); font-size: 1.35rem;
  font-weight: 700; color: var(--text-primary);
  margin-top: 2px;
}

.alloc-compact-info .act-detail {
  display: flex; gap: 10px; margin-top: 4px;
  font-size: 0.72rem;
}

.alloc-compact-info .act-detail span { font-family: var(--font-mono); font-weight: 600; }

.alloc-compact-checkin {
  flex-shrink: 0;
}

.checkin-btn-compact {
  padding: 6px 12px; border-radius: 14px;
  font-size: 0.68rem; font-family: var(--font-sans);
  cursor: pointer; transition: all 0.2s;
  background: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  color: var(--bg-primary); font-weight: 600;
  white-space: nowrap;
}

.checkin-btn-compact.done {
  background: transparent; border-color: var(--border);
  color: var(--text-muted); cursor: default;
}

.alloc-compact-mid {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.alloc-compact-chart {
  width: 120px; height: 42px; flex-shrink: 0;
}

.alloc-compact-chart canvas { width: 100%; height: 100%; display: block; }

.alloc-compact-alloc {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px;
}

.alloc-compact-alloc .aci {
  display: flex; justify-content: space-between; align-items: baseline;
}

.alloc-compact-alloc .aci-name { font-size: 0.6rem; color: var(--text-muted); }

.alloc-compact-alloc .aci-pct {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  color: var(--text-primary);
}

/* === 配置页 · 精简历史 === */
.history-compact h3 {
  font-size: 0.72rem; color: var(--text-muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
}

.history-compact-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
}

.history-compact-row:last-child { border-bottom: none; }

.history-compact-row .hcr-date {
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--text-muted); min-width: 44px; flex-shrink: 0;
}

.history-compact-row .hcr-alloc {
  flex: 1; display: flex; gap: 3px; flex-wrap: wrap;
}

.history-compact-row .hcr-alloc span {
  font-size: 0.52rem; padding: 1px 4px;
  border-radius: 3px; background: var(--tag-asset);
  color: var(--tag-asset-text);
}

.history-compact-row .hcr-sig {
  width: 18px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem; font-weight: 600; border-radius: 50%;
  background: var(--border); color: var(--text-muted);
}

.history-compact-row .hcr-sig.on {
  background: var(--accent-gold); color: var(--bg-primary);
}

.history-compact-row .hcr-total {
  font-family: var(--font-mono); font-size: 0.72rem;
  min-width: 58px; text-align: right; flex-shrink: 0;
}

.history-compact-row .hcr-return {
  font-family: var(--font-mono); font-size: 0.68rem;
  min-width: 50px; text-align: right; flex-shrink: 0;
  font-weight: 600;
}

.portfolio-header {
  padding: 16px;
}

.portfolio-summary {
  background: linear-gradient(135deg, #1a2030, #1a1f2b);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.portfolio-summary .total-label {
  font-size: 0.72rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.portfolio-summary .total-value {
  font-family: var(--font-mono);
  font-size: 2rem; font-weight: 700;
  color: var(--text-primary);
}

.portfolio-summary .total-detail {
  display: flex; gap: 16px; margin-top: 8px;
  font-size: 0.8rem;
}

.portfolio-summary .total-detail .daily {
  font-family: var(--font-mono); font-weight: 600;
}

.portfolio-summary .total-detail .cumulative {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* sparkline 迷你走势图 */
.sparkline-wrap {
  margin: 16px 0;
  position: relative;
  height: 80px;
}

.sparkline-wrap canvas {
  width: 100%; height: 100%;
}

.sparkline-label {
  display: flex; justify-content: space-between;
  font-size: 0.65rem; color: var(--text-muted);
  margin-top: 4px;
}

/* 当前配置摘要 */
.current-alloc {
  display: flex; gap: 8px; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid var(--border);
}

.current-alloc .alloc-item {
  flex: 1; text-align: center;
}

.current-alloc .alloc-item .alloc-name {
  font-size: 0.65rem; color: var(--text-muted);
}

.current-alloc .alloc-item .alloc-pct {
  font-family: var(--font-mono); font-size: 0.85rem;
  font-weight: 600; margin-top: 2px;
}

/* 历史记录列表 */
.portfolio-history {
  padding: 0 16px;
}

.portfolio-history h3 {
  font-size: 0.75rem; color: var(--text-muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 10px;
}

.history-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}

.history-row:hover { background: rgba(255,255,255,0.02); }

.history-row:last-child { border-bottom: none; }

.history-row .hr-date {
  font-family: var(--font-mono);
  font-size: 0.7rem; color: var(--text-muted);
  min-width: 48px;
}

.history-row .hr-alloc {
  flex: 1; display: flex; gap: 4px;
  flex-wrap: wrap;
}

.history-row .hr-alloc .mini-tag {
  font-size: 0.6rem; padding: 1px 5px;
  border-radius: 3px; background: var(--tag-asset);
  color: var(--tag-asset-text);
}

.history-row .hr-total {
  font-family: var(--font-mono); font-size: 0.85rem;
  min-width: 70px; text-align: right;
}

.history-row .hr-return {
  font-family: var(--font-mono); font-size: 0.8rem;
  min-width: 52px; text-align: right;
  font-weight: 600;
}

/* 调整配置弹窗 */
.adjust-btn {
  display: block; margin: 16px auto; text-align: center;
  padding: 10px 24px; border-radius: 20px;
  font-size: 0.82rem; font-family: var(--font-sans);
  cursor: pointer; transition: all 0.2s;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary);
}

.adjust-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }

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

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px; width: 100%; max-width: 400px;
  max-height: 80vh; overflow-y: auto;
}

.modal-content h3 {
  font-size: 1rem; margin-bottom: 16px;
  display: flex; justify-content: space-between;
}

.modal-content h3 .close-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer;
}

.alloc-slider-group {
  margin-bottom: 14px;
}

.alloc-slider-group label {
  display: flex; justify-content: space-between;
  font-size: 0.82rem; font-weight: 500; margin-bottom: 4px;
}

.alloc-slider-group label .val {
  font-family: var(--font-mono); color: var(--accent-gold);
}

.alloc-slider-group input[type="range"] {
  width: 100%; height: 6px;
  -webkit-appearance: none; appearance: none;
  background: var(--border); border-radius: 3px;
  outline: none;
}

.alloc-slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: var(--accent-gold);
  cursor: pointer; border: 2px solid var(--bg-primary);
}

.modal-content .save-btn {
  display: block; width: 100%; margin-top: 12px;
  padding: 10px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-family: var(--font-sans);
  font-weight: 600; cursor: pointer;
  background: var(--accent-gold); border: none;
  color: var(--bg-primary);
}

/* --- DNA 画像 --- */
.dna-grid {
  display: grid; gap: 12px; padding: 0 16px;
  grid-template-columns: 1fr 1fr;
}

.dna-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
}

.dna-card.full { grid-column: 1 / -1; }

.dna-card h3 {
  font-size: 0.75rem; color: var(--text-muted);
  font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 10px;
}

.dna-card .big-num {
  font-family: var(--font-mono); font-size: 1.8rem;
  font-weight: 700; color: var(--accent-gold);
}

.dna-card .sub-num {
  font-size: 0.75rem; color: var(--text-secondary);
  margin-top: 2px;
}

.risk-meter {
  display: flex; gap: 4px; margin-top: 8px;
}

.risk-meter .bar {
  flex: 1; height: 4px; border-radius: 2px; background: var(--border);
}

.risk-meter .bar.filled { background: var(--accent-gold); }

.cognitive-tree .node {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}

.cognitive-tree .node:last-child { border-bottom: none; }

.cognitive-tree .node .node-name {
  flex: 1; font-size: 0.82rem;
}

.cognitive-tree .node .node-level {
  display: flex; gap: 4px;
}

.cognitive-tree .node .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
}

.cognitive-tree .node .dot.filled { background: var(--accent-green); }

/* --- 画像页 · 四个横向成就 --- */
.achievements-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.achievement {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px; border-radius: 10px;
  background: var(--bg-input); border: 1px solid var(--border);
}
.achievement-icon { font-size: 1.25rem; line-height: 1; }
.achievement-val { font-size: 1.15rem; font-weight: 700; color: var(--accent-gold); font-family: var(--font-mono); line-height: 1.1; }
.achievement-val .achievement-unit { font-size: 0.6rem; font-weight: 500; color: var(--text-muted); margin-left: 2px; }
.achievement-label { font-size: 0.62rem; color: var(--text-muted); }

/* --- 角色形象（纸娃娃：居中人物 + 环绕装备槽） --- */
.avatar-card {
  margin: 0 16px 12px; padding: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.doll-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.doll-title-row { display: flex; align-items: center; justify-content: space-between; }
.doll-head h3 { font-size: 0.85rem; font-weight: 700; }
.avatar-sub { font-size: 0.72rem; color: var(--text-muted); }
.avatar-theme { font-size: 0.72rem; font-weight: 600; color: var(--accent, var(--text-secondary)); }
.gender-toggle { display: flex; gap: 6px; }
.gender-btn {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-input); border: 1px solid var(--border);
  font-size: 0.95rem; line-height: 1; cursor: pointer;
  font-family: var(--font-sans); transition: all 0.2s;
}
.gender-btn.active {
  background: var(--tag-asset); border-color: var(--accent-gold);
  box-shadow: 0 0 8px 0 var(--accent-gold);
}
.doll { position: relative; height: 284px; margin-top: 12px; }
.avatar-aura {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 205px; height: 205px; border-radius: 50%;
  background: radial-gradient(circle, var(--aura) 0%, transparent 64%);
  opacity: .5; pointer-events: none;
}
.doll-svg {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%); width: 156px;
}
.avatar-svg { width: 156px; height: auto; display: block; }
.equip-slot {
  position: absolute; width: 56px; height: 64px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--bg-input); cursor: pointer; transition: all 0.15s;
  font-family: var(--font-sans); padding: 3px 2px;
  border: 1.5px solid var(--rc, var(--border-light));
  box-shadow: 0 0 12px 0 var(--rc, transparent);
}
.equip-slot .slot-ico { width: 36px; height: 30px; display: flex; align-items: center; justify-content: center; }
.equip-slot .slot-ico svg { width: 36px; height: 30px; overflow: visible; }
.equip-slot .slot-item {
  font-size: 7.5px; color: var(--text-primary); line-height: 1.1;
  text-align: center; white-space: nowrap; overflow: hidden; max-width: 52px;
}
.equip-slot .slot-rarity { font-size: 7px; line-height: 1; font-weight: 600; }
/* 非顶级装备：吸引点击的升级按钮特效 */
.equip-slot.can-upgrade {
  animation: slotPulse 2s ease-in-out infinite;
}
.equip-slot.can-upgrade:hover {
  animation: none;
  transform: scale(1.06);
  box-shadow: 0 0 16px 0 var(--rc, var(--accent-gold));
  border-color: var(--accent-gold);
}
.slot-upgrade {
  position: absolute; top: -6px; right: -5px;
  padding: 2px 5px; border-radius: 8px;
  font-size: 6.5px; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, #f7dc97, var(--accent-gold));
  color: #1a1405;
  box-shadow: 0 0 8px rgba(212, 168, 83, 0.65);
  animation: badgeBob 1.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes slotPulse {
  0%, 100% { box-shadow: 0 0 8px 0 var(--rc, var(--accent-gold)); border-color: var(--rc, var(--border-light)); }
  50%      { box-shadow: 0 0 18px 2px var(--rc, var(--accent-gold)); border-color: var(--accent-gold); }
}
@keyframes badgeBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-2px) scale(1.12); }
}
/* 左 3 + 右 3（避开人物本体） */
.equip-slot.s-head { top: 20px; left: 0; }
.equip-slot.s-top { top: 96px; left: 0; }
.equip-slot.s-bottom { top: 172px; left: 0; }
.equip-slot.s-back { top: 20px; right: 0; }
.equip-slot.s-hand { top: 96px; right: 0; }
.equip-slot.s-shoes { top: 172px; right: 0; }
/* 角色正下方的等级展示 */
.avatar-level {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  padding: 3px 12px; border-radius: 10px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px;
  color: var(--accent-gold); background: var(--bg-input);
  border: 1px solid var(--accent-gold);
  box-shadow: 0 0 10px 0 rgba(212, 168, 83, 0.35);
}

/* --- 装备升级/保持条件浮层 --- */
.gear-popover { position: fixed; inset: 0; z-index: 400; }
.gear-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); }
.gear-sheet {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: var(--app-width);
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + var(--safe-bottom));
  box-shadow: 0 -12px 40px rgba(0,0,0,0.5);
}
.gear-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.gear-name { flex: 1; font-size: 0.95rem; font-weight: 600; }
.gear-rarity { font-size: 0.72rem; font-weight: 600; }
.gear-close {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 7px;
  width: 28px; height: 28px; color: var(--text-secondary); cursor: pointer;
  font-size: 0.9rem; font-family: var(--font-sans);
}
.gear-cond {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px;
}
.gear-cond-title { font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; }
.gear-metric { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 8px; }
.gear-bar { height: 8px; border-radius: 6px; background: var(--bg-input); overflow: hidden; }
.gear-bar-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent-gold), #ffe9a8);
  transition: width 0.3s;
}
.gear-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 8px; }

/* --- 日历 --- */
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}

.calendar-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; border-radius: 4px;
  background: var(--bg-card); color: var(--text-muted);
  font-family: var(--font-mono);
}

.calendar-day.today { border: 1px solid var(--accent-gold); color: var(--accent-gold); }

.calendar-day.stamped { background: rgba(76, 175, 125, 0.15); color: var(--accent-green); }

.calendar-header {
  font-size: 0.65rem; color: var(--text-muted);
  text-align: center; padding: 4px 0;
}

/* --- 市场总览 · 紧凑统计表（有表头、单元格仅数值） --- */
.mkt-stats-header {
  display: flex; align-items: center; padding: 0 0 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

.mkt-stats-hcell {
  font-size: 0.55rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.3px;
  text-align: center;
}

.mkt-stats-hcell:first-child { flex: 1.1; text-align: left; padding-left: 2px; }

.mkt-stats-hcell:not(:first-child) { flex: 1; }

.mkt-stats-row {
  display: flex; align-items: center; padding: 5px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
  border-radius: var(--radius-sm);
}

.mkt-stats-row:last-child { border-bottom: none; }

.mkt-stats-row:hover { background: rgba(255,255,255,0.03); }

.mkt-stats-row.active { background: rgba(212, 168, 83, 0.08); }

.mkt-stats-row.active .mkt-name { color: var(--accent-gold); }

.mkt-stats-left {
  flex: 1.1; display: flex; align-items: center; gap: 6px;
  min-width: 0;
}

.mkt-stats-cell {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

.mkt-stat-val {
  font-family: var(--font-mono); font-size: 0.72rem;
  font-weight: 600;
}

.mkt-stat-val.up { color: var(--accent-green); }

.mkt-stat-val.down { color: var(--accent-red); }

/* 配比列 — 带进度条，高度更紧凑 */
.mkt-stat-alloc-bar {
  width: 100%; max-width: 48px;
  height: 3px; background: var(--border);
  border-radius: 2px; overflow: hidden;
  margin-top: 1px;
}

.mkt-stat-alloc-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-green));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.mkt-flag { font-size: 1rem; }

.mkt-name { font-size: 0.76rem; font-weight: 600; }

.mkt-cn { font-size: 0.65rem; color: var(--text-muted); font-weight: 400; }

.mkt-sub { font-size: 0.7rem; color: var(--text-secondary); margin-top: 2px; }

/* --- 历史记录「签」标记 --- */
.hr-sig {
  flex-shrink: 0; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.66rem; font-weight: 600;
  border-radius: 6px;
}

.hr-sig.on { background: rgba(76, 175, 125, 0.25); color: var(--accent-green); }

.hr-sig.off { background: var(--bg-card); color: var(--text-muted); border: 1px dashed var(--border); }

/* === 每日问答 · 头部（标题 + 日期/星期/连续天数） === */
.quiz-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}

.quiz-head-title {
  font-size: 0.92rem; font-weight: 700; color: var(--text-primary);
  white-space: nowrap; flex-shrink: 0;
}

.quiz-head-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  min-width: 0;
}

.quiz-date-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 4px 10px;
  cursor: pointer; font-family: var(--font-sans);
  transition: border-color 0.2s;
}

.quiz-date-trigger:hover { border-color: var(--accent-gold); }

.qdt-date {
  font-size: 0.72rem; color: var(--text-primary);
  font-weight: 600; white-space: nowrap;
}

.qdt-weekday {
  font-size: 0.7rem; color: var(--accent-gold);
  font-weight: 600; white-space: nowrap;
  padding-left: 6px; border-left: 1px solid var(--border-light);
}

.qdt-caret {
  font-size: 0.55rem; color: var(--text-muted);
  transition: transform 0.2s;
}

.quiz-head-sub {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.66rem; color: var(--text-muted);
}

.qdt-streak { color: var(--accent-gold); font-weight: 600; }

.qdt-count { color: var(--text-muted); }

/* === 日期选择面板 === */
.date-picker-panel {
  margin-bottom: 14px; padding-top: 12px;
  border-top: 1px solid var(--border);
}

.dp-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.7rem; font-weight: 600; color: var(--text-secondary);
}

.dp-hint { font-size: 0.6rem; font-weight: 400; color: var(--text-muted); }

.dp-list {
  display: flex; gap: 6px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding-bottom: 2px;
}

.dp-list::-webkit-scrollbar { display: none; }

.dp-item {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 7px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-family: var(--font-sans);
  transition: all 0.15s;
}

.dp-item:hover { border-color: var(--border-light); }

.dp-item-day { font-size: 0.68rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; }

.dp-item-week { font-size: 0.55rem; color: var(--text-muted); white-space: nowrap; }

.dp-item.active {
  border-color: var(--accent-gold);
  background: rgba(212, 168, 83, 0.10);
}

.dp-item.active .dp-item-day { color: var(--accent-gold); }

.dp-item.active .dp-item-week { color: var(--accent-gold); }

/* === 每日问答 === */
.quiz-item {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.quiz-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.quiz-scenario {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.62rem; color: var(--text-muted);
  margin-bottom: 6px; line-height: 1.35;
}

.quiz-tag {
  flex-shrink: 0; font-size: 0.55rem; font-weight: 600;
  padding: 1px 6px; border-radius: 4px;
  background: rgba(212, 168, 83, 0.14);
  color: var(--accent-gold);
}

.quiz-question {
  font-size: 0.78rem; font-weight: 600; color: var(--text-primary);
  margin-bottom: 8px; line-height: 1.4;
}

.quiz-options {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.quiz-option {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 8px; border-radius: 6px;
  font-size: 0.68rem; font-weight: 500;
  font-family: var(--font-sans);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.quiz-option:hover:not(:disabled) {
  border-color: rgba(212, 168, 83, 0.4);
  background: rgba(212, 168, 83, 0.05);
}

.quiz-option:disabled { cursor: default; }

.quiz-option .qo-letter {
  flex-shrink: 0; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; font-size: 0.6rem; font-weight: 700;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}

.quiz-option.selected {
  border-color: var(--accent-gold);
  background: rgba(212, 168, 83, 0.10);
  color: var(--accent-gold);
}

.quiz-option.selected .qo-letter {
  background: rgba(212, 168, 83, 0.22);
  color: var(--accent-gold);
}

.quiz-insight {
  margin-top: 8px; font-size: 0.64rem;
  padding: 6px 9px; border-radius: 6px;
  line-height: 1.45; color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--accent-gold);
}

.quiz-insight .qi-label {
  display: inline-block; font-weight: 600; color: var(--accent-gold);
  margin-right: 5px;
}

.today-badge {
  display: inline-block; font-size: 0.6rem;
  background: var(--accent-gold); color: var(--bg-primary);
  border-radius: 4px; padding: 0 4px; margin-left: 2px;
}

/* --- 画像页 · 推荐金融产品（横向滑动净值卡） --- */
.product-scroll {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 4px 2px 10px; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.product-card {
  position: relative; flex: 0 0 auto; width: 250px; height: 130px;
  scroll-snap-align: start; overflow: hidden;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-input);
}
.product-chart { position: absolute; inset: 0; }
.product-chart .nav-chart { width: 100%; height: 100%; display: block; }
.nav-chart-empty { font-size: 0.7rem; color: var(--text-muted); display: flex; align-items: center; justify-content: center; height: 100%; }
.product-overlay {
  position: absolute; left: 0; top: 0; padding: 10px 12px;
  pointer-events: none; max-width: 70%;
}
.product-overlay .product-name { font-size: 0.84rem; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.product-overlay .product-desc { font-size: 0.64rem; color: rgba(255,255,255,0.88); margin-top: 3px; line-height: 1.35; text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.product-badge {
  position: absolute; right: 8px; top: 8px;
  font-size: 0.58rem; font-weight: 600; padding: 2px 8px; border-radius: 8px;
}
.badge-high { background: rgba(224, 85, 106, 0.92); color: #fff; }
.badge-mid { background: rgba(212, 168, 83, 0.92); color: #1a1405; }
.badge-low { background: rgba(76, 175, 125, 0.92); color: #fff; }

/* --- 空状态 --- */
.empty-state {
  text-align: center; padding: 40px 16px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 2rem; margin-bottom: 8px; }

.empty-state p { font-size: 0.85rem; }

/* --- 隐藏/显示 --- */
.hidden { display: none !important; }

/* --- 动画 --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse { animation: pulse 2s ease infinite; }

/* ============================================================
   开放世界 world view（2D 手绘地图 / 城市内部）
   ============================================================ */

.world-view {
  display: flex; flex-direction: column;
  min-height: calc(100vh - var(--nav-height) - var(--bottom-nav-height) - var(--safe-bottom) - 16px);
}

.world-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px 10px;
}
.world-back {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: 16px;
  padding: 6px 12px; font-size: 0.72rem; cursor: pointer;
  font-family: var(--font-sans); transition: border-color 0.2s;
}
.world-back:hover { border-color: var(--accent-gold); }
.world-title { flex: 1; text-align: center; font-size: 0.88rem; font-weight: 700; white-space: nowrap; }
.world-market { font-size: 0.64rem; color: var(--text-muted); white-space: nowrap; }

/* 世界地图画布（AI 生图背景 + 暗纱罩层） */
.world-map {
  position: relative;
  margin: 0 12px;
  height: clamp(460px, 62vh, 580px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(212, 168, 83, 0.22);
  overflow: hidden;
  background-color: #0a1322;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(212, 168, 83, 0.08);
}
.world-map-vein {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(212, 168, 83, 0.10), transparent 55%),
    linear-gradient(180deg, rgba(6, 10, 18, 0.5), rgba(6, 10, 18, 0.18) 42%, rgba(6, 10, 18, 0.72));
}
/* 漂浮尘埃 / 星点（元素密集感） */
.world-particles { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.world-particles::before,
.world-particles::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(232, 199, 138, 0.55) 1px, transparent 1.6px);
  background-size: 46px 46px;
  animation: starDrift 80s linear infinite;
  opacity: 0.32;
}
.world-particles::after {
  background-size: 92px 92px;
  animation-duration: 130s;
  opacity: 0.22;
}
@keyframes starDrift { from { background-position: 0 0; } to { background-position: 460px 460px; } }

/* 资金引力流（世界之心 → 城市/营地） */
.world-flow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.world-flow line {
  stroke: rgba(212, 168, 83, 0.28);
  stroke-width: 0.22;
  stroke-dasharray: 1.4 1.2;
  animation: flowDash 2.6s linear infinite;
}
@keyframes flowDash { to { stroke-dashoffset: -10; } }

/* 全球层奇观 */
.world-wonder {
  position: absolute; transform: translate(-50%, -50%);
  z-index: 3; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: transform 0.15s;
}
.world-wonder:hover { transform: translate(-50%, -50%) scale(1.08); }
.wonder-medallion {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; line-height: 1;
  background: radial-gradient(circle at 50% 34%, rgba(212, 168, 83, 0.36), rgba(18, 14, 7, 0.92) 74%);
  border: 1px solid rgba(212, 168, 83, 0.55);
  box-shadow: 0 0 16px rgba(212, 168, 83, 0.35), inset 0 0 12px rgba(0, 0, 0, 0.55);
  text-shadow: 0 0 6px rgba(212, 168, 83, 0.6);
}
.wonder-name { font-size: 0.68rem; font-weight: 700; color: var(--accent-gold); white-space: nowrap; }
.wonder-tag { font-size: 0.53rem; color: var(--text-muted); white-space: nowrap; }

/* 城市节点 */
.city-node {
  position: absolute; transform: translate(-50%, -50%);
  z-index: 4; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 6px; border-radius: 10px;
  transition: background 0.15s, transform 0.15s;
}
.city-node:hover { background: rgba(255, 255, 255, 0.05); }
.city-node .city-weather { font-size: 1rem; line-height: 1; }
.city-node .city-emblem { font-size: 1.3rem; line-height: 1.1; }
.city-node .city-name { font-size: 0.62rem; font-weight: 600; color: var(--text-primary); }
.city-node:not(.visited) .city-emblem { filter: grayscale(0.75) brightness(0.85); }
.city-beacon {
  position: absolute; top: -3px; right: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
  animation: pulse 1.4s ease infinite;
}

/* 我的营地（生命之树） */
.world-camp {
  position: absolute; transform: translate(-50%, -50%);
  z-index: 5; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: transform 0.15s;
}
.world-camp:hover { transform: translate(-50%, -50%) scale(1.06); }
.camp-tree {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 42%, rgba(76, 175, 125, 0.5), rgba(44, 122, 82, 0.12) 70%);
  box-shadow: 0 0 var(--glow, 4px) rgba(76, 175, 125, 0.5);
  font-size: 1.4rem;
}
.camp-name { font-size: 0.64rem; font-weight: 700; color: var(--accent-green); }
.camp-lv { font-size: 0.53rem; color: var(--text-muted); }

/* 地图上的小号角色化身 */
.world-avatar {
  position: absolute; transform: translate(-50%, -50%);
  left: 41%; top: 85%; z-index: 4; pointer-events: none;
}
.world-avatar-svg { width: 34px; height: 53px; overflow: visible; }

.world-hint {
  text-align: center; font-size: 0.62rem; color: var(--text-muted);
  padding: 10px 16px 4px;
}

/* 城市内部场景 */
.city-scene {
  position: relative; margin: 0 12px; padding: 14px;
  min-height: 460px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(212, 168, 83, 0.22);
  background-color: #0a1322;
  background-size: cover; background-position: center;
  overflow: hidden;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.7);
}
.city-scene::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 10, 18, 0.55), rgba(6, 10, 18, 0.22) 38%, rgba(6, 10, 18, 0.72));
}
.city-scene-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.city-avatar { display: flex; justify-content: center; }
.city-avatar .world-avatar-svg { width: 58px; height: 91px; }
.city-landmarks { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.city-landmark {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(26, 24, 18, 0.92), rgba(20, 18, 14, 0.9));
  border: 1px solid rgba(212, 168, 83, 0.22);
  cursor: pointer; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.45);
}
.city-landmark:hover { border-color: var(--accent-gold); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(212, 168, 83, 0.16); }
.lm-medallion {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; line-height: 1;
  background: radial-gradient(circle at 50% 34%, rgba(212, 168, 83, 0.30), rgba(18, 14, 7, 0.88) 74%);
  border: 1px solid rgba(212, 168, 83, 0.45);
  box-shadow: 0 0 12px rgba(212, 168, 83, 0.26), inset 0 0 10px rgba(0, 0, 0, 0.5);
}
.lm-info { flex: 1; min-width: 0; }
.lm-name { font-size: 0.82rem; font-weight: 700; }
.lm-desc { font-size: 0.66rem; color: var(--text-muted); }
.lm-badge {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  color: var(--accent-gold); background: rgba(212, 168, 83, 0.12);
  padding: 3px 8px; border-radius: 10px; white-space: nowrap;
}

/* ============================================================
   开放世界 · 内容场景（layer 2/3：世界形态的列表与详情）
   ============================================================ */
.world-scene {
  position: relative; margin: 0 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(212, 168, 83, 0.22);
  overflow: hidden;
  background-color: #0a1322;
  background-size: cover; background-position: center;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.75);
}
.world-scene::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 10, 18, 0.7), rgba(6, 10, 18, 0.42) 30%, rgba(6, 10, 18, 0.82));
}
.world-scene-content {
  position: relative; z-index: 1;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100vh - var(--nav-height) - var(--bottom-nav-height) - 96px);
  overflow-y: auto;
}

/* 资讯 · 广场公告栏 */
.notice-board, .quest-board { display: flex; flex-direction: column; gap: 12px; }
.notice-card {
  position: relative; padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(32, 27, 18, 0.94), rgba(22, 18, 13, 0.92));
  border: 1px solid rgba(212, 168, 83, 0.26);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(232, 199, 138, 0.12);
  cursor: pointer; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.notice-card:hover { transform: translateY(-2px); border-color: var(--accent-gold); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.52), 0 0 18px rgba(212, 168, 83, 0.18); }
.notice-card.read { opacity: 0.68; }
.notice-pin {
  position: absolute; top: 12px; right: 14px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-gold); box-shadow: 0 0 8px var(--accent-gold);
}
.notice-title { font-size: 0.88rem; font-weight: 700; padding-right: 22px; line-height: 1.4; }
.notice-summary { font-size: 0.72rem; color: var(--text-secondary); margin-top: 6px; line-height: 1.55; }
.notice-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.notice-date { margin-left: auto; font-size: 0.66rem; color: var(--text-muted); font-family: var(--font-mono); }

/* 策略 · 学院任务板 */
.quest-card {
  position: relative; padding: 14px 16px 14px 46px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(26, 21, 34, 0.94), rgba(16, 14, 22, 0.92));
  border: 1px solid rgba(155, 126, 196, 0.28);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  cursor: pointer; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.quest-card:hover { transform: translateY(-2px); border-color: var(--accent-purple); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.52), 0 0 18px rgba(155, 126, 196, 0.2); }
.quest-card.read { opacity: 0.68; }
.quest-seal {
  position: absolute; left: 14px; top: 16px; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #f4d58a, rgba(212, 168, 83, 0.2));
  box-shadow: 0 0 12px rgba(212, 168, 83, 0.5);
}
.quest-title { font-size: 0.86rem; font-weight: 700; line-height: 1.4; }
.quest-summary { font-size: 0.72rem; color: var(--text-secondary); margin-top: 6px; line-height: 1.55; }
.quest-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* 知识 · 图书馆书架 */
.shelf-section { display: flex; flex-direction: column; gap: 10px; }
.shelf-head { font-size: 0.72rem; font-weight: 700; color: var(--accent-gold); letter-spacing: 0.5px; }
.shelf-row { display: flex; gap: 10px; align-items: flex-start; }
.shelf-label { flex: 0 0 60px; font-size: 0.68rem; color: var(--text-secondary); padding-top: 8px; }
.shelf-books { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.book-card {
  flex: 1 1 calc(50% - 8px); min-width: 120px;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(18, 38, 50, 0.75); border: 1px solid rgba(91, 155, 213, 0.22);
  cursor: pointer; transition: border-color 0.15s, transform 0.15s;
}
.book-card:hover { border-color: var(--accent-blue); transform: translateY(-1px); }
.book-spine { width: 6px; height: 36px; border-radius: 3px; flex: 0 0 auto; background: linear-gradient(180deg, #e8c78a, #7a5a20); box-shadow: 0 0 8px rgba(212, 168, 83, 0.4); }
.book-name { flex: 1; font-size: 0.76rem; font-weight: 600; line-height: 1.3; }
.book-diff { font-size: 0.6rem; color: var(--text-muted); white-space: nowrap; }

/* 每日问答 · 世界日晷题卡 */
.rune-card {
  padding: 14px 16px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(22, 18, 34, 0.94), rgba(14, 11, 24, 0.92));
  border: 1px solid rgba(212, 168, 83, 0.25);
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.4);
}
.rune-card.answered { border-color: rgba(76, 175, 125, 0.35); }
.rune-head { margin-bottom: 8px; }
.rune-scenario { font-size: 0.72rem; color: var(--text-secondary); margin-bottom: 6px; line-height: 1.5; }
.rune-question { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; line-height: 1.4; }
.rune-options { display: flex; flex-direction: column; gap: 8px; }
.rune-option {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 10px 12px; border-radius: 10px; background: var(--bg-card);
  border: 1px solid var(--border); color: var(--text-primary);
  cursor: pointer; font-family: var(--font-sans); font-size: 0.76rem;
  transition: border-color 0.15s, background 0.15s;
}
.rune-option:hover { border-color: var(--accent-gold); }
.rune-option.selected { border-color: var(--accent-gold); background: rgba(212, 168, 83, 0.12); }
.rune-option:disabled { cursor: default; }
.rune-letter { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(212, 168, 83, 0.15); color: var(--accent-gold); font-weight: 700; font-size: 0.66rem; flex: 0 0 auto; }
.rune-option em { font-style: normal; }
.rune-insight { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(76, 175, 125, 0.1); border: 1px solid rgba(76, 175, 125, 0.25); font-size: 0.72rem; color: var(--text-secondary); line-height: 1.5; }
.rune-insight span { display: block; font-size: 0.62rem; color: var(--accent-green); font-weight: 700; margin-bottom: 4px; }

/* 成长画像 · 营地生命之树 */
.camp-panel { display: flex; flex-direction: column; align-items: center; padding: 10px; }
.life-tree-svg { width: 220px; height: auto; max-width: 100%; }
.life-tree-caption { font-size: 0.62rem; color: var(--text-muted); margin-top: 2px; }
.wq-progress { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: rgba(16, 20, 28, 0.82); border: 1px solid var(--border); }
.wq-progress span { font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; }
.wq-track { flex: 1; height: 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.wq-track i { display: block; height: 100%; background: linear-gradient(90deg, #8a6a3a, #d4a853); box-shadow: 0 0 10px rgba(212, 168, 83, 0.5); border-radius: 6px; }
.wq-progress em { font-style: normal; font-size: 0.7rem; color: var(--accent-gold); }
.interest-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.interest-row .tag { font-size: 0.72rem; padding: 5px 11px; }
.interest-row .tag:not(.on) { opacity: 0.4; }

/* 详情 · 篝火卷轴阅读 */
.scroll-panel {
  padding: 20px 18px; border-radius: 12px;
  background:
    linear-gradient(90deg, transparent, rgba(212, 168, 83, 0.05), transparent),
    linear-gradient(180deg, rgba(38, 31, 19, 0.95), rgba(24, 20, 13, 0.95));
  border: 1px solid rgba(212, 168, 83, 0.3);
  box-shadow: inset 0 1px 0 rgba(232, 199, 138, 0.15), 0 8px 30px rgba(0, 0, 0, 0.5);
}
.scroll-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.scroll-date { margin-left: auto; font-size: 0.66rem; color: var(--text-muted); font-family: var(--font-mono); }
.scroll-title { font-size: 1.05rem; font-weight: 800; line-height: 1.35; margin-bottom: 14px; color: var(--text-primary); }
.scroll-body { font-size: 0.82rem; line-height: 1.85; color: var(--text-primary); white-space: pre-wrap; }
.wq-btn {
  margin-top: 16px; padding: 9px 16px; border-radius: 10px;
  background: rgba(212, 168, 83, 0.12); border: 1px solid rgba(212, 168, 83, 0.35);
  color: var(--accent-gold); font-family: var(--font-sans); font-size: 0.76rem; cursor: pointer;
}
.wq-btn:hover { background: rgba(212, 168, 83, 0.2); }

/* ============================================================
   开放世界 · 2D 漫画风场景（暗黑奇幻鎏金线稿）
   ============================================================ */
.world2d-view {
  position: relative;
  height: calc(100vh - var(--nav-height) - var(--bottom-nav-height) - var(--safe-bottom) - 16px);
  min-height: 460px;
  overflow: hidden;
  background: #0a0e16;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(212, 168, 83, 0.14);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.55);
}
.w2d-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.w2d-node {
  position: absolute; transform: translate(-50%, -50%);
  z-index: 3; cursor: pointer; pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 96px;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease;
}
.w2d-node:hover { transform: translate(-50%, -53%); }
.w2d-node:active { transform: translate(-50%, -50%) scale(0.95); }

.w2d-illus {
  width: 76px; line-height: 0;
  filter: drop-shadow(0 0 10px rgba(212, 168, 83, 0.22));
  animation: w2dFloat 4.5s ease-in-out infinite;
}
.w2d-node:hover .w2d-illus { filter: drop-shadow(0 0 16px rgba(212, 168, 83, 0.55)); }
.w2d-illus-svg { width: 100%; height: auto; display: block; }

.w2d-label { text-align: center; line-height: 1.18; pointer-events: none; }
.w2d-label b {
  display: block; font-size: 0.68rem; font-weight: 800;
  color: var(--accent-gold); letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(212, 168, 83, 0.5); white-space: nowrap;
}
.w2d-label span { display: block; font-size: 0.52rem; color: var(--text-muted); white-space: nowrap; }

.w2d-node--portal { width: 84px; }
.w2d-node--portal > svg {
  width: 62px; margin: 0 auto;
  filter: drop-shadow(0 0 12px rgba(212, 168, 83, 0.3));
  animation: w2dFloat 4.5s ease-in-out infinite;
}
.w2d-node--portal:hover > svg { filter: drop-shadow(0 0 18px rgba(212, 168, 83, 0.6)); }
.w2d-node--portal .w2d-label b { color: #e8c78a; }

@keyframes w2dFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ============================================================
   开放世界 · 3D 场景（Three.js POC）
   ============================================================ */
.world3d-view {
  position: relative;
  height: calc(100vh - var(--nav-height) - var(--bottom-nav-height) - var(--safe-bottom) - 16px);
  min-height: 460px;
  overflow: hidden;
  background: #0a1322;
  border-radius: var(--radius-lg);
}
.w3d-canvas-wrap { position: absolute; inset: 0; }
.w3d-canvas-wrap canvas { display: block; touch-action: none; }

.w3d-hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  pointer-events: none;
}
.w3d-back {
  pointer-events: auto;
  background: rgba(16, 21, 30, 0.72); border: 1px solid rgba(212, 168, 83, 0.42);
  color: var(--text-primary); border-radius: 16px; padding: 6px 13px;
  font-size: 0.72rem; cursor: pointer; font-family: var(--font-sans);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.w3d-back:hover { border-color: var(--accent-gold); box-shadow: 0 0 12px rgba(212, 168, 83, 0.35); }
.w3d-title {
  flex: 1; text-align: center; font-size: 0.9rem; font-weight: 800;
  color: var(--accent-gold); text-shadow: 0 0 14px rgba(212, 168, 83, 0.5);
  letter-spacing: 1px; white-space: nowrap;
}
.w3d-spacer { width: 60px; flex: 0 0 auto; }

.w3d-hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 5;
  font-size: 0.66rem; color: rgba(200, 205, 215, 0.72);
  background: rgba(10, 14, 22, 0.62); padding: 5px 13px; border-radius: 12px;
  pointer-events: none; white-space: nowrap;
  border: 1px solid rgba(212, 168, 83, 0.18);
}

/* overlay 内容面板（底部上滑，全程留在 3D 场景内） */
.w3d-overlay { position: absolute; inset: 0; z-index: 20; }
.w3o-backdrop {
  position: absolute; inset: 0; background: rgba(4, 6, 12, 0.62);
  backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.22s;
}
.w3d-overlay.open .w3o-backdrop { opacity: 1; }
.w3o-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 86%; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(21, 17, 12, 0.98), rgba(12, 10, 7, 0.98));
  border-top: 1px solid rgba(212, 168, 83, 0.42);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.62);
  transform: translateY(102%);
  transition: transform 0.27s cubic-bezier(0.22, 1, 0.36, 1);
}
.w3d-overlay.open .w3o-panel { transform: translateY(0); }

.w3o-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(212, 168, 83, 0.18);
  flex: 0 0 auto;
}
.w3o-headbtn {
  flex: 0 0 auto; min-width: 46px;
  background: rgba(212, 168, 83, 0.12);
  border: 1px solid rgba(212, 168, 83, 0.35); color: var(--accent-gold);
  border-radius: 14px; padding: 5px 12px; font-size: 0.72rem; cursor: pointer;
  font-family: var(--font-sans);
}
.w3o-titlewrap { flex: 1; text-align: center; min-width: 0; }
.w3o-title { font-size: 0.9rem; font-weight: 800; color: var(--accent-gold); }
.w3o-sub { font-size: 0.64rem; color: var(--text-muted); margin-top: 1px; }
.w3o-spacer { width: 46px; flex: 0 0 auto; }

.w3o-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 14px 16px 24px;
  display: flex; flex-direction: column; gap: 12px;
}

/* --- 行情历史趋势页（上-核心指标 / 中-K线趋势 / 下-智能助手） --- */
.trend-page {
  padding: 16px 16px 24px;
}

.trend-topbar {
  display: flex; align-items: center; gap: 10px;
  margin: -4px 0 8px;
}
.trend-title {
  font-size: 1.15rem; font-weight: 800; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.trend-back {
  flex: 0 0 auto;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: var(--radius-sm);
  padding: 5px 12px; cursor: pointer; font-size: 0.78rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s, color 0.2s;
}
.trend-back:hover { border-color: var(--accent-gold); color: var(--accent-gold); }

/* 无边框、无左右内边距，仅靠小标题区分板块 */
.trend-section { margin-top: 20px; }
.trend-section h4 {
  font-size: 0.78rem; font-weight: 700; color: var(--text-secondary);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.4px;
}

/* 核心指标：3 列紧凑布局 */
.trend-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px;
}
.trend-stat {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.trend-stat-label { font-size: 0.62rem; color: var(--text-muted); }
.trend-stat-value {
  font-size: 0.62rem; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trend-stats-empty {
  font-size: 0.78rem; color: var(--text-muted); text-align: center;
  padding: 12px 0;
}
.trend-stats-toggle {
  grid-column: 1 / -1; text-align: center; padding: 4px 0 0;
  cursor: pointer; color: var(--accent-gold); font-size: 0.72rem;
  user-select: none;
}

.trend-chart { height: 225px; width: 100%; }
.trend-empty {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.8rem;
}

/* 智能助手：左 1/3 人设 + 右 2/3 对话框 */
.trend-agent { margin-top: 0; }
.agent-card {
  display: flex; gap: 12px; align-items: stretch;
  min-height: 300px;
}
.agent-avatar {
  flex: 0 0 32%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  padding: 12px 4px;
  background: var(--bg-card); border-radius: var(--radius-md);
}
.agent-avatar-circle {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, rgba(212,168,83,0.25), rgba(212,168,83,0.08));
  border: 1px solid rgba(212,168,83,0.35);
}
.agent-name { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); text-align: center; }
.agent-role { font-size: 0.66rem; color: var(--text-muted); text-align: center; }

.agent-chat {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--bg-card); border-radius: var(--radius-md);
  overflow: hidden;
}
.agent-chat-messages {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.agent-msg {
  max-width: 88%; padding: 8px 10px; border-radius: 12px;
  font-size: 0.76rem; line-height: 1.45; word-break: break-word;
}
.agent-msg.bot {
  align-self: flex-start;
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-primary);
}
.agent-msg.user {
  align-self: flex-end;
  background: var(--accent-gold); color: #14100a;
}
.agent-chat-input {
  display: flex; border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}
.agent-chat-input input {
  flex: 1 1 auto; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--text-primary); font-size: 0.78rem; padding: 10px 12px;
  font-family: var(--font-sans);
}
.agent-chat-input button {
  flex: 0 0 auto; background: var(--accent-gold); border: none;
  color: #14100a; font-size: 0.78rem; font-weight: 600;
  padding: 0 16px; cursor: pointer; font-family: var(--font-sans);
}

/* ============================================================
   财经数据日历 + 财经专题 + 我的策略（资讯/策略页迭代）
   ============================================================ */

/* --- 通用折叠区块（顶层使用，详情页内自动去除侧边距） --- */
.eco-section {
  margin: 0 16px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.detail-view .eco-section { margin: 0 0 16px; }

.eco-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; cursor: pointer; user-select: none;
}
.eco-header:hover { background: var(--bg-card-hover); }
.eco-header-title { font-size: 0.82rem; font-weight: 700; line-height: 1.35; }
.eco-header-meta { display: flex; align-items: center; gap: 10px; }
.eco-week-range { font-size: 0.68rem; color: var(--text-muted); }
.eco-toggle { font-size: 0.72rem; color: var(--accent-gold); white-space: nowrap; }

/* --- 重要性圆点 --- */
.import-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0; background: var(--text-muted);
}
.import-high { background: var(--accent-red); }
.import-mid { background: var(--accent-blue); }
.import-low { background: var(--text-muted); }

/* --- 财经数据：周度条（收起态） --- */
.eco-week-bar { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; }
.eco-week-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-secondary); border: 1px solid var(--border);
  cursor: pointer; transition: border-color 0.2s;
}
.eco-week-chip:hover { border-color: var(--accent-gold); }
.eco-week-name { flex: 1; min-width: 0; font-size: 0.8rem; }
.eco-week-fc { font-size: 0.72rem; color: var(--text-secondary); font-family: var(--font-mono); }
.eco-week-empty { padding: 14px 16px; font-size: 0.78rem; color: var(--text-muted); }

/* --- 财经数据：月历（展开态） --- */
.eco-calendar { padding: 0 12px 12px; }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.cal-weekdays span { text-align: center; font-size: 0.66rem; color: var(--text-muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding-top: 6px; }
.cal-cell {
  min-height: 54px; border-radius: var(--radius-sm);
  border: 1px solid transparent; padding: 4px 3px;
  display: flex; flex-direction: column; gap: 2px; overflow: hidden;
}
.cal-cell-empty { background: transparent; }
.cal-cell-has { background: var(--bg-secondary); border-color: var(--border); cursor: pointer; }
.cal-cell-has:hover { border-color: var(--accent-gold); }
.cal-cell-today { border-color: var(--accent-gold); }
.cal-num { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.2; }
.cal-item {
  display: flex; align-items: center; gap: 3px;
  font-size: 0.58rem; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-item .import-dot { width: 5px; height: 5px; }
.cal-more { font-size: 0.58rem; color: var(--accent-gold); }

/* --- 日历日期浮层列表 --- */
.eco-popup-backdrop {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: flex-end; justify-content: center;
}
.eco-popup {
  width: 100%; max-width: var(--app-width);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 16px; max-height: 70vh; overflow-y: auto;
}
.eco-popup-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.9rem; font-weight: 700; margin-bottom: 12px;
}
.eco-popup-head button { background: none; border: none; color: var(--text-muted); font-size: 1rem; cursor: pointer; }
.eco-popup-list { display: flex; flex-direction: column; gap: 8px; }
.eco-popup-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; transition: border-color 0.2s;
}
.eco-popup-item:hover { border-color: var(--accent-gold); }
.eco-popup-item-main { flex: 1; min-width: 0; }
.eco-popup-item-name { font-size: 0.82rem; }
.eco-popup-item-sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.eco-popup-item-fc { font-size: 0.78rem; font-family: var(--font-mono); color: var(--accent-gold); }

/* --- 详情页头（经济指标 / 专题 / 我的策略） --- */
.eco-detail-head { margin-bottom: 12px; }
.eco-detail-title { font-size: 1.15rem; font-weight: 700; line-height: 1.4; }
.eco-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.eco-detail-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; }

/* --- 核心指标 KPI --- */
.eco-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 12px 12px; }
.eco-kpi {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.eco-kpi span { font-size: 0.66rem; color: var(--text-muted); }
.eco-kpi b { font-size: 0.95rem; font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eco-kpi-actual b { color: var(--accent-green); }

/* --- 预测来源 --- */
.eco-sources { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 12px; }
.eco-source {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--bg-secondary);
  border-radius: var(--radius-sm); font-size: 0.78rem;
}
.eco-source b { font-family: var(--font-mono); color: var(--accent-gold); }

/* --- 历史趋势 --- */
.eco-history { display: flex; flex-direction: column; padding: 0 12px 12px; }
.eco-history-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 0.78rem;
}
.eco-history-row:last-child { border-bottom: none; }
.eco-history-row b { font-family: var(--font-mono); }

/* --- 财经专题详情 --- */
.topic-latest { padding: 12px; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; }
.topic-timeline { display: flex; flex-direction: column; padding: 0 12px 12px; }
.topic-node { display: flex; gap: 10px; padding-bottom: 14px; }
.topic-node-time { flex: 0 0 42px; font-size: 0.7rem; color: var(--accent-gold); font-family: var(--font-mono); }
.topic-node-body { flex: 1; min-width: 0; }
.topic-node-concl { font-size: 0.8rem; line-height: 1.6; }
.topic-node-sources { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.topic-src { font-size: 0.7rem; color: var(--text-muted); }
.topic-related { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 12px; }

/* --- 策略页 · 我的策略 / 平台策略 一左一右标签 --- */
.strategy-tabs {
  display: flex; gap: 8px; margin: 0 16px 12px; padding: 3px;
  background: var(--bg-secondary); border-radius: var(--radius-sm);
}
.strategy-tab {
  flex: 1; text-align: center; padding: 7px 6px;
  font-size: 0.78rem; font-weight: 500; color: var(--text-muted);
  border-radius: 5px; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.strategy-tab:hover { color: var(--text-secondary); }
.strategy-tab.active { background: var(--accent-gold); color: var(--bg-primary); font-weight: 600; }

/* --- 策略卡：右侧收益率区 --- */
.strategy-card { position: relative; display: flex; align-items: center; gap: 12px; }
.strategy-card-main { flex: 1; min-width: 0; }
.strategy-card-perf {
  flex: 0 0 auto; min-width: 88px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  padding-left: 12px; border-left: 1px solid var(--border);
}
.perf-label { font-size: 0.64rem; color: var(--text-muted); }
.perf-value { font-size: 1.05rem; font-family: var(--font-mono); }
.perf-sub { font-size: 0.6rem; color: var(--text-muted); white-space: nowrap; }

/* 我的策略 · 未完成态卡片：右上角删除 + 右侧流程进展 */
.my-card-del {
  position: absolute; top: 8px; right: 10px; z-index: 2;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.72rem; line-height: 1; cursor: pointer;
}
.my-card-del:hover { color: var(--accent-red); border-color: var(--accent-red); }
.strategy-card-perf.my-perf { justify-content: center; align-items: center; }
.strategy-card-perf.my-perf .ms-status { font-size: 0.85rem; }

/* --- 我的策略模块 --- */
.my-strat-body { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 16px; }
.my-strat-upload {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.my-strat-btn {
  flex: 0 0 auto; padding: 7px 14px; border-radius: var(--radius-sm);
  background: var(--accent-gold); border: 1px solid var(--accent-gold);
  color: var(--bg-primary); font-size: 0.78rem; font-weight: 600; cursor: pointer;
  font-family: var(--font-sans); white-space: nowrap; transition: opacity 0.2s;
}
.my-strat-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.my-strat-selected {
  font-size: 0.72rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 状态徽标 */
.ms-status { flex-shrink: 0; font-size: 0.72rem; }
.ms-progress { color: var(--text-secondary); animation: msPulse 1.2s ease-in-out infinite; }
.ms-action { color: var(--accent-blue); cursor: pointer; }
.ms-fail { color: var(--accent-red); }
.ms-success { color: var(--accent-green); font-family: var(--font-mono); }
@keyframes msPulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* --- 确认回测参数 --- */
.confirm-fields { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; }
.confirm-field {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.confirm-field-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); }
.confirm-field-head b { font-weight: 600; }
.conf-ok { color: var(--accent-green); }
.conf-low { color: var(--accent-red); }
.confirm-field-value { margin-top: 4px; font-size: 0.88rem; font-family: var(--font-mono); }

/* --- 失败原因 + 决策表单 --- */
.fail-reason { padding: 12px; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.7; }
.fail-form { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 12px; }
.fail-field { display: flex; flex-direction: column; gap: 5px; font-size: 0.72rem; color: var(--text-muted); }
.fail-field select {
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-sm);
  padding: 9px 10px; font-size: 0.8rem; font-family: var(--font-sans); outline: none;
}

/* --- 回测结果 --- */
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 12px 12px; }
.result-cell {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.result-cell span { font-size: 0.66rem; color: var(--text-muted); }
.result-cell b { font-size: 0.92rem; font-family: var(--font-mono); }
.result-curve { display: flex; flex-direction: column; padding: 0 12px 12px; max-height: 220px; overflow-y: auto; }
.curve-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 2px; border-bottom: 1px solid var(--border); font-size: 0.75rem;
}
.curve-row:last-child { border-bottom: none; }
.curve-row b { font-family: var(--font-mono); }

/* --- 卡片标题/简述缩小（财经专题 + 策略推荐） --- */
.topic-card .card-title,
.strategy-card .card-title { font-size: 0.78rem; line-height: 1.35; }
.topic-card .card-summary,
.strategy-card .card-summary { font-size: 0.7rem; line-height: 1.4; }
.topic-card,
.strategy-card { padding: 12px; margin-bottom: 10px; }

/* --- 扁平区块轻量小标题（财经专题） --- */
.section-mini-title {
  font-size: 0.76rem; font-weight: 700; color: var(--text-secondary);
  padding: 4px 16px 0; letter-spacing: 0.3px;
}