:root {
  color-scheme: dark;
  --bg: #07101d;
  --bg-soft: #0a1524;
  --panel: rgba(15, 28, 45, 0.88);
  --panel-solid: #0f1c2d;
  --panel-hover: #13243a;
  --line: rgba(153, 177, 202, 0.14);
  --line-strong: rgba(153, 177, 202, 0.24);
  --text: #eef5fb;
  --muted: #8fa3b8;
  --subtle: #647a91;
  --accent: #36d6ad;
  --accent-soft: rgba(54, 214, 173, 0.12);
  --accent-strong: #72e5c7;
  --up: #ff5a67;
  --up-soft: rgba(255, 90, 103, 0.12);
  --down: #2bd49c;
  --down-soft: rgba(43, 212, 156, 0.12);
  --warn: #f7b955;
  --warn-soft: rgba(247, 185, 85, 0.12);
  --danger: #ff6b79;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
  --radius: 18px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% -10%, rgba(38, 96, 122, 0.24), transparent 34rem),
    radial-gradient(circle at 10% 100%, rgba(36, 89, 82, 0.13), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 232px;
  flex-direction: column;
  padding: 26px 18px 22px;
  border-right: 1px solid var(--line);
  background: rgba(7, 16, 29, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark,
.auth-mark {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(54, 214, 173, 0.23);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(54, 214, 173, 0.15), rgba(54, 214, 173, 0.02));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.brand svg,
.auth-mark svg {
  width: 28px;
  fill: none;
  stroke: #7890a8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.brand svg .accent,
.auth-mark svg .accent {
  stroke: var(--accent);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: 0.04em;
  font-size: 16px;
}

.brand small {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 7px;
  margin-top: 46px;
}

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 13px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: 160ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.nav-item.active {
  border-color: rgba(54, 214, 173, 0.16);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.nav-icon {
  width: 22px;
  color: currentColor;
  font-size: 20px;
  line-height: 1;
  text-align: center;
}

.sidebar-foot {
  margin-top: auto;
  padding: 15px 10px 0;
  border-top: 1px solid var(--line);
}

.sidebar-foot p {
  margin: 9px 0 0;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.55;
}

.mode-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.mode-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 4px var(--warn-soft);
}

.main-content {
  width: min(1500px, calc(100% - 232px));
  margin-left: 232px;
  padding: 28px clamp(22px, 3vw, 48px) 34px;
}

.topbar {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(23px, 2.4vw, 31px);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 11px;
}

.clock-block {
  display: grid;
  margin-right: 8px;
  text-align: right;
}

.clock-block strong {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.clock-block span {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 10px;
}

.connection-chip,
.icon-button {
  border: 1px solid var(--line);
  background: rgba(15, 28, 45, 0.74);
  cursor: pointer;
}

.connection-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--subtle);
}

.connection-chip.online .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.connection-chip.error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--up-soft);
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
}

.icon-button svg {
  width: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button.loading svg {
  animation: spin 0.8s linear infinite;
}

.safety-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 26px;
  padding: 13px 16px;
  border: 1px solid rgba(247, 185, 85, 0.16);
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--warn-soft), rgba(247, 185, 85, 0.025));
}

.safety-icon {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(247, 185, 85, 0.35);
  border-radius: 50%;
  color: var(--warn);
  font-weight: 800;
}

.safety-banner div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 11px;
}

.safety-banner strong {
  color: #ffe3ae;
}

.safety-banner div span {
  color: #ae9d7d;
  font-size: 12px;
}

.safety-state {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--warn);
  font-size: 11px;
}

.view {
  display: none;
  animation: reveal 220ms ease;
}

.view.active {
  display: block;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card,
.panel,
.market-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(17, 32, 51, 0.94), rgba(11, 23, 39, 0.9));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.stat-card {
  min-height: 132px;
  padding: 19px;
  border-radius: var(--radius);
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.stat-icon {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}

.stat-value {
  display: block;
  margin-top: 17px;
  font-size: 27px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.stat-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  color: var(--subtle);
  font-size: 11px;
}

.mini-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--subtle);
}

.mini-status.ok {
  background: var(--accent);
}

.mini-status.warn {
  background: var(--warn);
}

.section-heading,
.panel-head,
.action-row,
.table-toolbar,
.security-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading {
  margin: 30px 2px 13px;
}

.section-note {
  color: var(--subtle);
  font-size: 11px;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.market-card {
  position: relative;
  overflow: hidden;
  min-height: 146px;
  padding: 18px;
  border-radius: 15px;
}

.market-card::after {
  position: absolute;
  right: -25px;
  bottom: -45px;
  width: 120px;
  height: 100px;
  border-radius: 50%;
  background: var(--accent-soft);
  content: "";
  filter: blur(18px);
}

.market-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.market-name strong {
  font-size: 13px;
}

.market-name span {
  color: var(--subtle);
  font-size: 10px;
}

.market-price {
  display: block;
  margin-top: 18px;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

.market-change {
  display: inline-flex;
  margin-top: 7px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.up {
  color: var(--up) !important;
}

.down {
  color: var(--down) !important;
}

.market-change.up {
  background: var(--up-soft);
}

.market-change.down {
  background: var(--down-soft);
}

.market-quality {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 1;
  color: var(--subtle);
  font-size: 10px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.panel {
  padding: 21px;
  border-radius: var(--radius);
}

.panel-head {
  margin-bottom: 18px;
}

.text-button {
  padding: 5px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
}

.candidate-row,
.timeline-item,
.source-item,
.system-source,
.position-card {
  border-top: 1px solid var(--line);
}

.candidate-row {
  display: grid;
  grid-template-columns: 38px minmax(110px, 1fr) 85px 72px;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
}

.candidate-row:first-child,
.timeline-item:first-child,
.source-item:first-child,
.system-source:first-child,
.position-card:first-child {
  border-top: 0;
}

.rank {
  color: var(--subtle);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.symbol-stack strong,
.symbol-stack span {
  display: block;
}

.symbol-stack strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.symbol-stack span {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 10px;
}

.score-meter {
  display: flex;
  align-items: center;
  gap: 7px;
}

.score-track {
  overflow: hidden;
  width: 48px;
  height: 4px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
}

.score-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1cae8c, var(--accent));
}

.score-meter b {
  min-width: 27px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 10px;
  white-space: nowrap;
}

.badge.eligible {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.watch {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.risk {
  background: var(--up-soft);
  color: var(--danger);
}

.badge.muted {
  background: rgba(143, 163, 184, 0.1);
  color: var(--muted);
}

.timeline-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px 0;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-item.risk .timeline-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--up-soft);
}

.timeline-copy strong {
  font-size: 12px;
}

.timeline-copy p {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-item time {
  color: var(--subtle);
  font-size: 9px;
}

.source-strip-panel {
  margin-top: 14px;
}

.source-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 0 0;
}

.source-logo {
  display: grid;
  flex: 0 0 auto;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 10px;
  background: rgba(143, 163, 184, 0.08);
  color: var(--muted);
  font-weight: 750;
  text-transform: uppercase;
}

.source-copy {
  min-width: 0;
}

.source-copy strong,
.source-copy span {
  display: block;
}

.source-copy strong {
  font-size: 12px;
}

.source-copy span {
  overflow: hidden;
  margin-top: 3px;
  color: var(--subtle);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-health-dot {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--subtle);
}

.source-health-dot.ok {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.action-row {
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(15, 28, 45, 0.7);
}

.action-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.daily-research-summary {
  margin-bottom: 14px;
}

.daily-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.daily-summary-card h2,
.daily-summary-card p {
  margin: 0;
}

.daily-summary-card p:last-child {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.daily-summary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 8px;
}

.daily-summary-metrics span {
  min-width: 78px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(143, 163, 184, 0.07);
  color: var(--subtle);
  font-size: 9px;
  text-align: center;
}

.daily-summary-metrics b {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 15px;
}

.market-rank {
  display: block;
  margin-top: 3px;
  color: var(--subtle);
  font-size: 9px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 39px;
  padding: 0 15px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
  transition: 150ms ease;
}

.primary-button {
  border: 1px solid #36d6ad;
  background: var(--accent);
  color: #052018;
  box-shadow: 0 8px 24px rgba(54, 214, 173, 0.13);
}

.primary-button:hover {
  background: #64e2c1;
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: rgba(143, 163, 184, 0.07);
  color: var(--text);
}

.danger-button {
  border: 1px solid rgba(255, 107, 121, 0.24);
  background: var(--up-soft);
  color: var(--danger);
}

.wide {
  width: 100%;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-panel > .panel-head {
  padding: 21px 21px 0;
}

.table-toolbar {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.search-field {
  display: flex;
  width: min(320px, 100%);
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(6, 15, 27, 0.62);
  color: var(--subtle);
}

.search-field input {
  width: 100%;
  height: 35px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.legend {
  display: flex;
  gap: 14px;
  color: var(--subtle);
  font-size: 10px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-dot.eligible {
  background: var(--accent);
}

.legend-dot.watch {
  background: var(--warn);
}

.responsive-table {
  overflow-x: auto;
}

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

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: rgba(6, 15, 27, 0.28);
  color: var(--subtle);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  color: var(--muted);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.018);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.factor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.factor-chip {
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(143, 163, 184, 0.07);
  color: var(--muted);
  font-size: 9px;
}

.reason-cell {
  max-width: 300px;
  line-height: 1.55;
}

.positions-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  margin-top: 0;
}

.sticky-panel {
  align-self: start;
  position: sticky;
  top: 18px;
}

.position-card {
  padding: 16px 0;
}

.position-card-head,
.position-metrics,
.position-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.position-card-head strong {
  font-size: 13px;
}

.position-card-head span {
  color: var(--subtle);
  font-size: 10px;
}

.position-metrics {
  margin-top: 14px;
}

.position-metrics div span,
.position-metrics div strong {
  display: block;
}

.position-metrics div span {
  color: var(--subtle);
  font-size: 9px;
}

.position-metrics div strong {
  margin-top: 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.position-actions {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
}

.position-notes {
  overflow: hidden;
  color: var(--subtle);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-link {
  padding: 3px;
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 10px;
}

.position-form {
  display: grid;
  gap: 14px;
}

.position-form label,
.token-field {
  display: grid;
  gap: 7px;
}

.position-form label > span,
.token-field > span {
  color: var(--muted);
  font-size: 11px;
}

.position-form input,
.position-form textarea,
.token-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(6, 15, 27, 0.7);
  color: var(--text);
}

.position-form input,
.token-field input {
  height: 39px;
  padding: 0 11px;
}

.position-form textarea {
  padding: 10px 11px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-hint {
  margin: -3px 0 0;
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.5;
}

.signal-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.signal-summary-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(15, 28, 45, 0.72);
}

.signal-summary-card span,
.signal-summary-card strong {
  display: block;
}

.signal-summary-card span {
  color: var(--subtle);
  font-size: 10px;
}

.signal-summary-card strong {
  margin-top: 8px;
  font-size: 22px;
}

.system-actions {
  margin-bottom: 14px;
}

.button-group {
  display: flex;
  gap: 8px;
}

.system-source {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
}

.system-source-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.system-source-main strong,
.system-source-main span {
  display: block;
}

.system-source-main span {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 9px;
}

.source-counter {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.detail-list {
  margin: 0;
}

.detail-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.detail-list div:first-child {
  border-top: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 11px;
}

.detail-list dd {
  margin: 0;
  color: var(--text);
  font-size: 11px;
  text-align: right;
}

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

.metric-tile {
  padding: 12px;
  border-radius: 10px;
  background: rgba(6, 15, 27, 0.55);
}

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

.metric-tile span {
  color: var(--subtle);
  font-size: 9px;
}

.metric-tile strong {
  margin-top: 6px;
  font-size: 15px;
}

.security-panel {
  margin-top: 14px;
}

.security-panel p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding: 16px 2px 0;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 9px;
}

.empty-state {
  display: grid;
  min-height: 170px;
  place-items: center;
  align-content: center;
  color: var(--subtle);
  text-align: center;
}

.empty-state.compact {
  grid-column: 1 / -1;
  min-height: 130px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.empty-state p {
  margin: 8px 0 0;
  font-size: 11px;
}

.empty-state strong {
  color: var(--muted);
  font-size: 12px;
}

.loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(54, 214, 173, 0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.skeleton-card {
  background: linear-gradient(100deg, #0e1b2c 20%, #14263a 38%, #0e1b2c 56%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease infinite;
}

.auth-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 21px;
  background: #0d1b2c;
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
}

.auth-dialog::backdrop {
  background: rgba(2, 8, 15, 0.82);
  backdrop-filter: blur(8px);
}

.auth-dialog form {
  padding: 29px;
}

.auth-dialog .auth-mark {
  margin-bottom: 20px;
}

.auth-dialog h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.auth-dialog p:not(.eyebrow):not(.auth-error) {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.token-field {
  margin: 20px 0 11px;
}

.token-field div {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(6, 15, 27, 0.7);
}

.token-field input {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.token-field button {
  padding: 0 11px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.auth-error {
  min-height: 17px;
  margin: 0 0 7px;
  color: var(--danger);
  font-size: 10px;
}

.auth-dialog small {
  display: block;
  margin-top: 13px;
  color: var(--subtle);
  font-size: 9px;
  line-height: 1.55;
}

.auth-dialog code {
  color: var(--muted);
}

.chart-dialog {
  width: min(1240px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: var(--shadow);
}

.chart-dialog::backdrop {
  background: rgba(2, 7, 13, 0.78);
  backdrop-filter: blur(5px);
}

.chart-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.chart-dialog-head h2 {
  margin-top: 3px;
}

.chart-dialog-body {
  padding: 12px;
  overflow: auto;
}

.chart-dialog-body svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: grid;
  width: min(360px, calc(100vw - 32px));
  gap: 9px;
  pointer-events: none;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: #132439;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 11px;
  line-height: 1.55;
  animation: toast-in 180ms ease;
}

.toast.error {
  border-left-color: var(--danger);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes skeleton {
  to { background-position-x: -200%; }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(4px); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 1120px) {
  .stat-grid,
  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .candidate-row {
    grid-template-columns: 30px minmax(95px, 1fr) 74px 68px;
  }
}

@media (max-width: 820px) {
  .daily-summary-card {
    align-items: stretch;
    flex-direction: column;
  }

  body {
    padding-bottom: 74px;
  }

  .sidebar {
    inset: auto 0 0;
    width: 100%;
    height: 66px;
    padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .brand,
  .sidebar-foot {
    display: none;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    margin: 0;
  }

  .nav-item {
    display: grid;
    min-height: 49px;
    place-items: center;
    gap: 2px;
    padding: 4px;
    text-align: center;
  }

  .nav-icon {
    font-size: 17px;
  }

  .nav-item span:last-child {
    font-size: 9px;
  }

  .main-content {
    width: 100%;
    margin-left: 0;
    padding: 20px 15px 28px;
  }

  .two-column,
  .positions-layout {
    grid-template-columns: 1fr;
  }

  .sticky-panel {
    position: static;
  }

  .source-strip {
    grid-template-columns: 1fr;
  }

  .source-item {
    padding: 11px 0;
  }

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

@media (max-width: 560px) {
  .daily-summary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-source {
    gap: 6px;
  }

  .source-counter {
    font-size: 9px;
  }

  .topbar {
    align-items: flex-start;
  }

  .clock-block {
    display: none;
  }

  .connection-chip {
    max-width: 115px;
    padding: 0 10px;
  }

  .connection-chip span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .safety-banner {
    align-items: flex-start;
  }

  .safety-state {
    display: none;
  }

  .stat-grid,
  .market-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .stat-card {
    min-height: 116px;
    padding: 14px;
  }

  .stat-value {
    margin-top: 13px;
    font-size: 21px;
  }

  .market-card {
    min-height: 132px;
    padding: 14px;
  }

  .market-price {
    margin-top: 15px;
    font-size: 20px;
  }

  .panel {
    padding: 17px;
  }

  .candidate-row {
    grid-template-columns: 26px minmax(90px, 1fr) 66px;
  }

  .candidate-row > .badge {
    display: none;
  }

  .action-row,
  .security-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .action-row .primary-button,
  .security-panel .danger-button {
    width: 100%;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .legend {
    justify-content: flex-end;
  }

  .button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .page-footer {
    display: grid;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === LLM Advisory(advisory only,不参与决策)2026-07-22 === */
.llm-advisory {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding-left: 36px;
}

.llm-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.4;
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.llm-chip.llm-risk {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.3);
}

.llm-chip.llm-forecast {
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.3);
}

.llm-chip.llm-neural {
  background: rgba(168, 85, 247, 0.12);
  color: #e9d5ff;
  border-color: rgba(168, 85, 247, 0.3);
}

.llm-chip.llm-news-positive {
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

.llm-chip.llm-news-negative {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.llm-chip.llm-news-neutral {
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
}

.llm-commentary {
  width: 100%;
  margin-top: 4px;
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}

.llm-advice {
  margin-top: 4px;
  font-size: 11px;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.08);
  padding: 4px 6px;
  border-radius: 4px;
  border-left: 2px solid #6366f1;
}

/* === 双路模拟盘 + LLM 准确率面板(2026-07-22)=== */
.cohort-comparison {
  margin-top: 16px;
}

.cohort-comparison h4 {
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 8px 0;
}

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

.cohort-table th,
.cohort-table td,
.llm-accuracy-table th,
.llm-accuracy-table td {
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.cohort-table th,
.llm-accuracy-table th {
  color: #94a3b8;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
}

.cohort-strict {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(34, 197, 94, 0.15);
  color: #bbf7d0;
  border-radius: 3px;
  font-size: 11px;
}

.cohort-loose {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(234, 179, 8, 0.15);
  color: #fde68a;
  border-radius: 3px;
  font-size: 11px;
}

.hint {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
  margin: 0 0 8px 0;
}
