@import url("/static/lingxi_assets/css/tokens.css");
@import url("/static/lingxi_assets/css/layout.css");
@import url("/static/lingxi_assets/css/components.css");
@import url("/static/lingxi_assets/css/pages.css");

:root {
  --lx-sidebar-w: 160px;
  --app-red: #ef1f2d;
  --app-green: #0fa36b;
  --app-blue: #1267f2;
}

html {
  min-width: 1280px;
}

body {
  min-width: 1280px;
  overflow-x: auto;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.lx-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: currentColor;
  background-color: currentColor;
  -webkit-mask-image: var(--icon);
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-image: var(--icon);
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.lx-icon[data-hydrated="true"] {
  background-color: transparent;
  -webkit-mask-image: none;
  mask-image: none;
}

.lx-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  color: currentColor;
}

h1,
h2,
h3,
p {
  margin: 0;
  letter-spacing: 0;
}

.brand-logo {
  width: 154px;
  height: 38px;
}

.lx-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  grid-template-columns: 560px minmax(340px, 520px) auto;
  height: 56px;
  padding: 0 18px;
}

.lx-brand strong {
  display: none;
}

.lx-search {
  justify-self: center;
  max-width: 520px;
}

.lx-search img {
  width: 16px;
  height: 16px;
}

.lx-search input {
  width: 100%;
  height: 30px;
  border: 0;
  outline: 0;
}

.lx-search kbd {
  color: #8a94a8;
  font-family: inherit;
  font-size: 12px;
  white-space: nowrap;
}

.lx-top-actions {
  justify-content: flex-end;
  gap: 16px;
  white-space: nowrap;
}

.lx-top-actions select {
  height: 34px;
  width: 140px;
  padding: 0 10px;
  border: 1px solid var(--lx-border);
  border-radius: var(--lx-radius);
  color: var(--lx-text);
  background: #fff;
  font-weight: 700;
}

.top-icon {
  position: relative;
}

.top-icon b {
  position: absolute;
  top: -9px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--app-red);
  font-size: 10px;
}

.user-dot {
  color: var(--lx-text);
  font-weight: 700;
}

.health-pill {
  display: none;
}

.lx-shell {
  grid-template-columns: var(--lx-sidebar-w) minmax(0, 1fr);
}

.lx-sidebar {
  position: sticky;
  top: var(--lx-topbar-h);
  height: calc(100vh - var(--lx-topbar-h));
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  overflow-y: auto;
  padding: 34px 10px 12px;
}

.lx-nav-item {
  width: 100%;
  height: 47px;
  gap: 10px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  color: #172033;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 5px;
}

.lx-nav-item .lx-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.lx-nav-item.active,
.lx-nav-item.is-active {
  background: var(--lx-blue-strong);
  color: #fff;
}

.lx-main {
  min-width: 0;
  padding: 22px 16px 12px;
  overflow: visible;
}

.section-tabs {
  position: sticky;
  top: var(--lx-topbar-h);
  z-index: 20;
  display: flex;
  gap: 0;
  height: 46px;
  align-items: stretch;
  padding-left: 0;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--lx-border);
  backdrop-filter: blur(10px);
}

.section-tab {
  min-width: 92px;
  padding: 0 18px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #28344d;
  background: transparent;
  font-weight: 800;
}

.section-tab.active {
  color: var(--lx-blue-strong);
  border-bottom-color: var(--lx-blue-strong);
}

.lx-page-title { align-items: center; margin: 0 0 12px; }
.lx-page-title h1 { font-size: 22px; }
.lx-page-title h2 { margin-top: 5px; font-size: 18px; }

.page-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.text-action,
.inline-more {
  height: auto;
  padding: 0;
  border: 0;
  color: var(--lx-blue-strong);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.text-action:hover,
.inline-more:hover {
  text-decoration: underline;
}

.lx-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.lx-btn .lx-icon {
  width: 15px;
  height: 15px;
}

.lx-grid-kpi {
  grid-area: kpi;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.lx-kpi-card {
  position: relative;
  display: block;
  min-height: 176px;
  padding: 20px 22px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23, 32, 51, 0.07);
  overflow: hidden;
}

.lx-kpi-card .lx-kpi-label {
  color: #172033;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.lx-kpi-card .lx-kpi-value {
  color: var(--lx-blue-strong);
  margin-top: 8px;
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
}

.lx-kpi-card .lx-kpi-delta {
  margin-top: 14px;
  color: #647086;
  font-size: 14px;
}

.lx-kpi-card .lx-kpi-delta b {
  color: var(--app-red);
  font-weight: 900;
}

.lx-kpi-card.is-green .lx-kpi-value,
.lx-kpi-card.is-green .lx-kpi-delta b {
  color: var(--app-green);
}

.lx-kpi-card.is-red .lx-kpi-value,
.lx-kpi-card.is-red .lx-kpi-delta b {
  color: var(--app-red);
}

.lx-kpi-card.is-green .lx-kpi-icon {
  background: #eaf8f2;
}

.lx-kpi-card.is-red .lx-kpi-icon {
  background: #fff0f0;
}

.lx-kpi-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eff6ff;
}

.lx-kpi-icon .lx-icon {
  width: 29px;
  height: 29px;
  color: var(--lx-blue-strong);
}

.is-green .lx-kpi-icon .lx-icon {
  color: var(--app-green);
}

.is-red .lx-kpi-icon .lx-icon {
  color: var(--app-red);
}

.lx-sparkline {
  position: absolute;
  right: 26px;
  bottom: 20px;
  width: 120px;
  height: 32px;
}

.lx-sparkline polyline {
  fill: none;
  stroke: var(--lx-blue-strong);
  stroke-width: 2.2;
}

.is-green .lx-sparkline polyline {
  stroke: var(--app-green);
}

.is-red .lx-sparkline polyline {
  stroke: var(--app-red);
}

.home-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.2fr) minmax(360px, 0.86fr) minmax(330px, 0.78fr);
  grid-template-areas:
    "kpi kpi kpi"
    "review market decision"
    "history backtest decision";
  gap: 12px;
  align-items: start;
}

.review-card {
  grid-area: review;
  height: 416px;
  overflow: hidden;
}

.decision-card {
  grid-area: decision;
  min-height: calc(416px + 210px + 12px);
  overflow: hidden;
}

.history-card {
  grid-area: history;
  min-height: 210px;
}

.backtest-card {
  grid-area: backtest;
  min-height: 210px;
}

.market-card {
  grid-area: market;
  height: 416px;
  overflow: hidden;
}

.panel-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title-line img {
  width: 18px;
  height: 18px;
}

.review-brief {
  padding: 0 14px;
}

.brief-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  min-height: 57px;
  max-height: 62px;
  border-bottom: 1px solid #eaf0f8;
  overflow: hidden;
}

.brief-label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--lx-text);
  font-weight: 800;
}

.brief-label > span:not(.lx-icon),
.brief-label .brief-icon {
  width: 24px;
  height: 24px;
  color: var(--lx-blue-strong);
  font-size: 20px;
  text-align: center;
}

.brief-row.risk .brief-label span {
  color: var(--app-red);
}

.brief-row.risk .brief-label .brief-icon {
  color: var(--app-red);
}

.brief-row ul {
  margin: 0;
  padding: 8px 0 7px 20px;
  font-size: 12px;
  line-height: 1.42;
  overflow: hidden;
}

.review-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-height: 38px;
  padding: 0 14px;
  color: var(--lx-text-muted);
  font-size: 12px;
}

.review-footer span:first-child {
  margin-right: auto;
}

.full-review {
  display: none;
}

.decision-top {
  display: grid;
  grid-template-columns: 1fr 100px;
  grid-template-areas:
    "theme theme"
    "score radar"
    "dims dims";
  gap: 14px;
  align-items: center;
  padding: 14px 14px 12px;
  border-bottom: 1px solid #eaf0f8;
}

.decision-top span {
  display: block;
  color: var(--lx-text);
  font-weight: 800;
}

.decision-top > div:first-child {
  grid-area: theme;
  display: flex;
  align-items: center;
  gap: 10px;
}

.decision-top > div:first-child strong {
  display: inline;
  margin-top: 0;
  color: var(--lx-blue-strong);
  font-size: 26px;
  word-break: keep-all;
}

.strength-score {
  grid-area: score;
}

.strength-score strong {
  color: var(--lx-blue-strong);
  font-size: 56px;
  line-height: 0.9;
}

.strength-score span {
  display: inline;
  color: var(--lx-text-muted);
  font-size: 24px;
  font-weight: 800;
}

.radar {
  grid-area: radar;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  background:
    repeating-radial-gradient(circle, transparent 0 19px, #c9dcff 20px 21px),
    conic-gradient(from 18deg, rgba(47,128,237,0.12), rgba(47,128,237,0.04), rgba(47,128,237,0.14));
  clip-path: polygon(50% 0, 95% 35%, 78% 94%, 22% 94%, 5% 35%);
}

.radar div {
  width: 70%;
  height: 70%;
  background: rgba(47,128,237,0.42);
  clip-path: polygon(50% 5%, 88% 38%, 72% 84%, 27% 78%, 12% 35%);
}

.dimension-bars {
  grid-area: dims;
  display: grid;
  gap: 9px;
}

.dim-row {
  display: grid;
  grid-template-columns: 72px 1fr 48px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.dim-row .track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

.dim-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--lx-blue-strong);
}

.dim-row.green i {
  background: var(--app-green);
}

.dim-row.orange i {
  background: #f59e0b;
}

.decision-section,
.decision-list,
.recent-card {
  margin: 12px 14px 0;
  padding: 12px;
  border: 1px solid #eaf0f8;
  border-radius: var(--lx-radius);
  background: #fff;
}

.decision-section h3,
.decision-list h3,
.recent-card h3 {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.featured-stocks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stock-tile {
  min-height: 112px;
  padding: 11px;
  border: 1px solid var(--lx-border);
  border-radius: var(--lx-radius);
  background: #fbfdff;
}

.mood-chart {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 12px;
  align-items: center;
  padding: 8px 14px 0;
}

.mood-chart svg {
  width: 100%;
  height: 96px;
}

.mood-chart polyline {
  fill: none;
  stroke: var(--lx-blue-strong);
  stroke-width: 3;
}

.mood-chart strong {
  display: block;
  color: var(--app-green);
  font-size: 30px;
}

.mood-chart span {
  color: var(--app-green);
  font-size: 12px;
  font-weight: 800;
}

.market-subtitle {
  margin: 8px 14px 6px;
  font-size: 13px;
}

.hot-bars {
  display: grid;
  gap: 5px;
  padding: 0 14px;
}

.hot-row {
  display: grid;
  grid-template-columns: 76px 1fr 28px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.hot-row .bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

.hot-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef1f2d, #f59e0b, #0fa36b);
}

.market-distribution {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 14px 0;
}

.red-box,
.green-box {
  min-height: 48px;
  padding: 6px 8px;
  border-radius: 7px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.red-box { background: linear-gradient(135deg, #ef4444, #ef1f2d); }
.green-box { background: linear-gradient(135deg, #0fa36b, #05b56d); }
.red-box strong,
.green-box strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

.volume-bar {
  display: flex;
  justify-content: space-between;
  margin: 7px 14px 0;
  color: var(--lx-text-muted);
  font-size: 12px;
}

.volume-bar strong {
  color: var(--app-red);
  font-size: 20px;
}

.volume-bar em {
  color: var(--lx-text);
  font-size: 12px;
  font-style: normal;
}

.side-market {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--lx-border);
  border-radius: var(--lx-radius);
  background: #fff;
}

.side-market-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.market-index,
.side-market-grid span {
  color: var(--lx-text-muted);
  font-size: 12px;
}

.market-number {
  color: var(--app-red);
  font-weight: 900;
}

.market-number span {
  margin-left: 4px;
  font-size: 12px;
}

.side-chart {
  width: 100%;
  height: 54px;
}

.side-chart polyline {
  fill: none;
  stroke: var(--app-red);
  stroke-width: 2;
}

.side-market-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px;
  font-size: 12px;
}

.side-market-grid strong {
  color: var(--lx-blue-strong);
}

.stock-tile strong,
.stock-tile span {
  display: block;
}

.stock-tile small {
  display: inline-flex;
  margin-top: 10px;
  padding: 3px 9px;
  border-radius: 5px;
  color: #fff;
  background: var(--app-red);
  font-size: 12px;
  font-weight: 800;
}

.stock-tile b {
  display: block;
  margin-top: 10px;
  color: var(--app-red);
}

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-line {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.status-dot {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--app-red);
  font-size: 11px;
}

.status-dot.orange {
  background: #f59e0b;
}

.danger-text {
  color: var(--app-red);
}

.recent-perf {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.recent-perf strong {
  display: block;
  color: var(--lx-blue-strong);
  font-size: 18px;
}

.recent-perf span {
  color: var(--lx-text-muted);
  font-size: 12px;
}

.select-row {
  display: inline-flex;
  gap: 8px;
}

.select-row span {
  padding: 4px 9px;
  border: 1px solid var(--lx-border);
  border-radius: 6px;
  color: var(--lx-text-muted);
  font-size: 12px;
}

.history-table,
.backtest-panel {
  padding: 10px 12px 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table th,
.table td {
  padding: 8px;
  border-bottom: 1px solid #eaf0f8;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--lx-text-muted);
  background: #f8fafe;
  font-weight: 800;
}

.tag,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid #cfe1ff;
  border-radius: 6px;
  color: var(--lx-blue-strong);
  background: #f0f6ff;
  font-size: 12px;
  font-weight: 700;
}

.tag.green {
  color: var(--app-green);
  background: #eaf8f2;
  border-color: #b9e7d4;
}

.tag.orange {
  color: #b7791f;
  background: #fff7e8;
  border-color: #f5d49a;
}

.backtest-score {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 10px;
  border-bottom: 1px solid #eaf0f8;
}

.score-cell {
  padding: 8px 10px 12px;
  border-left: 1px solid #eaf0f8;
  text-align: center;
}

.score-cell:first-child {
  border-left: 0;
}

.score-cell strong {
  display: block;
  color: var(--lx-blue-strong);
  font-size: 24px;
}

.score-cell.red strong {
  color: var(--app-red);
}

.win-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.win-strip span {
  min-width: 22px;
  padding: 3px 5px;
  border-radius: 5px;
  color: var(--app-red);
  background: #fff0f0;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.win-strip span.loss {
  color: var(--app-green);
  background: #eaf8f2;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.content-card {
  padding: 14px;
}

.content-card h2 {
  margin-bottom: 12px;
  font-size: 16px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-layout {
  grid-template-columns: minmax(360px, 0.78fr) minmax(0, 1.22fr);
  align-items: start;
}

.detail-layout > .content-card:first-child {
  max-height: calc(100vh - 156px);
  overflow: auto;
}

.detail-panel {
  position: sticky;
  top: 118px;
}

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

.compact-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item {
  border-top: 1px solid #eaf0f8;
  padding-top: 10px;
}

.item:first-child {
  border-top: 0;
  padding-top: 0;
}

.item-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.item-body {
  margin-top: 6px;
  color: var(--lx-text-muted);
  line-height: 1.65;
  white-space: pre-wrap;
}

button.item-open {
  display: grid;
  width: 100%;
  height: auto;
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid #eaf0f8;
  border-radius: 0;
  color: var(--lx-text);
  background: transparent;
  text-align: left;
}

button.item-open.active .item-title span:first-child {
  color: var(--lx-blue-strong);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.detail-row {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--lx-border);
  border-radius: var(--lx-radius);
  background: #f8fafe;
}

.detail-row span {
  display: block;
  color: var(--lx-text-muted);
  font-size: 12px;
}

.detail-row strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.detail-block {
  display: grid;
  gap: 6px;
}

.detail-block h3 {
  margin-top: 10px;
}

.detail-chips {
  margin-top: 8px;
}

.detail-actions,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--lx-blue-strong);
  border-radius: var(--lx-radius);
  color: #fff;
  background: var(--lx-blue-strong);
  font-weight: 800;
  text-decoration: none;
}

.inline-action,
.session-button {
  color: var(--lx-blue-strong);
}

.session-button {
  display: grid;
  height: auto;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--lx-border);
  border-radius: var(--lx-radius);
  background: #fff;
  text-align: left;
}

.qa-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.qa-input input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--lx-border);
  border-radius: var(--lx-radius);
}

.qa-messages {
  min-height: 180px;
}

.section-gap {
  margin-top: 12px;
}

.markdown {
  max-height: 520px;
  overflow: auto;
  padding: 0 12px 12px;
  line-height: 1.72;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1440px) {
  .lx-topbar {
    grid-template-columns: 390px minmax(300px, 1fr) auto;
  }

  .page-actions .text-action {
    display: none;
  }

  .featured-stocks {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 960px) {
  html,
  body {
    min-width: 0;
  }

  .lx-topbar {
    position: static;
    grid-template-columns: 1fr;
    height: auto;
    gap: 10px;
    padding: 12px;
  }

  .lx-shell {
    grid-template-columns: 1fr;
  }

  .lx-sidebar {
    position: static;
    height: auto;
    padding: 8px;
  }

  .nav {
    display: flex;
    overflow-x: auto;
    gap: 6px;
  }

  .lx-nav-item {
    flex: 0 0 auto;
    width: auto;
  }

  .section-tabs {
    position: static;
    overflow-x: auto;
  }

  .lx-grid-kpi,
  .home-dashboard-grid,
  .two-col,
  .detail-layout,
  .detail-grid,
  .compact-list {
    grid-template-columns: 1fr;
  }

  .home-dashboard-grid {
    grid-template-areas:
      "review"
      "decision"
      "history"
      "backtest";
  }

  .decision-top,
  .brief-row {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}
