:root {
  --bg: #080b10;
  --bg-soft: #0b1017;
  --panel: #0d131b;
  --panel-2: #111924;
  --line: #1d2733;
  --line-soft: #16202b;
  --text: #f3f6f8;
  --muted: #83909e;
  --muted-2: #5f6b78;
  --accent: #84ffb1;
  --accent-soft: rgba(132, 255, 177, .11);
  --danger: #ff7b80;
  --danger-soft: rgba(255, 123, 128, .10);
  --warning: #ffd978;
  --blue: #7aa7ff;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0,0,0,.24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% -10%, rgba(85, 122, 255, .08), transparent 27%),
    radial-gradient(circle at 88% 0%, rgba(132, 255, 177, .05), transparent 22%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.topbar {
  height: 68px;
  display: grid;
  grid-template-columns: auto minmax(280px, 640px) auto;
  gap: 28px;
  align-items: center;
  padding: 0 max(24px, calc((100vw - 1540px) / 2));
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 11, 16, .86);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: inline-grid; place-items: center;
  color: #07100a; background: var(--accent); font-weight: 900; letter-spacing: -.04em;
  box-shadow: 0 0 25px rgba(132,255,177,.18);
}
.brand-mark.small { width: 24px; height: 24px; border-radius: 7px; font-size: 12px; }
.brand-word { font-size: 18px; font-weight: 800; letter-spacing: -.04em; }
.brand-beta { color: var(--muted-2); font-size: 9px; border: 1px solid var(--line); padding: 3px 5px; border-radius: 5px; }

.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap input {
  width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: #0b1118; color: var(--text); padding: 0 56px 0 40px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.search-wrap input::placeholder { color: #586675; }
.search-wrap input:focus { border-color: #344353; background: #0e151e; box-shadow: 0 0 0 4px rgba(132,255,177,.04); }
.search-icon { position: absolute; left: 14px; color: var(--muted); font-size: 20px; z-index: 1; }
.search-wrap kbd { position: absolute; right: 10px; color: var(--muted-2); background: #111923; border: 1px solid #24303d; border-radius: 6px; padding: 3px 6px; font-size: 10px; }
.search-results {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  padding: 8px; background: #0c1219; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); max-height: 320px; overflow: auto;
}
.search-results.show { display: block; }
.search-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; text-align: left; padding: 10px 12px; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.search-item:hover, .search-item.active { background: #131c26; }
.search-item strong { font-size: 13px; }
.search-item span { color: var(--muted); font-size: 12px; }

.topnav { justify-self: end; display: flex; align-items: center; gap: 3px; }
.nav-link { border: 0; background: transparent; color: var(--muted); padding: 9px 11px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.nav-link:hover, .nav-link.active { color: var(--text); background: #101720; }
.mobile-menu-btn { display: none !important; }
.icon-btn { border: 1px solid var(--line); background: var(--panel); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; }

.main-content { width: min(1540px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 40px; }
.hero-strip { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; padding: 24px 4px 28px; }
.eyebrow, .section-kicker { color: var(--accent); font-weight: 800; letter-spacing: .11em; font-size: 10px; }
.hero-strip h1 { font-size: clamp(31px, 4vw, 54px); line-height: 1.03; letter-spacing: -.055em; margin: 10px 0 12px; max-width: 720px; }
.hero-strip h1 span { color: var(--accent); }
.hero-strip p { color: var(--muted); max-width: 760px; margin: 0; line-height: 1.75; font-size: 14px; }
.hero-status { min-width: 240px; display: flex; gap: 11px; align-items: center; justify-content: flex-end; padding-bottom: 4px; }
.hero-status strong, .hero-status small { display: block; }
.hero-status strong { font-size: 12px; }
.hero-status small { margin-top: 4px; color: var(--muted-2); font-size: 10px; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(132,255,177,.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(132,255,177,0); } 100% { box-shadow: 0 0 0 0 rgba(132,255,177,0); } }

.ticker-strip { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; margin-bottom: 16px; background: #0b1017; }
.ticker-card { min-width: 0; border: 0; border-right: 1px solid var(--line-soft); background: transparent; padding: 12px 14px; text-align: left; cursor: pointer; }
.ticker-card:last-child { border-right: 0; }
.ticker-card:hover { background: #0f1720; }
.ticker-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ticker-top strong { font-size: 12px; }
.ticker-top span { font-size: 10px; color: var(--muted-2); white-space: nowrap; }
.ticker-price { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.ticker-price b { font-size: 13px; }
.ticker-price em { font-size: 10px; font-style: normal; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(350px, .78fr); gap: 16px; }
.chart-column, .right-column { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: linear-gradient(180deg, rgba(15,22,31,.98), rgba(11,17,24,.98)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 0 rgba(255,255,255,.01) inset; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 22px 16px; }
.panel-head.compact { padding: 18px 20px 14px; border-bottom: 1px solid var(--line-soft); }
.panel-head h3 { margin: 5px 0 0; font-size: 15px; letter-spacing: -.02em; }
.symbol-row { display: flex; align-items: center; gap: 9px; }
.symbol-row h2 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.symbol-code { font-size: 11px; color: var(--muted); }
.market-tag { font-size: 9px; color: var(--blue); background: rgba(122,167,255,.09); border: 1px solid rgba(122,167,255,.16); padding: 3px 5px; border-radius: 5px; }
.price-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 9px; }
.price-row strong { font-size: 27px; letter-spacing: -.04em; }
.price-change { font-size: 12px; font-weight: 800; }
.positive { color: var(--accent) !important; }
.negative { color: var(--danger) !important; }
.muted { color: var(--muted-2); font-size: 10px; }
.chart-actions { display: flex; align-items: center; gap: 12px; }
.period-tabs { display: flex; background: #0a0f15; border: 1px solid var(--line-soft); border-radius: 8px; padding: 3px; }
.period-tabs button { border: 0; background: transparent; color: var(--muted-2); padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 10px; }
.period-tabs button.active { background: #17202a; color: var(--text); }
.ghost-btn, .text-btn { border: 0; background: transparent; cursor: pointer; }
.ghost-btn { border: 1px solid var(--line); color: var(--muted); padding: 8px 10px; border-radius: 8px; font-size: 10px; }
.text-btn { color: var(--muted); font-size: 10px; padding: 5px; }
.text-btn:hover { color: var(--accent); }

.chart-stage { height: 390px; position: relative; padding: 0 14px; }
#priceChart { width: 100%; height: 100%; display: block; }
.chart-hint { position: absolute; left: 24px; bottom: 16px; color: var(--muted-2); font-size: 9px; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.event-dot-mini { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 3px rgba(255,217,120,.08); }
.chart-tooltip { display: none; position: fixed; z-index: 100; width: 290px; background: rgba(10,15,21,.98); border: 1px solid #2a3643; border-radius: 11px; padding: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.38); pointer-events: none; }
.chart-tooltip.show { display: block; }
.tooltip-date { color: var(--muted-2); font-size: 9px; }
.tooltip-price { font-size: 15px; font-weight: 800; margin: 4px 0 8px; }
.tooltip-event { border-top: 1px solid var(--line-soft); padding-top: 8px; }
.tooltip-event strong { display: block; font-size: 11px; line-height: 1.45; }
.tooltip-event span { display: block; color: var(--muted); font-size: 9px; margin-top: 5px; }
.chart-footer { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-soft); }
.chart-footer > div { padding: 12px 18px; border-right: 1px solid var(--line-soft); }
.chart-footer > div:last-child { border-right: 0; }
.chart-footer span, .chart-footer strong { display: block; }
.chart-footer span { color: var(--muted-2); font-size: 9px; }
.chart-footer strong { margin-top: 4px; font-size: 11px; }

.event-timeline { padding: 2px 20px 8px; }
.event-row { display: grid; grid-template-columns: 76px 12px minmax(0,1fr) auto; gap: 12px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.event-row:last-child { border-bottom: 0; }
.event-date { color: var(--muted-2); font-size: 9px; padding-top: 3px; }
.event-axis { position: relative; min-height: 60px; }
.event-axis::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: -24px; width: 1px; background: #26323f; }
.event-row:last-child .event-axis::before { display: none; }
.event-axis i { display: block; width: 11px; height: 11px; border-radius: 50%; background: #111821; border: 2px solid var(--warning); position: relative; z-index: 1; }
.event-copy h4 { margin: 0; font-size: 12px; line-height: 1.5; }
.event-copy p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.event-source { display: flex; align-items: center; gap: 7px; margin-top: 8px; color: var(--muted-2); font-size: 9px; }
.source-badge { color: var(--text); background: #16202a; border: 1px solid #24303b; padding: 3px 6px; border-radius: 5px; }
.impact { text-align: right; min-width: 72px; }
.impact strong { font-size: 10px; }
.impact-meter { width: 72px; height: 4px; background: #18222c; border-radius: 99px; margin-top: 8px; overflow: hidden; }
.impact-meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; }
.metric { padding: 16px 18px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.metric:nth-child(even) { border-right: 0; }
.metric:nth-last-child(-n+2) { border-bottom: 0; }
.metric span, .metric strong { display: block; }
.metric span { color: var(--muted-2); font-size: 9px; }
.metric strong { margin-top: 6px; font-size: 13px; }
.live-chip { color: var(--muted); font-size: 8px; border: 1px solid var(--line); border-radius: 99px; padding: 5px 7px; display: flex; gap: 5px; align-items: center; }
.live-chip span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.source-filter { display: flex; gap: 6px; padding: 12px 16px 2px; overflow-x: auto; }
.source-filter button { flex: 0 0 auto; border: 1px solid var(--line-soft); background: transparent; color: var(--muted-2); border-radius: 99px; padding: 5px 8px; font-size: 8px; cursor: pointer; }
.source-filter button.active { color: var(--text); background: #17202a; border-color: #293542; }
.news-list { padding: 4px 16px 12px; }
.news-item { display: block; color: inherit; text-decoration: none; padding: 13px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.news-item:last-child { border-bottom: 0; }
.news-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted-2); font-size: 8px; }
.news-meta strong { color: var(--muted); font-size: 8px; }
.news-item h4 { margin: 7px 0 5px; font-size: 11px; line-height: 1.5; font-weight: 700; }
.news-item p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.news-score { color: var(--accent) !important; }
.news-item:hover h4 { color: var(--accent); }

.watchlist { padding: 4px 14px 12px; }
.watch-row { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; padding: 11px 4px; text-align: left; cursor: pointer; }
.watch-row:last-child { border-bottom: 0; }
.watch-row:hover { opacity: .78; }
.watch-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.stock-avatar { width: 28px; height: 28px; border-radius: 8px; background: #15202a; border: 1px solid #22303d; display: grid; place-items: center; font-size: 9px; font-weight: 800; }
.watch-main strong, .watch-main small { display: block; }
.watch-main strong { font-size: 10px; }
.watch-main small { color: var(--muted-2); font-size: 8px; margin-top: 3px; }
.watch-value { text-align: right; }
.watch-value strong, .watch-value small { display: block; }
.watch-value strong { font-size: 10px; }
.watch-value small { font-size: 8px; margin-top: 3px; }

.secondary-view.hidden, .workspace.hidden { display: none; }
.page-panel { min-height: 640px; padding: 34px; }
.page-title { max-width: 780px; margin-bottom: 28px; }
.page-title h2, .about-page h2 { font-size: clamp(30px,4vw,52px); letter-spacing: -.055em; margin: 10px 0 12px; }
.page-title p, .about-lead { color: var(--muted); line-height: 1.8; font-size: 14px; }
.news-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.global-news-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: #0b1118; min-height: 190px; }
.global-news-card:hover { border-color: #31404f; }
.global-news-card .news-meta { margin-bottom: 15px; }
.global-news-card h3 { font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.global-news-card p { color: var(--muted); font-size: 10px; line-height: 1.6; margin: 0; }
.about-page { padding-bottom: 70px; }
.about-page > .section-kicker { display: block; }
.about-lead { max-width: 760px; font-size: 16px; }
.about-lead strong { color: var(--text); }
.principle-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 40px; }
.principle-grid article { background: #0a1016; border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.principle-grid article > span { color: var(--accent); font-size: 10px; font-weight: 800; }
.principle-grid h3 { font-size: 15px; margin: 22px 0 8px; }
.principle-grid p { color: var(--muted); font-size: 11px; line-height: 1.7; margin: 0; }

.footer { width: min(1540px, calc(100% - 48px)); margin: 0 auto; border-top: 1px solid var(--line-soft); padding: 24px 2px 30px; display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; color: var(--muted-2); font-size: 9px; }
.footer-brand { display: flex; align-items: center; gap: 8px; color: var(--text); }
.footer p { margin: 0; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #f2f6f4; color: #0a0e12; padding: 10px 14px; border-radius: 9px; font-size: 11px; font-weight: 700; transition: .2s; z-index: 200; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1180px) {
  .ticker-strip { grid-template-columns: repeat(3, 1fr); }
  .ticker-card:nth-child(3) { border-right: 0; }
  .ticker-card:nth-child(-n+3) { border-bottom: 1px solid var(--line-soft); }
  .workspace { grid-template-columns: 1fr; }
  .right-column { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .watchlist-panel { grid-column: 1 / -1; }
  .news-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 12px; padding: 0 16px; }
  .topnav { display: none; position: absolute; top: 60px; right: 16px; padding: 8px; background: #0c1219; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
  .topnav.show { display: flex; flex-direction: column; align-items: stretch; }
  .mobile-menu-btn { display: block !important; }
  .brand-beta, .search-wrap kbd { display: none; }
  .main-content, .footer { width: min(100% - 28px, 1540px); }
  .hero-strip { align-items: flex-start; flex-direction: column; gap: 20px; padding-top: 20px; }
  .hero-status { justify-content: flex-start; }
  .chart-head { align-items: flex-start; flex-direction: column; }
  .chart-actions { width: 100%; justify-content: space-between; }
  .chart-stage { height: 330px; }
  .right-column { grid-template-columns: 1fr; }
  .watchlist-panel { grid-column: auto; }
  .news-grid, .principle-grid { grid-template-columns: 1fr; }
  .footer { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { justify-content: center; }
}

@media (max-width: 560px) {
  .brand-word { display: none; }
  .topbar { grid-template-columns: auto minmax(0,1fr) auto; }
  .search-wrap input { padding-right: 12px; font-size: 11px; }
  .ticker-strip { grid-template-columns: repeat(2,1fr); }
  .ticker-card:nth-child(2n) { border-right: 0; }
  .ticker-card:nth-child(3) { border-right: 1px solid var(--line-soft); }
  .ticker-card:nth-child(-n+4) { border-bottom: 1px solid var(--line-soft); }
  .hero-strip h1 { font-size: 35px; }
  .panel-head { padding-left: 16px; padding-right: 16px; }
  .period-tabs button { padding: 6px; }
  .chart-stage { height: 290px; padding: 0 6px; }
  .chart-footer { grid-template-columns: 1fr 1fr; }
  .chart-footer > div:nth-child(2) { border-right: 0; }
  .chart-footer > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .event-row { grid-template-columns: 60px 10px minmax(0,1fr); }
  .impact { grid-column: 3; text-align: left; }
  .impact-meter { width: 100%; max-width: 150px; }
  .page-panel { padding: 24px 18px; }
}
