:root {
  --bg: #070b14;
  --panel: rgba(10, 18, 35, 0.46);
  --panel-strong: rgba(12, 22, 45, 0.62);
  --line: rgba(110, 170, 255, 0.18);
  --text: rgba(235, 245, 255, 0.92);
  --muted: rgba(235, 245, 255, 0.62);
  --cyan: #56f0ff;
  --blue: #1f7bff;
  --gold: #f5c35c;
  --red: #ff4b4b;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: radial-gradient(1200px 800px at 70% 30%, rgba(60, 140, 255, 0.16), transparent 60%),
    radial-gradient(800px 600px at 30% 80%, rgba(90, 255, 225, 0.10), transparent 65%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei",
    "Noto Sans CJK SC", sans-serif;
  overflow: hidden;
}

#app {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 18, 35, 0.55), rgba(10, 18, 35, 0.28));
  backdrop-filter: blur(10px);
}

.title__main {
  font-weight: 700;
  letter-spacing: 0.6px;
  font-size: 18px;
}

.title__sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.status {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
}

.stage {
  position: relative;
}

#threeCanvas {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.searchbar,
.hud,
.footer,
#infoPanel,
#newsPanel {
  transition: opacity 520ms ease, transform 520ms ease;
}

.landingHero {
  position: absolute;
  inset: 0 auto 0 0;
  width: min(820px, 62vw);
  max-width: none;
  padding: clamp(20px, 3.6vw, 56px);
  display: grid;
  align-content: center;
  z-index: 6;
  pointer-events: none;
}

.landingHero__content {
  pointer-events: auto;
  display: grid;
  gap: 14px;
}

.landingHero__line {
  line-height: 1.06;
  letter-spacing: 0.2px;
  font-weight: 700;
  font-size: clamp(34px, 4.2vw, 66px);
  white-space: nowrap;
  opacity: 0.92;
}

.landingHero__line--primary {
  color: rgba(255, 255, 255, 0.92);
}

.landingHero__line--gradient {
  background: linear-gradient(90deg, rgba(86, 240, 255, 0.95), rgba(31, 123, 255, 0.95), rgba(245, 195, 92, 0.95));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.88;
}

.landingHero__go {
  width: max-content;
  margin-top: 6px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(110, 170, 255, 0.26);
  background: rgba(0, 0, 0, 0.14);
  color: rgba(235, 245, 255, 0.92);
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.6px;
  backdrop-filter: blur(10px);
}

.landingHero__go:hover {
  border-color: rgba(86, 240, 255, 0.40);
  background: rgba(86, 240, 255, 0.06);
}

body.is-landing #threeCanvas {
  left: 28%;
  width: auto;
  transform: translateX(12vw);
  transition: left 980ms cubic-bezier(0.18, 0.84, 0.16, 1);
}

body:not(.is-landing) #threeCanvas {
  transform: translateX(0);
  transition: left 980ms cubic-bezier(0.18, 0.84, 0.16, 1);
}

body.is-landing .landingHero {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 520ms ease, transform 520ms ease;
}

body:not(.is-landing) .landingHero {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 520ms ease, transform 520ms ease;
}

body.is-landing .searchbar,
body.is-landing .footer,
body.is-landing #infoPanel,
body.is-landing #newsPanel {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.stockPanel {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 50vw;
  height: 240px;
  z-index: 6;
  pointer-events: auto;
  display: grid;
  grid-template-rows: auto 1fr;
}

.stockPanel__content {
  padding: 12px 14px 14px 14px;
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.stockPanel__hint {
  font-size: 12px;
  color: rgba(235, 245, 255, 0.62);
  min-height: 16px;
}

.stockQuote {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
}

.stockQuote__left {
  display: grid;
  gap: 6px;
}

.stockQuote__name {
  font-size: 12px;
  font-weight: 700;
  color: rgba(235, 245, 255, 0.88);
}

.stockQuote__price {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: rgba(235, 245, 255, 0.92);
}

.stockQuote__spark {
  width: 140px;
  height: 44px;
  display: grid;
  align-items: center;
}

.stockQuote__right {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.stockQuote__badge {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgba(110, 170, 255, 0.18);
  background: rgba(0, 0, 0, 0.14);
  color: rgba(235, 245, 255, 0.92);
  min-width: 84px;
  text-align: center;
}

.stockQuote__delta {
  font-size: 12px;
  color: rgba(235, 245, 255, 0.62);
}

.stockQuote__badge.is-up {
  border-color: rgba(255, 75, 75, 0.32);
  background: rgba(255, 75, 75, 0.12);
}

.stockQuote__badge.is-down {
  border-color: rgba(62, 214, 126, 0.32);
  background: rgba(62, 214, 126, 0.10);
}

.stockQuote__spark svg {
  width: 100%;
  height: 100%;
}

.stockSpark__line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stockSpark__area {
  opacity: 0.18;
}

.stockQuote__spark.is-up .stockSpark__line {
  stroke: rgba(255, 75, 75, 0.92);
}

.stockQuote__spark.is-up .stockSpark__area {
  fill: rgba(255, 75, 75, 0.92);
}

.stockQuote__spark.is-down .stockSpark__line {
  stroke: rgba(62, 214, 126, 0.92);
}

.stockQuote__spark.is-down .stockSpark__area {
  fill: rgba(62, 214, 126, 0.92);
}

body.is-landing .stockPanel {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 520ms ease, transform 520ms ease;
}

body:not(.is-landing) .stockPanel {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 520ms ease, transform 520ms ease;
}

.searchbar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 32px));
  height: 44px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 8px 0 12px;
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(14, 28, 58, 0.52), rgba(10, 18, 35, 0.22));
  z-index: 7;
}

.searchbar__input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: rgba(235, 245, 255, 0.92);
  font-size: 13px;
  letter-spacing: 0.2px;
}

.searchbar__input::placeholder {
  color: rgba(235, 245, 255, 0.48);
}

.searchbar__clear {
  width: 34px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(110, 170, 255, 0.20);
  background: rgba(0, 0, 0, 0.12);
  color: rgba(235, 245, 255, 0.75);
  cursor: pointer;
}

.searchbar__clear:hover {
  border-color: rgba(110, 170, 255, 0.32);
  color: rgba(235, 245, 255, 0.9);
}

.ai-assistant-btn {
  position: fixed;
  top: 62px;
  left: 14px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(110, 170, 255, 0.22);
  background: rgba(0, 0, 0, 0.16);
  color: rgba(235, 245, 255, 0.92);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.ai-assistant-btn:hover {
  border-color: rgba(86, 240, 255, 0.35);
  background: rgba(86, 240, 255, 0.06);
}

.ai-chat {
  position: fixed;
  top: 114px;
  left: 14px;
  z-index: 1100;
  width: min(420px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 140px));
  border-radius: 14px;
  border: 1px solid rgba(110, 170, 255, 0.18);
  background: linear-gradient(180deg, rgba(10, 18, 35, 0.65), rgba(10, 18, 35, 0.30));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
  display: none;
  overflow: hidden;
}

.ai-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(110, 170, 255, 0.18);
}

.ai-chat__title {
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(235, 245, 255, 0.78);
}

.ai-chat__close {
  width: 32px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(110, 170, 255, 0.20);
  background: rgba(0, 0, 0, 0.12);
  color: rgba(235, 245, 255, 0.75);
  cursor: pointer;
}

.ai-chat__close:hover {
  border-color: rgba(110, 170, 255, 0.32);
  color: rgba(235, 245, 255, 0.92);
}

.ai-chat__messages {
  padding: 12px;
  height: calc(100% - 52px - 64px);
  overflow: auto;
  display: grid;
  gap: 10px;
}

.ai-msg {
  display: grid;
  gap: 6px;
}

.ai-msg__role {
  font-size: 11px;
  color: rgba(235, 245, 255, 0.55);
}

.ai-msg__bubble {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(110, 170, 255, 0.16);
  background: rgba(0, 0, 0, 0.14);
  color: rgba(235, 245, 255, 0.92);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-msg--user .ai-msg__bubble {
  border-color: rgba(86, 240, 255, 0.22);
  background: rgba(86, 240, 255, 0.08);
}

.ai-chat__composer {
  padding: 10px 12px;
  border-top: 1px solid rgba(110, 170, 255, 0.18);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.ai-chat__input {
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(110, 170, 255, 0.20);
  background: rgba(0, 0, 0, 0.12);
  color: rgba(235, 245, 255, 0.92);
  padding: 0 12px;
  outline: none;
  font-size: 13px;
}

.ai-chat__send {
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(110, 170, 255, 0.22);
  background: rgba(0, 0, 0, 0.10);
  color: rgba(235, 245, 255, 0.88);
  cursor: pointer;
  font-size: 13px;
}

.ai-chat__send:hover {
  border-color: rgba(86, 240, 255, 0.35);
  background: rgba(86, 240, 255, 0.06);
  color: rgba(235, 245, 255, 0.96);
}

.ai-chat__images {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.ai-chat__imgCard {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(110, 170, 255, 0.16);
  background: rgba(0, 0, 0, 0.12);
  text-decoration: none;
  color: rgba(235, 245, 255, 0.92);
}

.ai-chat__imgCard:hover {
  border-color: rgba(86, 240, 255, 0.28);
  background: rgba(86, 240, 255, 0.06);
}

.ai-chat__img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-chat__imgTitle {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.searchbar__results {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  border-radius: 14px;
  border: 1px solid rgba(110, 170, 255, 0.18);
  background: rgba(8, 14, 28, 0.82);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.searchbar__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(110, 170, 255, 0.10);
}

.searchbar__item:last-child {
  border-bottom: 0;
}

.searchbar__item:hover {
  background: rgba(86, 240, 255, 0.08);
}

.searchbar__itemTitle {
  font-size: 12px;
  font-weight: 700;
  color: rgba(235, 245, 255, 0.92);
}

.searchbar__itemSub {
  margin-top: 4px;
  font-size: 11px;
  color: rgba(235, 245, 255, 0.62);
}

.searchbar__tag {
  align-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(110, 170, 255, 0.18);
  color: rgba(235, 245, 255, 0.72);
  background: rgba(0, 0, 0, 0.10);
  font-size: 11px;
}

.hud {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  z-index: 6;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(10, 18, 35, 0.55), rgba(10, 18, 35, 0.25));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

.card__title {
  padding: 12px 14px 8px 14px;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(235, 245, 255, 0.78);
}

.legend {
  width: 260px;
  pointer-events: auto;
}

.legend__bar {
  height: 10px;
  margin: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: linear-gradient(90deg, #ffffff 0%, #1f7bff 35%, #f5c35c 70%, #ff4b4b 100%);
  box-shadow: 0 0 18px rgba(90, 255, 225, 0.10);
}

.legend__labels {
  padding: 10px 14px 14px 14px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.panel {
  position: absolute;
  right: 16px;
  top: 70px;
  width: 320px;
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(14, 28, 58, 0.55), rgba(10, 18, 35, 0.22));
  z-index: 6;
}

.panel--news {
  top: auto;
  bottom: 70px;
}

.newsList {
  display: grid;
  gap: 10px;
}

.newsItem {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(110, 170, 255, 0.14);
  background: rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.newsItem:hover {
  border-color: rgba(86, 240, 255, 0.28);
  background: rgba(86, 240, 255, 0.06);
}

.newsItem__title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(235, 245, 255, 0.92);
  line-height: 1.45;
}

.newsItem__meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: rgba(235, 245, 255, 0.62);
}

.newsItem__tag {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(110, 170, 255, 0.18);
  background: rgba(0, 0, 0, 0.10);
  color: rgba(235, 245, 255, 0.72);
  white-space: nowrap;
}

.newsModalOverlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
}

.newsModal {
  width: min(720px, calc(100vw - 32px));
  max-height: min(78vh, 720px);
  overflow: auto;
  pointer-events: auto;
}

.newsModal__header {
  padding: 12px 14px 8px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(110, 170, 255, 0.10);
}

.newsModal__title {
  font-size: 14px;
  font-weight: 700;
  color: rgba(235, 245, 255, 0.92);
  line-height: 1.45;
}

.newsModal__close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(110, 170, 255, 0.22);
  background: rgba(0, 0, 0, 0.10);
  color: rgba(235, 245, 255, 0.88);
  cursor: pointer;
}

.newsModal__close:hover {
  border-color: rgba(86, 240, 255, 0.35);
  background: rgba(86, 240, 255, 0.06);
  color: rgba(235, 245, 255, 0.96);
}

.newsModal__content {
  padding: 12px 14px 14px 14px;
  color: rgba(235, 245, 255, 0.78);
  font-size: 12px;
  line-height: 1.7;
}

.newsModal__link {
  margin-top: 10px;
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(110, 170, 255, 0.22);
  background: rgba(0, 0, 0, 0.10);
  color: rgba(235, 245, 255, 0.88);
  text-decoration: none;
}

.newsModal__link:hover {
  border-color: rgba(86, 240, 255, 0.35);
  background: rgba(86, 240, 255, 0.06);
  color: rgba(235, 245, 255, 0.96);
}

.panel__content {
  padding: 0 14px 14px 14px;
  display: grid;
  gap: 10px;
}

.panel__row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: center;
}

.panel__label {
  font-size: 12px;
  color: rgba(235, 245, 255, 0.62);
}

.panel__value {
  font-size: 13px;
  color: rgba(235, 245, 255, 0.92);
  text-align: right;
}

.panel__hint .panel__value {
  grid-column: 1 / -1;
  text-align: left;
  font-size: 11px;
  color: rgba(235, 245, 255, 0.55);
}

.panel__actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

.panel__btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(110, 170, 255, 0.22);
  background: rgba(0, 0, 0, 0.10);
  color: rgba(235, 245, 255, 0.88);
  font-size: 12px;
  text-decoration: none;
}

.panel__btn:hover {
  border-color: rgba(86, 240, 255, 0.35);
  background: rgba(86, 240, 255, 0.06);
  color: rgba(235, 245, 255, 0.96);
}

.tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 12;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(110, 170, 255, 0.22);
  background: rgba(8, 14, 28, 0.78);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  color: rgba(235, 245, 255, 0.95);
  font-size: 12px;
  max-width: 260px;
}

.tooltip__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.tooltip__sub {
  margin-top: 6px;
  color: rgba(235, 245, 255, 0.72);
  line-height: 1.45;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 18, 35, 0.18), rgba(10, 18, 35, 0.55));
  backdrop-filter: blur(10px);
  font-size: 12px;
  color: rgba(235, 245, 255, 0.72);
}

.kbd {
  padding: 3px 8px;
  border: 1px solid rgba(110, 170, 255, 0.24);
  border-radius: 999px;
  color: rgba(235, 245, 255, 0.86);
  background: rgba(0, 0, 0, 0.10);
}

.sep {
  margin: 0 8px;
  color: rgba(235, 245, 255, 0.30);
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(110, 170, 255, 0.22);
  background: rgba(0, 0, 0, 0.10);
}

@media (max-width: 980px) {
  .panel {
    width: 280px;
  }
}

@media (max-width: 780px) {
  .panel {
    display: none;
  }
  .legend {
    width: 220px;
  }
}
