/* ==========================================================================
   股票AI智能系统 — 全局设计系统
   --------------------------------------------------------------------------
   - 亮色主题，禁用暗色
   - 所有表单 / 表格 / 滚动条 / 弹窗 / 提示在此统一定义
   - 禁止使用任何外链资源
   ========================================================================== */

/* ---------- CSS 变量 ---------- */
:root {
    --primary:        #3B82F6;   /* 淡蓝主色 (blue-500) */
    --primary-hover:  #2563EB;   /* hover 加深 (blue-600) */
    --primary-light:  #EFF6FF;   /* 浅底 (blue-50) */
    --primary-soft:   #DBEAFE;   /* 软底 (blue-100) */

    --success:        #10B981;
    --success-light:  #D1FAE5;
    --warning:        #F59E0B;
    --warning-light:  #FEF3C7;
    --danger:         #EF4444;
    --danger-light:   #FEE2E2;
    --info:           #0EA5E9;
    --info-light:     #E0F2FE;

    --bg-page:        #F8FAFC;
    --bg-card:        #FFFFFF;
    --bg-soft:        #F1F5F9;
    --bg-hover:       #F8FAFC;

    --text-primary:   #0F172A;
    --text-secondary: #64748B;
    --text-muted:     #94A3B8;
    --text-inverse:   #FFFFFF;

    --border-color:   #E2E8F0;
    --border-strong:  #CBD5E1;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
    --shadow-lg: 0 10px 32px rgba(15, 23, 42, .12);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "PingFang SC Mono", monospace;

    --topbar-h:  56px;
    --sidebar-w: 200px;

    --transition: all 160ms ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img, svg { display: inline-block; vertical-align: middle; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #94A3B8; background-clip: padding-box; border: 2px solid transparent; }
* { scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent; }

/* ---------- 通用文本 ---------- */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-success   { color: var(--success); }
.text-danger    { color: var(--danger); }
.text-warning   { color: var(--warning); }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.text-mono      { font-family: var(--font-mono); }
.fw-bold        { font-weight: 600; }
.fw-semibold    { font-weight: 500; }

/* ---------- 图标 ---------- */
.icon { stroke-linecap: round; stroke-linejoin: round; color: currentColor; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 40px; height: 40px; }

/* ==========================================================================
   表单
   ========================================================================== */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.inline { flex-direction: row; align-items: center; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.form-label {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-help { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 2px; }

.form-input,
.form-select,
.form-textarea,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="search"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
}
textarea, .form-textarea {
    height: auto;
    min-height: 96px;
    padding: 10px 12px;
    line-height: 1.6;
    resize: vertical;
}
.form-input:hover,
.form-select:hover,
.form-textarea:hover,
input:hover, textarea:hover, select:hover {
    border-color: var(--border-strong);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus,
input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}
.form-input::placeholder,
.form-textarea::placeholder,
input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}
.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled,
input:disabled, textarea:disabled, select:disabled {
    background: var(--bg-soft);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* select 自定义箭头 */
select, .form-select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 32px;
}

/* checkbox / radio 自定义 */
.checkbox, .radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
}
.checkbox input[type="checkbox"],
.radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0; height: 0;
}
.checkbox .box,
.radio .box {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border-strong);
    background: var(--bg-card);
    transition: var(--transition);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.checkbox .box { border-radius: 4px; }
.radio .box    { border-radius: 50%; }
.checkbox input:checked + .box,
.radio input:checked + .box {
    background: var(--primary);
    border-color: var(--primary);
}
.checkbox input:checked + .box::after {
    content: '';
    width: 8px; height: 4px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
}
.radio input:checked + .box::after {
    content: '';
    width: 6px; height: 6px;
    background: #fff;
    border-radius: 50%;
}
.checkbox input:focus + .box,
.radio input:focus + .box {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}
.checkbox input:disabled + .box,
.radio input:disabled + .box {
    background: var(--bg-soft);
    border-color: var(--border-color);
}

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
}
.btn:hover { background: var(--bg-soft); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }

.btn-primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-success { color: #fff; background: var(--success); border-color: var(--success); }
.btn-success:hover { filter: brightness(.95); }

.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { filter: brightness(.95); }

.btn-warning { color: #fff; background: var(--warning); border-color: var(--warning); }
.btn-warning:hover { filter: brightness(.95); }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--text-primary); }

.btn-link {
    background: transparent;
    border-color: transparent;
    color: var(--primary);
    padding: 0 4px;
    height: auto;
}
.btn-link:hover { background: transparent; text-decoration: underline; }

/* ==========================================================================
   卡片
   ========================================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -20px -20px 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.card-header h2,
.card-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.card-actions { display: flex; align-items: center; gap: 8px; }

.placeholder { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.placeholder h2 { color: var(--text-primary); margin-bottom: 8px; }

/* ==========================================================================
   表格
   ========================================================================== */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.table thead th {
    text-align: left;
    padding: 12px 14px;
    background: var(--bg-soft);
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr.is-selected { background: var(--primary-light); }
.table .col-actions { width: 1%; white-space: nowrap; }
.table .col-num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }

.table-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 12px 14px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
}
.pagination .pg-info { margin-right: auto; }
.pagination .btn { height: 28px; padding: 0 10px; font-size: 12px; }
.pagination .btn.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ==========================================================================
   徽标 / 标签
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 10px;
    line-height: 1;
}
.badge-success { color: var(--success); background: var(--success-light); }
.badge-danger  { color: var(--danger);  background: var(--danger-light); }
.badge-warning { color: var(--warning); background: var(--warning-light); }
.badge-info    { color: var(--info);    background: var(--info-light); }
.badge-muted   { color: var(--text-secondary); background: var(--bg-soft); }

/* ==========================================================================
   Tooltip
   ========================================================================== */
.tooltip {
    position: relative;
    display: inline-flex;
}
.tooltip[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.4;
    color: #fff;
    background: rgba(15, 23, 42, .9);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    z-index: 2000;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-root {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
}
.modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .35);
    backdrop-filter: blur(2px);
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modal-fade .15s ease;
}
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 480px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modal-pop .18s ease;
}
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 6px;
}
.modal-close:hover { background: var(--bg-soft); color: var(--text-primary); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-page);
}

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop  { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

/* ==========================================================================
   Toast
   ========================================================================== */
.toast-root {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 13px;
    pointer-events: auto;
    animation: toast-in .2s ease;
}
.toast-success { border-color: var(--success); color: var(--success); }
.toast-error   { border-color: var(--danger);  color: var(--danger);  }
.toast-warning { border-color: var(--warning); color: var(--warning); }
.toast-info    { border-color: var(--info);    color: var(--info);    }

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

/* ==========================================================================
   主框架（顶栏 + 侧栏 + 内容）
   ========================================================================== */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.topbar-left  { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 600;
    font-size: 16px;
}
.brand-text { color: var(--text-primary); }

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-soft);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary);
}

.layout {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* ---------- 侧栏：完全竖向，可折叠的大类 ---------- */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 12px 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-group { display: flex; flex-direction: column; }

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    background: transparent;
    border: none;
    text-align: left;
    width: 100%;
}
.nav-group-header:hover { background: var(--bg-soft); }
.nav-group-header .nav-icon { color: var(--text-secondary); flex-shrink: 0; }
.nav-group-header .nav-label { flex: 1; }
.nav-group-header .nav-chevron {
    color: var(--text-muted);
    transition: transform .2s ease;
    flex-shrink: 0;
}
.nav-group.is-open  > .nav-group-header .nav-chevron { transform: rotate(90deg); }
.nav-group.is-open  > .nav-group-header { color: var(--primary); }
.nav-group.is-open  > .nav-group-header .nav-icon { color: var(--primary); }

.nav-group-body {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0 6px 8px;
    padding-left: 12px;
    border-left: 1px dashed var(--border-color);
}
.nav-group.is-open > .nav-group-body { display: flex; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition);
}
.nav-item:hover { background: var(--bg-soft); color: var(--text-primary); }
.nav-item .nav-icon { color: var(--text-muted); flex-shrink: 0; }
.nav-item.is-active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}
.nav-item.is-active .nav-icon { color: var(--primary); }

.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-width: 0;
}

/* ==========================================================================
   登录页 — 左装饰 + 右表单
   ========================================================================== */
.auth-layout {
    min-height: 100vh;
    display: flex;
    background: var(--bg-card);
}

/* 左侧装饰栏 */
.auth-decor {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    background: linear-gradient(135deg, #1E3A8A 0%, #1D4ED8 30%, #2563EB 60%, #3B82F6 100%);
}
.auth-decor svg.bg-deco {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.auth-decor .deco-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 40px;
    max-width: 520px;
}
.auth-decor .deco-mark {
    width: 132px;
    height: 132px;
    margin: 0 auto 28px;
    color: #FFFFFF;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .25);
}
.auth-decor h1 {
    margin: 0 0 12px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 4px;
    text-shadow: 0 2px 16px rgba(15, 23, 42, .3);
}
.auth-decor .slogan {
    font-size: 15px;
    opacity: .88;
    line-height: 1.9;
    margin: 0;
    letter-spacing: 1px;
}
.auth-decor .deco-features {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 28px;
    font-size: 13px;
    opacity: .85;
}
.auth-decor .deco-features span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 右侧表单栏 */
.auth-form-side {
    width: 480px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg-card);
}
.auth-card {
    width: 100%;
    max-width: 360px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
.auth-header { margin-bottom: 28px; }
.auth-title { margin: 0; font-size: 24px; font-weight: 700; color: var(--text-primary); }
.auth-subtitle { margin: 6px 0 0; color: var(--text-secondary); font-size: 14px; }
.auth-tip { margin-top: 20px; font-size: 12px; color: var(--text-muted); text-align: center; }

@media (max-width: 960px) {
    .auth-layout { flex-direction: column; }
    .auth-decor { min-height: 240px; flex: 0 0 auto; }
    .auth-decor .deco-mark { width: 84px; height: 84px; margin-bottom: 12px; border-radius: 18px; }
    .auth-decor h1 { font-size: 22px; }
    .auth-decor .deco-features { display: none; }
    .auth-form-side { width: 100%; padding: 28px 24px; }
}

/* ==========================================================================
   工具类
   ========================================================================== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-0 { padding: 0; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ==========================================================================
   行情三色系（A 股惯例：涨红 / 跌绿 / 平灰）
   —— 所有显示股票的容器统一使用
   ========================================================================== */
.up   { color: #DC2626; }
.down { color: #16A34A; }
.flat { color: var(--text-muted); }

/* 行情显示元件 */
.price-value {
    font-weight: 600;
    font-size: 14px;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}
.price-pct {
    font-size: 13px;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* 整行三色染色 —— 表格里 tr.row-up/down/flat 生效，连带所有文字 cell */
.table tbody tr.row-up   td { color: #DC2626; }
.table tbody tr.row-down td { color: #16A34A; }
.table tbody tr.row-flat td { color: var(--text-muted); }

/* 行着色时，按钮/徽章/sparkline 保留自己的颜色，避免 UI 错乱 */
.table tbody tr[class*="row-"] td .btn           { color: var(--text-primary); }
.table tbody tr[class*="row-"] td .btn-primary   { color: #fff; }
.table tbody tr[class*="row-"] td .btn-success   { color: #fff; }
.table tbody tr[class*="row-"] td .btn-danger    { color: #fff; }
.table tbody tr[class*="row-"] td .btn-warning   { color: #fff; }
.table tbody tr[class*="row-"] td .btn-ghost     { color: var(--text-secondary); }
.table tbody tr[class*="row-"] td .btn-link      { color: var(--primary); }
.table tbody tr[class*="row-"] td .badge         { color: var(--primary); }
.table tbody tr[class*="row-"] td .badge-success { color: var(--success); }
.table tbody tr[class*="row-"] td .badge-danger  { color: var(--danger); }
.table tbody tr[class*="row-"] td .badge-warning { color: var(--warning); }
.table tbody tr[class*="row-"] td .badge-info    { color: var(--info); }
.table tbody tr[class*="row-"] td .badge-muted   { color: var(--text-secondary); }

/* 行点击态 */
.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr.is-clickable:hover { background: var(--bg-hover); }

/* 价格/涨跌幅本体三色（当行未着色时也能用） */
.price-value.up,
.price-pct.up   { color: #DC2626; }
.price-value.down,
.price-pct.down { color: #16A34A; }
.price-value.flat { color: var(--text-primary); }
.price-pct.flat { color: var(--text-muted); }
/* 行内 price-value/price-pct 继承行色时保留三色语义，不被 tr.row-up td 的 color 覆盖 */
.table tbody tr[class*="row-"] td .price-value.up,
.table tbody tr[class*="row-"] td .price-pct.up   { color: #DC2626; }
.table tbody tr[class*="row-"] td .price-value.down,
.table tbody tr[class*="row-"] td .price-pct.down { color: #16A34A; }
.table tbody tr[class*="row-"] td .price-value.flat { color: var(--text-primary); }
.table tbody tr[class*="row-"] td .price-pct.flat { color: var(--text-muted); }

/* 股票详情 modal：基础信息 + K 线 一体页 */
/* 全屏级 modal（详情页专用） */
.modal-max {
    width: 96vw !important;
    max-width: 96vw !important;
    height: 88vh;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}
.modal-max .modal-header { flex-shrink: 0; }
.modal-max .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* 详情页 tab 导航 */
.stock-detail-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    padding: 0 20px;
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 2;
}
.stock-detail-tab {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
}
.stock-detail-tab:hover { color: var(--text-primary); }
.stock-detail-tab.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.stock-detail-pane {
    display: none;
    padding: 14px 20px;
}
.stock-detail-pane.is-active { display: block; }
/* 详细信息 tab 允许滚动（覆盖 K 线 tab 的 overflow:hidden） */
.stock-detail-pane.is-active.is-scrollable { overflow-y: auto; }

/* K 线 tab 左右布局：chart 按容器实际像素渲染，不缩放 */
.stock-detail-pane.is-active { overflow: hidden; }
.stock-detail-kline-layout {
    display: flex;
    gap: 16px;
    /* 严格不超出 modal body：88vh - header(52) - stockHeader(52) - tabbar(36) - padding(28) - 预留(40) */
    height: calc(88vh - 208px);
}
.stock-detail-kline-left {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
/* ECharts 容器撑满 */
.stock-detail-kline-left > div {
    width: 100%;
    height: 100%;
}
/* 中间列：可视化图表 */
.stock-detail-kline-mid {
    width: 280px;
    flex-shrink: 0;
    overflow: hidden;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding: 0 18px;
}
.kmid-donut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
}
.kmid-legend {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--text-secondary);
}
/* 右列：数据面板 */
.stock-detail-kline-right {
    width: 200px;
    flex-shrink: 0;
    overflow-y: auto;
    padding-left: 14px;
}
.stock-detail-kline-right .stock-detail-info {
    grid-template-columns: 1fr;
}
.stock-detail-kline-right .stock-detail-section {
    font-size: 13px;
    margin: 14px 0 8px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
}
.stock-detail-kline-right .stock-detail-section:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.kright-chart-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    margin-top: 10px;
    letter-spacing: 0.5px;
}
.kright-chart-title:first-child { margin-top: 0; }
.dot-buy, .dot-sell {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.dot-buy  { background: #DC2626; }
.dot-sell { background: #16A34A; }
/* 量能信号 */
.kmid-vol-signal { margin-bottom: 10px; }
.kmid-vol-label {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}
.kmid-vol-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    font-size: 11px;
    color: var(--text-secondary);
}
.kmid-vol-row span:first-child {
    width: 32px;
    flex-shrink: 0;
    text-align: right;
}
.kmid-vol-row span:last-child {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 10px;
}
.kmid-vol-bar {
    height: 12px;
    border-radius: 3px;
    min-width: 2px;
    flex: 1;
}

/* 均线距离 */
.kmid-ma-list { margin-bottom: 6px; }
.kmid-ma-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}
.kmid-ma-row:last-child { border-bottom: none; }
.kmid-ma-label {
    font-weight: 600;
    color: var(--text-secondary);
    width: 36px;
    flex-shrink: 0;
}
.kmid-ma-val {
    font-family: var(--font-mono);
    color: var(--text-primary);
    flex: 1;
}
.kmid-ma-dist {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 11px;
}
.kmid-ma-tag {
    font-size: 10px;
    color: var(--text-muted);
}
.kmid-ma-summary {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 0 2px;
    letter-spacing: 1px;
}

/* 新闻/来源 tab 里的外链卡片 */
.source-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.source-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}
.source-card:hover {
    border-color: var(--primary-soft);
    box-shadow: var(--shadow-sm);
    color: var(--primary);
}
.source-card-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.source-card-body h4 { margin: 0 0 2px; font-size: 14px; }
.source-card-body p  { margin: 0; font-size: 12px; color: var(--text-muted); }

.stock-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 14px;
}
.stock-detail-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.stock-detail-quote {
    padding: 8px 0 14px;
}
.stock-detail-big-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.stock-detail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
    margin-top: 16px;
}
.stock-detail-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.stock-detail-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 16px;
    padding: 12px 0 18px;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 16px;
}
.stock-detail-kv {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
}
.stock-detail-k {
    color: var(--text-muted);
    min-width: 56px;
    font-size: 12px;
}
.stock-detail-v {
    color: var(--text-primary);
}
.stock-detail-section {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}
.stock-detail-chart {
    width: 100%;
    overflow-x: auto;
}

/* 原生 SVG 蜡烛图容器（不缩放，按实际像素渲染） */
.candlestick-chart {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.candlestick-svg {
    display: block;
    /* width/height 由 JS 按容器实际像素设定，不用 CSS 缩放 */
}
/* 十字光标浮窗 */
.candlestick-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.92);
    color: #CBD5E1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.6;
    font-family: var(--font-mono);
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(100, 116, 139, 0.3);
}
.candlestick-tooltip b {
    color: #fff;
    font-weight: 600;
}

/* 迷你 K 线 sparkline */
.sparkline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 24px;
    padding: 0;
    border-radius: 4px;
    vertical-align: middle;
    color: var(--text-muted);
}
.sparkline.is-clickable {
    cursor: pointer;
    transition: background 0.15s;
}
.sparkline.is-clickable:hover {
    background: var(--bg-soft);
}
.sparkline-up   { color: #DC2626; }
.sparkline-down { color: #16A34A; }
.sparkline.is-empty .sparkline-dash {
    color: var(--text-muted);
    font-size: 13px;
}
.sparkline-svg { display: block; }

/* ==========================================================================
   策略管理 — 左竖 tab + 右详情布局
   ========================================================================== */
.strategy-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    align-items: start;
}
.strategy-aside {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 16px;
}
.strategy-aside .aside-title {
    padding: 8px 10px 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.strategy-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
    border: 1px solid transparent;
}
.strategy-tab:hover { background: var(--bg-soft); color: var(--text-primary); }
.strategy-tab.is-active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-soft);
    font-weight: 500;
}
.strategy-tab .tab-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strategy-tab .tab-active-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}
.strategy-tab.is-empty {
    justify-content: center;
    border: 1px dashed var(--border-color);
    color: var(--primary);
    margin-top: 4px;
}

.strategy-detail {
    min-width: 0;
}
.strategy-detail .detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.strategy-detail .detail-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
}
.strategy-detail .detail-class {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.strategy-detail .detail-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.dim-card {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 8px;
}
.dim-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.dim-card-head strong { font-size: 14px; }
.dim-card .ai-prompt {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    background: var(--bg-card);
    border-radius: 6px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   控制台 tab 专用组件
   ========================================================================== */

/* 行内操作按钮组（用于表格操作列）
   —— 强制单行排列，禁止竖排。列宽不够时溢出隐藏或用户横向滚动，不换行。 */
.row-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 6px;
    white-space: nowrap;
}
.row-actions .btn { white-space: nowrap; flex-shrink: 0; }
/* 操作列本身宽度自适应内容，不压缩 */
.table .col-actions .row-actions { white-space: nowrap; }

/* 持仓回测：卡片网格 */
.holding-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.holding-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition);
}
.holding-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-soft);
}
.holding-card.is-closed { opacity: 0.85; }
.holding-card.is-closed::after {
    content: '已清仓';
    align-self: flex-start;
    font-size: 11px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1px 8px;
}

.holding-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.holding-card-code {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
}
.holding-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.holding-card-quote {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0 2px;
}
.holding-card-quote .holding-card-quote-label {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.holding-card-quote .price-cell {
    flex: 1;
}
.holding-card-quote .sparkline {
    min-width: 56px;
    height: 20px;
}
.holding-card-return {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.1;
    margin: 4px 0;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}
.holding-card-return.up   { color: #DC2626; } /* A 股惯例：涨红 */
.holding-card-return.down { color: #16A34A; } /* 跌绿 */
.holding-card-return small {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}
.holding-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    font-size: 12px;
    color: var(--text-secondary);
}
.holding-card-meta b { color: var(--text-primary); font-weight: 500; }
.holding-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}
.holding-card-actions .btn { flex: 1; }

/* 路由管理：URL 卡片 */
.route-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 16px;
    transition: var(--transition);
}
.route-card:hover {
    border-color: var(--primary-soft);
    box-shadow: var(--shadow-sm);
}
.route-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.route-card-head .route-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.route-card-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}
.route-card-head .badge {
    margin-left: auto;
}
.route-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 14px;
}
.route-card-desc ul {
    margin: 6px 0 0 0;
    padding-left: 22px;
}
.route-card-desc li { margin-bottom: 2px; }
.route-url-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 12px;
}
.route-url-box code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    background: none;
    padding: 0;
    word-break: break-all;
    user-select: all;
}
.route-card-actions {
    display: flex;
    gap: 8px;
}
.route-output {
    margin-top: 14px;
    background: #0F172A;
    color: #E2E8F0;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.55;
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.route-output.is-hidden { display: none; }

/* 网络自检结果区 */
.net-check-result { margin-top: 14px; }
.net-check-result.is-hidden { display: none; }
.net-check-hint {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 12px;
}
.net-check-hint.is-ok {
    background: var(--success-light);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #047857;
}
.net-check-hint.is-warn {
    background: var(--warning-light);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #92400E;
}
.route-output .route-output-head {
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 6px;
    border-bottom: 1px solid #334155;
    padding-bottom: 4px;
}

/* 过滤/工具栏通用：card-header 内的一排小控件 */
.toolbar-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}
.toolbar-row .form-input,
.toolbar-row .form-select { height: 32px; }
.toolbar-row label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 批次卡片（往期选股） */
.batch-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
}
.batch-card:hover {
    border-color: var(--primary-soft);
    box-shadow: var(--shadow-sm);
}
.batch-card .batch-id {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--primary);
    min-width: 48px;
}
.batch-card .batch-time {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    min-width: 150px;
}
.batch-card .batch-strategy {
    flex: 1;
    font-size: 13px;
}
.batch-card .batch-counts {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}
.batch-card .batch-counts b {
    color: var(--text-primary);
    font-weight: 600;
}

/* ==========================================================================
   安全视觉组件 (Secure UI pack)
   --------------------------------------------------------------------------
   为登录 / 关键操作场景提供"专业安全感"的装饰组件：
     .secure-strip       TLS 加密通道状态条（含脉冲绿点）
     .enc-chip           加密指纹小徽章（可切换 .active）
     .slide-unlock       滑动解锁按钮（配套 JS 见 UI/examples/login.example.html）
     .sec-badges/-badge  安全协议徽章组
     .sec-fingerprint    伪会话指纹行
   组件均纯装饰不做真实加密，用于增强用户对安全性的感知。
   ========================================================================== */

/* TLS 加密通道状态条 */
.secure-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    margin-bottom: 18px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    color: #047857;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2px;
}
.secure-strip svg { flex-shrink: 0; }
.secure-strip .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65);
    animation: sec-pulse 1.6s infinite;
}
@keyframes sec-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(16, 185, 129, 0.65); }
    70%  { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);    }
    100% { box-shadow: 0 0 0 0   rgba(16, 185, 129, 0);    }
}

/* 标签行：form-label + 右侧加密指纹 chip */
.label-with-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.label-with-chip .form-label { margin-bottom: 0; }

/* 加密指纹 chip */
.enc-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 11px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.22);
    color: var(--primary-hover);
    font-size: 10.5px;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
    transition: var(--transition);
}
.enc-chip svg { color: var(--primary); }
.enc-chip .enc-hex {
    min-width: 52px;
    text-align: center;
    display: inline-block;
}
.enc-chip.active {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.4);
}

/* 滑动解锁 */
.slide-unlock {
    position: relative;
    margin-top: 22px;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #F1F5F9 0%, #E2E8F0 100%);
    border: 1px solid var(--border-strong);
    overflow: hidden;
    user-select: none;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    touch-action: none;
}
.slide-unlock::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg,
        transparent 35%,
        rgba(255, 255, 255, 0.55) 50%,
        transparent 65%);
    background-size: 220% 100%;
    animation: slide-shimmer 2.6s linear infinite;
    pointer-events: none;
}
@keyframes slide-shimmer {
    0%   { background-position: 220%  0; }
    100% { background-position: -220% 0; }
}
.slide-unlock .slide-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 52px;
    background: linear-gradient(90deg, var(--primary) 0%, #60A5FA 100%);
    transition: width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}
.slide-unlock .slide-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    pointer-events: none;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
    letter-spacing: 0.5px;
}
.slide-unlock .slide-thumb {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
    transition: left 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
                background 0.2s, border-color 0.2s, color 0.2s;
    color: var(--primary);
    touch-action: none;
}
.slide-unlock .slide-thumb:hover { border-color: #93C5FD; }
.slide-unlock .slide-thumb:active { cursor: grabbing; }
.slide-unlock .slide-thumb .thumb-icon-check { display: none; }
.slide-unlock.dragging .slide-thumb,
.slide-unlock.dragging .slide-fill { transition: none; }
.slide-unlock.unlocked .slide-fill {
    background: linear-gradient(90deg, #059669 0%, var(--success) 100%);
}
.slide-unlock.unlocked .slide-thumb {
    background: var(--success);
    color: var(--text-inverse);
    border-color: var(--success);
}
.slide-unlock.unlocked .slide-thumb .thumb-icon-lock  { display: none; }
.slide-unlock.unlocked .slide-thumb .thumb-icon-check { display: block; }
.slide-unlock.unlocked .slide-text {
    color: var(--text-inverse);
    text-shadow: none;
    font-weight: 600;
}
.slide-unlock.unlocked::before { animation: none; background: none; }

/* 安全协议徽章 */
.security-footer { margin-top: 16px; }
.sec-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 10px;
}
.sec-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-mono);
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    color: #475569;
    letter-spacing: 0.4px;
}
.sec-badge svg { color: var(--text-secondary); }

/* 会话指纹行 */
.sec-fingerprint {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 0.3px;
}
.sec-fingerprint code {
    color: var(--text-secondary);
    background: none;
    padding: 0;
    font-family: inherit;
}

/* ==========================================================================
   汉堡菜单按钮（默认隐藏，移动端显示）
   ========================================================================== */
.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
}
.hamburger-btn:hover { background: var(--bg-soft); }

/* ==========================================================================
   移动端响应式 (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {

    /* ---------- 汉堡按钮 ---------- */
    .hamburger-btn { display: flex; }

    /* ---------- 顶栏 ---------- */
    .topbar {
        height: 48px;
        padding: 0 12px;
    }
    .topbar-left { gap: 8px; }
    .topbar-right { gap: 6px; }
    .brand-text { font-size: 14px; }
    .brand .icon-md { width: 18px; height: 18px; }
    .user-chip { padding: 4px 8px; font-size: 12px; gap: 4px; }
    .user-chip .badge { font-size: 10px; padding: 1px 5px; }

    /* ---------- 侧栏：默认隐藏，覆盖展示 ---------- */
    .sidebar {
        position: fixed;
        top: 48px;
        left: 0;
        bottom: 0;
        width: 240px;
        z-index: 900;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: none;
        background: var(--bg-card);
        border-right: 1px solid var(--border-color);
    }
    .sidebar.is-mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    /* 半透明遮罩：用 sidebar 自身的 ::before 充当 */
    .sidebar.is-mobile-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 240px;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, .3);
    }

    /* ---------- 内容区 ---------- */
    .layout { flex-direction: column; }
    .content {
        padding: 12px;
        width: 100%;
    }

    /* ---------- 表格：横向滚动 ---------- */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table { min-width: 600px; }

    /* ---------- 卡片：单列 ---------- */
    .card-grid,
    .form-grid {
        grid-template-columns: 1fr !important;
    }

    /* ---------- 持仓卡片网格：单列 ---------- */
    .holding-grid {
        grid-template-columns: 1fr;
    }

    /* ---------- Modal：全屏 ---------- */
    .modal {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .modal-max {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    /* ---------- 股票详情K线：纵向堆叠 ---------- */
    .stock-detail-kline-layout {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
    }
    .stock-detail-kline-left {
        min-height: 280px;
        height: 50vw;
        max-height: 360px;
    }
    .stock-detail-kline-mid {
        width: 100%;
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--border-color);
        padding: 12px 0;
    }
    .stock-detail-kline-right {
        width: 100%;
        padding-left: 0;
        border-top: 1px solid var(--border-color);
        padding-top: 12px;
    }

    /* ---------- 登录页：隐藏左侧装饰 ---------- */
    .auth-layout { flex-direction: column; }
    .auth-decor { display: none; }
    .auth-form-side {
        width: 100%;
        padding: 24px 16px;
        min-height: 100vh;
    }

    /* ---------- 字体缩小 ---------- */
    body { font-size: 13px; }
    .card-header h2 { font-size: 15px; }
    .table { font-size: 12px; }
    .table thead th { padding: 10px 10px; }
    .table tbody td { padding: 10px 10px; }

    /* ---------- 按钮：大触控目标 ---------- */
    .btn { min-height: 44px; padding: 10px 16px; }
    .btn-sm { min-height: 36px; padding: 6px 12px; }

    /* ---------- 表单输入：防止 iOS 缩放 ---------- */
    .form-input,
    .form-select,
    .form-textarea,
    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="email"],
    input[type="search"],
    input[type="date"],
    input[type="time"],
    textarea,
    select {
        font-size: 16px;
        height: 44px;
    }
    textarea, .form-textarea {
        height: auto;
        min-height: 88px;
    }

    /* ---------- 工具栏：允许换行 ---------- */
    .toolbar-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .toolbar-row .form-select,
    .toolbar-row .form-input {
        width: 100% !important;
    }

    /* ---------- 股票详情 tab 栏横向滚动 ---------- */
    .stock-detail-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 12px;
    }

    /* ---------- 分页 ---------- */
    .pagination { padding: 10px; gap: 4px; font-size: 12px; }
    .pagination .btn { min-height: 36px; min-width: 36px; padding: 4px 8px; }
}

/* 日期 tab 导航（海选池/入围池按日期分组用） */
.date-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 14px;
    overflow-x: auto;
}
.date-tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    cursor: pointer;
}
.date-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.date-tab.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* 策略说明 */
.strategy-readme {
    padding: 4px 0;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-secondary);
}
.strategy-readme h4 { color: var(--text-primary); }
.strategy-readme strong { color: var(--text-primary); font-weight: 600; }
