

/* Complete issuer statements: keep period columns readable on small screens. */
.ticket-name-with-financials {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ticket-name-with-financials .company-financial-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 24px;
  min-height: 24px;
}

#companyFinancialModal {
  z-index: 1090; /* Above the mobile navigation (1080). */
}

#companyFinancialModal .modal-header > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

#companyFinancialModal .modal-header .btn-close {
  flex-shrink: 0;
  margin-left: auto;
}

#companyFinancialModal .company-financial-table {
  width: max-content;
  min-width: 100%;
  font-variant-numeric: tabular-nums;
}

#companyFinancialModal .company-financial-table th,
#companyFinancialModal .company-financial-table td {
  min-width: 150px;
  white-space: nowrap;
}

#companyFinancialModal .company-financial-table tbody th {
  position: sticky;
  left: 0;
  background: var(--ds-surface);
  z-index: 1;
  max-width: 200px;
  white-space: normal;
  overflow-wrap: anywhere;
}

#companyFinancialModal .financial-value--good {
  color: var(--ds-up);
  font-weight: 650;
}

#companyFinancialModal .financial-value--bad {
  color: var(--ds-down);
  font-weight: 650;
}

/* ---------- Login ---------- */

html body .login-grid {
  max-width: 1000px;
}

html body .login-brand {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(34, 211, 238, 0.22), transparent 58%),
    linear-gradient(145deg, #0b1a33, #0c1526 58%, #070d18);
  box-shadow: 0 34px 90px -46px rgba(2, 6, 23, 0.65);
}

html body .login-brand__title {
  margin-top: 0.6rem;
  font-size: clamp(1.5rem, 2.1vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

html body .login-brand__subtitle {
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.6;
}

html body .login-brand__eyebrow {
  color: #67e8f9;
}

html body .login-brand__feature-list li {
  color: #dbeafe;
  font-size: 0.82rem;
}

html body .login-brand__feature-list li::before {
  color: #67e8f9;
}

html body .login-brand__ticker {
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

html body .login-card {
  border-radius: 20px;
  box-shadow: 0 34px 90px -58px rgba(2, 6, 23, 0.5);
}

html body .login-card .card-body {
  padding: 2rem 1.85rem;
}

html body .login-card .page-title {
  font-size: 1.5rem;
}

/* ---------- Mobile tab bar ---------- */

html body .mobile-tabbar {
  border-top: 1px solid var(--ui-border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -10px 30px -24px rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

html body .mobile-tabbar__item {
  color: var(--ui-subtle);
  font-weight: 600;
}

html body .mobile-tabbar__item.active {
  color: var(--ui-accent-deep);
}

html[data-theme="dark"] body .mobile-tabbar {
  border-top-color: var(--ui-border);
  background: rgba(8, 13, 24, 0.94);
}

html[data-theme="dark"] body .mobile-tabbar__item {
  color: #71839c;
}

html[data-theme="dark"] body .mobile-tabbar__item.active {
  color: #bfdbfe;
}

/* ---------- Motion & focus ---------- */

html body :focus-visible {
  outline: none;
  box-shadow: var(--ui-ring);
}

/* ---------- Live run detail ---------- */

html body .live-page.is-run-detail .live-index-sections {
  display: none;
}

html body .run-detail {
  scroll-margin-top: 76px;
}

html body .run-generating-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.9rem 1.1rem 0;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 0.65rem;
  background: var(--ui-accent-soft);
  color: var(--ui-text);
  font-size: 0.85rem;
  font-weight: 500;
}

html body .run-generating-banner--timeout {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.1);
}

html body .run-generating-banner .spinner-border {
  flex-shrink: 0;
}

html body .run-empty-state {
  margin: 1rem 0 0.9rem;
  padding: 1.4rem 1rem;
  border: 1px dashed var(--ui-border-strong);
  border-radius: 0.9rem;
}

html body .run-empty-state .empty-state-block__hint {
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

html body .run-empty-summary {
  display: grid;
  gap: 0.75rem;
}

html body .run-empty-strategy {
  padding: 0.85rem 1rem;
  border: 1px solid var(--ui-border);
  border-radius: 0.8rem;
  background: var(--surface-muted);
}

html[data-theme="dark"] body .run-empty-strategy {
  background: rgba(148, 163, 184, 0.06);
}

html body .run-detail-card > .run-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 0.9rem;
}

html body .run-detail-heading {
  min-width: 0;
}

html body .registration-review {
  padding-block-start: 1rem;
  margin-block-start: 1rem;
  border-block-start: 1px solid var(--ui-border);
}

html body .registration-details { margin-block-start: 0.75rem; font-size: 0.875rem; }
html body .registration-actions p:empty { display: none; }
html body .live-quote-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; }
html body .trade-ticket-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; }
html body .trade-ticket-heading__identity { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; min-width: 0; }
html body .trade-ticket-heading__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; margin-inline-start: auto; }

html body .registration-context {
  color: var(--ui-muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

html body .registration-context p { margin-block-end: 0.5rem; }
html body .registration-context .registration-warning { color: var(--warning-600); }

html body .registration-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.75rem 1rem;
  margin-block: 1rem;
  font-variant-numeric: tabular-nums;
}

html body .registration-summary > div { min-width: 0; overflow-wrap: anywhere; }
html body .registration-summary span { display: block; color: var(--ui-muted); font-size: 0.875rem; }
html body .registration-summary strong { display: block; color: var(--ui-text); }
html body .registration-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
html body .registration-actions p { flex: 1 1 18rem; }
html body .registration-review:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 4px; }

@media (max-width: 767.98px) {
  html body .live-page.is-run-detail .run-detail-breadcrumb,
  html body .live-page.is-run-detail .run-detail-meta { display: none; }
  html body .live-page.is-run-detail .run-detail-actions { flex-wrap: nowrap; }
  html body .live-page.is-run-detail .trade-ticket-section .trade-ticket-heading { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 0.5rem; }
  html body .live-page.is-run-detail .trade-ticket-heading .trade-ticket-heading__identity { flex: 1; flex-wrap: nowrap; gap: 0.25rem; min-width: 0; }
  html body .live-page.is-run-detail .trade-ticket-heading .strategy-summary-toggle { text-align: start; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
  html body .live-page.is-run-detail .trade-ticket-heading .trade-ticket-heading__actions { width: auto; flex-wrap: nowrap; gap: 0.25rem; }
  html body .live-page .trade-ticket-mobile-table [data-ticket-field="代码"] { order: -3; grid-column: auto; }
  html body .live-page .trade-ticket-mobile-table [data-ticket-field="名称"] { order: -2; }
  html body .live-page .trade-ticket-mobile-table [data-ticket-field="操作"] { order: -1; }
  html body .live-page .trade-ticket-mobile-table td[data-mobile-priority="action"],
  html body .live-page .trade-ticket-mobile-table td[data-mobile-priority="meta"] { order: 1; }
  html body .live-page .trade-ticket-mobile-table [data-ticket-field="代码"]::before,
  html body .live-page .trade-ticket-mobile-table [data-ticket-field="名称"]::before { display: none; }
  html body .live-page.is-run-detail .run-overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html body .live-page.is-run-detail .run-kpi--pnl { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: baseline; padding: 0 0 0.5rem; }
  html body .live-page.is-run-detail .run-kpi--pnl .run-kpi__hint { grid-column: 1 / -1; }
  html body .live-page.is-run-detail .run-kpi:not(.run-kpi--pnl) { display: flex; align-items: baseline; gap: 0.5rem; margin: 0; padding: 0.5rem 0; border-inline-start: 0; border-block-start: 1px solid var(--ui-border); }
  html body .live-page.is-run-detail .run-kpi:not(.run-kpi--pnl) .run-kpi__value { font-size: 1.25rem; }
  html body .registration-review input,
  html body #registrationModal input:not([type="checkbox"]),
  html body .trade-ticket-section .order-price-input,
  html body .trade-ticket-section .order-lots-input { font-size: 1rem; min-height: 44px; }
  html body .ticket-selection-control { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  html body #registrationModal .form-check-label { display: flex; align-items: center; min-height: 44px; }
  html body #registrationModal .form-check-input { width: 1.25rem; height: 1.25rem; min-height: 1.25rem; margin-block-start: 0.75rem; }
  html body:has(#registrationModal.show) .mobile-tabbar { display: none; }
  html body #registrationModal .modal-footer { padding-block-end: calc(1rem + env(safe-area-inset-bottom)); }
  html body .registration-actions .btn,
  html body #registrationModal .btn { min-height: 44px; }
}

html body .run-detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ui-subtle);
  font-size: 0.72rem;
  font-weight: 500;
}

html body .run-detail-breadcrumb a {
  color: var(--ui-muted);
  font-weight: 600;
  text-decoration: none;
}

html body .run-detail-breadcrumb a:hover {
  color: var(--ui-accent-deep);
}

html body .run-detail-breadcrumb__sep {
  color: var(--ui-border-strong);
}

html body .run-detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.48rem;
  margin-top: 0.35rem;
}

html body .run-detail-title {
  margin: 0;
  color: var(--ui-ink);
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

html body .run-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.7rem;
  margin-top: 0.55rem;
  color: var(--ui-muted);
  font-size: 0.76rem;
}

html body .run-detail-meta strong {
  color: var(--ui-ink);
  font-weight: 600;
}

html body .run-detail-meta__label {
  margin-right: 0.3rem;
  color: var(--ui-subtle);
  font-weight: 500;
}

html body .run-detail-meta__sep {
  width: 1px;
  height: 12px;
  background: var(--ui-border);
}

html body .run-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

html body .run-detail-tabs {
  display: flex;
  gap: 0.2rem;
  padding: 0 0.95rem;
  border-bottom: 1px solid var(--ui-border);
  background: var(--surface);
  overflow-x: auto;
  scrollbar-width: none;
}

html body .run-detail-tabs::-webkit-scrollbar {
  display: none;
}

html body .run-detail-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  margin-bottom: -1px;
  padding: 0.62rem 0.7rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ui-muted);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
}

html body .run-detail-tab:hover {
  color: var(--ui-ink);
}

html body .run-detail-tab.is-active {
  color: var(--ui-accent-deep);
  border-bottom-color: var(--ui-accent);
}

html body .run-detail-tab__count {
  padding: 0.06rem 0.4rem;
  border-radius: 999px;
  background: var(--ui-accent-soft);
  color: var(--ui-accent-deep);
  font-size: 0.68rem;
  font-weight: 600;
}

html body .run-detail-panel {
  padding: 1rem 1.1rem 1.1rem;
}

html body .run-detail-panel[hidden] {
  display: none;
}

/* 指标带：只保留栅格骨架，视觉（缩进、分割线、字号、配色、响应式）统一交给 design-system.css。 */
html body .run-overview-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

html body .run-overview-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

html body .run-overview-block__hint {
  color: var(--ui-subtle);
  font-size: 0.72rem;
}

html body .run-position-group + .run-position-group {
  margin-top: 0.7rem;
}

html body .run-position-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.55rem;
  overflow: visible;
}

html body .run-position-strip .summary-strip__item {
  min-width: 0;
  min-height: 72px;
  flex: none;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  box-shadow: none;
}

html body .run-position-strip .summary-strip__value {
  margin-top: 0.24rem;
  font-family: var(--ui-font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

html body .run-detail-audit {
  margin-top: 1rem;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: #fbfcfe;
}

html body .run-detail-audit > summary {
  padding: 0.6rem 0.8rem;
  color: var(--ui-text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

html body .run-detail-audit__body {
  padding: 0 0.8rem 0.75rem;
  color: var(--ui-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

html body .run-detail-panel__intro {
  margin: 0 0 0.75rem;
  color: var(--ui-muted);
  font-size: 0.78rem;
}

html[data-theme="dark"] body .run-detail-tabs {
  background: #0e1626;
}

html[data-theme="dark"] body .run-detail-audit {
  border-color: var(--ui-border);
  background: #0b1322;
}
