/*
 文件名称：life-tools.css
 作者：wangkai（2026-11-26）
 创作时间：2026-11-26 14:10:00（北京时间）
 文件说明：生活工具公共样式（单位换算 / 日期计算器 / BMI 计算器 / 条形码生成），
          统一卡片、表单、标签页、结果区与移动端适配
*/

/* 页面容器 */
.lt-page {
    max-width: 1290px;
    margin: 24px auto 40px;
    padding: 0 12px;
}

/* 主面板 */
.lt-card {
    background: #ffffff;
    border: 1px solid #e5e9f2;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(31, 45, 61, 0.06);
    padding: 24px;
}

.lt-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 600;
    color: #1f2d3d;
}

.lt-sub {
    margin: 0 0 18px;
    font-size: 13px;
    color: #7a869a;
    line-height: 1.6;
}

/* 标签页 */
.lt-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.lt-tab {
    padding: 7px 16px;
    border: 1px solid #d5dbe8;
    border-radius: 999px;
    background: #ffffff;
    font-size: 13px;
    color: #3f4a5a;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.lt-tab:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.lt-tab.is-active {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

/* 表单 */
.lt-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.lt-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lt-field > label {
    font-size: 13px;
    color: #5a6678;
}

.lt-input,
.lt-select {
    width: 100%;
    height: 38px;
    padding: 4px 10px;
    border: 1px solid #d5dbe8;
    border-radius: 6px;
    background: #ffffff;
    font-size: 14px;
    color: #1f2d3d;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lt-input:focus,
.lt-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.lt-input--num {
    max-width: 220px;
}

.lt-check {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 24px;
    font-size: 13px;
    color: #3f4a5a;
    cursor: pointer;
    user-select: none;
}

.lt-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #2563eb;
    cursor: pointer;
}

/* 按钮 */
.lt-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.lt-btn {
    padding: 9px 18px;
    border: 1px solid #d5dbe8;
    border-radius: 6px;
    background: #ffffff;
    font-size: 14px;
    color: #1f2d3d;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.lt-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.lt-btn--primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.lt-btn--primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}

.lt-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.lt-tip {
    font-size: 13px;
    color: #7a869a;
    line-height: 1.6;
}

.lt-tip.is-ok {
    color: #16a34a;
}

.lt-tip.is-error {
    color: #dc2626;
}

/* 结果区 */
.lt-result {
    padding: 18px 20px;
    border: 1px solid #e5e9f2;
    border-radius: 10px;
    background: #f7f9fc;
    margin-bottom: 16px;
}

.lt-result__label {
    font-size: 13px;
    color: #7a869a;
    margin-bottom: 6px;
}

.lt-result__value {
    font-size: 30px;
    font-weight: 600;
    color: #1f2d3d;
    word-break: break-all;
    line-height: 1.3;
}

.lt-result__unit {
    margin-left: 6px;
    font-size: 15px;
    font-weight: 400;
    color: #5a6678;
}

.lt-result__desc {
    margin-top: 10px;
    font-size: 13px;
    color: #5a6678;
    line-height: 1.7;
}

/* 清单 / 表格 */
.lt-list {
    border: 1px solid #e5e9f2;
    border-radius: 10px;
    overflow: hidden;
}

.lt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    font-size: 14px;
    color: #1f2d3d;
    border-bottom: 1px solid #eef1f7;
}

.lt-row:last-child {
    border-bottom: 0;
}

.lt-row:nth-child(odd) {
    background: #fbfcfe;
}

.lt-row__name {
    color: #5a6678;
    font-size: 13px;
    flex: 0 0 auto;
}

.lt-row__value {
    font-variant-numeric: tabular-nums;
    text-align: right;
    word-break: break-all;
}

/* 徽标（BMI 分级等） */
.lt-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.7;
    background: #eef2f9;
    color: #3f4a5a;
}

.lt-badge.is-thin {
    background: #e0f2fe;
    color: #0369a1;
}

.lt-badge.is-normal {
    background: #dcfce7;
    color: #15803d;
}

.lt-badge.is-over {
    background: #fef3c7;
    color: #b45309;
}

.lt-badge.is-fat {
    background: #fee2e2;
    color: #b91c1c;
}

/* 条形码预览 */
.lt-barcode-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 18px;
    border: 1px solid #e5e9f2;
    border-radius: 10px;
    background: #ffffff;
    overflow-x: auto;
}

.lt-barcode-box svg,
.lt-barcode-box canvas {
    max-width: 100%;
    height: auto;
}

/* 移动端适配 */
@media (max-width: 900px) {
    .lt-card {
        padding: 16px;
    }

    .lt-result__value {
        font-size: 24px;
    }
}
