/* 全局样式 */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.navbar-text {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* 卡片样式 */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* 统计卡片 */
.stat-card {
    transition: transform 0.2s;
    height: 140px;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 表格样式 */
.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.table-actions {
    white-space: nowrap;
}

.table-actions .btn {
    margin-right: 0.25rem;
}

/* 按钮样式 */
.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* 表单样式 */
.form-label {
    font-weight: 500;
}

.form-text {
    font-size: 0.85rem;
}

/* 消息提示样式 */
.alert {
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-dismissible .btn-close {
    padding: 0.75rem;
}

/* 加载动画 */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* 进度条 */
.progress {
    height: 1.5rem;
}

.progress-bar {
    font-size: 0.875rem;
    line-height: 1.5rem;
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* 页脚样式 */
.footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h5 {
    margin-bottom: 0.5rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-indicator.status-success {
    background-color: #28a745;
}

.status-indicator.status-warning {
    background-color: #ffc107;
}

.status-indicator.status-danger {
    background-color: #dc3545;
}

.status-indicator.status-info {
    background-color: #17a2b8;
}

/* K线图容器 */
.chart-container {
    width: 100%;
    height: 400px;
    margin: 1rem 0;
}

/* 策略参数表单 */
.strategy-form .form-group {
    margin-bottom: 1rem;
}

.strategy-form .input-group-text {
    min-width: 50px;
}

/* 数据表格 */
.data-table {
    font-size: 0.9rem;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    vertical-align: middle;
}

/* 涨跌颜色 */
.text-rise {
    color: #dc3545;
}

.text-fall {
    color: #28a745;
}

/* 工具提示 */
.tooltip-inner {
    max-width: 300px;
}

/* 分页样式 */
.pagination {
    margin-top: 1rem;
}

.page-link {
    color: #0d6efd;
}

.page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* 搜索框 */
.search-box {
    max-width: 400px;
}

/* 过滤器面板 */
.filter-panel {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

/* 日志查看器 */
.log-viewer {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 0.375rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    max-height: 500px;
    overflow-y: auto;
}

.log-viewer .log-line {
    margin-bottom: 0.25rem;
}

.log-viewer .log-debug {
    color: #9cdcfe;
}

.log-viewer .log-info {
    color: #4ec9b0;
}

.log-viewer .log-warning {
    color: #dcdcaa;
}

.log-viewer .log-error {
    color: #f48771;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* 加载骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 2026 visual system */
:root {
    --ink: #172033;
    --muted: #697386;
    --canvas: #f3f6fb;
    --surface: rgba(255, 255, 255, 0.92);
    --line: #e5eaf2;
    --primary: #295cff;
    --primary-dark: #1839a8;
    --positive: #d83a52;
    --negative: #098b65;
    --shadow: 0 18px 50px rgba(40, 54, 85, 0.08);
}

body {
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 0%, rgba(41, 92, 255, .09), transparent 28rem),
        radial-gradient(circle at 92% 15%, rgba(25, 177, 132, .08), transparent 24rem),
        var(--canvas);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.navbar.bg-primary {
    background: rgba(20, 31, 58, .96) !important;
    box-shadow: 0 8px 30px rgba(16, 25, 48, .2);
    padding-block: .75rem;
}

.navbar .nav-link {
    border-radius: .65rem;
    margin-inline: .1rem;
    padding: .55rem .75rem !important;
}

.navbar .nav-link.active,
.navbar .nav-link:hover {
    background: rgba(255, 255, 255, .11);
}

.app-main {
    width: min(1600px, 100%);
    margin: 0 auto;
    padding: 2rem clamp(1rem, 3vw, 3rem) 3rem;
}

.page-shell {
    max-width: 1440px;
    margin-inline: auto;
}

.page-hero {
    padding: clamp(1.5rem, 3vw, 2.6rem);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 1.4rem;
    background:
        linear-gradient(125deg, rgba(255, 255, 255, .97), rgba(240, 245, 255, .92));
    box-shadow: var(--shadow);
}

.page-hero h1 {
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    letter-spacing: -.035em;
    font-weight: 750;
}

.eyebrow {
    display: block;
    margin-bottom: .45rem;
    color: var(--primary);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
}

.surface-card,
.metric-card,
.insight-card {
    border: 1px solid rgba(225, 231, 241, .9);
    border-radius: 1.15rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.surface-card {
    overflow: hidden;
}

.surface-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid var(--line);
}

.metric-card {
    height: 100%;
    min-height: 132px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.metric-card strong {
    font-size: 1.2rem;
}

.metric-label {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.insight-card {
    position: relative;
    overflow: hidden;
    padding: clamp(1.35rem, 2.5vw, 2rem);
    border-color: rgba(41, 92, 255, .2);
    background:
        radial-gradient(circle at 100% 0, rgba(78, 124, 255, .12), transparent 34%),
        linear-gradient(135deg, #fbfcff, #f1f5ff);
}

.insight-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #295cff, #7b61ff);
}

.ai-summary-heading {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: 1.15rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(41, 92, 255, .12);
}

.ai-summary-heading .eyebrow {
    margin-bottom: .2rem;
}

.ai-summary-heading h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    letter-spacing: -.02em;
}

.ai-summary-icon {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: .9rem;
    color: #fff;
    background: linear-gradient(135deg, #295cff, #7657ff);
    box-shadow: 0 10px 24px rgba(41, 92, 255, .24);
}

.ai-summary-content {
    color: #273248;
    font-size: .98rem;
    line-height: 1.8;
}

.ai-summary-content > :last-child {
    margin-bottom: 0;
}

.ai-summary-content p {
    margin: 0 0 .9rem;
}

.ai-summary-content h3,
.ai-summary-content h4,
.ai-summary-content h5 {
    margin: 1.2rem 0 .65rem;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
}

.ai-summary-content ul,
.ai-summary-content ol {
    display: grid;
    gap: .65rem;
    margin: .25rem 0 1rem;
    padding-left: 1.35rem;
}

.ai-summary-content li {
    padding: .65rem .8rem;
    border: 1px solid rgba(41, 92, 255, .1);
    border-radius: .75rem;
    background: rgba(255, 255, 255, .68);
}

.ai-summary-content li::marker {
    color: var(--primary);
    font-weight: 800;
}

.ai-summary-content strong {
    color: #172033;
    font-weight: 800;
}

.ai-summary-content code {
    padding: .12rem .35rem;
    border-radius: .35rem;
    color: #244fc9;
    background: #e8efff;
    font-size: .9em;
}

.ai-summary-content blockquote {
    margin: 1rem 0 0;
    padding: .8rem 1rem;
    border-left: 3px solid #f59e0b;
    border-radius: 0 .7rem .7rem 0;
    color: #7c4a03;
    background: rgba(255, 247, 224, .8);
}

.ai-summary-fallback {
    color: var(--muted);
    font-style: italic;
}

.empty-panel {
    padding: 4rem 1.5rem;
    text-align: center;
    color: var(--muted);
    border: 1px dashed #cbd5e1;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, .58);
}

.empty-panel i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.empty-panel h3 {
    color: var(--ink);
    font-size: 1.15rem;
}

.btn {
    border-radius: .72rem;
    font-weight: 650;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #486fff);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(41, 92, 255, .18);
}

.market-table thead th {
    padding: .85rem 1rem;
    color: var(--muted);
    font-size: .75rem;
    letter-spacing: .04em;
    background: #f8faff;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.market-table td {
    padding: 1rem;
    border-color: var(--line);
}

.market-table td strong {
    display: block;
}

.market-table td small {
    display: block;
    color: var(--muted);
}

.market-chip,
.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .3rem .62rem;
    font-size: .72rem;
    font-weight: 800;
}

.market-chip.cn { color: #244fc9; background: #e8efff; }
.market-chip.hk { color: #9e2c4c; background: #ffeaf0; }
.market-chip.us { color: #08765a; background: #e5f8f2; }
.status-pill.success { color: #08765a; background: #def7ee; }
.status-pill.danger { color: #aa2d46; background: #ffe6eb; }
.status-pill.muted { color: #566176; background: #edf0f5; }

.chart-canvas-wrap {
    position: relative;
    height: min(52vh, 480px);
}

.chart-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.chart-summary > div {
    padding: .8rem 1rem;
    border-radius: .8rem;
    background: #f6f8fc;
}

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

.chart-summary span {
    color: var(--muted);
    font-size: .75rem;
}

.insight-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1rem;
    border-radius: .9rem;
    background: #f7f9fd;
}

.insight-strip small {
    width: 100%;
    color: var(--muted);
}

.report-disclaimer {
    margin-top: 1rem;
    color: var(--muted);
    font-size: .82rem;
    text-align: center;
}

.modal-content {
    border: 0;
    border-radius: 1.15rem;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .22);
}

.form-control,
.form-select {
    border-color: #dbe2ed;
    border-radius: .72rem;
    padding: .65rem .8rem;
}

.text-rise { color: var(--positive) !important; }
.text-fall { color: var(--negative) !important; }

.profile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.profile-email-state {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    padding: .75rem 1rem;
    border: 1px solid #dbe2ed;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .72);
    font-weight: 600;
}

.profile-email-state.is-ready {
    border-color: rgba(25, 135, 84, .24);
    color: var(--positive);
    background: rgba(25, 135, 84, .08);
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    max-width: 820px;
    margin: 1.25rem auto 0;
}

.profile-card {
    padding: 1.5rem;
}

.profile-card .form-control[readonly] {
    color: var(--muted);
    background: #f7f9fd;
}

.profile-actions {
    display: flex;
    justify-content: flex-end;
}

.profile-actions .btn {
    min-width: 150px;
}

.profile-report-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #dbe2ed;
    border-radius: .9rem;
    background: #f8faff;
}

.profile-report-toggle .form-check-label {
    color: var(--ink);
    font-weight: 700;
}

.profile-report-toggle .form-switch {
    margin: 0;
    padding-left: 3rem;
}

.profile-report-toggle .form-check-input {
    width: 2.5rem;
    height: 1.35rem;
    margin-left: -3rem;
    cursor: pointer;
}

.profile-report-toggle .form-check-input:disabled {
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .app-main { padding: 1rem .75rem 2rem; }
    .page-hero { border-radius: 1rem; }
    .chart-summary { grid-template-columns: repeat(2, 1fr); }
    .navbar .nav-link { margin-block: .1rem; }
    .profile-hero { align-items: flex-start; flex-direction: column; }
    .profile-layout { grid-template-columns: 1fr; }
    .profile-actions .btn { width: 100%; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

/* 确认对话框样式 */
#confirmModal .modal-header {
    border-bottom: 2px solid #e9ecef;
    padding: 1rem 1.5rem;
}

#confirmModal .modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

#confirmModal .modal-title i {
    margin-right: 0.5rem;
}

#confirmModal .modal-body {
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

#confirmModal .modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

#confirmModal .btn {
    min-width: 80px;
    font-weight: 500;
}

#confirmModal .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

#confirmModal .btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

#confirmModal .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

#confirmModal .btn-secondary:hover {
    background-color: #5c636a;
    border-color: #565e64;
}

/* =========================================================
   Stock Compass 2026 — unified product design system
   ========================================================= */
:root {
    --sc-ink: #111827;
    --sc-ink-soft: #344054;
    --sc-muted: #667085;
    --sc-canvas: #f4f6fa;
    --sc-surface: rgba(255, 255, 255, .94);
    --sc-surface-soft: #f8fafc;
    --sc-line: #e4e7ec;
    --sc-line-strong: #d0d5dd;
    --sc-brand: #3b5bfd;
    --sc-brand-deep: #2037b7;
    --sc-accent: #18a785;
    --sc-warm: #f59e0b;
    --sc-danger: #e5484d;
    --sc-navy: #101828;
    --sc-radius-sm: .72rem;
    --sc-radius: 1rem;
    --sc-radius-lg: 1.45rem;
    --sc-shadow-sm: 0 1px 2px rgba(16, 24, 40, .03), 0 6px 18px rgba(16, 24, 40, .04);
    --sc-shadow: 0 18px 45px rgba(16, 24, 40, .08);
    --sc-shadow-float: 0 24px 70px rgba(16, 24, 40, .14);
}

html {
    background: var(--sc-canvas);
    scroll-behavior: smooth;
}

body.app-body {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--sc-ink);
    background:
        linear-gradient(180deg, #f9fafc 0, var(--sc-canvas) 28rem),
        var(--sc-canvas);
    font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.ambient-orb {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(3px);
    opacity: .55;
}

.ambient-orb-one {
    top: 7rem;
    right: -9rem;
    width: 28rem;
    height: 28rem;
    background: radial-gradient(circle, rgba(59, 91, 253, .11), transparent 68%);
}

.ambient-orb-two {
    bottom: 2rem;
    left: -12rem;
    width: 34rem;
    height: 34rem;
    background: radial-gradient(circle, rgba(24, 167, 133, .09), transparent 68%);
}

/* Navigation */
.app-navbar {
    z-index: 1030;
    padding: .72rem clamp(.75rem, 2vw, 1.5rem);
    border-bottom: 1px solid rgba(228, 231, 236, .8);
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 8px 30px rgba(16, 24, 40, .04);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.app-navbar-inner {
    max-width: 1640px;
    margin: 0 auto;
    padding: 0;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: .72rem;
    margin-right: 1.45rem;
    color: var(--sc-ink) !important;
    text-decoration: none;
}

.brand-symbol {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(145deg, #182957, #243e86);
    box-shadow: 0 9px 22px rgba(34, 61, 145, .24);
}

.brand-symbol img {
    width: 27px;
    height: 27px;
    object-fit: contain;
}

.brand-copy {
    display: grid;
    line-height: 1.05;
}

.brand-copy strong {
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.brand-copy small {
    margin-top: .3rem;
    color: #98a2b3;
    font-size: .54rem;
    font-weight: 800;
    letter-spacing: .18em;
}

.app-primary-nav {
    gap: .18rem;
}

.app-navbar .nav-link {
    display: inline-flex;
    align-items: center;
    gap: .46rem;
    margin: 0;
    padding: .58rem .68rem !important;
    border: 1px solid transparent;
    border-radius: .75rem;
    color: #475467 !important;
    font-size: .88rem;
    font-weight: 650;
    white-space: nowrap;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.app-navbar .nav-link:hover {
    color: var(--sc-ink) !important;
    background: #f2f4f7;
}

.app-navbar .nav-link.active {
    color: var(--sc-brand) !important;
    border-color: rgba(59, 91, 253, .1);
    background: #eef1ff;
}

.nav-icon {
    display: grid;
    width: 1.2rem;
    height: 1.2rem;
    place-items: center;
    font-size: .78rem;
}

.app-utility-nav {
    align-items: center;
    gap: .55rem;
    margin-left: 1rem;
}

.market-pulse {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .55rem .72rem;
    border: 1px solid var(--sc-line);
    border-radius: 999px;
    color: var(--sc-muted);
    background: #fff;
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
}

.pulse-dot {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sc-accent);
    box-shadow: 0 0 0 4px rgba(24, 167, 133, .1);
}

.user-menu-trigger {
    padding: .38rem .58rem !important;
    border-color: var(--sc-line) !important;
    background: #fff;
}

.user-avatar {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(145deg, var(--sc-brand), #7656f8);
    font-size: .72rem;
}

.dropdown-menu {
    min-width: 220px;
    padding: .55rem;
    border: 1px solid rgba(228, 231, 236, .9);
    border-radius: 1rem;
    box-shadow: var(--sc-shadow-float);
}

.dropdown-item {
    padding: .68rem .75rem;
    border-radius: .65rem;
    color: var(--sc-ink-soft);
    font-size: .88rem;
}

.dropdown-item:hover {
    color: var(--sc-brand);
    background: #f2f4ff;
}

.dropdown-profile {
    display: grid;
    padding: .55rem .75rem .7rem;
}

.dropdown-profile small {
    color: var(--sc-muted);
    font-size: .7rem;
}

.dropdown-profile strong {
    margin-top: .14rem;
    font-size: .88rem;
}

.navbar-toggler {
    border: 1px solid var(--sc-line);
    border-radius: .75rem;
}

.navbar-toggler-icon {
    filter: invert(18%) sepia(14%) saturate(1125%) hue-rotate(179deg);
}

/* Page shell and headings */
.app-main {
    position: relative;
    width: min(1640px, 100%);
    margin: 0 auto;
    padding: clamp(1.35rem, 2.6vw, 2.5rem) clamp(.9rem, 3vw, 3rem) 3.5rem;
}

.page-shell {
    max-width: 1480px;
    margin: 0 auto;
}

.page-hero,
.legacy-page-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.35rem;
    padding: clamp(1.45rem, 3vw, 2.5rem);
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: var(--sc-radius-lg);
    background:
        radial-gradient(circle at 92% 12%, rgba(76, 110, 245, .13), transparent 31%),
        radial-gradient(circle at 5% 100%, rgba(24, 167, 133, .08), transparent 28%),
        linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(246, 248, 255, .95));
    box-shadow: var(--sc-shadow);
}

.page-hero::after,
.legacy-page-hero::after {
    content: "";
    position: absolute;
    top: -2rem;
    right: 8%;
    width: 9rem;
    height: 9rem;
    border: 1px solid rgba(59, 91, 253, .1);
    border-radius: 50%;
    box-shadow: 0 0 0 24px rgba(59, 91, 253, .025), 0 0 0 50px rgba(59, 91, 253, .018);
    pointer-events: none;
}

.page-hero h1,
.legacy-page-hero h1,
.legacy-page-hero h2 {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--sc-ink);
    font-size: clamp(1.75rem, 3vw, 2.65rem);
    font-weight: 800;
    letter-spacing: -.045em;
}

.page-hero h1 i,
.legacy-page-hero h1 i,
.legacy-page-hero h2 i {
    margin-right: .45rem;
    color: var(--sc-brand);
    font-size: .78em;
}

.page-hero p,
.legacy-page-hero p {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: .65rem 0 0;
    color: var(--sc-muted) !important;
    line-height: 1.75;
}

.page-hero .btn,
.legacy-page-hero .btn {
    position: relative;
    z-index: 2;
}

.eyebrow {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    margin-bottom: .6rem;
    color: var(--sc-brand);
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .16em;
}

.eyebrow::before {
    content: "";
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 750;
    letter-spacing: -.02em;
}

/* Surfaces */
.card,
.surface-card,
.metric-card,
.insight-card {
    border: 1px solid rgba(228, 231, 236, .92) !important;
    border-radius: var(--sc-radius) !important;
    background: var(--sc-surface);
    box-shadow: var(--sc-shadow-sm);
}

.card {
    overflow: hidden;
    margin-bottom: 1.25rem;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.card:hover {
    border-color: #d5dafd !important;
    box-shadow: 0 15px 38px rgba(16, 24, 40, .075);
}

.card-header,
.surface-card-header {
    min-height: 58px;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--sc-line);
    color: var(--sc-ink);
    background: rgba(249, 250, 251, .74) !important;
    font-size: .92rem;
    font-weight: 750;
}

.card-header i {
    margin-right: .42rem;
    color: var(--sc-brand);
}

.card-header.bg-primary,
.card-header.bg-info,
.card-header.bg-dark,
.card-header.bg-success {
    color: var(--sc-ink) !important;
    background: linear-gradient(90deg, #f6f7ff, #fafbff) !important;
}

.card-body {
    padding: 1.25rem;
}

.surface-card {
    overflow: hidden;
}

.metric-card {
    position: relative;
    min-height: 136px;
    padding: 1.25rem;
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    right: -2rem;
    bottom: -2.7rem;
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    background: rgba(59, 91, 253, .055);
}

.metric-label,
.stat-label {
    color: var(--sc-muted);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.metric-card strong {
    margin-top: .35rem;
    font-size: 1.35rem;
}

/* Dashboard and statistics */
.stats-cards-row {
    margin-bottom: .35rem;
}

.stat-card {
    height: 100% !important;
    min-height: 154px;
    border-left: 1px solid var(--sc-line) !important;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card .card-body {
    padding: 1.2rem;
}

.stat-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    font-size: 1rem !important;
}

.stat-value {
    color: var(--sc-ink);
    font-size: clamp(1.65rem, 2.4vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -.04em;
}

.stat-footer {
    margin-top: auto;
    color: var(--sc-muted);
    font-size: .76rem;
}

.date-range-value {
    display: grid;
    gap: .35rem;
    color: var(--sc-ink-soft);
    font-size: .76rem;
}

/* Tables */
.table-responsive {
    border-radius: .8rem;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #f7f8ff;
    margin-bottom: 0;
    color: var(--sc-ink-soft);
}

.table > thead > tr > th,
.market-table thead th,
.data-table th {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--sc-line) !important;
    color: var(--sc-muted);
    background: #f8f9fc !important;
    font-size: .69rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table > tbody > tr > td,
.market-table td {
    padding: .95rem 1rem;
    border-color: #edf0f4;
    vertical-align: middle;
    font-size: .86rem;
}

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

.table a:not(.btn) {
    color: var(--sc-brand);
    font-weight: 650;
    text-decoration: none;
}

.table-sm > :not(caption) > * > * {
    padding: .72rem .8rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .32rem;
    min-height: 40px;
    padding: .55rem .9rem;
    border-radius: .72rem;
    font-size: .84rem;
    font-weight: 700;
    box-shadow: none;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    border-color: var(--sc-brand);
    background: linear-gradient(135deg, var(--sc-brand), #526cff);
    box-shadow: 0 8px 20px rgba(59, 91, 253, .2);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--sc-brand-deep);
    background: linear-gradient(135deg, #304de5, #435df0);
    box-shadow: 0 10px 24px rgba(59, 91, 253, .26);
}

.btn-secondary {
    border-color: var(--sc-line);
    color: var(--sc-ink-soft);
    background: #fff;
}

.btn-secondary:hover {
    border-color: var(--sc-line-strong);
    color: var(--sc-ink);
    background: #f9fafb;
}

.btn-success {
    border-color: var(--sc-accent);
    background: var(--sc-accent);
}

.btn-info {
    border-color: #0ea5c6;
    color: #fff;
    background: #0ea5c6;
}

.btn-warning {
    border-color: var(--sc-warm);
    color: #fff;
    background: var(--sc-warm);
}

.btn-outline-primary {
    border-color: #c7d0ff;
    color: var(--sc-brand);
    background: #fff;
}

.btn-outline-primary:hover,
.btn-outline-primary.active {
    border-color: var(--sc-brand);
    color: #fff;
    background: var(--sc-brand);
}

.btn-sm {
    min-height: 34px;
    padding: .4rem .68rem;
    font-size: .76rem;
}

.btn-lg {
    min-height: 48px;
    padding: .72rem 1.2rem;
}

.btn-group {
    gap: .4rem;
}

.btn-group > .btn {
    border-radius: .68rem !important;
}

/* Forms */
.form-label {
    margin-bottom: .45rem;
    color: var(--sc-ink-soft);
    font-size: .8rem;
    font-weight: 700;
}

.form-control,
.form-select,
.input-group-text {
    min-height: 44px;
    border-color: var(--sc-line-strong);
    border-radius: .76rem;
    color: var(--sc-ink);
    background-color: #fff;
    font-size: .87rem;
    transition: border .16s ease, box-shadow .16s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #8495ff;
    box-shadow: 0 0 0 4px rgba(59, 91, 253, .1);
}

.input-group > .form-control,
.input-group > .form-select {
    border-radius: 0 .76rem .76rem 0;
}

.input-group-text {
    min-width: 44px;
    justify-content: center;
    border-radius: .76rem 0 0 .76rem;
    color: var(--sc-muted);
    background: #f8fafc;
}

.form-text {
    margin-top: .4rem;
    color: var(--sc-muted);
    font-size: .73rem;
}

.form-check-input:checked {
    border-color: var(--sc-brand);
    background-color: var(--sc-brand);
}

textarea.form-control {
    min-height: 94px;
}

/* Feedback and status */
.alert {
    padding: .9rem 1rem;
    border: 0;
    border-radius: .85rem;
    font-size: .84rem;
}

.alert-warning { color: #854d0e; background: #fff8e6; }
.alert-danger { color: #9f1239; background: #fff0f3; }
.alert-success { color: #067458; background: #eafaf5; }
.alert-info { color: #155e75; background: #ecfbff; }

.badge,
.status-pill,
.market-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .34rem .62rem;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .015em;
}

.bg-primary { background-color: var(--sc-brand) !important; }
.bg-success { background-color: var(--sc-accent) !important; }
.bg-info { background-color: #0ea5c6 !important; }
.bg-warning { background-color: var(--sc-warm) !important; }
.bg-danger { background-color: var(--sc-danger) !important; }
.bg-secondary { background-color: #667085 !important; }

.text-primary { color: var(--sc-brand) !important; }
.text-success { color: var(--sc-accent) !important; }
.text-info { color: #0ea5c6 !important; }
.text-warning { color: var(--sc-warm) !important; }
.text-danger { color: var(--sc-danger) !important; }
.text-muted,
.text-secondary { color: var(--sc-muted) !important; }

.progress {
    height: 10px !important;
    overflow: hidden;
    border-radius: 999px;
    background: #eaecf0;
}

.progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sc-brand), #7b61ff);
}

/* Empty states, insights and utilities */
.empty-state,
.empty-panel {
    padding: 3.75rem 1.25rem;
    border: 1px dashed #cfd5e2;
    border-radius: var(--sc-radius);
    color: var(--sc-muted);
    background: rgba(255, 255, 255, .62);
    text-align: center;
}

.empty-state i,
.empty-panel > i {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 1rem;
    place-items: center;
    border-radius: 18px;
    color: var(--sc-brand);
    background: #eef1ff;
    font-size: 1.35rem;
}

.empty-state h5,
.empty-panel h3 {
    color: var(--sc-ink);
    font-weight: 750;
}

.insight-card {
    position: relative;
    overflow: hidden;
    padding: clamp(1.4rem, 2.5vw, 2rem);
    border-color: #d9deff !important;
    background:
        radial-gradient(circle at 100% 0, rgba(59, 91, 253, .12), transparent 36%),
        linear-gradient(135deg, #fff, #f6f7ff);
}

.ai-summary-icon {
    background: linear-gradient(145deg, var(--sc-brand), #7956e8);
}

.log-viewer {
    max-height: 620px;
    overflow: auto;
    padding: .8rem;
    border-radius: .8rem;
    color: #d0d5dd;
    background: #111827;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: .76rem;
}

.log-line {
    padding: .55rem .65rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    line-height: 1.65;
}

.pagination {
    gap: .28rem;
}

.page-link {
    min-width: 36px;
    border: 1px solid var(--sc-line);
    border-radius: .62rem !important;
    color: var(--sc-ink-soft);
    text-align: center;
}

.page-item.active .page-link {
    border-color: var(--sc-brand);
    background: var(--sc-brand);
}

code,
.font-monospace {
    color: #3448ad;
}

/* Modals */
.modal-content {
    overflow: hidden;
    border: 1px solid rgba(228, 231, 236, .9);
    border-radius: 1.25rem;
    box-shadow: var(--sc-shadow-float);
}

.modal-header {
    padding: 1.15rem 1.3rem;
    border-bottom-color: var(--sc-line);
}

.modal-title {
    color: var(--sc-ink);
    font-size: 1rem;
    font-weight: 760;
}

.modal-body {
    padding: 1.3rem;
}

.modal-footer {
    padding: 1rem 1.3rem;
    border-top-color: var(--sc-line);
    background: #fafbfc;
}

/* Profile */
.profile-layout {
    max-width: 860px;
}

.profile-card {
    padding: clamp(1.25rem, 3vw, 2rem);
}

.profile-report-toggle {
    border-color: var(--sc-line);
    background: #f8f9fc;
}

/* Footer */
.app-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding: 1rem clamp(1rem, 3vw, 3rem);
    border-top: 1px solid rgba(228, 231, 236, .85);
    color: #98a2b3;
    background: rgba(255, 255, 255, .64);
    font-size: .7rem;
    letter-spacing: .035em;
}

.app-footer .container-fluid {
    display: flex;
    max-width: 1580px;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    padding: 0;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.footer-mark {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sc-accent);
}

/* Authentication experience */
body.auth-page {
    min-height: 100vh;
    margin: 0;
    color: var(--sc-ink);
    background: #eef1f7;
    font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(440px, 1.12fr) minmax(420px, .88fr);
}

.auth-visual {
    position: relative;
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 5.5rem);
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background:
        radial-gradient(circle at 85% 12%, rgba(105, 130, 255, .42), transparent 30%),
        radial-gradient(circle at 15% 88%, rgba(20, 196, 155, .22), transparent 28%),
        linear-gradient(145deg, #10172c 0%, #152651 48%, #243a7a 100%);
}

.auth-visual::before {
    content: "";
    position: absolute;
    top: 16%;
    right: -10rem;
    width: 34rem;
    height: 34rem;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 50%;
    box-shadow:
        0 0 0 55px rgba(255, 255, 255, .025),
        0 0 0 110px rgba(255, 255, 255, .018);
}

.auth-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .12;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, transparent, #000 30%, transparent 92%);
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: .75rem;
    color: #fff;
    text-decoration: none;
}

.auth-brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 14px;
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(8px);
}

.auth-brand-mark img {
    width: 31px;
    height: 31px;
    object-fit: contain;
}

.auth-brand > span:last-child {
    display: grid;
}

.auth-brand strong {
    font-size: 1.05rem;
    letter-spacing: -.02em;
}

.auth-brand small {
    margin-top: .25rem;
    color: rgba(255,255,255,.5);
    font-size: .56rem;
    font-weight: 800;
    letter-spacing: .17em;
}

.auth-visual-copy {
    position: relative;
    z-index: 1;
    max-width: 680px;
}

.auth-kicker {
    color: #91a7ff;
    font-size: .65rem;
    font-weight: 850;
    letter-spacing: .18em;
}

.auth-visual-copy h1 {
    margin: 1rem 0 1.25rem;
    font-size: clamp(2.75rem, 5.2vw, 5.5rem);
    font-weight: 760;
    letter-spacing: -.065em;
    line-height: 1.06;
}

.auth-visual-copy p {
    max-width: 570px;
    margin: 0;
    color: rgba(255,255,255,.65);
    font-size: clamp(.95rem, 1.25vw, 1.12rem);
    line-height: 1.9;
}

.auth-market-strip {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.auth-market-strip span {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .58rem .8rem;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    color: rgba(255,255,255,.76);
    background: rgba(255,255,255,.055);
    font-size: .74rem;
    backdrop-filter: blur(8px);
}

.auth-market-strip i {
    color: #8fa6ff;
    font-size: .62rem;
}

.auth-market-strip span:first-child i { color: #ff7b89; }
.auth-market-strip span:nth-child(2) i { color: #fbbf5f; }
.auth-market-strip span:nth-child(3) i { color: #4bd6ad; }

.auth-panel {
    display: flex;
    min-height: 100vh;
    padding: clamp(2rem, 5vw, 5rem);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background:
        radial-gradient(circle at 100% 0, rgba(59, 91, 253, .07), transparent 30%),
        #fff;
}

.auth-form-wrap {
    width: min(100%, 440px);
}

.auth-form-heading {
    margin-bottom: 2rem;
}

.auth-form-heading h2 {
    margin: .65rem 0 .55rem;
    color: var(--sc-ink);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.04em;
}

.auth-form-heading p {
    margin: 0;
    color: var(--sc-muted);
    font-size: .9rem;
}

.auth-page .form-control,
.auth-page .input-group-text {
    min-height: 50px;
}

.auth-page .btn-lg {
    min-height: 52px;
}

.auth-switch {
    margin: 1.5rem 0 0;
    color: var(--sc-muted);
    font-size: .82rem;
    text-align: center;
}

.auth-switch a {
    color: var(--sc-brand);
    font-weight: 750;
    text-decoration: none;
}

.auth-footnote {
    width: min(100%, 440px);
    margin-top: 2rem;
    color: #98a2b3;
    font-size: .68rem;
    text-align: center;
}

/* Error experience */
.error-stage {
    display: grid;
    min-height: 62vh;
    place-items: center;
}

.error-panel {
    position: relative;
    width: min(100%, 680px);
    overflow: hidden;
    padding: clamp(2rem, 5vw, 4.5rem);
    border: 1px solid var(--sc-line);
    border-radius: 1.5rem;
    background: rgba(255,255,255,.94);
    box-shadow: var(--sc-shadow);
    text-align: center;
}

.error-code {
    position: absolute;
    top: -2.4rem;
    right: -1rem;
    color: rgba(59, 91, 253, .055);
    font-size: 9rem;
    font-weight: 900;
    letter-spacing: -.08em;
    line-height: 1;
}

.error-icon {
    position: relative;
    display: grid;
    width: 68px;
    height: 68px;
    margin: 0 auto 1.4rem;
    place-items: center;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(145deg, var(--sc-brand), #7656f8);
    box-shadow: 0 16px 32px rgba(59, 91, 253, .24);
    font-size: 1.5rem;
}

.error-panel h1 {
    position: relative;
    margin-bottom: .75rem;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.035em;
}

.error-panel p {
    position: relative;
    margin: 0 auto;
    color: var(--sc-muted);
    line-height: 1.8;
}

/* Legacy inline helpers normalized */
hr {
    border-color: var(--sc-line);
    opacity: 1;
}

.card[style*="height: 120px"] {
    height: 142px !important;
}

[style*="font-size: 2rem"] {
    opacity: .88;
}

@media (max-width: 1199.98px) {
    .app-navbar {
        padding-inline: .85rem;
    }

    .app-navbar .navbar-collapse {
        margin-top: .75rem;
        padding: .8rem;
        border: 1px solid var(--sc-line);
        border-radius: 1rem;
        background: #fff;
        box-shadow: var(--sc-shadow);
    }

    .app-primary-nav,
    .app-utility-nav {
        align-items: stretch;
        margin-left: 0;
    }

    .app-navbar .nav-link {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .brand-copy small {
        display: none;
    }

    .app-main {
        padding: 1rem .75rem 2.5rem;
    }

    .page-hero,
    .legacy-page-hero {
        align-items: flex-start !important;
        padding: 1.25rem;
        border-radius: 1.15rem;
    }

    .page-hero h1,
    .legacy-page-hero h1,
    .legacy-page-hero h2 {
        font-size: 1.65rem;
    }

    .page-hero > .d-flex,
    .legacy-page-hero > .d-flex {
        width: 100%;
    }

    .page-hero .btn,
    .legacy-page-hero .btn {
        flex: 1;
    }

    .card-body {
        padding: 1rem;
    }

    .table > thead > tr > th,
    .table > tbody > tr > td {
        padding: .75rem;
    }

    .app-footer .container-fluid {
        gap: .5rem;
        flex-direction: column;
        text-align: center;
    }

    .auth-shell {
        display: block;
    }

    .auth-visual {
        min-height: 270px;
        padding: 1.5rem;
    }

    .auth-visual-copy {
        margin: 2.5rem 0;
    }

    .auth-visual-copy h1 {
        margin-block: .7rem;
        font-size: 2.25rem;
    }

    .auth-visual-copy p,
    .auth-market-strip {
        display: none;
    }

    .auth-panel {
        min-height: calc(100vh - 270px);
        padding: 2rem 1.25rem;
        justify-content: flex-start;
    }
}

@media (min-width: 768px) and (max-width: 1050px) {
    .auth-shell {
        grid-template-columns: .85fr 1.15fr;
    }

    .auth-visual {
        padding: 2.2rem;
    }

    .auth-visual-copy h1 {
        font-size: 3.1rem;
    }
}
