/**
 * 智能诊断模块样式
 */

/* ============================================
   诊断按钮样式
   ============================================ */

.diagnosis-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    margin-left: 8px;
}

.diagnosis-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.diagnosis-btn:active {
    transform: translateY(0);
}

/* ============================================
   诊断面板样式
   ============================================ */

.diagnosis-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.diagnosis-panel.active {
    display: flex;
}

.diagnosis-panel .diagnosis-content {
    background: #1a1a2e;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   诊断面板头部
   ============================================ */

.diagnosis-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diagnosis-header h3 {
    margin: 0;
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.diagnosis-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diagnosis-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ============================================
   加载状态
   ============================================ */

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   诊断区块
   ============================================ */

.diagnosis-section {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.diagnosis-section:last-child {
    border-bottom: none;
}

.diagnosis-section h4 {
    margin: 0 0 16px 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.diagnosis-section h5 {
    margin: 0 0 8px 0;
    color: #ddd;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   概览部分
   ============================================ */

.diagnosis-summary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stock-info h4 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 18px;
}

.stock-info .current-price {
    margin: 4px 0;
    color: #7fff00;
    font-size: 24px;
    font-weight: 600;
}

.stock-info .timestamp {
    margin: 4px 0 0 0;
    color: #888;
    font-size: 12px;
}

.score-display {
    text-align: center;
}

.score-circle {
    width: 120px;
    height: 120px;
    border: 4px solid;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.score-value {
    font-size: 36px;
    font-weight: 700;
}

.score-label {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

.score-stars {
    font-size: 20px;
    color: #ffd700;
}

/* ============================================
   当前状态部分
   ============================================ */

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

.status-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.status-label {
    display: block;
    color: #888;
    font-size: 12px;
    margin-bottom: 8px;
}

.status-value {
    display: block;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.status-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.highlight-item {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
    color: #7fff00;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}

/* ============================================
   详细分析部分
   ============================================ */

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.analysis-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 8px;
}

.analysis-item ul {
    margin: 8px 0 0 0;
    padding: 0 0 0 20px;
    color: #ccc;
    font-size: 13px;
    line-height: 1.8;
}

.analysis-item li {
    margin: 4px 0;
}

/* ============================================
   购买建议部分
   ============================================ */

.buying-suggestion {
    background: rgba(255, 255, 255, 0.03);
}

.suggestion-main {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid;
    margin-bottom: 16px;
}

.suggestion-level {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.suggestion-advice {
    color: #ddd;
    font-size: 15px;
    margin: 0;
}

.suggestion-details {
    background: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: 8px;
}

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

.suggestion-item {
    text-align: center;
}

.suggestion-label {
    display: block;
    color: #888;
    font-size: 12px;
    margin-bottom: 8px;
}

.suggestion-value {
    display: block;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.suggestion-value small {
    display: block;
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
    font-weight: 400;
}

.suggestion-value.stop-loss {
    color: #ff6b6b;
}

.suggestion-value.target {
    color: #51cf66;
}

.suggestion-reason {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 6px;
}

.suggestion-reason h5 {
    margin: 0 0 8px 0;
}

.suggestion-reason pre {
    margin: 0;
    color: #ccc;
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-wrap;
    font-family: inherit;
}

/* ============================================
   策略匹配部分
   ============================================ */

.strategy-confidence {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.confidence-bar {
    flex: 1;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.confidence-value {
    color: #fff;
    font-weight: 600;
    min-width: 50px;
}

.strategy-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.strategy-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.strategy-item.best-strategy {
    border-left-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.strategy-item.triggered {
    border-left-color: #7fff00;
}

.strategy-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

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

.strategy-name {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.strategy-score {
    font-weight: 700;
    font-size: 16px;
}

.strategy-badge {
    display: inline-block;
    background: rgba(127, 255, 0, 0.2);
    color: #7fff00;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-bottom: 8px;
}

.strategy-detail {
    color: #aaa;
    font-size: 13px;
    margin: 0;
    line-height: 1.6;
}

.strategy-note {
    color: #888;
    font-size: 12px;
    text-align: center;
    margin: 16px 0 0 0;
}

/* ============================================
   策略详细信息样式
   ============================================ */

.strategy-badge-inactive {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: #888;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-bottom: 8px;
}

.strategy-item.has-details {
    padding-bottom: 20px;
}

/* 评分细分样式 */
.score-breakdown {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.breakdown-title,
.checks-title,
.suggestions-title {
    color: #aaa;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.breakdown-item,
.condition-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.breakdown-item:last-child,
.condition-item:last-child {
    margin-bottom: 0;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 8px;
}

.item-name {
    color: #ddd;
    font-size: 13px;
    font-weight: 500;
}

.item-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.item-status.status-met {
    background: rgba(127, 255, 0, 0.2);
    color: #7fff00;
}

.item-status.status-partial {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.item-status.status-not-met {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.item-score {
    color: #7fff00;
    font-size: 13px;
    font-weight: 600;
}

.item-detail,
.item-desc {
    color: #999;
    font-size: 12px;
    line-height: 1.5;
    margin-top: 4px;
}

.item-desc {
    color: #777;
    font-size: 11px;
    margin-top: 6px;
}

/* 条件检查样式 */
.condition-checks {
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

/* 建议样式 */
.score-suggestions {
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

.suggestion-item {
    color: #ffc107;
    font-size: 12px;
    padding: 8px 12px;
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    margin-bottom: 6px;
    line-height: 1.5;
}

.suggestion-item:last-child {
    margin-bottom: 0;
}

/* 用户判断提示样式 */
.user-judgment {
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
}

.judgment-message {
    color: #7fff00;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 12px;
    background: rgba(127, 255, 0, 0.1);
    border-left: 3px solid #7fff00;
    border-radius: 4px;
}

/* ============================================
   错误状态
   ============================================ */

.diagnosis-error {
    padding: 60px 20px;
    text-align: center;
    color: #ff6b6b;
    font-size: 16px;
}

/* ============================================
   响应式设计
   ============================================ */

@media (max-width: 768px) {
    .diagnosis-panel {
        padding: 10px;
    }

    .diagnosis-summary {
        flex-direction: column;
        text-align: center;
    }

    .score-display {
        margin-top: 20px;
    }

    .current-status .status-row {
        grid-template-columns: 1fr;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .suggestion-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   滚动条样式
   ============================================ */

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

.diagnosis-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.diagnosis-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

.diagnosis-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* ============================================
   体系触发概览样式
   ============================================ */

.triggered-systems-overview {
    background: linear-gradient(135deg, rgba(127, 255, 0, 0.05) 0%, rgba(102, 126, 234, 0.05) 100%);
}

.overview-intro {
    color: #aaa;
    font-size: 14px;
    margin: 0 0 16px 0;
}

.triggered-systems,
.near-trigger-systems {
    margin-bottom: 20px;
}

.triggered-systems:last-child,
.near-trigger-systems:last-child {
    margin-bottom: 0;
}

.subsection-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.system-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 14px;
    border-radius: 8px;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.system-card.triggered {
    border-left-color: #7fff00;
    background: rgba(127, 255, 0, 0.05);
}

.system-card.near-trigger {
    border-left-color: #ffc107;
    background: rgba(255, 193, 7, 0.05);
}

.system-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.system-card .system-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.system-card .system-score {
    font-size: 16px;
    font-weight: 700;
}

.system-card .system-detail {
    color: #aaa;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.system-card .system-advice {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.system-card .advice-label {
    color: #888;
    font-size: 12px;
}

.system-card .advice-value {
    font-size: 13px;
    font-weight: 600;
}

.system-card .system-suggestions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.system-card .suggestion-tip {
    color: #ffc107;
    font-size: 11px;
    padding: 6px 10px;
    background: rgba(255, 193, 7, 0.1);
    border-left: 2px solid #ffc107;
    border-radius: 4px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.system-card .suggestion-tip:last-child {
    margin-bottom: 0;
}

.overview-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.overview-tip {
    color: #7fff00;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
    padding: 12px;
    background: rgba(127, 255, 0, 0.1);
    border-left: 3px solid #7fff00;
    border-radius: 6px;
}

.overview-tip strong {
    color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .systems-grid {
        grid-template-columns: 1fr;
    }
}

/* 体系详细信息展示样式 */
.system-breakdown,
.system-conditions,
.system-signals,
.system-condition-details,
.system-score-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.breakdown-item-mini,
.condition-item-mini,
.signal-item-mini,
.detail-item-mini {
    font-size: 11px;
    line-height: 1.6;
    padding: 4px 8px;
    margin-bottom: 4px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.2);
}

.breakdown-item-mini,
.signal-item-mini {
    color: #7fff00;
    border-left: 2px solid #7fff00;
}

.condition-item-mini {
    color: #aaa;
}

.detail-item-mini {
    color: #aaa;
}

.detail-item-mini.met {
    color: #7fff00;
    border-left: 2px solid #7fff00;
    background: rgba(127, 255, 0, 0.05);
}

.detail-item-mini.partial {
    color: #ffc107;
    border-left: 2px solid #ffc107;
    background: rgba(255, 193, 7, 0.05);
}

.detail-item-mini.not-met {
    color: #ff6b6b;
    border-left: 2px solid #ff6b6b;
    background: rgba(255, 107, 107, 0.05);
}

.signals-title {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
    font-weight: 500;
}

.breakdown-item-mini:last-child,
.condition-item-mini:last-child,
.signal-item-mini:last-child,
.detail-item-mini:last-child {
    margin-bottom: 0;
}