/* public/assets/css/life/roi-calculator.css */

.roi-workspace {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    width: 100%;
    margin-bottom: 40px;
    align-items: flex-start;
}

.roi-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    overflow: hidden;
}

.roi-panel-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.01);
}

.roi-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.roi-panel-body {
    padding: 24px;
}

/* =========================================================
   左侧：流式防溢出配置台
   ========================================================= */
.roi-sidebar {
    flex: 1;
    min-width: 320px;
    max-width: 450px;
}

/* 引入 minmax(0, 1fr) 防止撑爆 Grid */
.roi-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }

.roi-form-group { display: flex; flex-direction: column; min-width: 0; }
.roi-form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

.roi-input, .roi-select-sm {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 6px;
    background: var(--bg-body); color: var(--text-main); font-size: 0.95rem; font-weight: 600;
    font-family: 'Inter', monospace; outline: none; transition: 0.2s; box-sizing: border-box;
    text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.roi-input:focus, .roi-select-sm:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 0, 102, 204), 0.1); }
.roi-select-sm { padding: 6px 10px; font-size: 0.85rem; cursor: pointer; }

.roi-divider { border: none; border-top: 1px dashed var(--border-color); margin: 20px 0; }
.roi-sub-heading { font-size: 0.95rem; font-weight: 700; color: var(--text-main); margin: 0 0 16px 0; }

.roi-btn-calc {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--primary-color); color: white; border: none; border-radius: 8px;
    padding: 14px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: 0.3s;
    margin-top: 20px; box-shadow: 0 4px 10px rgba(var(--primary-rgb, 0, 102, 204), 0.2);
}
.roi-btn-calc:hover { transform: translateY(-2px); opacity: 0.9; }

/* =========================================================
   右侧：工程仪表盘
   ========================================================= */
.roi-main-content {
    flex: 2;
    min-width: 0;
}

/* 状态标牌 */
.roi-status-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 50px; font-size: 0.85rem; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-safe { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.status-safe .status-dot { background: #10b981; box-shadow: 0 0 8px #10b981; }
.status-warning { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.status-warning .status-dot { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
.status-danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.status-danger .status-dot { background: #ef4444; box-shadow: 0 0 8px #ef4444; animation: pulse 1s infinite; }
@keyframes pulse { 0% { opacity: 1;} 50% { opacity: 0.4;} 100% { opacity: 1;} }

/* 数据卡片 */
.roi-metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; }
.roi-metric-card { background: var(--bg-body); border: 1px solid var(--border-color); padding: 20px; border-radius: 12px; display: flex; flex-direction: column; justify-content: center; transition: 0.3s; }
.roi-metric-title { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.roi-metric-value { font-size: 1.8rem; font-weight: 800; color: var(--text-main); font-family: 'Inter', monospace; }
.roi-metric-value small { font-size: 1rem; font-weight: 600; color: var(--text-muted); margin: 0 4px; }
.roi-card-muted { background: rgba(0,0,0,0.02); }

/* 警报变色联动 */
.roi-metric-card.danger { background: rgba(239, 68, 68, 0.05); border-color: #ef4444; }
.roi-metric-card.danger .roi-metric-value { color: #ef4444; }
.roi-metric-card.warning { background: rgba(59, 130, 246, 0.05); border-color: #3b82f6; }
.roi-metric-card.warning .roi-metric-value { color: #3b82f6; }

/* 数据表格 */
.roi-table-wrapper { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 8px; }
.roi-data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.95rem; }
.roi-data-table th, .roi-data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-color); font-variant-numeric: tabular-nums; white-space: nowrap; }
.roi-data-table th { background: rgba(0,0,0,0.02); font-weight: 600; color: var(--text-muted); }
.roi-data-table tr:last-child td { border-bottom: none; }
.roi-row-highlight { background: rgba(var(--primary-rgb, 0, 102, 204), 0.05); }

/* 暗黑模式适配 */
[data-theme="dark"] .roi-panel-header, [data-theme="dark"] .roi-data-table th { background: rgba(255,255,255,0.02); }
[data-theme="dark"] .roi-input, [data-theme="dark"] .roi-select-sm, [data-theme="dark"] .roi-metric-card { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .roi-card-muted { background: #1e293b; }

/* =========================================================
   SEO 内容强化网格
   ========================================================= */
.tool-seo-content { margin-top: 50px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 40px; }
.tool-seo-content h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 20px; color: var(--text-main); }
.seo-intro-section { margin-bottom: 40px; }
.seo-lead-text { font-size: 1rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 15px;}
.seo-sub-heading { font-size: 1.4rem; font-weight: 700; margin-bottom: 20px; color: var(--text-main); border-left: 4px solid var(--primary-color); padding-left: 12px;}
.seo-feature-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.seo-feature-card { background: var(--bg-body); border: 1px solid var(--border-color); padding: 24px; border-radius: 12px; transition: all 0.3s ease; }
.seo-feature-card:hover { border-color: var(--primary-color); transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0, 102, 204, 0.08); }
.seo-feature-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.seo-icon { width: 40px; height: 40px; color: var(--primary-color); background: rgba(var(--primary-rgb, 0, 102, 204), 0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.seo-icon svg { width: 20px; height: 20px; }
.seo-feature-card h3 { font-size: 1.1rem; font-weight: 700; margin: 0; color: var(--text-main); }
.seo-feature-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin: 0; }

[data-theme="dark"] .tool-seo-content { background: var(--bg-surface); }
[data-theme="dark"] .seo-feature-card { background: #0f172a; border-color: #334155; }

/* 移动端完美折叠 */
@media (max-width: 900px) {
    .roi-sidebar { max-width: 100%; }
    .seo-feature-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
    .roi-grid-2 { grid-template-columns: 1fr; }
}