:root {
  --bg: #07101e;
  --panel: #0f1b2f;
  --panel-2: #13223a;
  --text: #edf4ff;
  --muted: #95a3b8;
  --border: #24344e;
  --green: #35d07f;
  --red: #ff5f6d;
  --yellow: #f0b90b;
  --blue: #4ea1ff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
body { padding-bottom: 96px; }
button { font: inherit; color: inherit; }

.hero {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 12px 16px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: radial-gradient(circle at top right, rgba(78,161,255,.25), transparent 35%), linear-gradient(180deg, #101d32, #07101e);
}
.eyebrow { color: var(--blue); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 4px 0; font-size: 24px; }
h2 { margin: 0; font-size: 18px; }
p { line-height: 1.55; }
.muted { color: var(--muted); }
.tiny-muted { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 4px; }
.good { color: var(--green); }
.bad { color: var(--red); }

.icon-btn, .text-btn, .tab {
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 8px 12px;
}
.text-btn { color: var(--blue); background: transparent; }
.icon-btn { background: #1f6feb; }
.text-link { color: var(--blue); text-decoration: none; font-size: 14px; white-space: nowrap; }

main { padding: 12px; }
.page { display: none; }
.page.active { display: block; }
.card {
  background: rgba(15, 27, 47, .96);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
.card-title { color: var(--muted); margin-bottom: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric {
  background: #0a1424;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
}
.metric .label { color: var(--muted); font-size: 12px; }
.metric .value { font-size: 18px; font-weight: 760; margin-top: 4px; }

.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.tab.active { border-color: var(--blue); background: rgba(78,161,255,.18); color: var(--blue); }
.scan-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0a1424;
  margin: 12px 0;
}
.scan-status-title { font-size: 13px; font-weight: 800; margin-bottom: 2px; }
.scan-status-time { color: var(--blue); font-size: 12px; white-space: nowrap; }

.token-list { display: grid; gap: 8px; }
.token-row {
  width: 100%;
  border: 1px solid var(--border);
  background: #0a1424;
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  text-align: left;
}
.token-main { display: grid; gap: 4px; min-width: 0; }
.symbol { font-weight: 800; letter-spacing: .02em; }
.reason { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score { text-align: right; font-size: 18px; font-weight: 800; }
.tag { font-size: 11px; padding: 3px 7px; border-radius: 999px; background: #15243d; color: var(--muted); display: inline-block; width: fit-content; }
.tag.good { color: var(--green); background: rgba(53,208,127,.12); }
.tag.bad { color: var(--red); background: rgba(255,95,109,.12); }

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-block; border: 1px solid var(--border); border-radius: 999px; padding: 6px 9px; color: var(--muted); font-size: 12px; }
.pill.good { color: var(--green); }
.pill.bad { color: var(--red); }
.pill.yellow { color: var(--yellow); }

.analysis-hero {
  background:
    radial-gradient(circle at 12% 0%, rgba(78,161,255,.16), transparent 32%),
    rgba(15, 27, 47, .96);
}
.chart-workbench {
  padding: 12px;
}
.chart-block {
  border: 1px solid rgba(36,52,78,.75);
  border-radius: 16px;
  padding: 10px;
  background: rgba(10, 20, 36, .72);
  margin-top: 10px;
}
.subsection-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 800;
}
.research-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 9px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(78,161,255,.10), rgba(53,208,127,.06));
}
.research-summary div {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.research-summary strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-footnote {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  padding: 9px 10px 10px;
  border-top: 1px solid var(--border);
}
.mini-chart {
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #050b15;
}
.mini-chart svg { display: block; width: 100%; height: auto; min-height: 260px; }
.tradingview-chart {
  width: 100%;
  height: clamp(360px, 64vh, 460px);
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #050b15;
}
.tradingview-chart iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.tv-widget-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
}
.tradingview-widget-container__widget {
  width: 100%;
  height: 100%;
}
.tv-load-note {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(78,161,255,.25);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(7,16,30,.78);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
}
.inline-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(78,161,255,.10), rgba(53,208,127,.04));
}
.inline-chart-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.inline-kline-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 260px;
}
.inline-chart-empty {
  height: 100%;
  min-height: 320px;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}
.flow-block {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0a1424;
  padding: 10px;
  margin-bottom: 10px;
}
.flow-block h3 { margin: 0 0 8px; font-size: 15px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 4px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
th { color: var(--muted); font-weight: 600; }

.profile-box { padding: 12px; background: #0a1424; border-radius: 14px; border: 1px solid var(--border); }
.safe-list { color: var(--muted); line-height: 1.8; padding-left: 20px; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
  background: rgba(7,16,30,.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 4px;
  border-radius: 12px;
}
.nav-item.active { color: var(--text); background: var(--panel-2); }

.skeleton {
  height: 62px;
  border-radius: 14px;
  background: linear-gradient(90deg, #0b1525, #172944, #0b1525);
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0% { opacity:.55; } 50% { opacity:1; } 100% { opacity:.55; } }

@media (max-width: 380px) {
  .bottom-nav { gap: 4px; padding-left: 6px; padding-right: 6px; }
  .nav-item { font-size: 12px; padding: 9px 2px; }
  h1 { font-size: 22px; }
  .tradingview-chart { height: 360px; }
  .research-summary { grid-template-columns: 1fr; }
  .subsection-title { display: grid; }
}

@media (max-width: 640px) {
  main { padding: 10px; }
  .tradingview-chart { height: 360px; }
  .chart-workbench { padding: 10px; }
}
