/* ====== 东哥选股 H5 · 移动端重设计 v2 ====== */
:root {
  --bg: #0c0c1a;
  --card: #151530;
  --card2: #1a1a38;
  --border: #2a2a48;
  --text: #eaeaef;
  --text2: #9a9ab8;
  --muted: #5a5a78;
  --red: #e94560;
  --red-bg: rgba(233,69,96,0.12);
  --gold: #f0b840;
  --gold-bg: rgba(240,184,64,0.12);
  --green: #3cb878;
  --green-bg: rgba(60,184,120,0.12);
  --blue: #5090e0;
  --radius: 14px;
  --radius-sm: 10px;
  --safe-b: env(safe-area-inset-bottom, 16px);
}

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

html{
  font-size: 17px;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body{
  font-family: -apple-system,BlinkMacSystemFont,'SF Pro Display','PingFang SC','Microsoft YaHei',sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app{
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ====== 顶部 ====== */
#topBar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(12,12,26,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo{ display:flex; align-items:center; gap:10px; }
.logo-icon{ font-size: 28px; line-height:1; }
.logo-text{ font-size: 19px; font-weight: 800; letter-spacing: 1px; }

.quota-badge{
  font-size: 13px;
  color: var(--text2);
  background: var(--card);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.quota-badge strong{ color: var(--gold); font-weight: 700; }

/* ====== 页面容器 ====== */
.page{
  display: none;
  flex-direction: column;
  flex: 1;
  padding-bottom: 80px;
}
.page.active{ display: flex; }

/* ========== 首页 ========== */

/* Hero - 精简 */
.hero{
  text-align: center;
  padding: 36px 24px 24px;
}
.hero-title{
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--red), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.hero-title .ver{
  font-size: 15px;
  font-weight: 700;
  -webkit-text-fill-color: var(--red);
  background: var(--red-bg);
  -webkit-background-clip: text;
  background-clip: text;
  padding: 3px 8px;
  border-radius: 5px;
  margin-left: 6px;
  vertical-align: middle;
}
.hero-sub{ font-size: 15px; color: var(--text2); letter-spacing: 0.5px; }

/* 搜索框 - 主角 */
.search-box{ padding: 8px 20px 16px; }
.search-input-wrap{
  display: flex;
  gap: 0;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.search-input-wrap:focus-within{
  border-color: var(--red);
  box-shadow: 0 0 0 4px var(--red-bg);
}
.search-input{
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 20px;
  padding: 16px 18px;
  font-family: 'SF Mono','Menlo','Consolas',monospace;
  letter-spacing: 2px;
  min-width: 0;
}
.search-input::placeholder{
  color: var(--muted);
  font-family: inherit;
  letter-spacing: 0.5px;
  font-size: 16px;
}
.search-btn{
  padding: 16px 28px;
  background: var(--red);
  color: #fff;
  border: none;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  -webkit-appearance: none;
}
.search-btn:active{ opacity: 0.82; }
.search-btn:disabled{ background: #555; opacity: 0.5; }

.search-hints{
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.hint-chip{
  font-size: 13px;
  color: var(--text2);
  background: var(--card);
  padding: 8px 14px;
  border-radius: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.hint-chip:active{
  border-color: var(--red);
  color: var(--red);
  background: var(--red-bg);
}
.search-error{
  color: var(--red);
  font-size: 14px;
  margin-top: 10px;
  min-height: 22px;
  padding-left: 4px;
}

/* 特点 - 单列大卡片 */
.features{
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 20px 12px;
}
.feature-card{
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.feature-icon{
  font-size: 32px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feature-body{ flex:1; min-width:0; }
.feature-title{ font-size: 16px; font-weight: 700; margin-bottom: 3px; }
.feature-desc{ font-size: 13px; color: var(--text2); line-height: 1.5; }

/* 近期分析 */
.recent-section{ padding: 12px 20px 24px; }
.section-title{
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.recent-list{ display:flex; flex-direction:column; gap:10px; }
.recent-item{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.recent-item:active{
  border-color: var(--red);
  background: var(--card2);
}
.recent-code{
  font-family: 'SF Mono','Menlo','Consolas',monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  min-width: 70px;
}
.recent-name{ flex:1; font-size: 16px; font-weight: 500; }
.recent-score{
  font-size: 14px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 8px;
}
.score-bp{ background: var(--green-bg); color: var(--green); }
.score-b{ background: var(--gold-bg); color: var(--gold); }
.score-cp{ background: var(--red-bg); color: var(--red); }

/* 合规声明横幅 */
.compliance-banner{
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  margin: 8px 20px 16px;
  background: rgba(233,69,96,0.06);
  border: 1px solid rgba(233,69,96,0.2);
  border-radius: var(--radius);
}
.compliance-icon{ font-size: 28px; flex-shrink: 0; line-height: 1.2; }
.compliance-text{
  font-size: 12px;
  color: var(--text2);
  line-height: 1.8;
}
.compliance-text strong{ color: var(--red); }

/* 报告页底部免责 */
.report-disclaimer{
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 12px 20px 20px;
  line-height: 1.8;
  background: rgba(233,69,96,0.04);
  border-top: 1px solid var(--border);
}

/* 免责（旧版，保留兼容） */
.disclaimer{
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 20px;
  line-height: 1.8;
}

/* ========== 分析中页面 ========== */
.analyzing-wrap{
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
  text-align: center;
}

.analyzing-spinner{
  width: 52px;
  height: 52px;
  border: 4px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 28px;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

.analyzing-title{
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.analyzing-stock{
  font-size: 28px;
  color: var(--gold);
  font-family: 'SF Mono','Menlo','Consolas',monospace;
  font-weight: 700;
  margin-bottom: 40px;
  letter-spacing: 2px;
}

.analyzing-steps{
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 280px;
}
.step{
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s;
}
.step-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: all 0.3s;
}
.step.active{ color: var(--text); font-weight: 600; }
.step.active .step-dot{
  background: var(--red);
  box-shadow: 0 0 10px var(--red-bg);
}
.step.done{ color: var(--green); }
.step.done .step-dot{ background: var(--green); }

.analyzing-note{
  margin-top: 40px;
  font-size: 13px;
  color: var(--muted);
}

/* ========== 报告页 ========== */
.report-header{
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 58px;
  z-index: 99;
  gap: 8px;
}
.report-stock-title{
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}
.back-btn, .share-btn{
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-appearance: none;
}
.back-btn:active, .share-btn:active{ background: var(--border); }

.report-wrap{
  flex: 1;
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.report-placeholder{
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--muted);
  font-size: 15px;
}
.report-wrap iframe{
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  border: none;
  background: #0d1117;
}

/* 报告页底部操作栏 */
.report-fab{
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-fab button{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* ========== 定价页 ========== */
.page-header{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 58px;
  z-index: 99;
}
.page-header h2{ font-size: 19px; font-weight: 700; }

.pricing-cards{
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pricing-card{
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 20px;
  border: 1px solid var(--border);
  position: relative;
}
.pricing-card.featured{
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(240,184,64,0.1);
}

.pricing-badge{
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 14px;
  display: inline-block;
}
.pricing-badge.hot{ color: var(--gold); }

.pricing-price{
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 2px;
}
.pricing-period{
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 16px;
}

.pricing-features{
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.pricing-features li{
  font-size: 14px;
  color: var(--text2);
  padding-left: 20px;
  position: relative;
  line-height: 1.6;
}
.pricing-features li::before{
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.pricing-btn{
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  -webkit-appearance: none;
}
.pricing-btn.primary{ background: var(--red); color: #fff; }
.pricing-btn.primary:active{ opacity: 0.85; }
.pricing-btn.outline{
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: default;
}

/* ========== 我的页面 ========== */
.user-card{
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 20px;
  margin: 12px 16px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.user-avatar{ font-size: 48px; line-height: 1; }
.user-info{ flex: 1; }
.user-name{ font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.user-plan{ font-size: 14px; color: var(--text2); }

.login-btn{
  padding: 10px 22px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  -webkit-appearance: none;
  white-space: nowrap;
}
.login-btn:active{ opacity: 0.85; }

.quota-card{
  margin: 0 16px 20px;
  padding: 28px 20px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}
.quota-title{ font-size: 14px; color: var(--text2); margin-bottom: 10px; }
.quota-number{
  font-size: 60px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 16px;
}
.quota-bar{
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.quota-bar-fill{
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: 4px;
  transition: width 0.4s;
}
.quota-sub{ font-size: 13px; color: var(--muted); }

.menu-list{
  margin: 0 16px 24px;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
}
.menu-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--card);
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
  -webkit-tap-highlight-color: transparent;
}
.menu-item:last-child{ border-bottom: none; }
.menu-item:active{ background: var(--card2); }
.menu-arrow{ color: var(--muted); font-size: 16px; }

/* ====== 底部导航 ====== */
#bottomNav{
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 500px;
  margin: 0 auto;
  background: rgba(21,21,48,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 8px 0;
  padding-bottom: calc(8px + var(--safe-b));
  z-index: 200;
}
.nav-item{
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  min-height: 52px;
  justify-content: center;
}
.nav-item.active{ color: var(--red); }
.nav-icon{ font-size: 24px; line-height: 1; }
.nav-label{ font-size: 12px; font-weight: 600; }

/* ====== Toast ====== */
.toast{
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  padding: 12px 28px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.4s forwards;
  white-space: nowrap;
  max-width: 90%;
  pointer-events: none;
}
.toast-error{ background: var(--red); color: #fff; }
.toast-success{ background: var(--green); color: #fff; }
.toast-info{ background: var(--card); color: var(--text); border: 1px solid var(--border); }

@keyframes toastIn{
  from{ opacity:0; transform:translateX(-50%) translateY(-12px); }
  to{ opacity:1; transform:translateX(-50%) translateY(0); }
}
@keyframes toastOut{
  from{ opacity:1; }
  to{ opacity:0; }
}

/* ====== 响应式（大屏居中） ====== */
@media (min-width: 501px){
  #app{
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}
