/* 移动端量化终端 · 样式（手机优先，深色） */
:root {
  --bg: #0b0e14;
  --panel: #11151d;
  --panel-2: #161b26;
  --line: #1e2430;
  --text: #d8dee9;
  --muted: #8b94a6;
  --accent: #4c8dff;
  --up: #26a69a;
  --down: #ef5350;
  --buy: #3fb950;
  --stop: #f85149;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.hint { color: var(--muted); font-size: 12px; }

/* ---------- 横向滚动标签条 ---------- */
.strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex: 0 0 auto;
}
.strip::-webkit-scrollbar { display: none; }

.strip button {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all .15s ease;
}
.strip button.active {
  background: rgba(76, 141, 255, .14);
  border-color: var(--accent);
  color: #fff;
}
.strip button.dropped { opacity: .40; text-decoration: line-through; }

/* ---------- 上半：K 线区 ---------- */
#chart-panel {
  display: flex;
  flex-direction: column;
  flex: 0 0 52dvh;
  min-height: 240px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  flex: 0 0 auto;
}
#chart-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chart-title b { color: #fff; font-weight: 600; }
.bar-right { display: flex; gap: 6px; flex: 0 0 auto; }
.bar-right button {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.bar-right button:active { background: rgba(76, 141, 255, .16); }

#chart-stack { position: relative; flex: 1 1 auto; min-height: 0; }
.pane { position: absolute; inset: 0; display: none; }
.pane.active { display: block; }
#chart-stack .chart-host { position: absolute; inset: 0; }

#pane-macro { overflow-y: auto; padding: 10px 12px; }

.macro-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.macro-card h4 {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.macro-card .tone { font-size: 15px; font-weight: 600; }
.tone-risk-on { color: var(--up); }
.tone-risk-off { color: var(--down); }
.tone-neutral { color: var(--muted); }

#legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 12px 10px;
  font-size: 11px;
  color: var(--muted);
  flex: 0 0 auto;
}
#legend .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* ---------- 下半：报告阅读区 ---------- */
#reader-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--bg);
}

#report {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 14px 40px;
  font-size: 13.5px;
  line-height: 1.75;
  word-break: break-word;
}
#report h1 { font-size: 18px; margin: 14px 0 8px; }
#report h2 { font-size: 15px; margin: 18px 0 8px; color: #fff; border-left: 3px solid var(--accent); padding-left: 8px; }
#report h3 { font-size: 13.5px; margin: 14px 0 6px; color: #dbe4f3; }
#report p { margin: 8px 0; }
#report ul, #report ol { padding-left: 20px; margin: 8px 0; }
#report li { margin: 3px 0; }
#report table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 11.5px;
  border-radius: 8px;
}
#report table th, #report table td {
  border: 1px solid var(--line);
  padding: 5px 8px;
  white-space: nowrap;
}
#report table th { background: var(--panel-2); color: var(--muted); font-weight: 500; }
#report blockquote {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--line);
  background: rgba(76, 141, 255, .06);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
}
#report code {
  background: var(--panel-2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
}
#report strong { color: #fff; }
#report hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  background: rgba(28, 34, 46, .96);
  color: #fff;
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: all .22s ease;
  z-index: 99;
  max-width: 86vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 820px) {
  #app { flex-direction: row; }
  #chart-panel { flex: 1 1 58%; height: 100dvh; border-bottom: none; border-right: 1px solid var(--line); }
  #reader-panel { flex: 1 1 42%; height: 100dvh; }
  #app { height: 100dvh; }
}
