/* H5 移动端样式（手机竖屏） */
body { max-width: 520px; margin: 0 auto; min-height: 100vh; }

/* 顶部栏 */
.h5-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-2);
  border-bottom: 1px solid var(--card-border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.h5-header .logo { font-size: 16px; font-weight: 700; }
.h5-header .logo small { color: var(--muted); font-weight: 400; font-size: 11px; }
.h5-header .user { font-size: 12px; color: var(--muted); }
.h5-header .logout { cursor: pointer; color: var(--muted); font-size: 12px; }

/* 顶部操作区（刷新 + 用户菜单） */
.header-actions { display: flex; align-items: center; gap: 10px; }
.refresh-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--muted);
  cursor: pointer;
  flex: none;
  padding: 0;
}
.refresh-btn:active { background: var(--card); }
.refresh-btn.spinning svg { animation: h5-spin 0.7s linear infinite; }
@keyframes h5-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.h5-container { padding: 12px; }

/* 顶部状态条 */
.status-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--flat); display: inline-block; }
.status-dot.on { background: var(--down); }
.status-dot.off { background: var(--risk-high); }
.status-bar.offline { color: var(--risk-high); font-weight: 600; }

/* 摘要卡 */
.summary-card {
  background: linear-gradient(135deg, #1c2330, #16203a);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.summary-card .summary-text { font-size: 14px; line-height: 1.7; }

/* 资金面板 */
.fund-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fund-item { text-align: center; padding: 8px 4px; }
.fund-item .val { font-size: 18px; font-weight: 700; }
.fund-item .label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 指数列表 */
.index-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-border);
}
.index-row:last-child { border-bottom: none; }
.index-row .name { font-weight: 600; }
.index-row .price { font-size: 15px; font-weight: 700; }
.index-row .chg { font-size: 12px; min-width: 70px; text-align: right; }

/* 情绪面板 */
.emotion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.emotion-grid .item { padding: 6px 2px; }
.emotion-grid .val { font-size: 16px; font-weight: 700; }
.emotion-grid .label { font-size: 11px; color: var(--muted); }

/* 板块列表 */
.sector-row {
  display: flex;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 13px;
  gap: 8px;
}
.sector-row:last-child { border-bottom: none; }
.sector-row .num { width: 22px; text-align: center; font-weight: 700; color: var(--muted); flex: none; }
.sector-row .num.top { color: var(--risk-mid); }
.sector-row .name { flex: 1; }
.sector-row .tag { font-size: 10px; color: var(--risk-mid); margin-left: 4px; }
.sector-row .pct { font-weight: 700; min-width: 64px; text-align: right; }

/* 榜单 */
.rank-row {
  display: flex;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 13px;
  gap: 8px;
}
.rank-row:last-child { border-bottom: none; }
.rank-row .num { width: 22px; text-align: center; font-weight: 700; color: var(--muted); }
.rank-row .num.top { color: var(--risk-mid); }
.rank-row .code { color: var(--muted); font-size: 11px; }
.rank-row .pct { margin-left: auto; font-weight: 700; min-width: 64px; text-align: right; }
.rank-row .amt { margin-left: auto; font-weight: 700; min-width: 64px; text-align: right; }

/* 追踪面板 */
.track-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-border);
  gap: 8px;
  font-size: 13px;
}
.track-item:last-child { border-bottom: none; }
.track-item .info { flex: 1; }
.track-item .info .name { font-weight: 600; }
.track-item .info .news { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-item .nums { text-align: right; font-size: 12px; }
.track-item .del { color: var(--muted); cursor: pointer; font-size: 16px; padding: 2px 4px; }

.track-add { display: flex; gap: 8px; margin-top: 10px; position: relative; }
.track-add .input { flex: 1; }

/* 股票搜索下拉候选 */
.track-search-results {
  display: none;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  margin-top: 6px;
  -webkit-overflow-scrolling: touch;
}
.track-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border);
  cursor: pointer;
  font-size: 14px;
}
.track-search-item:last-child { border-bottom: none; }
.track-search-item:active { background: var(--card); }
.track-search-item .ts-name { font-weight: 600; }
.track-search-item .ts-code { color: var(--muted); font-size: 12px; }

/* 大盘分时量能入口 */
a.minute-entry { display: block; text-decoration: none; color: inherit; }
.minute-entry-inner { display: flex; align-items: center; justify-content: space-between; }
.minute-entry .me-info { flex: 1; }
.minute-entry .me-title { font-weight: 700; font-size: 14px; }
.minute-entry .me-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.minute-entry .me-arrow { font-size: 22px; color: var(--muted); margin-left: 8px; }

/* 外围 */
.global-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--card-border);
}
.global-row:last-child { border-bottom: none; }

/* 风险 */
.risk-item {
  border-left: 3px solid;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 6px;
  background: var(--bg-2);
  font-size: 13px;
}
.risk-item .risk-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.risk-item .risk-type { font-weight: 700; }

/* 盘前简报 */
.brief-line { padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--card-border); }
.brief-line:last-child { border-bottom: none; }

/* 登录页 */
.login-wrap { padding: 60px 24px; }
.login-logo { font-size: 22px; font-weight: 800; text-align: center; }
.login-sub { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 32px; }
#login-form { display: flex; flex-direction: column; gap: 14px; }
.login-btn { padding: 12px; font-size: 15px; }
.login-tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }

/* 分段标题 */
.section-title {
  font-size: 13px;
  font-weight: 700;
  margin: 16px 0 8px;
  color: var(--text);
  display: flex;
  align-items: center;
}
.section-title::before {
  content: "";
  width: 3px; height: 14px;
  background: var(--accent);
  border-radius: 2px;
  margin-right: 8px;
}

/* 双榜单并排 */
.rank-col-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 底部 tab 菜单 */
.h5-tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  display: flex;
  background: var(--bg-2);
  border-top: 1px solid var(--card-border);
  z-index: 200;
}
.h5-tabbar .tab-item {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 13px 2px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  border-top: 2px solid transparent;
  margin-top: -1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h5-tabbar .tab-item.active {
  color: var(--accent);
  font-weight: 700;
  border-top-color: var(--accent);
}
/* 底部菜单不遮挡内容 */
.h5-container { padding-bottom: 72px; }

/* 顶部用户下拉菜单 */
.h5-header .user { position: relative; display: flex; align-items: center; gap: 6px; }
.menu-toggle {
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: var(--bg-2);
  flex: none;
}
.menu-toggle::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
}
.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  min-width: 120px;
  overflow: hidden;
  z-index: 300;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.menu-item {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}
.menu-item:hover { background: var(--bg-2); }
.menu-item + .menu-item { border-top: 1px solid var(--card-border); }

/* 修改密码弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.modal {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-title { font-size: 15px; font-weight: 700; text-align: center; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* 单股查询结果 */
.quote-card { padding-top: 4px; }
.quote-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.quote-head .q-name { font-weight: 700; font-size: 15px; }
.quote-price { font-size: 30px; font-weight: 800; line-height: 1.2; }
.quote-chg { display: flex; gap: 12px; font-size: 14px; font-weight: 600; margin: 4px 0 12px; }
.quote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.q-item { background: var(--bg-2); border-radius: 8px; padding: 8px; text-align: center; }
.q-item .label { font-size: 11px; color: var(--muted); }
.q-item .val { font-size: 14px; font-weight: 600; margin-top: 2px; }
.quote-actions { margin-top: 12px; }
.quote-time { font-size: 11px; margin-top: 8px; text-align: right; }

/* 主力净流入单行展示 */
.fund-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-2);
  border-radius: 8px;
  padding: 12px 14px;
}
.fund-main .label { font-size: 13px; color: var(--muted); }
.fund-main .val { font-size: 20px; font-weight: 700; }

/* 个股权威新闻列表 */
.news-list { display: flex; flex-direction: column; }
.news-item { padding: 9px 0; border-bottom: 1px solid var(--card-border); }
.news-item:last-child { border-bottom: none; }
.news-title {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}
a.news-title:hover { color: var(--accent); }
.news-meta { display: flex; gap: 10px; font-size: 11px; color: var(--muted); margin-top: 3px; }
.news-summary { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* 复盘专区 */
.review-lines { display: flex; flex-direction: column; gap: 8px; }
.review-line {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  padding-left: 10px;
  position: relative;
}
.review-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.review-risks {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(255, 107, 107, 0.08);
  border-radius: 6px;
  font-size: 12px;
  color: var(--risk-high);
  line-height: 1.6;
}

/* 个股监控列表 */
.monitor-tip { font-size: 11px; color: var(--muted); margin-top: 8px; }
.monitor-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--card-border);
  gap: 10px;
  cursor: pointer;
}
.monitor-row:last-child { border-bottom: none; }
.monitor-row:active { background: var(--bg-2); }
.monitor-row .m-info { flex: 1; min-width: 0; }
.monitor-row .m-name { font-weight: 600; font-size: 14px; }
.monitor-row .m-code { font-size: 11px; color: var(--muted); margin-top: 2px; }
.monitor-row .m-price { font-size: 16px; font-weight: 700; min-width: 58px; text-align: right; }
.monitor-row .m-chg { font-size: 13px; font-weight: 600; min-width: 58px; text-align: right; }
.monitor-row .m-net { font-size: 12px; text-align: right; min-width: 60px; }
.monitor-row .m-net .m-net-label { color: var(--muted); margin-right: 4px; font-size: 11px; }
.monitor-row .m-del {
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  flex: none;
  line-height: 1;
}
.monitor-row .m-del:active { color: var(--risk-high); }

/* 实时要闻列表 */
.news-source {
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(88, 130, 255, 0.14);
  color: var(--accent);
  font-weight: 600;
}
.news-item .news-title { font-size: 14px; }
.news-item .news-meta { align-items: center; }

/* 板块行可点击 + 成分股弹层 */
.sector-row { cursor: pointer; }
.sector-row:active { background: var(--bg-2); }
.sector-row::after { content: "›"; color: var(--muted); font-size: 16px; flex: none; }

.sector-modal { max-height: 72vh; }
.sector-stock-list {
  overflow-y: auto;
  max-height: 52vh;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}
.sector-stock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 13px;
}
.sector-stock-row:last-child { border-bottom: none; }
.sector-stock-row .num { width: 20px; text-align: center; font-weight: 700; color: var(--muted); flex: none; }
.sector-stock-row .num.top { color: var(--risk-mid); }
.sector-stock-row .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sector-stock-row .info .name { font-weight: 600; }
.sector-stock-row .info .code { font-size: 11px; color: var(--muted); }
.sector-stock-row .price { font-weight: 600; }
.sector-stock-row .pct { font-weight: 700; min-width: 64px; text-align: right; }

/* 当日分时做T信号 */
.intraday-sigs { margin-top: 10px; }
.sig-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--card-border);
}
.sig-row:last-child { border-bottom: none; }
.sig-tag {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex: none;
}
.sig-b { background: var(--up); }
.sig-s { background: var(--down); }
.sig-name { font-size: 13px; font-weight: 600; color: var(--text); }
.sig-pts {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  justify-content: flex-end;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}
.sig-pt { white-space: nowrap; }
.intraday-tip {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* ================= 做T（T+0）页面 ================= */
.t-strategy { margin-bottom: 12px; padding: 10px 12px; background: var(--bg-2); border-radius: 8px; }
.ts-line { font-size: 12px; line-height: 1.6; color: var(--text); }
.ts-line b { color: var(--accent, #3b82f6); }
.t-env-grid { display: flex; gap: 8px; }
.env-item {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  background: var(--bg-2);
  border-radius: 8px;
}
.env-label { font-size: 11px; color: var(--muted); }
.env-val { font-size: 15px; font-weight: 700; margin-top: 3px; color: var(--text); }
.t-env-note { margin-top: 10px; font-size: 12px; line-height: 1.5; }

.t-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg-2);
  border-radius: 8px;
  font-size: 13px;
}
.t-selected-name { font-weight: 600; color: var(--text); }
.t-selected-code { color: var(--muted); font-size: 12px; }
.t-selected-clear { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 16px; padding: 0 4px; }

.t-pos-form { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.t-pos-form .input { flex: 1; min-width: 0; }

.t-pos-item { padding: 12px 0; border-bottom: 1px solid var(--card-border); }
.t-pos-item:last-child { border-bottom: none; }
.t-pos-head { display: flex; align-items: flex-start; gap: 8px; }
.t-info { flex: 1; min-width: 0; }
.t-name { font-size: 15px; font-weight: 700; color: var(--text); }
.t-code { font-size: 12px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.t-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.t-status { flex: none; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 10px; white-space: nowrap; }
.t-del { flex: none; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 4px; }

.t-buy { background: var(--up); color: #fff; }
.t-sell { background: var(--down); color: #fff; }
.t-fake { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.t-lean-long { background: rgba(225, 29, 72, 0.12); color: var(--up); }
.t-lean-short { background: rgba(5, 150, 105, 0.12); color: var(--down); }
.t-forbidden { background: var(--bg-2); color: var(--muted); }
.t-watch { background: var(--bg-2); color: var(--muted); }

.t-metrics { display: flex; margin-top: 10px; gap: 6px; }
.t-metric { flex: 1; text-align: center; padding: 6px 2px; background: var(--bg-2); border-radius: 8px; }
.tm-label { font-size: 11px; color: var(--muted); }
.tm-val { font-size: 13px; font-weight: 700; margin-top: 2px; color: var(--text); }

.t-sr { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.t-sr-item { font-size: 11px; color: var(--muted); }

.t-signal { margin-top: 10px; padding: 8px 10px; background: var(--bg-2); border-radius: 8px; }
.t-signal-title { display: flex; align-items: center; gap: 8px; }
.t-signal-action { font-size: 13px; font-weight: 700; color: var(--text); }
.t-signal-reason { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.t-signal-fake { border: 1px dashed rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.06); }
.sig-fake { background: #f59e0b; color: #fff; }
.t-signal-target { display: flex; gap: 16px; margin-top: 6px; font-size: 12px; font-weight: 600; }
.t-signal-target .tg-up { color: var(--up); }
.t-signal-target .tg-down { color: var(--down); }

.t-forbid { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.t-forbid-tag { font-size: 11px; color: var(--muted); background: var(--bg-2); padding: 2px 6px; border-radius: 4px; }
.t-quota { margin-top: 8px; font-size: 11px; }

/* 分时做T图 */
.t-chart { margin-top: 10px; padding: 8px; background: var(--bg-2); border-radius: 8px; }
.t-chart-canvas { display: block; width: 100%; }
.t-net-canvas { display: block; width: 100%; margin-top: 2px; }
.t-chart-legend { display: flex; gap: 14px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.t-chart-legend .lg { font-weight: 600; }
.t-chart-legend .lg-b { color: #e11d48; }
.t-chart-legend .lg-s { color: #059669; }
.t-chart-legend .lg-avg { color: #f59e0b; font-weight: 400; }
.t-chart-legend .lg-net { color: var(--muted); font-weight: 400; }

/* 做T信号日志 */
.sl-item { padding: 10px 0; border-bottom: 1px solid var(--card-border); }
.sl-item:last-child { border-bottom: none; }
.sl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sl-tag { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; color: #fff; }
.sl-buy { background: var(--up); }
.sl-sell { background: var(--down); }
.sl-none { background: var(--bg-2); color: var(--muted); }
.sl-name { font-size: 13px; font-weight: 600; color: var(--text); }
.sl-fake { font-size: 11px; color: #b45309; background: rgba(245, 158, 11, 0.16); padding: 1px 6px; border-radius: 4px; }
.sl-time { margin-left: auto; font-size: 11px; color: var(--muted); }
.sl-meta { margin-top: 6px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.sl-reason { margin-top: 4px; font-size: 12px; color: var(--text); line-height: 1.5; }
