/* ============================================
   重量计算页 weight_calc.php 专属样式
   Tab切换 / 轮辋 / 轮辐
   ============================================ */

/* ===== Tab 切换 ===== */
.calc-tabs {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    width: 100%;
    min-height: 44px;
    position: relative;
    z-index: 1;
}
.calc-tab {
    display: inline-block !important;
    padding: 10px 28px;
    background: transparent;
    border: none;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    position: relative;
    font-family: inherit;
    transition: color .15s;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0;
}
.calc-tab:hover { color: var(--text); }
.calc-tab.active {
    color: var(--accent);
    font-weight: 600;
}
.calc-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 2px;
    background: var(--accent);
}

/* ===== 容器 ===== */
.calc-container {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
    align-items: start;
}
.lf-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 18px;
    align-items: start;
}

@media (max-width: 900px) {
    .calc-container { grid-template-columns: 1fr; }
    .lf-container { grid-template-columns: 1fr; }
}

/* ===== 卡片 ===== */
.calc-card, .lf-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 22px;
}

.calc-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* ===== 输入组 ===== */
.input-group { margin-bottom: 13px; }
.input-group label {
    display: block; font-size: 12.5px; font-weight: 500;
    color: var(--dark); margin-bottom: 5px;
}
.input-group input {
    width: 100%; height: 38px; padding: 0 12px;
    border: 1.5px solid var(--border); border-radius: 4px;
    font-size: 14px; color: var(--text); outline: none;
    font-family: inherit; transition: border-color .15s;
    -moz-appearance: textfield;
}
.input-group input::-webkit-outer-spin-button,
.input-group input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(185,28,42,.08); }
.input-group input::placeholder { color: #b0bac9; }

/* 双列 */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ===== 按钮组 ===== */
.calc-actions { display: flex; gap: 10px; margin-top: 18px; }
.calc-btn-primary {
    flex: 1; display: inline-flex; align-items: center; justify-content: center;
    height: 40px; background: var(--accent); color: #fff;
    border: none; border-radius: 4px; font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: background .15s;
}
.calc-btn-primary:hover { background: var(--accent-hover); }
.calc-btn-outline {
    height: 40px; padding: 0 20px; background: transparent;
    color: var(--muted); border: 1px solid var(--border);
    border-radius: 4px; font-size: 13.5px; cursor: pointer;
    font-family: inherit; transition: all .15s;
}
.calc-btn-outline:hover { border-color: var(--muted); color: var(--text); }

/* ===== 结果区（轮辋）===== */
.formula-display {
    background: #f5f6fa; border: 1px solid var(--border);
    border-radius: 4px; padding: 14px 16px; margin-bottom: 18px;
}
.formula-label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing:.8px; color:var(--muted); margin-bottom:6px; }
.formula-display code { font-size: 14px; color: var(--text); letter-spacing:.3px; }

.result-value { text-align:center; padding:26px 0 20px; border-bottom:1px dashed var(--border); }
.result-number { font-size:44px; font-weight:700; color:var(--accent); line-height:1; }
.result-unit { display:block; font-size:14px; color:var(--muted); margin-top:6px; }

.result-detail {
    margin-top:14px; padding:12px 14px; background:#fef2f2;
    border:1px solid #fecaca; border-radius:4px; font-size:13px;
    color:#991b1b; line-height:1.7; display:none;
}
.result-detail.show { display:block; }

/* ===== 历史记录 ===== */
.history-area { margin-top:18px; border:1px solid var(--border); border-radius:4px; overflow:hidden; }
.history-header {
    display:flex; align-items:center; justify-content:space-between;
    padding:9px 14px; background:#f5f6fa; border-bottom:1px solid var(--border);
}
.history-title { font-size:13px; font-weight:600; color:var(--dark); }
.history-title small { font-weight:400; color:var(--muted); margin-left:3px; }
.history-list { list-style:none; padding:0; margin:0; max-height:240px; overflow-y:auto; }
.history-item {
    display:flex; align-items:center; gap:8px; padding:8px 12px;
    border-bottom:1px solid #f1f5f9; font-size:12.5px;
    cursor:pointer; transition:background .12s;
}
.history-item:last-child{ border-bottom:none; }
.history-item:hover{ background:#fafbfe; }
.history-expr{ color:var(--muted); flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.history-val{ font-weight:700; color:var(--accent); min-width:64px; text-align:right; }
.history-empty{ text-align:center; color:#cbd5e1; padding:22px; font-size:13px; }

.btn-sm { padding:4px 10px; font-size:11.5px; cursor:pointer; font-family:inherit; }
.history-clear-btn {
    background:transparent; color:var(--muted); border:1px solid var(--border);
    border-radius:3px; transition:all .15s;
}
.history-clear-btn:hover{ border-color:var(--accent); color:var(--accent); }

/* ===== 轮辐分步结果 ===== */
.lf-step-results { margin-bottom:18px; }
.lf-step-row {
    display:flex; align-items:center; padding:7px 0;
    border-bottom:1px dashed #eee; font-size:13px;
}
.lf-step-row:last-child { border:none; }
.lf-step-label { flex:1; color:var(--muted); }
.lf-step-val { font-weight:600; color:var(--text); min-width:80px; text-align:right; }
.lf-step-unit { color:#94a3b8; font-size:11.5px; min-width:32px; }
.lf-step-total { background:#fffbeb; margin:6px -4px; padding:7px 4px; border-radius:3px; }
.lf-step-total .lf-step-val { color:#b45309; }
.lf-step-net { background:#f0fdf4; margin:6px -4px; padding:7px 4px; border-radius:3px; }
.lf-step-net .lf-step-val { color:#15803d; }

/* ===== 提示条 ===== */
.calc-tip {
    margin-top:16px; padding:12px 16px; background:#fffbeb;
    border-left:3px solid #d97706; font-size:12.5px; color:#92400e; line-height:1.7;
}

/* ===== 响应式 ===== */
@media (max-width: 700px) {
    .calc-card,.lf-card { padding:16px; }
    .result-number { font-size:34px; }
    .result-value { padding:18px 0 14px; }
    .row-2 { grid-template-columns:1fr; }
    .lf-form-card h4 { font-size:12.5px; }
    .calc-tabs { overflow-x:auto; }
}
