/* 盘口雷达AI · 走地精算师 H5 */
:root {
  --ai-from: #6c7bff;
  --ai-to: #a855f7;
  --ai-mid: #8b5cf6;
  --ai-glow: rgba(108, 123, 255, 0.38);
  --ai-glow-soft: rgba(168, 85, 247, 0.22);
  --green: #22c55e;
  --green-dark: #16a34a;
  --green-light: #dcfce7;
  --green-glow: rgba(34, 197, 94, 0.25);
  --accent: #ff6b00;
  --accent-soft: #fff4eb;
  --accent-glow: rgba(255, 107, 0, 0.18);
  --bg: #f0f4ff;
  --bg-pearl: #fafbff;
  --bg-mica: #e8ecf8;
  --bg-deep: #1e1b4b;
  --card: #ffffff;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.92);
  --text: #0f172a;
  --text-muted: #64748b;
  --border: rgba(99, 102, 241, 0.1);
  --orange: #f97316;
  --red: #ef4444;
  --yellow: #eab308;
  --gold: #d4af37;
  --gold-light: #fef3c7;
  --tabbar-h: 62px;
  --tabbar-float: 14px;
  --composer-stack: 124px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 16px;
  --shadow: 0 8px 32px rgba(76, 29, 149, 0.08);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
}

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

html,
body {
  height: 100%;
  background:
    radial-gradient(ellipse 120% 55% at 50% -8%, rgba(147, 197, 253, 0.55) 0%, transparent 58%),
    radial-gradient(ellipse 80% 40% at 88% 12%, rgba(196, 181, 253, 0.42) 0%, transparent 52%),
    linear-gradient(180deg, #f8faff 0%, #f3f6ff 42%, #eef1fa 72%, #e4e8f4 100%);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

body {
  max-width: 430px;
  margin: 0 auto;
  overflow-x: hidden;
  position: relative;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  max-width: 430px;
  margin: 0 auto;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(15, 23, 42, 0.012) 3px, rgba(15, 23, 42, 0.012) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(15, 23, 42, 0.012) 3px, rgba(15, 23, 42, 0.012) 4px);
}

.app {
  min-height: 100%;
  position: relative;
  z-index: 1;
}

body::after {
  opacity: 0.2;
}

/* ===== 场景背景 ===== */
.scene-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.scene-bg--subtle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(108, 123, 255, 0.08) 0%, transparent 55%);
}

.scene-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(56px);
}

.scene-bg__orb--blue {
  width: 280px;
  height: 280px;
  top: -60px;
  left: -80px;
  background: rgba(96, 165, 250, 0.45);
}

.scene-bg__orb--violet {
  width: 240px;
  height: 240px;
  top: 40px;
  right: -70px;
  background: rgba(167, 139, 250, 0.4);
}

.scene-bg__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(108, 123, 255, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(30, 27, 75, 0.04) 0%, transparent 35%);
}

/* ===== 首页 · AI 决策引擎 ===== */
.view--home-hero {
  padding: 0 18px;
  padding-bottom: calc(var(--tabbar-h) + var(--tabbar-float) + var(--safe-bottom) + 16px);
  position: relative;
  min-height: 100dvh;
}

.brand-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 2px 20px;
  position: relative;
  z-index: 2;
}

.brand-bar__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-bar__sub {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 240px;
}

.badge-pro--glow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #5c4008;
  background: linear-gradient(145deg, #fffbeb 0%, #fde68a 35%, #fbbf24 70%, #d97706 100%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.35),
    0 4px 20px rgba(251, 191, 36, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
  animation: proGlow 3s ease-in-out infinite;
}

@keyframes proGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35), 0 4px 20px rgba(251, 191, 36, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.85); }
  50% { box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.5), 0 6px 28px rgba(251, 191, 36, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.85); }
}

.home-hero__scroll {
  position: relative;
  z-index: 1;
  flex: 1;
}

.engine-card {
  position: relative;
  padding: 22px 20px 24px;
  border-radius: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 24px 64px rgba(108, 123, 255, 0.12),
    0 2px 0 rgba(255, 255, 255, 0.8) inset,
    0 -1px 0 rgba(108, 123, 255, 0.06) inset;
  overflow: hidden;
  margin-bottom: 14px;
}

.engine-card__shine {
  position: absolute;
  top: -40%;
  left: -20%;
  width: 140%;
  height: 60%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.45) 50%, transparent 60%);
  pointer-events: none;
}

.engine-card__chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ai-mid);
  background: rgba(108, 123, 255, 0.1);
  border: 1px solid rgba(108, 123, 255, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.engine-card__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.engine-card__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 18px;
}

.engine-card__orb {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.engine-card__orb img {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 8px 24px var(--ai-glow));
  animation: orbFloat 4s ease-in-out infinite;
}

.engine-card__orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(108, 123, 255, 0.25);
  box-shadow: 0 0 32px var(--ai-glow-soft);
  animation: orbPulse 3s ease-in-out infinite;
}

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

@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.06); opacity: 1; }
}

.engine-card__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.engine-card__tags span {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(108, 123, 255, 0.12);
}

.cta-engine {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  display: block;
  padding: 15px 24px;
  border: none;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--ai-from) 0%, var(--ai-to) 100%);
  box-shadow:
    0 12px 36px var(--ai-glow),
    0 0 0 1px rgba(255, 255, 255, 0.25) inset;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta-engine:active {
  transform: scale(0.98);
}

.cta-engine__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.25) 50%, transparent 65%);
  pointer-events: none;
}

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

.aux-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 12px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 32px rgba(76, 29, 149, 0.06);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.aux-card:active {
  transform: scale(0.98);
  box-shadow: 0 8px 24px rgba(108, 123, 255, 0.12);
}

.aux-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(108, 123, 255, 0.12), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(108, 123, 255, 0.15);
}

.aux-card__body strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.aux-card__body small {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.home-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding-bottom: 4px;
}

.home-status.is-online { color: var(--ai-mid); }
.home-status.is-offline { color: var(--red); }

/* ===== AI 分析工作台 ===== */
.view--analyze {
  padding: 0;
  padding-bottom: calc(var(--tabbar-h) + var(--tabbar-float) + var(--composer-stack) + var(--safe-bottom));
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

.analyze-bar {
  text-align: center;
  padding: 14px 18px 8px;
  position: relative;
  z-index: 2;
}

.analyze-bar__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.analyze-bar__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.analyze-bar__status.is-online { color: var(--ai-mid); }
.analyze-bar__status.is-offline { color: var(--red); }

.gemini-composer--ai .gemini-composer__send.is-ready {
  background: linear-gradient(135deg, var(--ai-from), var(--ai-to));
  box-shadow: 0 6px 20px var(--ai-glow);
}

.gemini-composer--ai .gemini-composer__box {
  border-color: rgba(108, 123, 255, 0.15);
  box-shadow: 0 12px 40px rgba(108, 123, 255, 0.1);
}

/* 策略库 · 双面板 */
.library-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--glass-border);
}

.library-tabs__btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.library-tabs__btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--ai-from), var(--ai-to));
  box-shadow: 0 6px 18px var(--ai-glow-soft);
}

.strategy-tabs__btn.is-active {
  background: linear-gradient(135deg, var(--ai-from), var(--ai-to));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px var(--ai-glow-soft);
}

.ambient-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient-bg::before,
.ambient-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
}

.ambient-bg::before {
  width: 220px;
  height: 220px;
  top: 8%;
  left: -40px;
  background: rgba(186, 230, 253, 0.45);
}

.ambient-bg::after {
  width: 200px;
  height: 200px;
  top: 22%;
  right: -50px;
  background: rgba(233, 213, 255, 0.38);
}

.view {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 16px;
  padding-bottom: calc(var(--tabbar-h) + var(--tabbar-float) + var(--safe-bottom) + 20px);
}

.view--active {
  display: flex;
}

.view--home-chat.view--active {
  flex-direction: column;
}

.view[hidden] {
  display: none !important;
}

.page-spacer {
  height: 8px;
}

/* ===== 首页顶栏 · Premium ===== */
.topbar--premium {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 14px 18px 10px;
  position: relative;
  z-index: 2;
}

.topbar__ball-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.topbar__ball-svg {
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.08));
}

.topbar__center {
  text-align: center;
  min-width: 0;
}

.topbar__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.topbar__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.topbar__status.is-online {
  color: var(--green-dark);
}

.topbar__status.is-offline {
  color: var(--red);
}

.status-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

.status-led--on {
  background: linear-gradient(135deg, var(--ai-from), var(--ai-to));
  box-shadow: 0 0 0 3px rgba(108, 123, 255, 0.2), 0 0 10px var(--ai-glow-soft);
  animation: ledPulse 2s ease-in-out infinite;
}

@keyframes ledPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.badge-pro--pearl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #6b4f0a;
  background: linear-gradient(145deg, #fff9e8 0%, #f3e2b3 38%, #d4af37 100%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 2px 8px rgba(180, 140, 40, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.badge-pro--pearl svg {
  color: #a67c00;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
}

/* legacy topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 8px;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__ball {
  font-size: 28px;
  line-height: 1;
}

.topbar__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.topbar__sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.badge-pro {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fde047, #facc15);
  color: #854d0e;
  font-size: 12px;
  font-weight: 700;
}

.ai-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 8px;
  white-space: nowrap;
}

.ai-status.is-online {
  color: var(--green-dark);
}

.ai-status.is-offline {
  color: var(--red);
}

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

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 20px 8px 24px;
}

.hero__title {
  font-size: 26px;
  font-weight: 800;
  color: var(--green-dark);
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.hero__tagline {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-muted);
  letter-spacing: 0.2em;
}

/* ===== 首页 · Gemini 聊天布局 ===== */
.view--home-chat {
  padding: 0;
  padding-bottom: calc(var(--tabbar-h) + var(--tabbar-float) + var(--composer-stack) + var(--safe-bottom));
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

.home-chat__scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 20px 24px;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 1;
}

.home-chat__welcome {
  text-align: center;
  padding: 4px 0 16px;
}

.home-chat__lead {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: none;
}

.home-chat__messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 12px;
  min-height: 48px;
}

.home-chat__messages:empty {
  display: none;
}

.msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: msgIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.msg__avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: linear-gradient(145deg, #fff, #f1f5f9);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.msg__bubble {
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.msg--user .msg__bubble {
  border-bottom-right-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.msg--ai .msg__bubble {
  border-bottom-left-radius: 8px;
}

.msg--ai {
  align-self: flex-start;
}

.msg__img {
  display: block;
  max-width: 180px;
  border-radius: 10px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
}

.msg__text {
  font-size: 13px;
  color: var(--text-muted);
}

.msg--typing .msg__bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.msg-dots {
  display: inline-flex;
  gap: 4px;
}

.msg-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: msgDot 1.1s infinite ease-in-out;
  font-style: normal;
}

.msg-dots i:nth-child(2) { animation-delay: 0.15s; }
.msg-dots i:nth-child(3) { animation-delay: 0.3s; }

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

@keyframes msgDot {
  0%, 70%, 100% { opacity: 0.35; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}

/* Gemini 毛玻璃输入框 */
.gemini-composer--glass {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--tabbar-float) + var(--safe-bottom));
  width: 100%;
  max-width: 430px;
  padding: 0 16px 8px;
  z-index: 45;
}

.gemini-composer--glass .gemini-composer__box {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 10px 10px 10px 16px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 12px 40px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.gemini-composer--glass .gemini-composer__box:focus-within {
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow:
    0 16px 48px rgba(34, 197, 94, 0.1),
    0 0 0 1px rgba(34, 197, 94, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.gemini-composer--glass .gemini-composer__attach {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.15s;
}

.gemini-composer--glass .gemini-composer__attach:hover {
  color: var(--green-dark);
}

.gemini-composer--glass .gemini-composer__send.is-ready {
  background: linear-gradient(145deg, #34d399, var(--green));
  color: #fff;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.gemini-composer--glass .gemini-composer__foot {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: #9ca3af;
  letter-spacing: 0.02em;
}

/* legacy composer */
.gemini-composer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  width: 100%;
  max-width: 430px;
  padding: 8px 14px 10px;
  background: linear-gradient(0deg, var(--bg) 75%, transparent);
  z-index: 45;
}

.gemini-composer__preview {
  margin-bottom: 8px;
}

.gemini-composer__thumb {
  position: relative;
  display: inline-block;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--green);
  box-shadow: 0 4px 14px var(--green-glow);
}

.gemini-composer__thumb img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
}

.gemini-composer__thumb-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.gemini-composer__box {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px;
  background: var(--card);
  border-radius: 26px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07), 0 0 0 1px rgba(34, 197, 94, 0.06);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.gemini-composer__box:focus-within {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 6px 24px rgba(34, 197, 94, 0.12), 0 0 0 2px var(--green-light);
}

.gemini-composer__attach {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
}

.gemini-composer__attach:active {
  transform: scale(0.94);
  background: #bbf7d0;
}

.gemini-composer__input {
  flex: 1;
  min-width: 0;
  max-height: 110px;
  padding: 7px 2px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  resize: none;
  font-family: inherit;
  outline: none;
}

.gemini-composer__input::placeholder {
  color: #9ca3af;
}

.gemini-composer__send {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #e5e7eb;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s, color 0.2s;
}

.gemini-composer__send.is-ready {
  background: var(--green);
  color: #fff;
  box-shadow: 0 3px 12px var(--green-glow);
}

.gemini-composer__send.is-ready:active {
  transform: scale(0.94);
}

.gemini-composer__send:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.gemini-composer__foot {
  margin-top: 6px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

.howto--premium {
  margin-top: 28px;
  padding-bottom: 12px;
}

.howto--premium .howto__divider {
  margin-bottom: 28px;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.howto--premium .howto__divider::before,
.howto--premium .howto__divider::after {
  background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.08), transparent);
  height: 1px;
}

.howto--premium .howto__steps {
  gap: 16px;
}

.howto--premium .howto__step {
  padding: 0 4px;
}

.howto__icon-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.howto__icon-wrap--upload {
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.18);
}

.howto__icon-wrap--analyze {
  box-shadow: 0 10px 24px rgba(96, 165, 250, 0.16);
}

.howto__icon-wrap--predict {
  box-shadow: 0 10px 24px rgba(217, 119, 6, 0.14);
}

.howto__icon-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.howto__icon-img--svg {
  width: 56px;
  height: 56px;
  padding: 2px;
}

.howto__icon-svg {
  width: 36px;
  height: 36px;
}

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

.howto__desc {
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-muted);
}

.howto--compact {
  margin-top: 20px;
  padding-bottom: 8px;
}

/* ===== 上传卡片（旧版，保留兼容） ===== */
.upload-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: var(--shadow), 0 0 0 1px var(--green-glow);
}

.upload-card__inner {
  position: relative;
}

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  margin: 12px;
  padding: 24px 16px;
  border: 2px dashed var(--green);
  border-radius: 12px;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.upload-zone:active {
  background: var(--green-light);
}

.upload-zone__icon {
  color: var(--green);
  margin-bottom: 12px;
}

.upload-zone__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.upload-zone__hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.upload-zone__hint--primary {
  color: var(--green-dark);
  font-weight: 600;
  font-size: 13px;
}

.upload-zone__btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 32px;
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 24px;
  box-shadow: 0 4px 12px var(--green-glow);
}

.upload-preview {
  position: relative;
  margin: 12px;
  border-radius: 12px;
  overflow: hidden;
  max-height: 240px;
}

.upload-preview img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.upload-preview__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* ===== 如何使用 ===== */
.howto {
  margin-top: 32px;
}

.howto__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.howto__divider::before,
.howto__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.howto__steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}

.howto__step p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 8px;
}

.howto__icon {
  font-size: 28px;
}

/* ===== 报告顶栏 ===== */
.report-topbar,
.simple-topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 14px 0;
  min-height: 48px;
}

.report-topbar__title,
.simple-topbar h1 {
  font-size: 17px;
  font-weight: 600;
}

.report-topbar__back,
.report-topbar__share {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.report-topbar__back {
  left: -8px;
}

.report-topbar__share {
  right: -8px;
  color: var(--accent);
}

.view--report {
  background: var(--bg);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
}

.report-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== 研报顶栏对阵 ===== */
.report-hero {
  background: var(--card);
  border-radius: 20px;
  padding: 20px 16px 16px;
  border: 1px solid #eceff3;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.04);
}

.report-hero__teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-team {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.report-team--away {
  align-items: center;
}

.report-team__flag {
  width: 52px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e8ecf1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  background: #f3f4f6;
}

.report-team__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}

.report-hero__center {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 96px;
}

.report-hero__score {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text);
  line-height: 1.1;
}

.report-hero__risk {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.report-hero__risk-pct {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.report-hero__risk-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
}

.report-hero__minute {
  font-size: 11px;
  color: var(--text-muted);
}

.report-hero__meta {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== 流式研报大面板 ===== */
.report-sheet {
  background: #fafbfc;
  border-radius: 20px;
  border: 1px solid #e8eaee;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.03);
}

.report-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #eef0f3;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.report-sheet__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
}

.report-sheet__tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 8px;
  border-radius: 6px;
}

.report-md {
  padding: 18px 18px 22px;
  font-size: 15px;
  line-height: 1.75;
  color: #374151;
}

.report-md h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 1.2em 0 0.55em;
  padding-bottom: 0.35em;
  border-bottom: 2px solid var(--accent-soft);
}

.report-md h2:first-child {
  margin-top: 0;
}

.report-md p {
  margin: 0.55em 0;
}

.report-md ul,
.report-md ol {
  margin: 0.6em 0;
  padding-left: 1.25em;
}

.report-md li {
  margin: 0.35em 0;
}

.report-md blockquote {
  margin: 0.8em 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  color: #4b5563;
}

.report-md strong,
.report-md .md-action {
  color: var(--accent);
  font-weight: 800;
}

.report-md-fallback {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
}

.report-disclaimer {
  font-size: 11px;
  line-height: 1.6;
  color: #9ca3af;
  text-align: center;
  padding: 4px 8px 0;
}

.report-locked .report-sheet {
  position: relative;
}

.report-locked .report-md {
  filter: blur(7px);
  user-select: none;
  pointer-events: none;
  max-height: 220px;
  overflow: hidden;
}

/* ===== 比赛卡片（旧版兼容） ===== */
.match-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.match-card__teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.team--right {
  text-align: right;
}

.team__flag {
  font-size: 32px;
  line-height: 1.2;
}

.team__name {
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
}

.match-card__score {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.score {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
}

.status {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.status--live {
  color: var(--green);
}

.minute {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.match-card__meta {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 14px;
}

/* ===== 面板 ===== */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.panel__head h2 {
  font-size: 15px;
  font-weight: 700;
}

.panel__info {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}

/* ===== 风险条 ===== */
.risk-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.risk-row__pct {
  font-size: 36px;
  font-weight: 800;
  color: var(--orange);
}

.risk-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
}

.risk-badge--low {
  background: #dcfce7;
  color: var(--green-dark);
}

.risk-badge--mid {
  background: #fef9c3;
  color: #a16207;
}

.risk-badge--high {
  background: #fee2e2;
  color: var(--red);
}

.risk-bar {
  position: relative;
  height: 10px;
  border-radius: 5px;
  margin-bottom: 8px;
}

.risk-bar__track {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(to right, #22c55e, #eab308, #ef4444);
}

.risk-bar__thumb {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  transform: translateY(-50%);
  background: #fff;
  border: 3px solid var(--orange);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.risk-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== 推荐列表 ===== */
.rec-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rec {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
}

.rec__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
}

.rec--good .rec__icon {
  background: #dcfce7;
  color: var(--green-dark);
}

.rec--bad .rec__icon {
  background: #fee2e2;
  color: var(--red);
}

.rec--warn .rec__icon {
  background: #fef9c3;
  color: #a16207;
}

.rec__body strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.rec__body p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.rec__tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.rec__tag--good {
  background: #dcfce7;
  color: var(--green-dark);
}

.rec__tag--bad {
  background: #fee2e2;
  color: var(--red);
}

.rec__tag--warn {
  background: #fef9c3;
  color: #a16207;
}

/* ===== 关键因素 ===== */
.factor-list {
  list-style: none;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.factor-list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 8px;
}

.factor-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: bold;
}

.btn-outline {
  display: block;
  width: 100%;
  padding: 14px;
  margin: 8px 0 16px;
  border: 2px solid var(--green);
  border-radius: 12px;
  background: transparent;
  color: var(--green-dark);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-outline:active {
  background: var(--green-light);
}

/* ===== 加载 ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  max-width: 430px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  gap: 16px;
}

.loading-overlay[hidden] {
  display: none !important;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--green-light);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== 占位页（旧） ===== */
.placeholder-page {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.placeholder-page p:first-child {
  font-size: 48px;
  margin-bottom: 16px;
}

.placeholder-page .muted {
  font-size: 13px;
  margin-top: 8px;
}

/* ===== 子页面（历史 / 策略 / 我的） ===== */
.view--sub {
  padding-top: 8px;
}

.sub-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.sub-scroll--profile {
  padding-top: 4px;
}

.sub-topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 12px 0 16px;
  min-height: 48px;
}

.sub-topbar__title {
  font-size: 17px;
  font-weight: 600;
}

.sub-topbar__action {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 4px;
  cursor: pointer;
}

.sub-topbar__action:active {
  color: var(--accent);
}

.sub-lead {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
  padding: 0 2px;
}

.sub-empty {
  text-align: center;
  padding: 48px 20px 32px;
}

.sub-empty__icon {
  font-size: 44px;
  margin-bottom: 14px;
  opacity: 0.85;
}

.sub-empty__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.sub-empty__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 历史记录 */
.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.history-card:active {
  transform: scale(0.98);
}

.history-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.history-card__teams {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  flex: 1;
}

.history-card__risk {
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.history-card__risk--high {
  background: #fef2f2;
  color: #dc2626;
}

.history-card__risk--mid {
  background: #fff7ed;
  color: #ea580c;
}

.history-card__risk--low {
  background: #f0fdf4;
  color: #16a34a;
}

.history-card__label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.history-card__meta {
  font-size: 11px;
  color: #94a3b8;
}

/* 策略库 */
.strategy-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.strategy-tabs__btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.65);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.strategy-tabs__btn.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 4px 14px var(--green-glow);
}

.strategy-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.strategy-card {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

.strategy-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.strategy-card__tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--green-dark);
  background: var(--green-light);
  padding: 3px 8px;
  border-radius: 6px;
}

.strategy-card__title {
  font-size: 15px;
  font-weight: 600;
}

.strategy-card__summary {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.strategy-card__points {
  list-style: none;
  font-size: 12px;
  color: var(--text);
  line-height: 1.55;
}

.strategy-card__points li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 6px;
}

.strategy-card__points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* 我的 */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 16px;
  margin-bottom: 12px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.06);
}

.profile-hero__avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, #ecfdf5, #d1fae5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.profile-hero__info {
  flex: 1;
  min-width: 0;
}

.profile-hero__name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-hero__id {
  font-size: 12px;
  color: var(--text-muted);
}

.profile-hero__badge {
  flex-shrink: 0;
  font-size: 11px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.profile-stat {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
}

.profile-stat__val {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.profile-stat__val--dot {
  font-size: 15px;
}

.profile-stat__val--online {
  color: var(--green-dark);
}

.profile-stat__val--offline {
  color: #94a3b8;
}

.profile-stat__label {
  font-size: 11px;
  color: var(--text-muted);
}

.profile-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 20px;
}

.profile-menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.profile-menu__item:last-child {
  border-bottom: none;
}

.profile-menu__item:active {
  background: rgba(15, 23, 42, 0.03);
}

.profile-menu__item--danger .profile-menu__text {
  color: #dc2626;
}

.profile-menu__icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.profile-menu__text {
  flex: 1;
  font-weight: 500;
}

.profile-menu__arrow {
  color: #cbd5e1;
  font-size: 18px;
}

.profile-foot {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  padding-bottom: 8px;
}

/* ===== 底部导航 ===== */
.tabbar--glass {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 406px;
  height: var(--tabbar-h);
  padding: 0 6px;
  display: flex;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 22px;
  box-shadow:
    0 12px 40px rgba(15, 23, 42, 0.1),
    0 2px 8px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  z-index: 50;
}

.tabbar--glass .tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: none;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 8px 0;
  border-radius: 16px;
  transition: color 0.2s, background 0.2s;
}

.tabbar--glass .tabbar__item.is-active {
  color: var(--ai-mid);
  font-weight: 600;
}

.tabbar--glass .tabbar__item.is-active .tabbar__pill {
  background: linear-gradient(135deg, var(--ai-from), var(--ai-to));
  box-shadow: 0 6px 20px var(--ai-glow-soft);
}

.tabbar--glass .tabbar__item.is-active .tabbar__icon {
  color: #fff;
  transform: translateY(-1px);
  filter: none;
}

.tabbar--glass .tabbar__item--featured:not(.is-active) {
  color: var(--ai-mid);
  font-weight: 600;
}

.tabbar--glass .tabbar__pill {
  width: 36px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: background 0.2s, box-shadow 0.2s;
}

.tabbar--glass .tabbar__icon {
  width: 20px;
  height: 20px;
  transition: transform 0.2s, color 0.2s, filter 0.2s;
}

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 50;
}

.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  padding: 6px 0;
}

.tabbar__item.is-active {
  color: var(--green);
}

.tabbar__icon {
  width: 22px;
  height: 22px;
}

/* ===== 弹层 ===== */
.modal {
  border: none;
  padding: 0;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  background: transparent;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.modal__sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  max-height: 70vh;
  background: var(--card);
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  overflow-y: auto;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal__head h3 {
  font-size: 17px;
}

.modal__close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal__content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}

.modal__content p + p {
  margin-top: 12px;
}

.report-raw {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  padding: 12px;
  border-radius: 8px;
  font-family: inherit;
  margin-bottom: 12px;
}

.disclaimer {
  padding: 12px;
  background: #fff7ed;
  border-radius: 8px;
  color: #9a3412 !important;
  font-size: 13px !important;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--tabbar-float) + var(--composer-stack) + var(--safe-bottom) + 8px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 10px 20px;
  background: rgba(31, 41, 55, 0.9);
  color: #fff;
  font-size: 14px;
  border-radius: 8px;
  z-index: 200;
  text-align: center;
}

.toast[hidden] {
  display: none !important;
}

.pay-wall {
  position: fixed;
  inset: 0;
  max-width: 430px;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.55);
  z-index: 150;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
}

.pay-wall[hidden] {
  display: none !important;
}

.pay-wall__card {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 20px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.pay-wall__title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pay-wall__desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.pay-wall__credits {
  font-size: 13px;
  color: var(--green-dark);
  margin-bottom: 16px;
}

.pay-wall__btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.pay-wall__mock {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.report-locked .report-sheet::after {
  content: '';
  display: none;
}

.report-locked .report-hero {
  filter: none;
}

.rec__body strong {
  font-weight: 700;
}

@media (min-width: 431px) {
  body {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
  }
}
