:root {
    --canvas: #0d1114;
    --panel: #151c21;
    --panel-2: #1a2329;
    --line: #2d3a42;
    --text: #edf2f3;
    --muted: #91a0a7;
    --dim: #65747c;
    --cyan: #4bc0d9;
    --green: #48c690;
    --red: #ef737a;
    --orange: #df935f;
    --yellow: #e2bf64;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* Authentication */
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); }
.auth-brand { padding: clamp(48px, 10vw, 150px); border-right: 1px solid var(--line); background: #10171b; }
.brand-mark, .section-label, .timezone { margin: 0; color: var(--cyan); font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.auth-brand h1 { max-width: 450px; margin: 18px 0 12px; font-size: clamp(34px, 5vw, 60px); line-height: 1.08; }
.auth-brand > p:not(.brand-mark) { max-width: 420px; color: var(--muted); font-size: 16px; }
.auth-meta { margin-top: 52px; color: var(--dim); font-size: 12px; }
.auth-meta span, .connection-dot, .live-status i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 8px; }
.auth-panel { align-self: center; width: min(100%, 420px); margin: auto; padding: 32px; }
.auth-switch { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.auth-tab { padding: 10px 0; margin-right: 28px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--dim); font-weight: 700; }
.auth-tab.active { color: var(--text); border-bottom-color: var(--cyan); }
.auth-panel label, .filters-grid label, .holding-form label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
.auth-panel input, .filters-grid input, .filters-grid select, .holding-form input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 5px; background: #10161a; color: var(--text); padding: 9px 11px; outline: none; }
.auth-panel input:focus, .filters-grid input:focus, .filters-grid select:focus, .holding-form input:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(75,192,217,.13); }
.auth-panel label + label { margin-top: 16px; }
.primary-button, .secondary-button { min-height: 42px; border: 0; border-radius: 5px; padding: 10px 16px; font-weight: 750; }
.primary-button { background: var(--cyan); color: #071317; }
.primary-button:hover { background: #6dcee2; }
.secondary-button { background: #28363e; color: var(--text); }
.secondary-button:hover { background: #35474f; }
.auth-panel .primary-button { width: 100%; margin-top: 24px; }
.form-message { min-height: 21px; margin: 12px 0 0; color: var(--orange); font-size: 12px; }

/* Application layout */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 196px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; padding: 25px 14px 18px; border-right: 1px solid var(--line); background: #10171b; }
.brand { display: flex; align-items: center; gap: 9px; padding: 0 10px; font-size: 17px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); }
.side-nav { margin-top: 50px; display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 10px; border: 0; border-left: 2px solid transparent; background: transparent; color: var(--muted); text-align: left; }
.nav-item span { color: var(--dim); font-size: 10px; font-variant-numeric: tabular-nums; }
.nav-item:hover, .nav-item.active { color: var(--text); background: #192126; }
.nav-item.active { border-left-color: var(--cyan); }
.sidebar-footer { margin-top: auto; padding: 0 10px; color: var(--dim); font-size: 11px; }
.main-area { min-width: 0; max-width: 1560px; width: 100%; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 82px; padding: 17px 34px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 2px 0 0; font-size: 21px; }
.account { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; }
.account button { border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--muted); padding: 6px 9px; }
.account button:hover { color: var(--text); border-color: var(--muted); }
.view { display: none; padding: 32px 34px 56px; }
.view.active { display: block; }
.signal-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 4px 0 28px; border-bottom: 1px solid var(--line); }
.signal-hero h2 { max-width: 700px; margin: 7px 0; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; }
.signal-hero p:not(.section-label) { max-width: 680px; margin: 0; color: var(--muted); }
.signal-hero.compact h2 { font-size: 28px; }
.live-status { flex: 0 0 auto; display: flex; align-items: center; margin-top: 8px; border: 1px solid var(--line); border-radius: 5px; padding: 7px 9px; color: var(--muted); font-size: 12px; }

.control-surface { margin-top: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.mode-row { display: flex; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.mode-button { width: 185px; padding: 9px 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); text-align: left; }
.mode-button b, .mode-button small { display: block; }
.mode-button small { margin-top: 2px; font-size: 11px; color: var(--dim); }
.mode-button.active { border-color: #377282; background: #162b32; color: var(--text); }
.filters-grid { display: grid; grid-template-columns: 160px 145px 150px 130px minmax(160px, 1fr); align-items: end; gap: 12px; padding-top: 16px; }
.filters-grid .toggle-label { flex-direction: row; align-items: center; min-height: 42px; gap: 8px; white-space: nowrap; }
.filters-grid .toggle-label input { width: 16px; min-height: 16px; accent-color: var(--cyan); }
.filters-grid label > small { min-height: 30px; color: var(--dim); font-size: 10px; font-weight: 400; line-height: 1.35; }
.help-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--muted); }
.help-panel summary { padding: 11px 14px; cursor: pointer; color: var(--text); font-size: 12px; font-weight: 700; }
.help-panel div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 0 14px 13px; }
.help-panel p { margin: 0; font-size: 11px; }.help-panel b { color: var(--text); }
.scan-progress { display: flex; align-items: center; gap: 13px; margin-top: 20px; padding: 16px; border-left: 2px solid var(--cyan); background: #142026; }
.scan-progress b { font-size: 13px; }.scan-progress p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.spinner { width: 20px; height: 20px; border: 2px solid #42606a; border-top-color: var(--cyan); border-radius: 50%; animation: spin .75s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.results { margin-top: 24px; }.results-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; }.results-head h3 { margin: 3px 0 0; font-size: 19px; }.results-head > p { margin: 0; color: var(--dim); font-size: 12px; text-align: right; }
.result-note { margin: 13px 0; padding: 10px 12px; border: 1px solid #32434a; border-radius: 5px; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
table { width: 100%; min-width: 1180px; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 13px; border-bottom: 1px solid #28343a; text-align: left; vertical-align: middle; } th { background: var(--panel-2); color: var(--muted); font-size: 10px; letter-spacing: .06em; white-space: nowrap; } tr:last-child td { border-bottom: 0; } tr:hover td { background: rgba(75,192,217,.035); }
.sort-button { border: 0; background: transparent; color: inherit; padding: 0; font: inherit; letter-spacing: inherit; text-transform: none; }
.sort-button::after { content: " ↑↓"; color: var(--dim); font-size: 10px; }.sort-button.active::after { content: " ↓"; color: var(--cyan); }.sort-button.asc::after { content: " ↑"; }
td strong { display: block; font-variant-numeric: tabular-nums; } td small { display: block; max-width: 320px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }.rank { color: var(--dim); font-variant-numeric: tabular-nums; }.positive, .direction-up { color: var(--red); }.negative, .direction-down { color: var(--green); }.direction-flat, .direction-uncertain { color: var(--yellow); }.sector-tag, .signal-tag { display: inline-block; border-radius: 4px; padding: 3px 6px; font-size: 11px; white-space: nowrap; }.sector-tag { border: 1px solid #366071; color: #80d3e6; }.signal-tag { background: #173d31; color: #70d7a8; }.empty-cell { padding: 40px; color: var(--muted); text-align: center; }
.holding-form { display: grid; grid-template-columns: 130px minmax(180px, 1fr) 115px 125px minmax(150px, 1fr) auto auto; gap: 12px; align-items: end; }
.holding-form .primary-button, .holding-form .secondary-button { white-space: nowrap; }
.row-action { border: 0; background: transparent; color: var(--dim); font-size: 12px; }.row-action:hover { color: var(--red); }

@media (max-width: 1050px) { .app-shell { grid-template-columns: 1fr; }.sidebar { position: sticky; top: 0; z-index: 5; flex-direction: row; align-items: center; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }.side-nav { display: flex; margin: 0 0 0 30px; }.nav-item { min-height: 36px; }.sidebar-footer { margin: 0 0 0 auto; }.topbar { min-height: 70px; padding: 14px 20px; }.view { padding: 24px 20px 40px; }.filters-grid { grid-template-columns: repeat(3, 1fr); }.filters-grid .primary-button { grid-column: span 2; }.holding-form { grid-template-columns: repeat(3, 1fr); }.holding-form .primary-button, .holding-form .secondary-button { width: 100%; } }
@media (max-width: 640px) { .auth-layout { grid-template-columns: 1fr; }.auth-brand { padding: 50px 24px 32px; border-right: 0; border-bottom: 1px solid var(--line); }.auth-brand h1 { font-size: 38px; }.auth-meta { margin-top: 28px; }.auth-panel { padding: 28px 24px 42px; }.auth-panel input, .filters-grid input, .filters-grid select, .holding-form input { font-size: 16px; }.sidebar { padding: 9px 12px; }.brand { padding: 0; font-size: 15px; }.side-nav { flex: 1; margin-left: 14px; justify-content: flex-end; }.nav-item { flex: 1; justify-content: center; padding: 0 5px; font-size: 12px; }.nav-item span, .sidebar-footer { display: none; }.topbar { padding: 13px 14px; }.topbar h1 { font-size: 18px; }.account span { display: none; }.view { padding: 22px 12px 34px; }.signal-hero { display: block; padding-bottom: 20px; }.signal-hero h2 { font-size: 25px; }.live-status { display: inline-flex; margin-top: 15px; }.mode-row { overflow-x: auto; }.mode-button { flex: 0 0 170px; }.filters-grid { grid-template-columns: 1fr 1fr; gap: 10px; }.filters-grid label:first-child { grid-column: span 2; }.filters-grid .toggle-label { grid-column: span 1; }.filters-grid .primary-button { grid-column: span 2; width: 100%; }.holding-form { grid-template-columns: 1fr 1fr; gap: 10px; }.holding-form label:nth-child(2), .holding-form label:nth-child(5), .holding-form .primary-button, .holding-form .secondary-button { grid-column: span 2; }.help-panel div { grid-template-columns: 1fr; }.results-head { display: block; }.results-head > p { margin-top: 7px; text-align: left; }.table-wrap { border-radius: 5px; } table { min-width: 1180px; } th, td { padding: 10px; }.control-surface { padding: 12px; } }
