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

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

.spr-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;
}

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

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

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

/* =========================================================
   左侧控制台 (防溢出流式布局重构)
   ========================================================= */
.spr-sidebar {
    flex: 1;
    min-width: 320px;
    max-width: 450px;
}

/* 核心修复：引入 minmax(0, 1fr) 防止子元素内容撑破 Grid */
.spr-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.spr-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }

/* 核心修复：防止 form-group 被超长文本撑大 */
.spr-form-group { 
    display: flex; 
    flex-direction: column; 
    min-width: 0; 
}

.spr-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;
}
.spr-form-group label small { font-weight: 400; opacity: 0.8; }

.spr-input {
    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;
}
.spr-input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 0, 102, 204), 0.1); }

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

/* 新增：求解模式的弹性排版头部 */
.spr-mode-switch {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.spr-select-sm {
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-main);
    font-weight: 600;
    outline: none;
    max-width: 100%;
    cursor: pointer;
}

.spr-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);
}
.spr-btn-calc:hover { transform: translateY(-2px); opacity: 0.9; }

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

/* 状态标牌 */
.spr-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(245, 158, 11, 0.1); color: #f59e0b; }
.status-warning .status-dot { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.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;} }

/* 数据卡片 */
.spr-metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; }
.spr-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; }
.spr-metric-title { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.spr-metric-value { font-size: 1.8rem; font-weight: 800; color: var(--text-main); font-family: 'Inter', monospace; }
.spr-metric-value small { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); margin-left: 4px; }
.spr-metric-card.danger { background: rgba(239, 68, 68, 0.05); border-color: #ef4444; }
.spr-metric-card.danger .spr-metric-value { color: #ef4444; }
.spr-metric-card.warning { background: rgba(245, 158, 11, 0.05); border-color: #f59e0b; }
.spr-metric-card.warning .spr-metric-value { color: #f59e0b; }

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

/* 详细参数网格 */
.spr-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.spr-detail-item { display: flex; justify-content: space-between; padding: 12px; background: var(--bg-body); border-radius: 6px; border: 1px solid var(--border-color); font-size: 0.9rem;}
.spr-dl-label { color: var(--text-muted); font-weight: 600; }
.spr-dl-value { color: var(--text-main); font-family: monospace; font-size: 1rem; }

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

/* =========================================================
   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) {
    .spr-sidebar { max-width: 100%; }
    .seo-feature-grid-3 { grid-template-columns: 1fr; }
}

/* 极致小屏保护 */
@media (max-width: 400px) {
    .spr-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .spr-grid-2 { grid-template-columns: 1fr; }
}