/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 头部 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* 测试环境标识 */
.env-badge-test {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 12px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 12px;
    font-size: 0.82em;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Tab 导航 */
.tab-navigation {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.tab-button {
    flex: 1;
    padding: 15px 30px;
    background: transparent;
    border: none;
    font-size: 1.1em;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #e9ecef;
    color: #667eea;
}

.tab-button.active {
    color: #667eea;
    background: white;
    border-bottom: 3px solid #667eea;
}

/* Tab 内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 主内容 */
main {
    padding: 40px;
}

/* 输入区域 */
.input-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.input-section h2 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.5em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.help-text {
    display: block;
    margin-top: 8px;
    color: #888;
    font-size: 0.9em;
}

/* 按钮 */
.btn-primary, .btn-secondary {
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    font-size: 0.9em;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 日志展开/收起按钮 */
.log-toggle-container {
    text-align: center;
    margin: 20px 0;
}

.btn-toggle-log {
    padding: 10px 30px;
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 8px;
    color: #667eea;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-toggle-log:hover {
    background: #667eea;
    color: white;
}

#toggleLogIcon {
    display: inline-block;
    transition: transform 0.3s;
}

#toggleLogIcon.expanded {
    transform: rotate(180deg);
}

/* 实时日志容器 */
.log-container {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

.log-header h3 {
    color: #0f0;
    font-size: 1.2em;
    margin: 0;
}

.btn-small {
    padding: 6px 15px;
    background: #333;
    color: #0f0;
    border: 1px solid #0f0;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-small:hover {
    background: #0f0;
    color: #1e1e1e;
}

.log-content {
    background: #000;
    color: #0f0;
    font-family: 'Courier New', 'Consolas', monospace;
    padding: 15px;
    height: 400px;
    overflow-y: auto;
    border-radius: 8px;
    font-size: 0.9em;
    line-height: 1.6;
}

.log-content::-webkit-scrollbar {
    width: 8px;
}

.log-content::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb {
    background: #0f0;
    border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb:hover {
    background: #0c0;
}

.log-entry {
    margin: 5px 0;
    padding: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.log-time {
    color: #888;
    flex-shrink: 0;
}

.log-level {
    font-weight: bold;
    flex-shrink: 0;
    min-width: 60px;
}

.log-message {
    flex: 1;
    word-break: break-word;
}

/* 不同日志级别的颜色 */
.log-info .log-level {
    color: #0f0;
}

.log-info .log-message {
    color: #0f0;
}

.log-warning .log-level {
    color: #ff0;
}

.log-warning .log-message {
    color: #ff0;
}

.log-error .log-level {
    color: #f00;
}

.log-error .log-message {
    color: #f00;
}

/* 加载状态（保留用于按钮） */
.spinner, .spinner-large {
    display: inline-block;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner {
    width: 16px;
    height: 16px;
}

.spinner-large {
    width: 50px;
    height: 50px;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 结果区域 */
.results-section {
    margin-bottom: 40px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.results-header h2 {
    color: #667eea;
    font-size: 1.8em;
}

.timestamp {
    color: #888;
    font-size: 0.9em;
}

/* 图表容器 */
.charts-container {
    margin-bottom: 40px;
}

/* 分析结果走势图卡片网格 */
.result-charts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 4px 0;
}

.result-chart-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    min-width: 200px;
    flex-wrap: wrap;
}

/* RSI 徽章 */
.rsi-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 8px;
    padding: 5px 10px;
    min-width: 72px;
    border: 1.5px solid currentColor;
    cursor: default;
}
.rsi-value {
    font-size: 0.95em;
    font-weight: 700;
    line-height: 1.1;
}
.rsi-signal {
    font-size: 0.72em;
    font-weight: 600;
    margin-top: 1px;
}
.rsi-tip {
    display: none; /* 仅 title tooltip 展示，不占空间 */
}
/* 颜色区分 */
.rsi-oversold-deep  { background: #f6ffed; color: #237804; border-color: #52c41a; }
.rsi-oversold       { background: #d9f7be; color: #237804; border-color: #73d13d; }
.rsi-weak           { background: #e6fffb; color: #006d75; border-color: #36cfc9; }
.rsi-healthy        { background: #f0f5ff; color: #1d39c4; border-color: #597ef7; }
.rsi-strong         { background: #fff7e6; color: #ad4e00; border-color: #ffa940; }
.rsi-overbought     { background: #fff2e8; color: #cf1322; border-color: #ff7875; }
.rsi-overbought-deep { background: #fff1f0; color: #a8071a; border-color: #ff4d4f; }
.rsi-limit-up       { background: #fff1f0; color: #cf1322; border-color: #ff4d4f; font-weight: 700; }
.rsi-rsi-lag        { background: #fffbe6; color: #874d00; border-color: #ffc53d; }

.result-chart-card-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.result-chart-name {
    font-size: 0.95em;
    font-weight: 600;
    color: #222;
}

.result-chart-code {
    font-size: 0.8em;
    color: #888;
}

.result-chart-type {
    font-size: 0.75em;
    color: #aaa;
}

.chart-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chart-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

/* 分析表格 */
.analysis-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.analysis-container h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* ── 分析结果卡片布局 ────────────────────────────── */

/* 总容器 */
.analysis-cards-container {
    width: 100%;
}

/* 字段管理工具栏 */
.analysis-field-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 0 14px;
}
.analysis-field-toolbar .toolbar-label {
    font-size: 0.82em;
    color: #888;
    white-space: nowrap;
    margin-right: 4px;
}
.field-toggle-btn {
    font-size: 0.78em;
    padding: 3px 9px;
    border-radius: 12px;
    border: 1px solid #667eea;
    background: #ede9ff;
    color: #5548c8;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
    user-select: none;
}
.field-toggle-btn:hover { background: #d4ceff; }
.field-toggle-btn.hidden {
    background: #e8e8e8;
    border-color: #bbb;
    color: #999;
    text-decoration: line-through;
    opacity: 0.7;
}

/* 卡片网格 */
.analysis-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

/* 单张卡片 */
.analysis-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(102,126,234,0.10);
    border: 1px solid #e8eaf6;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
    touch-action: pan-y;
    overflow: hidden;
    contain: layout style;
    content-visibility: auto;
    contain-intrinsic-size: 0 320px;
}
.analysis-card:hover {
    box-shadow: 0 6px 24px rgba(102,126,234,0.18);
    transform: translateY(-2px);
}

/* 卡片头部 */
.analysis-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid #f0f1fa;
    background: linear-gradient(135deg,#f5f3ff 0%,#eef1ff 100%);
    transition: background 0.2s;
}
/* 涨红跌绿（A股悯例） */
.analysis-card-header[data-trend="up"] {
    background: linear-gradient(135deg,#fff1f0 0%,#ffe4e4 100%);
    border-bottom-color: #ffc5c5;
}
.analysis-card-header[data-trend="dn"] {
    background: linear-gradient(135deg,#f0fff4 0%,#dcf5e7 100%);
    border-bottom-color: #b7e3c8;
}
.card-title {
    font-size: 1.05em;
    font-weight: 700;
    color: #2d2560;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-code {
    font-size: 0.8em;
    color: #888;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}
.card-chart-btn {
    flex-shrink: 0;
    font-size: 0.78em;
    padding: 4px 10px;
    border-radius: 10px;
    background: #e6f7ee;
    color: #27ae60;
    border: 1px solid #b7e3c8;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.card-chart-btn:hover { background: #c6f0d8; }

/* 卡片字段区 */
.analysis-card-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    padding: 12px 14px;
    flex: 1;
}
.card-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.field-label {
    font-size: 0.72em;
    color: #aaa;
    font-weight: 500;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.field-value {
    font-size: 0.88em;
    color: #333;
    word-break: break-word;
}
.field-value small {
    font-size: 0.85em;
    opacity: 0.85;
}

/* 颜色规则 */
.card-field.field-up .field-value  { color: #e84040; font-weight: 600; }
.card-field.field-dn .field-value  { color: #27ae60; font-weight: 600; }
.card-field.field-price .field-value { color: #3b4fc8; font-weight: 700; }

/* 常规价格 */
.card-field.field-normal-price-bull .field-value { color: #27ae60; font-weight: 600; }
.card-field.field-normal-price-bear .field-value { color: #e84040; font-weight: 600; }

/* 建议购入价（含仓位）— 全宽突出展示 */
.card-field.field-buy {
    grid-column: 1 / -1;
    border-radius: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg,#fffbec 0%,#fff3d0 100%);
    border-left: 4px solid #f5a623;
}
.card-field.field-buy .field-label {
    font-size: 0.75em;
    color: #b8860b;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 3px;
    display: block;
}
.card-field.field-buy .field-value {
    font-size: 1.0em;
    font-weight: 700;
    color: #c47500;
    line-height: 1.55;
}

/* 短期止盈止损 — 全宽突出 */
.card-field.field-stpsl {
    grid-column: 1 / -1;
    border-radius: 8px;
    padding: 8px 14px;
    background: #fafafa;
    border-left: 4px solid #9b59b6;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.card-field.field-stpsl .field-label {
    font-size: 0.75em;
    color: #7d3c98;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
    display: block;
}
.card-field.field-stpsl .field-value {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.card-field.field-stpsl .tpsl-tp {
    font-size: 0.92em;
    font-weight: 700;
    color: #c0392b;
    line-height: 1.5;
}
.card-field.field-stpsl .tpsl-sl {
    font-size: 0.92em;
    font-weight: 700;
    color: #1a7a1a;
    line-height: 1.5;
}

/* 长期止盈止损 */
.card-field.field-ltpsl {
    grid-column: 1 / -1;
    border-radius: 8px;
    padding: 8px 14px;
    background: #fafafa;
    border-left: 4px solid #667eea;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.card-field.field-ltpsl .field-label {
    font-size: 0.75em;
    color: #3a52c8;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
    display: block;
}
.card-field.field-ltpsl .field-value {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.card-field.field-ltpsl .tpsl-tp {
    font-size: 0.88em;
    font-weight: 600;
    color: #c0392b;
    line-height: 1.5;
}
.card-field.field-ltpsl .tpsl-sl {
    font-size: 0.88em;
    font-weight: 600;
    color: #1a7a1a;
    line-height: 1.5;
}

/* 今日操作建议（全宽） */
.card-field.field-advice {
    grid-column: 1 / -1;
    border-radius: 8px;
    padding: 8px 12px;
    background: #f8f9ff;
    line-height: 1.6;
    word-break: break-word;
    white-space: normal;
}
.card-field.field-adv-buy  { background: #e8f8ef; border-left: 4px solid #27ae60; padding-left: 10px; }
.card-field.field-adv-sell { background: #fff0f0; border-left: 4px solid #e84040; padding-left: 10px; }
.card-field.field-adv-hold { background: #f0f4ff; border-left: 4px solid #667eea; padding-left: 10px; }

.card-field.field-advice .field-value {
    font-size: 0.9em;
    line-height: 1.65;
    color: #333;
}

/* RSI 徽章行（全宽） */
.card-rsi-badge {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 2px;
}

/* 成交额徽章 */
.card-vol-badge {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 0;
}
.vol-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    cursor: default;
}
.vol-badge .vol-value { font-weight: 600; }
.vol-badge .vol-signal { font-size: 0.7rem; opacity: 0.8; }
.vol-huge   { background: #fef3c7; color: #92400e; }
.vol-large  { background: #dbeafe; color: #1e40af; }
.vol-normal { background: #f1f5f9; color: #475569; }
.vol-low    { background: #f8f8f8; color: #9ca3af; }

/* 卡片操作按钮区 */
.analysis-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: #fafbff;
    border-top: 1px solid #f0f1fa;
    min-height: 44px;
    align-items: center;
}
.analysis-card-actions .btn-action {
    font-size: 0.82em;
    padding: 6px 12px;
    min-height: 34px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, box-shadow 0.15s;
}
.analysis-card-actions .btn-action:hover { background: #f0f4ff; box-shadow: 0 2px 6px rgba(102,126,234,0.12); }
.analysis-card-actions .btn-sotp,
.analysis-card-actions .btn-sotp-cached { background: #eef2ff; color: #3b4fc8; border-color: #c5d0f8; }
.analysis-card-actions .btn-sotp-disabled { opacity: 0.45; cursor: not-allowed; }
.analysis-card-actions .btn-add-favorite  { background: #fffbe6; color: #b8860b; border-color: #f0d060; }

/* ── 历史记录列表卡片 ─────────────────────────────── */
.history-list-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.history-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8eaf6;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.history-card:hover {
    background: #f0f4ff;
    box-shadow: 0 2px 10px rgba(102,126,234,0.12);
}
.history-card-left { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.history-card-filename {
    font-size: 0.92em;
    font-weight: 600;
    color: #2d2560;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.history-card-meta {
    font-size: 0.78em;
    color: #999;
}
.history-card-arrow {
    font-size: 1.4em;
    color: #bbb;
    margin-left: 12px;
    flex-shrink: 0;
}

/* ── 历史详情模态框卡片网格 ───────────────────────── */
.history-detail-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
    padding: 4px 0;
}

/* ── 响应式适配 ───────────────────────────────────── */
@media (max-width: 768px) {
    .analysis-cards-grid { grid-template-columns: 1fr; }
    .history-detail-cards { grid-template-columns: 1fr; }
    .analysis-field-toolbar { gap: 4px; }
    .field-toggle-btn { font-size: 0.72em; padding: 2px 7px; }
    .analysis-card-actions .btn-action { min-height: 40px; min-width: 44px; }
    
    /* 手机端投资建议优化 */
    .card-field.field-advice {
        padding: 10px 12px;
        margin: 4px 0;
        border-radius: 10px;
    }
    .card-field.field-advice .field-label {
        font-size: 0.75em;
        margin-bottom: 4px;
        display: block;
    }
    .card-field.field-advice .field-value {
        font-size: 0.92em;
        line-height: 1.7;
        display: block;
    }
}
@media (max-width: 480px) {
    .analysis-card-fields { grid-template-columns: 1fr; }
    .analysis-cards-grid { gap: 10px; }
    .analysis-card-actions { gap: 6px; }
    
    /* 超小屏投资建议优化 */
    .card-field.field-advice {
        padding: 12px 14px;
        margin: 6px 0;
        border-radius: 12px;
    }
    .card-field.field-advice .field-label {
        font-size: 0.73em;
        margin-bottom: 6px;
        display: block;
        font-weight: 600;
        color: #666;
    }
    .card-field.field-advice .field-value {
        font-size: 0.95em;
        line-height: 1.75;
        display: block;
        color: #222;
    }
    .card-field.field-adv-buy .field-value  { color: #1a6e1a; }
    .card-field.field-adv-sell .field-value { color: #a8071a; }
    .card-field.field-adv-hold .field-value { color: #1d39c4; }
}

/* ── 分析结果表格 ─────────────────────────────────── */
.analysis-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.10);
    border: 1px solid #e4e7ef;
}

.analysis-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    background: #fff;
    font-size: 0.87em;
}

/* thead */
.analysis-table thead tr {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.analysis-table th {
    position: relative;
    color: #fff;
    font-weight: 600;
    font-size: 0.82em;
    padding: 11px 22px 11px 10px; /* extra right padding for resizer */
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.18);
    user-select: none;
    letter-spacing: 0.02em;
}
.analysis-table th:last-child { border-right: none; }

/* 列标题文字 */
.at-th-label {
    display: inline-block;
    vertical-align: middle;
    padding-right: 4px;
}

/* 隐藏/固定按钮组（悬停时显示） */
.at-th-btns {
    display: none;
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    gap: 2px;
    align-items: center;
    background: rgba(40,30,80,0.72);
    border-radius: 5px;
    padding: 2px 3px;
    z-index: 4;
}
.analysis-table th:hover .at-th-btns { display: flex; }

.at-col-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 0.82em;
    line-height: 1;
    padding: 2px 3px;
    border-radius: 3px;
    opacity: 0.8;
    transition: opacity 0.15s, background 0.15s;
}
.at-col-btn:hover { opacity: 1; background: rgba(255,255,255,0.18); }

/* 固定列标题：sticky + 不透明渐变背景 */
.col-pinned {
    position: sticky !important;
    z-index: 4;
    background: linear-gradient(135deg, #4a3fa8 0%, #5e35b1 100%) !important;
    box-shadow: 3px 0 8px rgba(0,0,0,0.22);
}
.col-pinned .at-col-pin { opacity: 1; }

/* 固定列数据单元格：sticky + 不透明实色背景（由行奇偶决定） */
.col-cell-pinned {
    position: sticky !important;
    z-index: 3;
    background: #fff !important;        /* 奇数行（默认）— 强制实色，完全覆盖下方滚动列 */
    box-shadow: 3px 0 8px rgba(0,0,0,0.08);
}
/* 偶数行固定列背景 */
.at-even .col-cell-pinned { background: #f9fafb !important; }
/* hover 时固定列背景与非固定列一致 */
.analysis-table tbody tr:hover .col-cell-pinned { background: #f0f4ff !important; }

/* 隐藏列 */
.col-hidden { display: none !important; padding: 0 !important; border: none !important; }

/* 拖拽手柄 */
.col-resizer {
    position: absolute;
    right: 0; top: 0;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    border-right: 3px solid rgba(255,255,255,0.35);
    transition: border-color 0.12s, background 0.12s;
    z-index: 3;
}
.col-resizer:hover, .col-resizer:active {
    border-right-color: #a5c8ff;
    background: rgba(165,200,255,0.22);
}
/* 拖拽时全局游标 */
body.col-resizing { cursor: col-resize !important; user-select: none !important; }

/* tbody cells */
.analysis-table .at-cell {
    padding: 8px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #edf0f6;
    border-right: 1px solid #edf0f6;
    overflow: hidden;
}
.analysis-table .at-cell-inner {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
/* 今日建议列：允许换行，不截断 */
.analysis-table .at-cell-adv {
    display: block;
    white-space: normal;
    line-height: 1.55;
    font-size: 0.93em;
    word-break: break-all;
}

.analysis-table tbody tr:hover .at-cell { background: #f0f4ff; }
.analysis-table .at-even .at-cell      { background: #f9fafb; }
.analysis-table .at-even:hover .at-cell { background: #f0f4ff; }

/* 涨跌幅 */
.cell-up { color: #d0021b; font-weight: 700; }
.cell-dn { color: #0a8a0a; font-weight: 700; }

/* 止盈止损（A股惯例：盈利红色，亏损绿色） */
.cell-tp .at-cell-inner { color: #c0392b; font-weight: 600; }
.cell-sl .at-cell-inner { color: #1a6e1a; font-weight: 600; }

/* 合并止盈止损列（短期/长期各一列） */
.cell-tpsl { white-space: normal !important; line-height: 1; }
.cell-tpsl .tpsl-tp {
    display: block;
    color: #c0392b;
    font-weight: 600;
    font-size: 0.87em;
    line-height: 1.55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cell-tpsl .tpsl-sl {
    display: block;
    color: #1a6e1a;
    font-weight: 600;
    font-size: 0.87em;
    line-height: 1.55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 购入区间状态 */
.cell-buy-entered .at-cell-inner {
    display: inline-block;
    background: rgba(102,126,234,0.13);
    color: #4c6ef5;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 5px;
}
.cell-buy-wait .at-cell-inner { color: #e67e22; font-weight: 600; }

/* 今日操作建议颜色 */
.cell-adv-buy  .at-cell-adv { color: #1a56db; }
.cell-adv-sell .at-cell-adv { color: #c0392b; }
.cell-adv-hold .at-cell-adv { color: #444; }

/* 操作按钮列 */
.at-action { text-align: center; }

/* 隐藏列恢复工具栏 */
.at-hidden-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: #f0f4ff;
    border: 1px solid #d0d8f8;
    border-top: none;
    border-radius: 0 0 10px 10px;
    font-size: 0.82em;
    color: #555;
}
.at-show-col-btn {
    background: #fff;
    border: 1px solid #b0bce8;
    color: #4c6ef5;
    border-radius: 4px;
    padding: 2px 9px;
    cursor: pointer;
    font-size: 0.82em;
    transition: background 0.15s, color 0.15s;
}
.at-show-col-btn:hover { background: #4c6ef5; color: #fff; }

/* 失败提示 */
.failed-codes {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    color: #856404;
}

/* 提取信息样式 */
.extraction-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #2196f3;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.extraction-info-header {
    font-size: 1.1em;
    font-weight: 600;
    color: #1976d2;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.extraction-info-content {
    color: #0d47a1;
}

.extraction-info-content p {
    margin: 10px 0;
    line-height: 1.6;
}

.extraction-info-content strong {
    color: #1565c0;
}

.extraction-info-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.extraction-info-content li {
    margin: 8px 0;
    line-height: 1.6;
}

.extraction-info-content code {
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #1565c0;
    font-weight: 600;
}

/* 走势分析 ASCII 段落 */
.trend-analysis-block {
    margin: 16px 0 8px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
}

.trend-analysis-title {
    font-size: 0.85em;
    font-weight: 600;
    color: #8b949e;
    padding: 8px 14px 6px;
    border-bottom: 1px solid #21262d;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.trend-analysis-pre {
    margin: 0;
    padding: 14px 16px;
    font-family: 'Courier New', 'Consolas', 'Menlo', monospace;
    font-size: 0.82em;
    line-height: 1.7;
    color: #c9d1d9;
    white-space: pre;
    overflow-x: auto;
    background: transparent;
}

/* 历史记录 */
.history-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h2 {
    color: #667eea;
    font-size: 1.5em;
}

.history-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-toggle-history {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 8px;
    color: #667eea;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-toggle-history:hover {
    background: #667eea;
    color: white;
}

#toggleHistoryIcon {
    display: inline-block;
    transition: transform 0.3s;
}

#toggleHistoryIcon.expanded {
    transform: rotate(180deg);
}

.history-list {
    max-height: 480px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 2px;
}

.history-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s;
}

.history-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

.history-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.history-item-time {
    color: #888;
    font-size: 0.9em;
}

.loading-text {
    text-align: center;
    color: #888;
    padding: 20px;
}

/* 自选股票区域 */
.favorites-section {
    padding: 20px 0;
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.favorites-header h2 {
    color: #667eea;
    font-size: 1.8em;
}

.favorites-list-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.favorites-table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
}

.favorites-table table {
    width: 100%;
    min-width: 800px;
}

.favorites-table th,
.favorites-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #e0e0e0;
}

.favorites-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.favorites-table tr:nth-child(even) {
    background: #f8f9fa;
}

.favorites-table tr:hover {
    background: #e9ecef;
}

.favorites-table input[type="number"] {
    width: 100%;
    padding: 6px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9em;
}

.favorites-table input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.btn-action {
    padding: 6px 12px;
    margin: 0 3px;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background: #28a745;
    color: white;
}

.btn-edit:hover {
    background: #218838;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-add-favorite {
    background: #667eea;
    color: white;
}

.btn-add-favorite:hover {
    background: #5568d3;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-small {
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h3 {
    color: #667eea;
    font-size: 1.5em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: #888;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    color: #333;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.modal-body input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.modal-body input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

/* 底部 */
footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #888;
    border-top: 1px solid #e0e0e0;
}

/* 进度条 */
.progress-container {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

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

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* 分析进行中：无宽度时显示流动动画 */
.progress-fill.is-loading {
    width: 100% !important;
    background: linear-gradient(90deg, #667eea 30%, #a78bfa 50%, #667eea 70%);
    background-size: 200% 100%;
    animation: progress-indeterminate 1.6s linear infinite;
    transition: none;
}

.progress-text {
    margin-top: 8px;
    text-align: center;
    color: #667eea;
    font-size: 0.9em;
    font-weight: 600;
}

/* 表格颜色编码 */
.cell-profit {
    color: #d32f2f;
    font-weight: 600;
}

.cell-loss {
    color: #2e7d32;
    font-weight: 600;
}

.cell-buy-entered {
    background: rgba(102, 126, 234, 0.12) !important;
    color: #667eea;
    font-weight: 700;
}
/* 固定列时使用实色背景，避免半透明导致底层内容透出 */
.col-cell-pinned.cell-buy-entered,
.col-cell-pinned.cell-buy-entered.at-cell {
    background: #e8eafb !important;
}
.at-even .col-cell-pinned.cell-buy-entered,
.at-even .col-cell-pinned.cell-buy-entered.at-cell {
    background: #e3e5f8 !important;
}
.analysis-table tbody tr:hover .col-cell-pinned.cell-buy-entered,
.analysis-table tbody tr:hover .col-cell-pinned.cell-buy-entered.at-cell {
    background: #dde0f5 !important;
}
/* 固定列中"已进入"内标签也用实色，防止 inline-block 半透明溢出 */
.col-cell-pinned.cell-buy-entered .at-cell-inner {
    background: #c8ccf2 !important;
}

.cell-buy-wait {
    color: #ff9800;
}

.cell-price {
    font-weight: 700;
    color: #1a237e;
    font-size: 0.9em;
}

.cell-profitable {
    background: rgba(46, 125, 50, 0.08) !important;
}

.cell-losing {
    background: rgba(211, 47, 47, 0.08) !important;
}

/* 响应式设计 - 优化适配 */
@media (max-width: 1024px) {
    .container {
        border-radius: 0;
    }

    main {
        padding: 30px 20px;
    }

    .analysis-table table,
    .favorites-table table {
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
        background: white;
    }

    .container {
        box-shadow: none;
        border-radius: 0;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 1.6em;
    }

    .subtitle {
        font-size: 1em;
    }

    main {
        padding: 20px 15px;
    }

    .input-section,
    .history-section {
        padding: 20px;
    }

    .tab-button {
        padding: 12px 15px;
        font-size: 1em;
    }

    .analysis-table,
    .favorites-table {
        font-size: 0.8em;
        overflow-x: auto;
    }

    .analysis-table table,
    .favorites-table table {
        min-width: 700px;
    }

    .modal-content {
        width: 98%;
        max-height: 90vh;
        border-radius: 8px;
    }

    .modal-body {
        padding: 20px;
    }

    .btn-primary, .btn-secondary {
        padding: 12px 30px;
        font-size: 1em;
    }

    .chart-item {
        padding: 15px;
        margin-bottom: 20px;
    }

    .log-content {
        height: 300px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.4em;
    }

    .tab-button {
        padding: 10px 12px;
        font-size: 0.9em;
    }

    main {
        padding: 15px 10px;
    }

    .input-section,
    .history-section {
        padding: 15px;
    }

    textarea {
        font-size: 0.9em;
        padding: 12px;
    }

    .analysis-table,
    .favorites-table {
        font-size: 0.75em;
    }

    .analysis-table table,
    .favorites-table table {
        min-width: 600px;
    }

    .modal-content.modal-small {
        max-width: 95%;
    }

    .history-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .history-header-actions {
        flex-direction: column;
        gap: 10px;
    }

    .results-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* 高性能优化 */
* {
    -webkit-tap-highlight-color: transparent;
}

button,
textarea,
input {
    transition: all 0.2s ease-in-out;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 优化动画性能 */
.spinner,
.spinner-large {
    will-change: transform;
}

.btn-primary:hover,
.btn-secondary:hover {
    will-change: transform, box-shadow;
}

/* 响应式图片和媒体 */
img,
svg,
canvas {
    max-width: 100%;
    height: auto;
}

/* 防止内容溢出 */
pre,
code,
td,
th {
    word-wrap: break-word;
    word-break: break-word;
}

/* 优化触摸体验 */
@media (hover: none) {
    .btn-primary:hover,
    .btn-secondary:hover,
    .tab-button:hover,
    .btn-toggle-history:hover,
    .btn-toggle-log:hover {
        transform: none;
    }
}

/* ══════════════════════════════════════════════════════
   强势板块选股策略 Tab 样式
   ════════════════════════════════════════════════════ */

/* Tab 内容容器（选股Tab在 main 外，需单独处理 padding） */
.screener-tab-content {
    padding: 0 40px 40px;
}

.screener-section {
    padding: 0;
}

/* 标题区域 */
.screener-header {
    padding: 30px 0 20px;
    border-bottom: 3px solid #667eea;
    margin-bottom: 30px;
}

.screener-header h2 {
    color: #667eea;
    font-size: 1.8em;
    margin-bottom: 6px;
}

.screener-subtitle {
    color: #888;
    font-size: 0.95em;
}

/* 参数面板 */
.screener-params {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px 30px;
    margin-bottom: 25px;
}

.screener-params h3 {
    color: #555;
    font-size: 1.1em;
    margin-bottom: 18px;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

@media (max-width: 900px) {
    .params-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .params-grid { grid-template-columns: 1fr; }
}

.param-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.param-label {
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.param-hint {
    font-weight: 400;
    color: #aaa;
    font-size: 0.85em;
}

.param-input {
    padding: 9px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color .2s;
    width: 100%;
}

.param-input:focus {
    outline: none;
    border-color: #667eea;
}

/* 持仓信息勾选项 */
.param-position-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: linear-gradient(135deg, #e8f4fd 0%, #d6eaf8 100%);
    border: 1.5px solid #aed6f1;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.param-position-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    color: #1a5276;
    font-size: 0.95em;
    user-select: none;
}

.param-position-label:hover .param-position-text {
    color: #154360;
}

.param-checkbox {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    padding: 0 !important;
    cursor: pointer;
    accent-color: #667eea;
    border-radius: 4px;
}

.param-position-text {
    line-height: 1.4;
}

/* 风险排除说明栏 */
.risk-filter-notice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 4px solid #f39c12;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9em;
    color: #856404;
    margin-bottom: 20px;
}

/* 选股按钮 */
.btn-screen {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.15em;
    font-weight: 700;
    cursor: pointer;
    transition: all .3s;
    letter-spacing: .05em;
}

.btn-screen:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 153, 142, .4);
}

.btn-screen:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* 摘要统计 */
.screen-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
    align-items: center;
}

.summary-item {
    background: white;
    border-radius: 10px;
    padding: 14px 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    min-width: 90px;
    border: 2px solid transparent;
}

.summary-item.highlight { border-color: #667eea; }
.summary-item.highlight2 { border-color: #11998e; }
.summary-item.muted { opacity: .75; }

.summary-num {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    color: #333;
    line-height: 1.1;
}

.summary-item.highlight  .summary-num { color: #667eea; }
.summary-item.highlight2 .summary-num { color: #11998e; }
.summary-item.muted      .summary-num { color: #999; }

.summary-label {
    display: block;
    font-size: 0.82em;
    color: #888;
    margin-top: 4px;
}

.summary-timestamp {
    margin-left: auto;
    color: #aaa;
    font-size: 0.85em;
    align-self: flex-end;
}

/* 结果卡片 */
.screen-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.screen-card h3 {
    color: #667eea;
    font-size: 1.3em;
    margin-bottom: 18px;
}

.screen-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.screen-card-header h3 { margin-bottom: 0; }

/* 一键分析按钮 */
.btn-analyze-screened {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all .3s;
    white-space: nowrap;
}

.btn-analyze-screened:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102,126,234,.4);
}

/* 表格 */
.screen-table-wrapper {
    overflow-x: auto;
}

.screen-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.screen-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    white-space: nowrap;
}

.screen-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.92em;
    vertical-align: middle;
}

.screen-table tbody tr:hover { background: #f5f8ff; }
.screen-table tbody tr:last-child td { border-bottom: none; }

/* 颜色工具类 */
.text-up   { color: #e53e3e; font-weight: 600; }
.text-down { color: #38a169; font-weight: 600; }

.inflow-pos { color: #e53e3e; font-weight: 600; }
.inflow-neg { color: #38a169; font-weight: 600; }

/* 常规市值列 */
.mcap-discount {
    color: #237804;
    font-weight: 600;
}
.mcap-discount .mcap-chg {
    margin-left: 2px;
    font-size: 0.82em;
    color: #52c41a;
    font-weight: 700;
}
.mcap-premium {
    color: #cf1322;
    font-weight: 500;
}
.mcap-premium .mcap-chg {
    margin-left: 2px;
    font-size: 0.82em;
    color: #f5222d;
    font-weight: 600;
}

.strong-inflow { color: #c0392b; font-weight: 700; }
.normal-inflow { color: #e74c3c; }

/* 徽章 */
.rank-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    text-align: center;
    line-height: 22px;
    font-size: 0.75em;
    font-weight: 700;
    margin-right: 6px;
}

.limit-up-badge {
    background: #e53e3e;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.82em;
    font-weight: 600;
}

.sector-tag {
    background: #e9ecef;
    color: #555;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.82em;
}

/* 选股综合评分徽章 */
.screen-score-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    font-size: 1em;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    min-width: 52px;
    justify-content: center;
}
.screen-score-badge small {
    font-size: 0.72em;
    font-weight: 600;
    opacity: 0.85;
}
.screen-score-badge.score-a { background: #d4edda; color: #155724; }
.screen-score-badge.score-b { background: #cce5ff; color: #004085; }
.screen-score-badge.score-c { background: #fff3cd; color: #856404; }
.screen-score-badge.score-d { background: #f8d7da; color: #721c24; }


.stock-code {
    font-family: 'Courier New', monospace;
    background: #f0f4ff;
    color: #3b5bf5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* 单只分析按钮 */
.btn-analyze-one {
    padding: 5px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.82em;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}

.btn-analyze-one:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(102,126,234,.4);
}

/* 无数据 */
.no-data {
    text-align: center;
    color: #aaa;
    padding: 24px;
    font-size: 0.95em;
}

.no-stocks-msg {
    text-align: center;
    color: #888;
    padding: 30px;
    font-size: 1em;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ══════════════════════════════════════════════════════
   自选行情看板 + 星标按钮 + 全局移动端适配
   ════════════════════════════════════════════════════ */

/* ── 自选看板 ───────────────────────────────────────── */
.watchlist-section {
    padding: 0 0 30px;
}

.watchlist-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 0 16px;
    border-bottom: 3px solid #667eea;
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}

.watchlist-header h2 {
    color: #667eea;
    font-size: 1.8em;
    margin-bottom: 4px;
}

.watchlist-update-time {
    color: #aaa;
    font-size: 0.85em;
}

/* 刷新行情按钮 */
.btn-refresh-wl {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all .3s;
    white-space: nowrap;
}

.btn-refresh-wl:hover   { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(17,153,142,.4); }
.btn-refresh-wl:disabled{ opacity: .6; cursor: not-allowed; transform: none; }

/* 卡片网格 */
.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

/* 单张行情卡片 */
.wl-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 16px 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    border: 2px solid #f0f0f0;
    transition: border-color .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wl-card:hover {
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102,126,234,.15);
}

.wl-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wl-name {
    font-size: 1.05em;
    font-weight: 700;
    color: #222;
}

.wl-code-tag {
    font-size: 0.78em;
    background: #f0f4ff;
    color: #3b5bf5;
    padding: 2px 6px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
}

.wl-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.wl-price {
    font-size: 1.7em;
    font-weight: 700;
    color: #222;
    line-height: 1;
}

.wl-chg {
    font-size: 1em;
    font-weight: 700;
}

.wl-up   { color: #e53e3e; }
.wl-down { color: #38a169; }

.wl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 0.83em;
    color: #666;
}

.wl-meta span b { color: #333; }

.wl-actions {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.btn-wl-analyze, .btn-wl-remove {
    flex: 1;
    padding: 8px 4px;
    border: none;
    border-radius: 8px;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.btn-wl-analyze {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-wl-analyze:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,.4); }

.btn-wl-remove {
    background: #f8f9fa;
    color: #dc3545;
    border: 1.5px solid #dc354540;
}

.btn-wl-remove:hover { background: #dc3545; color: white; }

/* 加载 / 空状态 */
.wl-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #aaa;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.wl-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: #dc3545;
    background: #fff5f5;
    border-radius: 10px;
}

.watchlist-empty {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}

.watchlist-empty .empty-icon { font-size: 3em; margin-bottom: 12px; }
.watchlist-empty p { margin: 6px 0; font-size: 1.05em; }
.watchlist-empty .empty-hint { font-size: 0.85em; color: #bbb; }

/* ── 星标按钮 ────────────────────────────────────────── */
.btn-star {
    background: none;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 1.2em;
    line-height: 1;
    width: 34px;
    height: 34px;
    cursor: pointer;
    color: #ccc;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-star:hover    { border-color: #f6ad55; color: #f6ad55; transform: scale(1.1); }
.btn-star.star-active { border-color: #f59e0b; color: #f59e0b; background: #fffbeb; }
.btn-star.star-active:hover { background: #fef3c7; }

/* ══════════════════════════════════════════════════════
   全局移动端适配（max-width: 768px）
   ════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    body { padding: 0; }

    .container {
        border-radius: 0;
        min-height: 100vh;
    }

    header { padding: 20px 16px; }
    header h1 { font-size: 1.5em; }

    /* Tab 导航手机端 */
    .tab-navigation {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tab-navigation::-webkit-scrollbar { display: none; }
    .tab-button {
        flex: none;
        min-width: 90px;
        padding: 12px 14px;
        font-size: 0.9em;
    }

    main { padding: 16px; }

    /* 输入区域 */
    .input-section { padding: 16px; }
    .input-section h2 { font-size: 1.2em; }

    /* 表格横向滚动 */
    .analysis-table, .favorites-table,
    .screen-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .analysis-table table,
    .screen-table { min-width: 600px; }

    /* 行情卡片：单列 */
    .watchlist-grid { grid-template-columns: 1fr; }

    /* 参数网格：单列 */
    .params-grid { grid-template-columns: 1fr !important; }

    /* 摘要条 */
    .screen-summary { gap: 8px; }
    .summary-item { min-width: 70px; padding: 10px 12px; }
    .summary-num { font-size: 1.4em; }

    /* 选股结果标题行 */
    .screen-card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .btn-analyze-screened { width: 100%; text-align: center; }

    /* 自选页头部 */
    .watchlist-header { flex-direction: column; }
    .btn-refresh-wl  { width: 100%; justify-content: center; }

    /* 分析按钮 */
    .btn-primary { font-size: 1em; padding: 14px 20px; }

    /* 选股策略Tab */
    .screener-tab-content { padding: 0 16px 30px; }

    /* 历史区域 */
    .history-section { padding: 16px; }
    .history-header  { flex-direction: column; align-items: flex-start; gap: 10px; }
    .history-header-actions { width: 100%; display: flex; justify-content: flex-end; gap: 8px; }

    /* 模态框 */
    .modal-content { margin: 0 8px; }
    .modal-small   { width: calc(100% - 16px) !important; }

    /* 进度条 */
    .progress-container { margin: 12px 0; }
}

@media (max-width: 480px) {
    header h1 { font-size: 1.2em; }
    .tab-button { min-width: 76px; font-size: 0.82em; padding: 10px 8px; }
    .wl-price  { font-size: 1.4em; }
}


/* ══════════════════════════════════════════════════════
   每日资讯栏 + 每日推荐栏
   ════════════════════════════════════════════════════ */

/* ── 通用折叠区域 ───────────────────────────────────── */
.daily-section {
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.daily-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.daily-section-header:hover {
    background: #eef0f4;
}

.daily-section-header h2 {
    margin: 0;
    font-size: 1.3em;
    color: #667eea;
}

.daily-section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-refresh-daily {
    background: none;
    border: 1px solid #667eea;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh-daily:hover {
    background: #667eea;
    color: white;
}

.daily-toggle-icon {
    display: inline-block;
    transition: transform 0.3s;
    font-size: 0.9em;
    color: #666;
}

.daily-toggle-icon.expanded {
    transform: rotate(180deg);
}

.daily-section-body {
    padding: 0 24px 20px;
}

.daily-empty {
    text-align: center;
    padding: 30px 20px;
    color: #888;
}

.daily-empty p {
    margin-bottom: 12px;
    font-size: 1em;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85em;
}

/* ── 每日资讯 — 情绪标签 ─────────────────────────────── */
.daily-sentiment {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    background: white;
    border: 1px solid #e0e0e0;
}

.sentiment-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95em;
}

.sentiment-badge.positive {
    background: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #a3d9a5;
}

.sentiment-badge.negative {
    background: #fde8e8;
    color: #c0392b;
    border: 1px solid #f5b7b1;
}

.sentiment-badge.neutral {
    background: #fff8e1;
    color: #f39c12;
    border: 1px solid #f9e79f;
}

.sentiment-summary {
    flex: 1;
    font-size: 0.95em;
    color: #555;
    line-height: 1.5;
}

/* ── 新闻影响卡片 ─────────────────────────────────── */
.daily-news-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-impact-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #ccc;
    transition: box-shadow 0.2s;
}

.news-impact-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.news-impact-card.impact-positive {
    border-left-color: #27ae60;
}

.news-impact-card.impact-negative {
    border-left-color: #e74c3c;
}

.news-impact-card.impact-neutral {
    border-left-color: #f39c12;
}

.news-impact-direction {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8em;
}

.news-impact-direction.positive {
    background: #e6f4ea;
    color: #1e7e34;
}

.news-impact-direction.negative {
    background: #fde8e8;
    color: #c0392b;
}

.news-impact-direction.neutral {
    background: #fff8e1;
    color: #f39c12;
}

.news-impact-content {
    flex: 1;
    min-width: 0;
}

.news-impact-title {
    font-weight: 600;
    font-size: 0.95em;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
}

.news-impact-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.8em;
}

.news-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: #eef0f5;
    color: #555;
}

.news-tag.sector {
    background: #e8eaf6;
    color: #3f51b5;
}

.news-tag.stock {
    background: #fce4ec;
    color: #c62828;
}

.news-impact-reason {
    font-size: 0.85em;
    color: #777;
    margin-top: 4px;
}

/* ── 新闻相关个股 ──────────────────────────────────── */
.daily-news-stocks {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #ddd;
}

.news-stocks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.news-stocks-title {
    font-weight: 600;
    font-size: 0.95em;
    color: #333;
}

.news-stocks-hint {
    font-size: 0.78em;
    color: #aaa;
}

.news-stocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.news-stock-card {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.85em;
    transition: box-shadow 0.15s;
}

.news-stock-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.news-stock-card.direction-positive { border-left: 3px solid #e53935; }
.news-stock-card.direction-negative { border-left: 3px solid #43a047; }
.news-stock-card.direction-neutral  { border-left: 3px solid #bbb; }

.nsc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }

.nsc-dir {
    font-size: 0.8em;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.nsc-dir.positive { background: #fdecea; color: #c62828; }
.nsc-dir.negative { background: #e8f5e9; color: #2e7d32; }
.nsc-dir.neutral  { background: #f5f5f5; color: #666; }

.nsc-code { font-size: 0.75em; color: #999; }

.nsc-name { font-weight: 600; color: #333; margin-bottom: 6px; font-size: 0.95em; }

.nsc-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.nsc-price-val { font-size: 1.1em; font-weight: 700; color: #222; }
.nsc-chg { font-size: 0.88em; font-weight: 600; }
.nsc-chg.up   { color: #e53935; }
.nsc-chg.down { color: #43a047; }
.nsc-chg.flat { color: #888; }

.nsc-reason { font-size: 0.78em; color: #777; margin-bottom: 4px; line-height: 1.4; }
.nsc-news   { font-size: 0.73em; color: #aaa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 每日推荐 — 摘要 ─────────────────────────────── */
.daily-picks-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.picks-stat-card {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 14px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.picks-stat-value {
    font-size: 1.6em;
    font-weight: 700;
    color: #667eea;
}

.picks-stat-label {
    font-size: 0.8em;
    color: #888;
    margin-top: 4px;
}

/* ── 推荐股票卡片 ─────────────────────────────────── */
.daily-picks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.pick-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    border: 1px solid #e0e0e0;
    transition: box-shadow 0.2s, transform 0.15s;
}

.pick-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.pick-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pick-card-name {
    font-weight: 700;
    font-size: 1.1em;
    color: #333;
}

.pick-card-code {
    font-size: 0.8em;
    color: #999;
    margin-left: 6px;
}

.pick-card-score {
    font-size: 1.4em;
    font-weight: 700;
    color: #667eea;
}

.pick-card-score small {
    font-size: 0.55em;
    font-weight: 400;
    color: #999;
}

.pick-card-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.85em;
}

.pick-info-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pick-info-label {
    color: #999;
}

.pick-info-value {
    font-weight: 600;
}

.pick-info-value.up {
    color: #e74c3c;
}

.pick-info-value.down {
    color: #27ae60;
}

/* ── 评分条 ─────────────────────────────────── */
.score-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.score-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8em;
}

.score-bar-label {
    width: 48px;
    text-align: right;
    color: #888;
    flex-shrink: 0;
}

.score-bar-track {
    flex: 1;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.score-bar-fill.dim-gain   { background: linear-gradient(90deg, #ff6b6b, #ee5a24); }
.score-bar-fill.dim-volume { background: linear-gradient(90deg, #6c5ce7, #a29bfe); }
.score-bar-fill.dim-bid    { background: linear-gradient(90deg, #00b894, #55efc4); }
.score-bar-fill.dim-stable { background: linear-gradient(90deg, #fdcb6e, #f39c12); }
.score-bar-fill.dim-leader   { background: linear-gradient(90deg, #0984e3, #74b9ff); }
.score-bar-fill.dim-momentum { background: linear-gradient(90deg, #e17055, #fd79a8); }

/* ── 隔夜风险标签 ────────────────────────────────────────── */
.overnight-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}
.overnight-badge.risk-high   { background: #ffeaea; color: #d63031; border: 1px solid #fab4b4; }
.overnight-badge.risk-medium { background: #fff7e6; color: #e67e22; border: 1px solid #fad6a5; }
.overnight-badge.risk-low    { background: #eafaf1; color: #27ae60; border: 1px solid #a9dfbf; }

/* ── 原始分提示（被隔夜惩罚时显示） ─────────────────────── */
.raw-score-hint {
    font-size: 0.65em;
    color: #aaa;
    text-decoration: line-through;
    margin-right: 2px;
    font-weight: 400;
}

/* ── 轮动阶段标签 ────────────────────────────────────────── */
.rotation-tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 6px;
    font-size: 0.78em;
    font-weight: 600;
}
.rotation-tag.rotation-新热     { background: #dff0ff; color: #0066cc; }
.rotation-tag.rotation-升温     { background: #e6f9ef; color: #1a8a4a; }
.rotation-tag.rotation-持续     { background: #f0f0f0; color: #555; }
.rotation-tag.rotation-峰值     { background: #fff3cd; color: #856404; }
.rotation-tag.rotation-轮出预警 { background: #fde8e8; color: #c0392b; }

.score-bar-value {
    width: 30px;
    text-align: left;
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
}

/* ── 推荐卡片操作 ─────────────────────────────────── */
.pick-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.pick-card-actions .btn-primary {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85em;
}

/* ── 每日推荐工具栏（勾选 & 批量操作）────────────────── */
.picks-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 14px;
    margin-bottom: 12px;
    background: #f4f6ff;
    border: 1px solid #dde2f5;
    border-radius: 8px;
}

.picks-select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    color: #374151;
    user-select: none;
}

.picks-select-all input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.picks-count {
    font-size: 0.84em;
    color: #6b7280;
    flex: 1;
    min-width: 60px;
}

.picks-toolbar .btn-sm {
    padding: 5px 12px;
    font-size: 0.82em;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.picks-toolbar .btn-primary {
    background: #667eea;
    color: #fff;
}

.picks-toolbar .btn-primary:hover { background: #5a6fd6; }

.picks-toolbar .btn-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.picks-toolbar .btn-secondary:hover { background: #f3f4f6; }

.picks-toolbar .btn-danger {
    background: #fff0f0;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.picks-toolbar .btn-danger:hover { background: #fee2e2; }

/* ── 勾选框样式 ────────────────────────────────────── */
.pick-card-cb {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

/* ── 已选中的卡片高亮 ───────────────────────────────── */
.pick-card.pick-card-selected {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.18);
    background: #fafbff;
}

.pick-sector-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    background: #e8eaf6;
    color: #3f51b5;
    font-size: 0.8em;
    font-weight: 500;
}

.picks-score-guide {
    width: 100%;
    border: 1px dashed #d9d9d9;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fafcff;
}

.guide-title {
    font-weight: 700;
    color: #374151;
    margin-bottom: 6px;
    font-size: 0.9em;
}

.guide-line {
    font-size: 0.82em;
    color: #5b6470;
    line-height: 1.5;
}

.pick-sector-group {
    margin-bottom: 14px;
    border: 1px solid #eceff5;
    border-radius: 12px;
    padding: 10px;
    background: #fbfcff;
}

.pick-sector-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    padding: 2px 4px;
}

.pick-sector-title {
    font-size: 1em;
    font-weight: 700;
    color: #2f3a56;
}

.pick-sector-meta {
    font-size: 0.82em;
    color: #6b7280;
}

.pick-trade-plan {
    margin: 10px 0;
    padding: 8px 10px;
    border: 1px solid #ecedf3;
    border-radius: 8px;
    background: #fcfdff;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
}

.pick-trade-plan .plan-label {
    color: #6b7280;
    font-size: 0.8em;
    margin-right: 6px;
}

.pick-trade-plan .plan-value {
    color: #1f2937;
    font-size: 0.84em;
    font-weight: 600;
}

/* ── 刷新中状态 ─────────────────────────────────── */
.daily-section.refreshing .daily-section-header h2::after {
    content: ' ⏳';
}

/* ── 每日栏移动端适配 ───────────────────────────── */
@media (max-width: 768px) {
    .daily-section-header { padding: 12px 16px; }
    .daily-section-header h2 { font-size: 1.1em; }
    .daily-section-body { padding: 0 16px 16px; }
    .daily-picks-grid { grid-template-columns: 1fr; }
    .pick-sector-header { flex-direction: column; align-items: flex-start; gap: 4px; }
    .pick-trade-plan { grid-template-columns: 1fr; }
    .news-impact-card { flex-direction: column; gap: 8px; }
    .news-impact-direction { width: 36px; height: 36px; font-size: 0.7em; }
    .daily-sentiment { flex-direction: column; gap: 8px; }
    .picks-stat-card { min-width: 80px; padding: 10px; }
    .picks-stat-value { font-size: 1.3em; }
}

@media (max-width: 480px) {
    .daily-section-header h2 { font-size: 1em; }
    .daily-picks-summary { gap: 8px; }
    .pick-card { padding: 14px; }
    .pick-card-header { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ══════════════════════════════════════════════════════
   自选股增强：工具栏 + 复选框 + K线图弹框
   ══════════════════════════════════════════════════════ */

/* ── 工具栏 ─────────────────────────────────────────── */
.wl-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.wl-select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9em;
    color: #555;
    user-select: none;
}
.wl-select-all-label input[type=checkbox] {
    width: 16px; height: 16px; cursor: pointer;
    accent-color: #1890ff;
}
.wl-selected-count {
    font-size: 0.85em;
    color: #888;
    min-width: 60px;
}
.wl-toolbar-btns {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
/* 批量操作按钮仅在有选中时显示 */
.wl-toolbar .wl-toolbar-btns .btn-primary,
.wl-toolbar .wl-toolbar-btns .btn-danger {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.2s;
}
.wl-toolbar.has-selection .wl-toolbar-btns .btn-primary,
.wl-toolbar.has-selection .wl-toolbar-btns .btn-danger {
    opacity: 1;
    pointer-events: auto;
}
.btn-danger {
    background: linear-gradient(135deg, #ff4d4f, #cf1322);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85em;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.btn-danger:hover { opacity: 0.85; }
.btn-danger:active { transform: scale(0.97); }

/* ── 卡片复选框 ─────────────────────────────────────── */
.wl-card {
    position: relative;
}
.wl-card-checkbox-wrap {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    cursor: pointer;
    line-height: 1;
}
.wl-card-checkbox-wrap input[type=checkbox] {
    width: 16px; height: 16px;
    accent-color: #1890ff;
    cursor: pointer;
}
.wl-card.wl-selected {
    border-color: #1890ff !important;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.25);
}
/* 让卡片顶部内容在复选框右侧 */
.wl-card .wl-card-top {
    padding-left: 28px;
}
/* 走势图按钮 */
.btn-wl-chart {
    background: linear-gradient(135deg, #722ed1, #531dab);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.82em;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.btn-wl-chart:hover { opacity: 0.85; }

/* 移至持仓按钮 */
.btn-wl-holdings {
    background: linear-gradient(135deg, #f57c00, #ff9800);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.82em;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.btn-wl-holdings:hover { opacity: 0.85; }

/* 移至自选按钮（在持仓卡片中） */
.btn-wl-to-fav {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.82em;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.btn-wl-to-fav:hover { opacity: 0.85; }

/* btn-warning for toolbar */
.btn-warning {
    background: linear-gradient(135deg, #f57c00, #ff9800);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-warning:hover { opacity: 0.88; transform: translateY(-1px); }

/* 持仓区域标题样式 */
.holdings-section .watchlist-header { border-bottom-color: #f57c00; }
.holdings-section .watchlist-header h2 { color: #f57c00; }
.btn-refresh-holdings {
    background: linear-gradient(135deg, #f57c00 0%, #ff9800 100%);
}
.btn-refresh-holdings:hover { box-shadow: 0 6px 18px rgba(245,124,0,.4); }

/* ── 自选卡片持仓/成本内联编辑 ─────────────────────── */
.wl-cost-edit {
    display: flex;
    gap: 10px;
    margin: 8px 0 4px;
    padding: 6px 8px;
    background: #f8f9fb;
    border-radius: 6px;
    border: 1px solid #eaedf3;
}

.wl-edit-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.78em;
    color: #6b7280;
    flex: 1;
}

.wl-edit-label input {
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 0.9em;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
}

.wl-edit-label input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

/* ── 每日推荐子标签 ─────────────────────────────────── */
.picks-sub-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 2px solid #eaecf0;
    padding-bottom: 0;
}

.picks-sub-tab {
    background: none;
    border: none;
    padding: 6px 16px 8px;
    font-size: 0.9em;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 4px 4px 0 0;
    transition: color 0.15s, border-color 0.15s;
}

.picks-sub-tab:hover { color: #374151; }

.picks-sub-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

/* ── 历史回测工具栏 ─────────────────────────────────── */
.picks-review-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.picks-review-label {
    font-size: 0.88em;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.picks-review-label select {
    padding: 5px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9em;
    outline: none;
    background: #fff;
}

/* ── 历史回测统计条 ─────────────────────────────────── */
.picks-review-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #f8faff;
    border: 1px solid #e0e7ff;
    border-radius: 8px;
}

.rv-stat {
    font-size: 0.85em;
    color: #374151;
    padding: 3px 10px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.rv-win { color: #d32f2f; }
.rv-loss { color: #1565c0; }

/* ── 历史回测表格 ─────────────────────────────────── */
.picks-review-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.picks-review-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
}

.picks-review-table th {
    background: #f5f6fa;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
    line-height: 1.35;
}

.picks-review-table th small {
    display: block;
    font-weight: 400;
    font-size: 0.8em;
    color: #6b7280;
}

.picks-review-table td {
    padding: 6px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #374151;
    vertical-align: middle;
}

.picks-review-table .rv-name { font-weight: 600; }
.picks-review-table .rv-code { color: #6b7280; font-size: 0.84em; }
.picks-review-table .rv-score { font-weight: 700; color: #4c6ef5; }
.picks-review-table .rv-rec,
.picks-review-table .rv-cur  { line-height: 1.6; }
.picks-review-table .rv-price { font-weight: 700; font-size: 0.96em; color: #1a237e; }
.picks-review-table .rv-price-fixed { color: #e65100; }   /* 推荐时价格：橙色，表示锁定值 */
.picks-review-table .rv-rec-price   { white-space: nowrap; }
.picks-review-table .rv-hold  { font-size: 1.02em; font-weight: 700; }
.picks-review-table .rv-na    { color: #bbb; }

.picks-review-table tr:last-child td { border-bottom: none; }

.picks-review-table tr:hover td { background: #fafbff; }

.review-up   { color: #d32f2f; font-weight: 600; }
.review-down { color: #1565c0; font-weight: 600; }

/* ── 历史回测：分阶段统计条 ────────────────────────────── */
.picks-review-tiers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 9px 14px;
    background: #fffbf0;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    font-size: 0.85em;
}

.rv-tier-label {
    color: #6b7280;
    font-weight: 600;
    white-space: nowrap;
}

.rv-tier {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.rv-tier small {
    color: #9ca3af;
    font-size: 0.9em;
}

.rv-tier-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 700;
    white-space: nowrap;
}

.rv-badge-high { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.rv-badge-mid  { background: #fff7e6; color: #d46b08; border: 1px solid #ffd591; }
.rv-badge-low  { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }

.picks-review-empty {
    padding: 24px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9em;
}

/* ── 标的详情弹框 ────────────────────────────────────── */
.stock-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.52);
    z-index: 1010;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px;
    overflow-y: auto;
}
.stock-detail-container {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 640px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.24);
    overflow: hidden;
}
.stock-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.stock-detail-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    color: #fff;
    font-size: 1.1em;
    font-weight: 700;
}
.stock-detail-code {
    font-size: 0.82em;
    opacity: 0.82;
    font-weight: 400;
}
.stock-detail-close {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    line-height: 1;
    transition: background 0.15s;
}
.stock-detail-close:hover { background: rgba(255,255,255,0.36); }

.stock-detail-body {
    padding: 18px 22px 24px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}
.sd-section {
    margin-bottom: 18px;
}
.sd-section-title {
    font-size: 0.82em;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e8ecff;
}
.sd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
}
.sd-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.sd-label {
    font-size: 0.73em;
    color: #999;
    font-weight: 500;
}
.sd-value {
    font-size: 0.88em;
    color: #222;
    font-weight: 600;
    word-break: break-all;
}
/* 近期新闻单列全宽 */
.sd-grid .sd-item:last-child:nth-child(odd) {
    grid-column: span 2;
}
/* 宽网格：主营业务等长文本用全宽单列显示 */
.sd-grid-wide {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px 14px;
}
.sd-item-wide {
    grid-column: 1 / -1;
}
.sd-item-wide .sd-value {
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
    font-weight: 400;
    color: #444;
}
.sd-loading-text {
    font-size: 0.82em;
    color: #aaa;
    padding: 4px 0;
}

/* 详情按钮 */
.btn-detail {
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    color: #4c6ef5;
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.15s;
    white-space: nowrap;
}
.btn-detail:hover { background: #e0e8ff; }

/* 深度分析 🔬 按钮 */
.btn-sotp {
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #0369a1;
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.15s;
    white-space: nowrap;
}
.btn-sotp:hover { background: #bae6fd; }
.btn-sotp-cached {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}
.btn-sotp-cached:hover { background: #bbf7d0; }
.btn-sotp-disabled {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ── K 线图弹框 ──────────────────────────────────────── */
.wl-chart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.wl-chart-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.wl-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 10px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.wl-chart-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #222;
    display: flex;
    align-items: center;
    gap: 8px;
}
.wl-chart-code {
    font-size: 0.8em;
    font-weight: 400;
    color: #888;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 20px;
}
.wl-chart-close {
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    color: #888;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.wl-chart-close:hover { background: #f5f5f5; color: #333; }

/* K 线周期 Tab */
.kline-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 20px 6px;
    flex-shrink: 0;
    border-bottom: 1px solid #f5f5f5;
}
.kline-tab {
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 5px 18px;
    font-size: 0.88em;
    cursor: pointer;
    color: #555;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.kline-tab:hover { background: #e6f4ff; border-color: #91caff; color: #1677ff; }
.kline-tab.active {
    background: #1677ff;
    border-color: #1677ff;
    color: #fff;
    font-weight: 600;
}

/* K线图头部动作区 */
.wl-chart-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.kline-nav-btn {
    background: #f5f5f5;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.82em;
    cursor: pointer;
    color: #555;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.kline-nav-btn:hover { background: #e6f4ff; border-color: #91caff; color: #1677ff; }
.kline-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.kline-ext-btn {
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.82em;
    cursor: pointer;
    color: #d46b08;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.kline-ext-btn:hover { background: #ffe7ba; border-color: #ffa940; color: #ad4e00; }
.wl-chart-latest-price {
    color: #f5222d;
    font-weight: 700;
    font-size: 1em;
    margin-left: 6px;
}
.wl-chart-latest-price.up { color: #f5222d; }
.wl-chart-latest-price.down { color: #52c41a; }

/* MA 开关区 */
.kline-ma-toggles {
    display: flex;
    gap: 8px;
    padding: 4px 16px 6px;
    flex-wrap: wrap;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}
.ma-toggle-label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8em;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
}
.ma-toggle-label input[type=checkbox] { width: 12px; height: 12px; cursor: pointer; }

/* 分享按钮 */
.results-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.btn-share-result {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 0.88em;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 2px 6px rgba(102,126,234,0.35);
}
.btn-share-result:hover { opacity: 0.88; transform: translateY(-1px); }

/* 图表主体 */
.wl-chart-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 4px 4px;
    min-height: 0;
    position: relative;
}
/* 加载遮罩：绝对定位在图表之上，新数据到后才消失 */
.wl-chart-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255,255,255,0.82);
    color: #555;
    font-size: 0.95em;
    z-index: 10;
    border-radius: 0 0 8px 8px;
    min-height: 200px;
}
.wl-chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #f5222d;
    font-size: 0.95em;
}

/* 响应式 */
@media (max-width: 768px) {
    .wl-chart-container { max-width: 100%; border-radius: 0; max-height: 100vh; }
    .wl-chart-overlay { padding: 0; }
    .kline-tab { padding: 5px 12px; }
    .wl-toolbar { gap: 8px; padding: 6px 10px; }
    .wl-toolbar-btns { margin-left: 0; width: 100%; }
}

/* ── 登录弹窗 ─────────────────────────────────────── */
.login-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.login-modal-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-modal-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.login-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.login-modal-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.login-modal-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.login-modal-input:focus {
    border-color: #667eea;
}

.login-modal-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.login-modal-btn:hover { opacity: 0.9; }

.login-modal-error {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 10px;
    min-height: 18px;
}

.login-modal-success {
    color: #27ae60;
    font-size: 0.85rem;
    margin-top: 10px;
    font-weight: 600;
}

/* 登录/注册 tab */
.login-modal-tabs {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.4);
    margin-bottom: 16px;
}

.login-tab-btn {
    flex: 1;
    padding: 8px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
    transition: background 0.2s, color 0.2s;
}

.login-tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.login-tab-btn:not(.active):hover { background: rgba(102, 126, 234, 0.08); }

/* ── 用户信息栏 ──────────────────────────────────── */
.header-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.user-info-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 6px 14px;
    color: #fff;
    font-size: 0.9rem;
}

.user-info-name {
    font-weight: 500;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover { background: rgba(255,255,255,0.35); }

/* ── 资金面板（自选页） ─────────────────────────── */
.funds-panel {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border: 1px solid #b3d9f7;
    border-radius: 10px;
    padding: 12px 16px;
    margin: 10px 0 14px;
    font-size: 0.9rem;
}

.funds-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.funds-label {
    color: #546e8a;
    font-size: 0.85rem;
}

.funds-value {
    font-weight: 700;
    color: #1a5276;
    font-size: 0.95rem;
}

.funds-available {
    color: #27ae60;
}

.btn-edit-funds {
    margin-left: auto;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-edit-funds:hover { opacity: 0.88; }

/* ── 选股页资金栏 ──────────────────────────────── */
.screener-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.screener-funds-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f7ff;
    border: 1px solid #b3d9f7;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.88rem;
}

/* ── 策略模式选择器 ──────────────────────────────── */
.strategy-mode-card {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
    border: 1px solid #b0bce8;
    border-left: 4px solid #667eea;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.12);
}

.strategy-mode-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #5563a0;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.strategy-mode-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.strategy-mode-option {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    background: #fff;
    border: 2px solid #dde3f4;
    border-radius: 10px;
    padding: 10px 14px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.strategy-mode-option:hover {
    border-color: #7b8fd4;
    background: #f5f7ff;
}

.strategy-mode-option input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: #5563a0;
}

.strategy-mode-option.active {
    border-color: #5563a0;
    background: #eef1ff;
    box-shadow: 0 2px 8px rgba(85,99,160,0.15);
}

.strategy-mode-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.strategy-mode-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #333;
}

.strategy-mode-desc {
    font-size: 0.78rem;
    color: #666;
    line-height: 1.4;
}

/* ══════════════════════════════════════════════════════════
   公司深度分析 Modal（SOTP 估值报告）
══════════════════════════════════════════════════════════ */

/* ── 遮罩层 ── */
.company-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.82);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 24px 12px;
}

/* ── 容器 ── */
.company-modal-container {
    position: relative;
    width: 100%;
    max-width: 780px;
    background: #0d1117;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 80px rgba(0,0,0,0.7);
    margin: auto;
}

.company-modal-close {
    position: sticky;
    top: 0;
    float: right;
    z-index: 10;
    width: 36px;
    height: 36px;
    margin: 14px 14px 0 0;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.company-modal-close:hover { background: rgba(255,255,255,0.25); }

/* ── Loading ── */
.company-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    min-height: 300px;
    color: #ccc;
    gap: 16px;
}
.company-loading-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.company-loading-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}
.company-loading-sub {
    font-size: 0.85rem;
    color: #888;
}

/* ── Error ── */
.company-modal-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: #ccc;
    min-height: 260px;
}
.company-error-icon { font-size: 2.5rem; }
.company-error-msg  { color: #f87171; font-size: 0.95rem; text-align: center; }

/* ── Section 通用 ── */
.sotp-section {
    padding: 32px 28px;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.sotp-section-dark {
    background: #111827;
}
.sotp-section-risk {
    background: #1a0e00;
}
.sotp-section-badge {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    font-weight: 700;
    background: rgba(249,115,22,0.18);
    color: #f97316;
    border: 1px solid rgba(249,115,22,0.3);
    border-radius: 20px;
    padding: 3px 12px;
    margin-bottom: 14px;
}
.sotp-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    line-height: 1.3;
}

/* ── 封面区 ── */
.sotp-cover {
    padding: 24px 28px 28px;
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.sotp-cover-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    background: #f97316;
    color: #fff;
    border-radius: 20px;
    padding: 4px 14px;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}
.sotp-cover-code {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 4px;
}
.sotp-cover-name {
    font-size: 2.6rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.1;
}
.sotp-cover-tagline {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 18px;
}
.sotp-hero-box {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 22px 24px;
}
.sotp-hero-label {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-bottom: 8px;
}
.sotp-hero-price {
    font-size: 3.6rem;
    font-weight: 900;
    color: #f97316;
    line-height: 1;
    margin-bottom: 10px;
}
.sotp-hero-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #94a3b8;
}
.sotp-hero-sep { color: rgba(255,255,255,0.2); }
.sotp-upside-badge {
    font-weight: 700;
    border-radius: 8px;
    padding: 2px 10px;
    font-size: 0.9rem;
}
.sotp-upside-pos { background: rgba(239,68,68,0.15); color: #f87171; }
.sotp-upside-neg { background: rgba(34,197,94,0.15); color: #4ade80; }
.sotp-hero-summary {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.5;
}

/* ── 业务分部卡片 ── */
.sotp-segment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.sotp-seg-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px;
    text-align: left;
}
.sotp-seg-icon   { font-size: 1.6rem; margin-bottom: 6px; }
.sotp-seg-name   { font-size: 0.88rem; font-weight: 700; color: #e2e8f0; margin-bottom: 4px; }
.sotp-seg-revenue {
    font-size: 1.25rem;
    font-weight: 900;
    color: #38bdf8;
}
.sotp-seg-unit   { font-size: 0.7rem; font-weight: 400; color: #94a3b8; }
.sotp-seg-margin {
    display: inline-block;
    margin-top: 0;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid;
    border-radius: 6px;
    padding: 2px 7px;
}
.sotp-seg-share  { font-size: 0.72rem; color: #475569; margin-top: 2px; }
.sotp-seg-notes  { font-size: 0.72rem; color: #94a3b8; margin-top: 6px; line-height: 1.4; }

.sotp-total-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(249,115,22,0.07);
    border: 1px solid rgba(249,115,22,0.2);
    border-radius: 12px;
    padding: 12px 18px;
    margin-top: 4px;
}
.total-bar-label { font-size: 0.85rem; color: #94a3b8; flex: 1; }
.total-bar-value { font-size: 1.2rem; font-weight: 900; color: #f97316; }

/* ── 估值明细 ── */
.sotp-val-list   { display: flex; flex-direction: column; gap: 14px; }
.sotp-val-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    overflow: hidden;
}
.sotp-val-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sotp-val-name  { font-weight: 700; color: #e2e8f0; font-size: 0.95rem; }
.sotp-val-badge {
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(99,102,241,0.18);
    color: #818cf8;
    border-radius: 6px;
    padding: 2px 10px;
}
.sotp-val-body     { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.sotp-val-kv       { display: flex; justify-content: space-between; align-items: center; }
.kv-k              { font-size: 0.8rem; color: #64748b; }
.kv-v              { font-size: 0.85rem; color: #e2e8f0; font-weight: 500; text-align: right; }
.sotp-val-multiple { color: #f97316; font-weight: 700; }
.sotp-val-price    { color: #38bdf8; font-weight: 700; font-size: 1rem; }
.sotp-val-rationale { font-size: 0.75rem; color: #94a3b8; margin-top: 4px; }
.sotp-val-rationale-why {
    color: #7c6a10;
    background: #fef9c3;
    border-radius: 4px;
    padding: 4px 8px;
    margin-top: 4px;
    font-size: 0.75rem;
    line-height: 1.5;
}

/* 总体投资建议块 */
.overall-advice-block {
    margin: 16px 0;
    border-radius: 12px;
    border: 1.5px solid #6366f1;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    overflow: hidden;
}
.overall-advice-header {
    background: #6366f1;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 10px 16px;
    letter-spacing: 0.04em;
}
.overall-advice-body {
    padding: 14px 18px;
    font-size: 0.88rem;
    line-height: 1.8;
    color: #2d2d6b;
    white-space: pre-wrap;
}

/* ── SOTP 汇总表 ── */
.sotp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
    margin-bottom: 22px;
}
.sotp-table th {
    text-align: left;
    padding: 10px 12px;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sotp-table td {
    padding: 11px 12px;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.sotp-table tr:hover td  { background: rgba(255,255,255,0.03); }
.sotp-table-discount td  { color: #f87171; }
.sotp-table-total td {
    font-weight: 700;
    border-top: 2px solid rgba(255,255,255,0.12);
    background: rgba(249,115,22,0.06);
    font-size: 1rem;
}
.sotp-neg        { color: #f87171 !important; }
.sotp-total-val  { color: #f97316 !important; font-size: 1.1rem; }

/* ── 情景分析 ── */
.sotp-scenario-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 22px;
}
.scenario-card {
    border-radius: 14px;
    padding: 18px;
    text-align: center;
}
.scenario-bear  { background: linear-gradient(135deg, #450a0a, #7f1d1d); }
.scenario-base  { background: linear-gradient(135deg, #1c1f35, #2e3561); border: 2px solid #f97316; }
.scenario-bull  { background: linear-gradient(135deg, #052e16, #14532d); }
.scenario-label { font-size: 0.78rem; color: rgba(255,255,255,0.7); margin-bottom: 8px; font-weight: 600; }
.scenario-price { font-size: 1.9rem; font-weight: 900; color: #fff; margin-bottom: 6px; }
.scenario-notes { font-size: 0.72rem; color: rgba(255,255,255,0.55); line-height: 1.4; }

.sotp-action-hint {
    font-size: 0.87rem;
    color: #94a3b8;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
}
.hint-sep { margin: 0 4px; color: rgba(255,255,255,0.2); }

/* ── 风险提示 ── */
.sotp-risk-list  { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.sotp-risk-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 12px;
    border-left: 4px solid transparent;
}
.risk-high { border-left-color: #ef4444; background: rgba(239,68,68,0.07); }
.risk-mid  { border-left-color: #f59e0b; background: rgba(245,158,11,0.07); }
.risk-low  { border-left-color: #3b82f6; background: rgba(59,130,246,0.07); }

.risk-num {
    font-size: 1.1rem;
    font-weight: 900;
    color: rgba(255,255,255,0.3);
    min-width: 28px;
    padding-top: 1px;
}
.risk-content  { flex: 1; }
.risk-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 6px;
}
.risk-level-badge {
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 6px;
    padding: 2px 8px;
    flex-shrink: 0;
}
.risk-badge-high { background: rgba(239,68,68,0.2); color: #fca5a5; }
.risk-badge-mid  { background: rgba(245,158,11,0.2); color: #fcd34d; }
.risk-badge-low  { background: rgba(59,130,246,0.2); color: #93c5fd; }
.risk-desc  { font-size: 0.82rem; color: #94a3b8; line-height: 1.6; }

.sotp-disclaimer {
    font-size: 0.75rem;
    color: #475569;
    text-align: center;
    line-height: 1.6;
    padding: 0 8px;
}

/* ── 触发按钮样式 ── */
.btn-wl-company {
    padding: 7px 10px;
    border: 1px solid rgba(249,115,22,0.35);
    border-radius: 8px;
    background: rgba(249,115,22,0.08);
    color: #fb923c;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s, border-color 0.18s;
}
.btn-wl-company:hover {
    background: rgba(249,115,22,0.18);
    border-color: rgba(249,115,22,0.6);
}
.btn-company-one {
    padding: 5px 9px;
    border: 1px solid rgba(249,115,22,0.35);
    border-radius: 7px;
    background: rgba(249,115,22,0.08);
    color: #fb923c;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.18s;
    margin-left: 4px;
}
.btn-company-one:hover { background: rgba(249,115,22,0.2); }
.btn-company-pick {
    padding: 7px 12px;
    background: rgba(249,115,22,0.12);
    border: 1px solid rgba(249,115,22,0.3);
    border-radius: 8px;
    color: #fb923c;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.18s;
    white-space: nowrap;
}
.btn-company-pick:hover { background: rgba(249,115,22,0.25); }

/* ── KPI 数据网格 ── */
.sotp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}
.sotp-kpi-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 14px 16px;
    text-align: center;
}
.sotp-kpi-highlight {
    background: rgba(249,115,22,0.1);
    border-color: rgba(249,115,22,0.25);
}
.sotp-kpi-value {
    font-size: 1.35rem;
    font-weight: 900;
    color: #38bdf8;
    line-height: 1.1;
    margin-bottom: 4px;
}
.sotp-kpi-highlight .sotp-kpi-value { color: #fb923c; }
.sotp-kpi-change {
    font-size: 0.72rem;
    font-weight: 700;
    color: #4ade80;
    margin-bottom: 4px;
}
.sotp-kpi-label {
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.3;
}

/* ── SOTP 简介卡 ── */
.sotp-intro-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.6;
}
.sotp-intro-icon { font-size: 1.1rem; flex-shrink: 0; }
.sotp-section-subtitle {
    font-size: 0.78rem;
    color: #475569;
    margin-bottom: 14px;
    margin-top: -10px;
}

/* ── 分部卡片新字段 ── */
.sotp-seg-sublabel {
    font-size: 0.72rem;
    color: #64748b;
    margin-bottom: 8px;
    line-height: 1.3;
}
.sotp-seg-revenue-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.sotp-seg-bar-track {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    margin: 6px 0;
    overflow: hidden;
}
.sotp-seg-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    border-radius: 4px;
    transition: width 0.6s ease;
}
.seg-growth-pos { background: rgba(34,197,94,0.12); color: #4ade80; font-size: 0.7rem; font-weight: 700; border-radius: 5px; padding: 2px 6px; }
.seg-growth-neg { background: rgba(239,68,68,0.12); color: #f87171; font-size: 0.7rem; font-weight: 700; border-radius: 5px; padding: 2px 6px; }

/* ── 封面顶部行（代码+名称） ── */
.sotp-cover-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.sotp-cover-code-name {
    font-size: 0.82rem;
    color: #94a3b8;
    text-align: right;
}
.sotp-cover-dot { margin: 0 4px; }

/* ── 当前价 vs SOTP 价对比框 ── */
.sotp-price-compare {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 18px 24px;
    margin-bottom: 20px;
}
.spc-item {
    flex: 1;
    text-align: center;
}
.spc-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 8px;
}
.spc-price {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 4px;
}
.spc-currency { font-size: 0.78rem; color: #64748b; }
.spc-arrow {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.2);
    flex-shrink: 0;
}
.spc-sotp { text-align: center; }
.spc-sotp-price { color: #f97316 !important; }
.spc-upside {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f87171;
    margin-top: 4px;
}

/* ── 风险管理行动指引 ── */
.sotp-risk-action {
    background: rgba(180,83,9,0.12);
    border: 1px solid rgba(249,115,22,0.25);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.sra-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 10px;
}
.sra-body { display: flex; flex-direction: column; gap: 8px; }
.sra-row {
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.6;
}
.sra-row strong { color: #fb923c; }
.sra-track {
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.sra-metric {
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 6px;
    padding: 2px 10px;
    color: #a5b4fc;
    font-size: 0.78rem;
}

/* ── 响应式适配 ── */
@media (max-width: 600px) {
    .sotp-cover-name   { font-size: 2rem; }
    .sotp-hero-price   { font-size: 2.8rem; }
    .sotp-scenario-row { grid-template-columns: 1fr; }
    .sotp-segment-grid { grid-template-columns: 1fr 1fr; }
    .sotp-kpi-grid     { grid-template-columns: 1fr 1fr; }
    .sotp-price-compare { flex-direction: column; gap: 8px; }
    .spc-arrow         { transform: rotate(90deg); }
    .company-modal-overlay { padding: 0; align-items: flex-end; }
    .company-modal-container { border-radius: 20px 20px 0 0; }
}

/* ═══════════════ 分析力度 effort 选择器 ═══════════════ */
.param-effort-option {
    margin-top: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(102,126,234,0.08), rgba(118,75,162,0.06));
    border: 1px solid rgba(102,126,234,0.2);
    border-radius: 12px;
}
.param-effort-title {
    font-weight: 700;
    color: #4c51bf;
    margin-bottom: 10px;
    font-size: 0.95rem;
}
.param-effort-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.param-effort-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    line-height: 1.35;
}
.param-effort-item:hover { border-color: #a3bffa; }
.param-effort-item input[type="radio"] { margin-top: 3px; }
.param-effort-item input[type="radio"]:checked + span { color: #4c51bf; }
.param-effort-item:has(input:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102,126,234,0.12), rgba(118,75,162,0.08));
    box-shadow: 0 2px 8px rgba(102,126,234,0.2);
}
.param-effort-item small { color: #718096; font-size: 0.72rem; }
.param-effort-recommend { position: relative; }
.param-effort-recommend::after {
    content: '推荐';
    position: absolute;
    top: -8px;
    right: 6px;
    background: linear-gradient(135deg, #f6ad55, #ed8936);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

/* 登录面板切换提示 */
.login-switch-hint {
    margin-top: 12px;
    text-align: center;
    font-size: 0.85rem;
    color: #718096;
}
.login-switch-hint a {
    color: #667eea;
    font-weight: 700;
    margin-left: 4px;
    text-decoration: none;
    border-bottom: 1px dashed rgba(102,126,234,0.5);
}
.login-switch-hint a:hover { color: #5a67d8; border-bottom-color: #5a67d8; }

/* ═══════════════ 手机端综合优化 ═══════════════ */
@media (max-width: 768px) {
    .login-tab-btn { padding: 12px 0; font-size: 1rem; }
    .login-modal-card { padding: 24px 18px; width: 92%; max-width: 92%; }
    .login-modal-title { font-size: 1.2rem; }
    .login-modal-input { font-size: 16px; padding: 11px 12px; }  /* 16px 防止 iOS 自动放大 */
    .login-modal-btn   { min-height: 46px; font-size: 1rem; }
    .login-modal-subtitle { font-size: 0.85rem; }
    .login-switch-hint { font-size: 0.9rem; }

    .tab-navigation {
        flex-wrap: wrap;
        gap: 6px;
    }
    .tab-button { min-height: 44px; font-size: 0.9rem; padding: 10px 12px; flex: 1 1 auto; }

    .param-effort-options { grid-template-columns: 1fr; }
    .param-effort-item { padding: 12px 14px; }

    .params-grid { grid-template-columns: 1fr !important; gap: 10px; }
    .param-input { min-height: 42px; font-size: 16px; }
    .strategy-mode-options { grid-template-columns: 1fr; }

    .screener-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .screener-funds-bar { width: 100%; }

    .btn-screen { width: 100%; min-height: 50px; font-size: 1rem; }

    /* 分析输入框 */
    textarea, input[type="text"], input[type="number"] { font-size: 16px !important; }

    /* 结果表格横向滚动 */
    .analysis-table-wrapper, .screen-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* 头部 */
    header h1 { font-size: 1.4rem; }
    .subtitle  { font-size: 0.85rem; }
    .header-main { flex-direction: column; gap: 10px; align-items: flex-start; }
    .user-info-bar { width: 100%; justify-content: space-between; }
}

@media (max-width: 480px) {
    body, .container { padding-left: 8px; padding-right: 8px; }
    .login-modal-card { padding: 20px 14px; }
    .login-modal-icon { font-size: 2.2rem; }
    .tab-button { font-size: 0.82rem; padding: 9px 8px; }
    header h1 { font-size: 1.2rem; }
    .btn-primary, .btn-secondary { min-height: 44px; font-size: 0.95rem; }
}

/* ── v3.0 走势分析：sparkline + modal ─────────────────────────── */
.pick-sparkline-row { display:flex; align-items:center; gap:10px; padding:6px 10px; background:#f8f9fb; border-radius:6px; margin:6px 0; }
.pick-sparkline { display:inline-flex; }
.pick-sparkline-hint { font-size:11px; color:#6b7280; }
.sparkline-empty { font-size:11px; color:#9ca3af; }
.sparkline-svg { display:block; }
.confirm-badge { display:inline-block; padding:2px 6px; border-radius:4px; font-size:11px; margin-left:4px; }
.confirm-badge.cf-upgrade { background:#fee2e2; color:#b91c1c; }
.confirm-badge.cf-hold    { background:#e0e7ff; color:#3730a3; }
.confirm-badge.cf-watch   { background:#fef3c7; color:#92400e; }
.confirm-badge.cf-down    { background:#d1fae5; color:#065f46; }

/* 走势分析 Modal */
#trendAnalysisModal { position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:1100; align-items:center; justify-content:center; }
#trendAnalysisModal.modal[style*="flex"] { display:flex !important; }
.trend-block { padding:12px 14px; border:1px solid #eef0f3; border-radius:8px; margin-bottom:12px; background:#fff; }
.trend-block h4 { margin:0 0 10px; font-size:14px; color:#111827; display:flex; justify-content:space-between; align-items:center; }
.trend-total { font-size:12px; color:#ef4444; font-weight:600; }
.trend-spark { padding:4px 0; }
.trend-kline-tbl { width:100%; border-collapse:collapse; font-size:12px; margin-top:6px; }
.trend-kline-tbl th, .trend-kline-tbl td { padding:4px 8px; border-bottom:1px solid #f1f2f6; text-align:left; }
.trend-kline-tbl td.up { color:#e74c3c; } .trend-kline-tbl td.down { color:#2ecc71; }
.trend-bars .trend-bar-row { display:flex; align-items:center; gap:8px; margin:4px 0; font-size:12px; }
.trend-bar-label { width:70px; color:#4b5563; }
.trend-bar-track { flex:1; height:8px; background:#f3f4f6; border-radius:4px; overflow:hidden; }
.trend-bar-fill { height:100%; background:linear-gradient(90deg,#f59e0b,#ef4444); }
.trend-bar-value { width:50px; text-align:right; color:#374151; font-variant-numeric:tabular-nums; }
.trend-note { font-size:11px; color:#92400e; margin-top:4px; }
.trend-reason { font-size:12px; color:#4b5563; margin-bottom:6px; }
.trend-factors { font-size:12px; color:#4b5563; margin:4px 0 0 18px; padding:0; }
.trend-row { display:flex; justify-content:space-between; font-size:12px; padding:3px 0; border-bottom:1px dashed #f3f4f6; }
.trend-row:last-child { border-bottom:none; }
.trend-row span { color:#6b7280; } .trend-row b { color:#111827; font-weight:600; }
.trend-empty { font-size:12px; color:#9ca3af; text-align:center; padding:16px; }

/* 🧪 手动试算沙盒栏 */
#previewSection .daily-section-header h2 { display:flex; align-items:center; gap:8px; }
.preview-badge {
    display:inline-block;
    font-size:11px;
    padding:2px 8px;
    background:linear-gradient(90deg,#8b5cf6,#6366f1);
    color:#fff;
    border-radius:10px;
    font-weight:600;
    letter-spacing:0.5px;
}
.preview-intro {
    background:#fef3c7;
    border-left:3px solid #f59e0b;
    color:#78350f;
    padding:10px 14px;
    margin:0 0 12px 0;
    border-radius:6px;
    font-size:13px;
    line-height:1.6;
}
.preview-intro strong { color:#92400e; }
.preview-limit { color:#b45309; font-size:12px; margin-left:6px; }
.preview-toolbar {
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:12px;
    flex-wrap:wrap;
}
.preview-toolbar .btn-primary { padding:8px 18px; font-size:14px; }
.preview-toolbar .btn-primary:disabled { opacity:0.6; cursor:not-allowed; }
.preview-ts {
    color:#6b7280;
    font-size:12px;
    font-style:italic;
}
#previewCards { margin-top:8px; }
#previewSummary .picks-score-guide { display:none; } /* 试算栏不需要买入门槛提示 */
