* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; background: #f5f6fa; color: #2c3e50; }

/* 导航 */
.navbar { display: flex; align-items: center; padding: 0 20px; height: 52px; background: #fff; border-bottom: 2px solid #3498db; }
.nav-brand { font-size: 18px; font-weight: 700; color: #3498db; margin-right: 32px; }
.nav-links { list-style: none; display: flex; gap: 20px; flex: 1; }
.nav-links a { text-decoration: none; color: #555; font-size: 14px; }
.nav-links a:hover { color: #3498db; }

/* 用户区 */
.nav-user { display: flex; align-items: center; gap: 14px; }
.user-name { font-size: 14px; color: #333; font-weight: 600; }

/* 搜索框 */
.nav-search { display: flex; align-items: center; margin-right: 16px; }
.nav-search input {
    width: 130px; padding: 4px 10px; border: 1px solid #ddd; border-radius: 14px;
    font-size: 13px; font-family: monospace; outline: none; transition: border-color 0.15s;
}
.nav-search input:focus { border-color: #3498db; width: 150px; }

.btn-link { font-size: 13px; color: #888; text-decoration: none; }
.btn-link:hover { color: #3498db; }

/* 主容器 */
.container { max-width: 96%; margin: 20px auto; padding: 0 12px; }
h2 { margin-bottom: 14px; font-size: 22px; }
.card { background: #fff; border-radius: 8px; padding: 18px 22px; margin-bottom: 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.card h3 { font-size: 16px; margin-bottom: 12px; color: #555; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid #eee; text-align: left; }
.table th { background: #f8f9fa; font-weight: 600; color: #666; }
.table tr:hover { background: #f0f7ff; }

/* 状态色 */
.positive { color: #e74c3c; font-weight: 600; }
.negative { color: #27ae60; font-weight: 600; }
.loading { padding: 40px; text-align: center; color: #999; }
.empty { padding: 30px; text-align: center; color: #aaa; }
.error { padding: 20px; text-align: center; color: #e74c3c; background: #fdf2f2; border-radius: 4px; }

/* 筛选栏 */
.filter-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.filter-bar label { font-size: 13px; }
.filter-bar input, .filter-bar select { padding: 4px 8px; border: 1px solid #ddd; border-radius: 4px; }
.filter-bar button { padding: 5px 16px; background: #3498db; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.filter-bar button:hover { background: #2980b9; }

/* ===== 控制台 ===== */
.hint { font-size: 13px; color: #888; margin-bottom: 14px; }

.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.param-label { font-size: 13px; color: #666; display: flex; align-items: center; gap: 4px; }
.param-label input { padding: 3px 6px; border: 1px solid #ccc; border-radius: 3px; font-size: 13px; }

.btn { padding: 8px 18px; border: none; border-radius: 5px; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity 0.15s; }
.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-blue   { background: #3498db; }
.btn-teal   { background: #1abc9c; }
.btn-purple { background: #9b59b6; }
.btn-green  { background: #27ae60; }
.btn-orange { background: #e67e22; }
.btn-red    { background: #e74c3c; }
.btn-indigo { background: #4b6584; }
.btn-violet { background: #8854d0; }
.btn-cyan   { background: #0fb9b1; }
.btn-slate  { background: #778ca3; }

/* 命令块 */
.cmd-block {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; margin-bottom: 8px;
    background: #f8f9fb; border-radius: 6px; border: 1px solid #eef0f4;
}
.cmd-block:last-child { margin-bottom: 0; }
.cmd-title {
    font-size: 13px; font-weight: 600; color: #555; min-width: 90px;
}
.cmd-params { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.param-num { width: 55px; padding: 3px 6px; border: 1px solid #ccc; border-radius: 3px; font-size: 13px; }
.param-code { width: 80px; padding: 3px 6px; border: 1px solid #ccc; border-radius: 3px; font-size: 13px; font-family: monospace; text-transform: uppercase; }

.log-console {
    background: #1e1e1e; color: #d4d4d4; font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 12px; line-height: 1.55; padding: 14px 16px; border-radius: 6px;
    min-height: 300px; max-height: 500px; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
}

.status-badge { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.status-idle    { background: #e8e8e8; color: #888; }
.status-running { background: #fff3cd; color: #856404; animation: pulse 1.2s infinite; }
.status-done    { background: #d4edda; color: #155724; }
.status-failed  { background: #f8d7da; color: #721c24; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== 仪表盘 ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.stat-card.sc-blue::before   { background: linear-gradient(90deg, #3498db, #2ecc71); }
.stat-card.sc-green::before  { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.stat-card.sc-purple::before { background: linear-gradient(90deg, #9b59b6, #8e44ad); }
.stat-card.sc-orange::before { background: linear-gradient(90deg, #e67e22, #f39c12); }

.stat-label { font-size: 12px; color: #888; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 700; color: #2c3e50; line-height: 1.1; }
.stat-sub { font-size: 12px; color: #999; margin-top: 4px; }

.dash-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}
@media (max-width: 900px) {
    .dash-row { grid-template-columns: 1fr; }
}

/* 准确率条形图 */
.acc-bar-wrap { margin-bottom: 10px; }
.acc-bar-label {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; margin-bottom: 4px;
}
.acc-bar-label span:first-child { font-weight: 600; color: #555; }
.acc-bar-label span:last-child { font-weight: 700; }
.acc-bar-track {
    height: 10px; background: #eef0f4; border-radius: 5px; overflow: hidden;
}
.acc-bar-fill {
    height: 100%; border-radius: 5px; transition: width 0.6s ease;
}
.acc-bar-fill.ab-high  { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.acc-bar-fill.ab-mid   { background: linear-gradient(90deg, #f39c12, #e67e22); }
.acc-bar-fill.ab-low   { background: linear-gradient(90deg, #e74c3c, #c0392b); }

/* 预测卡片 */
.pred-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.pred-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-left: 4px solid #3498db;
}
.pred-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.pred-card-header .stock-name { font-weight: 700; font-size: 15px; color: #2c3e50; }
.pred-card-header .stock-code { font-size: 12px; color: #999; font-family: monospace; }
.pred-card-row {
    display: flex; gap: 16px; font-size: 13px; color: #666; margin-top: 4px;
}
.pred-card-row .val { font-weight: 600; color: #333; }
.conf-tag {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
}
.conf-tag.ct-hi { background: #d4edda; color: #155724; }
.conf-tag.ct-mid { background: #fff3cd; color: #856404; }
.conf-tag.ct-lo { background: #e8e8e8; color: #888; }

.market-tag {
    display: inline-block; padding: 1px 6px; border-radius: 3px;
    font-size: 11px; color: #fff; background: #95a5a6; margin-left: 4px;
}

.industry-tag {
    display: inline-block; padding: 1px 6px; border-radius: 3px;
    font-size: 11px; color: #2980b9; background: #eaf2f8; margin-left: 4px;
}

.copy-code { cursor: pointer; transition: color 0.2s; }
.copy-code:hover { color: #3498db !important; }
.copy-btn {
    cursor: pointer; margin-left: 2px; font-size: 13px;
    opacity: 0.5; transition: opacity 0.2s; vertical-align: middle;
}
.copy-btn:hover { opacity: 1; }

/* 趋势图 (纯 CSS) */
.trend-chart {
    display: flex; align-items: flex-end; gap: 8px; height: 100px; padding-top: 8px;
}
.trend-bar-wrap {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%;
}
.trend-bar {
    width: 100%; min-height: 4px; border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, #3498db, #2ecc71);
    transition: height 0.4s ease;
}
.trend-label { font-size: 11px; color: #999; white-space: nowrap; }
.trend-count { font-size: 11px; color: #555; font-weight: 600; }

/* 置信度分布 */
.conf-dist { display: flex; gap: 12px; flex-wrap: wrap; }
.conf-dist-item {
    flex: 1; min-width: 80px; text-align: center; padding: 12px 8px;
    background: #f8f9fb; border-radius: 8px;
}
.conf-dist-item .num { font-size: 24px; font-weight: 700; color: #2c3e50; }
.conf-dist-item .label { font-size: 12px; color: #888; margin-top: 2px; }

/* 快捷入口 */
.quick-links { display: flex; gap: 12px; flex-wrap: wrap; }
.quick-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 6px;
    background: #f0f7ff; color: #3498db; text-decoration: none;
    font-size: 13px; font-weight: 600; transition: all 0.15s;
}
.quick-link:hover { background: #3498db; color: #fff; }

/* 个股详情页 */
.stock-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; background: #fff; border-radius: 8px;
    margin-bottom: 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.stock-h-left { display: flex; align-items: center; gap: 6px; }
.stock-h-code { font-size: 22px; font-weight: 700; color: #2c3e50; font-family: monospace; }
.stock-h-name { font-size: 16px; color: #555; margin-left: 4px; }

.section-title {
    font-size: 16px; font-weight: 700; color: #2c3e50;
    margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.section-title::before {
    content: ''; width: 4px; height: 18px; background: #3498db;
    border-radius: 2px; display: inline-block;
}
