/* ==================== 仪表盘专用样式 ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dashboard-grid .full-width {
    grid-column: 1 / -1;
}

/* AI分析面板 */
.ai-panel {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #ddd6fe 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.ai-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(129,140,248,.15) 0%, transparent 70%);
    pointer-events: none;
}

.ai-panel .ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.ai-panel .ai-title {
    font-size: 15px;
    font-weight: 700;
    color: #3730a3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-panel .ai-content {
    font-size: 13.5px;
    line-height: 1.8;
    white-space: pre-line;
    color: var(--text);
}

/* ==================== 同步状态 ==================== */
.sync-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.sync-status-dot.idle { background: var(--text-muted); }
.sync-status-dot.success { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,.4); }
.sync-status-dot.error { background: var(--danger); box-shadow: 0 0 6px rgba(239,68,68,.4); }
.sync-status-dot.running {
    background: var(--warning);
    box-shadow: 0 0 8px rgba(245,158,11,.5);
    animation: statusPulse 1.5s infinite;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(245,158,11,.4); }
    50% { box-shadow: 0 0 12px rgba(245,158,11,.7); }
}

/* ==================== 设置页面 ==================== */
.settings-section {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-xs);
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border-light);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
    gap: 16px;
}

.settings-row:last-child { border-bottom: none; }

.settings-row .setting-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.settings-row .setting-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.5;
}

/* Toggle开关 */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle input { display: none; }

.toggle .slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 12px;
    transition: all var(--transition);
}

.toggle .slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.toggle input:checked + .slider { background: var(--primary); }
.toggle input:checked + .slider::before { transform: translateX(20px); }

/* ==================== 健康度仪表盘 ==================== */
.health-dashboard {
    margin-bottom: 24px;
}

.health-card {
    display: flex;
    align-items: center;
    gap: 40px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 36px;
    box-shadow: var(--shadow-sm);
}

.health-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.gauge-ring {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.gauge-inner {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 4px rgba(0,0,0,.06);
}

.gauge-score {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.gauge-level {
    font-size: 14px;
    font-weight: 700;
    margin-top: 4px;
}

.gauge-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 10px;
    font-weight: 600;
}

.health-dims {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 32px;
}

.health-dim {
    min-width: 200px;
}

.health-dim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.health-dim-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.health-dim-score {
    font-size: 14px;
    font-weight: 700;
}

.health-dim-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.health-dim-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ==================== 热力图 ==================== */
.heatmap-container {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    box-shadow: var(--shadow-xs);
}

.heatmap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 800px;
}

.heatmap-table thead th {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 10px 8px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    z-index: 2;
}

.heatmap-table tbody td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.heatmap-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.03);
}

.heatmap-sku-col {
    min-width: 160px;
}

.heatmap-sku {
    font-size: 11px;
    max-width: 160px;
}

.heatmap-month {
    text-align: center;
    min-width: 70px;
}

.heatmap-cell {
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    padding: 6px 4px !important;
    border-radius: 3px;
    transition: transform 0.15s;
    cursor: default;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    z-index: 1;
    position: relative;
}
