/* ============================================
   京东毛保页面样式
   ============================================ */

/* 子菜单分隔线 */
.submenu-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--spacing-sm) 0;
}

/* 特殊链接样式 */
.special-link {
    background: linear-gradient(90deg, rgba(225, 37, 27, 0.05) 0%, transparent 100%);
    border-left: 2px solid #e1251b;
}

.special-link:hover {
    background: linear-gradient(90deg, rgba(225, 37, 27, 0.1) 0%, transparent 100%);
}

/* 公式说明列表 */
.formula-notes {
    list-style: none;
    padding: 0;
    margin-top: var(--spacing-sm);
}

.formula-notes li {
    padding: var(--spacing-xs) 0;
    padding-left: var(--spacing-lg);
    position: relative;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.formula-notes li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* 示例详情 */
.example-detail {
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.example-params {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px dashed var(--border-color);
}

.example-calc {
    font-size: 0.9rem;
}

.example-calc p {
    margin-bottom: var(--spacing-xs);
}

.result-note {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-sm);
    font-weight: 500;
}

.result-note.success {
    background: rgba(72, 187, 120, 0.1);
    color: #276749;
    border-left: 3px solid #48bb78;
}

.result-note.warning {
    background: rgba(237, 137, 54, 0.1);
    color: #c05621;
    border-left: 3px solid #ed8936;
}

/* 临界点分析 */
.formula-critical {
    margin-top: var(--spacing-lg);
}

.critical-content {
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.critical-formula {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin: var(--spacing-sm) 0;
}

.critical-formula p {
    margin-bottom: var(--spacing-xs);
}

.critical-example {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: rgba(26, 54, 93, 0.05);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

/* 毛保计算结果样式 */
.result-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.result-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-color);
    border-radius: var(--radius-md);
}

.result-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 80px;
}

.result-item .result-value {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    font-family: var(--font-mono);
}

.result-item .result-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.success-text {
    color: #276749 !important;
}

.warning-text {
    color: #c05621 !important;
}


.faq-hero > :not(.hero-chips) {
    position: relative;
    z-index: 2;
}

/* ══════════════════════════════════════════════════════════
   毛保页 Tab 布局 —— mb-* 系列样式
   ══════════════════════════════════════════════════════════ */

/* ── Tab 导航栏 ─────────────────────────────────────────── */
.mb-tab-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mb-tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.55rem 1.1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.mb-tab-btn:hover {
    border-color: #764ba2;
    color: #667eea;
    background: rgba(102, 126, 234, 0.07);
}

.mb-tab-active {
    border-color: #764ba2 !important;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #fff !important;
    font-weight: 600;
}

/* ── 输入区网格 ─────────────────────────────────────────── */
.mb-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.mb-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.mb-input-row .input-group {
    min-width: 140px;
    flex: 1;
}

/* ── 按钮变体 ───────────────────────────────────────────── */
.mb-btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

.mb-btn-auto {
    align-self: flex-end;
    white-space: nowrap;
    flex-shrink: 0;
}

.mb-btn-amber,
.mb-btn-green {
    background: linear-gradient(135deg, #667eea, #764ba2);
}
.mb-btn-amber:hover,
.mb-btn-green:hover {
    background: linear-gradient(135deg, #5a6fd6, #6a3d96);
}

/* ── 结果面板 ───────────────────────────────────────────── */
.mb-result-panel {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.mb-result-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
}

.mb-banner-safe {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.mb-banner-warn {
    background: #fff5f5;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* ── 四项指标卡片网格 ───────────────────────────────────── */
.mb-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.mb-metric-card {
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem 0.75rem;
    text-align: center;
}

.mb-metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    white-space: normal;
    word-break: keep-all;
}

.mb-metric-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    overflow: visible;
}

.mb-metric-unit {
    font-size: 0.72rem;
    color: var(--text-tertiary, #9ca3af);
    margin-top: 2px;
}

/* ── 标题图标颜色 & 徽章颜色 ───────────────────────────── */
.mb-tab-icon-blue i,
.mb-tab-icon-purple i,
.mb-tab-icon-amber i,
.mb-tab-icon-green i  { color: var(--primary-color); margin-right: 6px; }

.mb-badge-blue,
.mb-badge-purple,
.mb-badge-amber,
.mb-badge-green  { background: #f0f4fa; color: var(--primary-light); }

/* ── 反推定价：临界价高亮卡片 ──────────────────────────── */
.mb-critical-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #f0f4fa, #e8edf7);
    border: 1.5px solid #c3cfe2;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
}

.mb-critical-left {
    min-width: 180px;
}

.mb-critical-label {
    font-size: 0.8rem;
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 4px;
}

.mb-critical-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.mb-critical-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.mb-critical-right {
    flex: 1;
    min-width: 200px;
}

.mb-critical-formula {
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.8;
}

.mb-critical-formula code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
}

.mb-critical-detail {
    color: var(--primary-light);
}

/* ── 表格区域通用 ───────────────────────────────────────── */
.mb-table-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.mb-table-hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.mb-table-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.mb-legend-safe    { color: #15803d; }
.mb-legend-danger  { color: #b91c1c; }
.mb-legend-critical { color: #d97706; }

.mb-summary-box {
    margin-top: 0.75rem;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.7;
}

/* ── 利润敏感性分析 ─────────────────────────────────────── */
.mb-sens-conclusion {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 0.85rem 1.1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.mb-sens-safe {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.mb-sens-warn {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.mb-sens-chart {
    width: 100%;
    height: 320px;
    margin-bottom: 1rem;
}

/* ── 毛保页 formula-body 左功能/右说明 两列布局 ─── */
.mb-tab-panel .formula-body {
    grid-template-columns: minmax(0, 1fr) 268px;
    align-items: start;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .mb-tab-panel .formula-body { grid-template-columns: 1fr; }
    .mb-right-panel { position: static; }
}

.mb-left-panel { min-width: 0; }

.mb-right-panel {
    background: #f8f9fc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.2rem 1.25rem;
    font-size: 0.84rem;
    position: sticky;
    top: 80px;
}

.mb-rp-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 0.55rem;
    margin-top: 1rem;
}
.mb-rp-title:first-child { margin-top: 0; }
.mb-rp-title i { color: #667eea; }

.mb-rp-formula {
    background: white;
    border: 1px solid #e8edf7;
    border-left: 3px solid #667eea;
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    font-size: 0.78rem;
    color: var(--text-primary);
    line-height: 2;
}

.mb-example-block {
    background: white;
    border: 1px solid #e8edf7;
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
}

.mb-ex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    font-size: 0.8rem;
}

.mb-ex-label { color: var(--text-muted); }

.mb-ex-divider {
    border-top: 1px dashed var(--border-color);
    margin: 5px 0;
}

.mb-ex-safe { color: #15803d; font-weight: 600; }
.mb-ex-warn { color: #b91c1c; font-weight: 600; }
.mb-ex-info { color: var(--primary-color); font-weight: 600; }

.mb-rp-tip {
    margin-top: 0.7rem;
    padding: 0.5rem 0.7rem;
    background: rgba(102, 126, 234, 0.07);
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.mb-example-details {
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.mb-example-summary {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0.55rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    list-style: none;
    background: #f8f9fc;
}
.mb-example-summary::-webkit-details-marker { display: none; }
.mb-example-summary i { color: #667eea; }
.mb-example-summary::after {
    content: '\ea4e';
    font-family: 'remixicon';
    margin-left: auto;
    font-size: 1rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.mb-example-details[open] .mb-example-summary::after {
    transform: rotate(180deg);
}

.mb-example-details .mb-example-block {
    border: none;
    border-radius: 0;
    border-top: 1px solid var(--border-color);
}
.mb-example-details .mb-rp-tip {
    margin-top: 0;
    border-radius: 0;
    border-top: 1px solid var(--border-color);
}

/* ── 毛保页操作按钮（立即计算/反推计算等）蓝紫渐变 ─── */
.mb-tab-panel .calc-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
}
.mb-tab-panel .calc-button:hover {
    background: linear-gradient(135deg, #5a6fd6, #6a3d96);
    transform: translateY(-1px);
}
