@charset "utf-8";

/* =========================
   糖尿病计算器 - 保留原HTML结构的样式优化
   ========================= */

/* 主容器 */
.mcon.pb10 {
    padding: 20px 10px 20px 20px;
}

/* 表格统一样式 */
.table1 {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border-collapse: collapse;
}

/* 表格行 */
.table1 tr {
    margin-bottom: 15px;
}

/* 表头单元格 - 左侧标签 */
.table1 th {
    width: 100px;
    text-align: right;
    padding: 8px 12px 8px 0;
    font-size: 14px;
    color: #555;
    font-weight: normal;
    vertical-align: middle;
}

/* 数据单元格 - 右侧输入区 */
.table1 td {
    padding: 8px 0;
    vertical-align: middle;
}

/* 输入框统一样式 */
.table1 .inpt {
    width: 180px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.table1 .inpt:focus {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

/* 只读结果框 */
.table1 .inpt[readonly] {
    background: #f5f7fa;
    color: #ff4d4f;
    font-weight: bold;
}

/* select 下拉框 */
.table1 .Input {
    width: 180px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    vertical-align: middle;
}

.table1 .Input:focus {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

/* 按钮组所在单元格 */
.table1 tr:has(.btn-input) td {
    text-align: center;
    padding: 15px 0 15px 0;
}

/* 按钮样式 */
.table1 .btn1 {
    min-width: 110px;
    height: 38px;
    padding: 0 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    margin: 0 6px;
}

/* 计算按钮 */
.table1 .btn1:first-child {
    background: #1677ff;
    color: #fff;
}

.table1 .btn1:first-child:hover {
    background: #4096ff;
}

/* 清除按钮 */
.table1 .btn1.calc {
    background: #fff;
    border: 1px solid #dcdfe6;
    color: #666;
}

.table1 .btn1.calc:hover {
    border-color: #1677ff;
    color: #1677ff;
}

/* 计算结果标题行 */
.table1 .smallTitle {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: center;
    padding: 15px 0 8px 0;
    background: transparent;
}

/* 单位文字（输入框后面的文字） */
.table1 td span {
    font-size: 14px;
    color: #666;
    margin-left: 8px;
    white-space: nowrap;
}

/* =========================
   移动端适配 - 优化版
   ========================= */
@media screen and (max-width: 768px) {
    .mcon.pb10 {
        padding: 0 12px;
    }

    /* 保持表格特性，只优化宽度 */
    .table1 {
        width: 100%;
        max-width: 100%;
    }

    .nry_bt h1{font-size:42px;}

    /* 让每一行独立显示，但不破坏结构 */
    .table1 tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 20px;
    }

    /* 标签独立一行，左对齐 */
    .table1 th {
        width: auto;
        text-align: left;
        padding: 0 0 8px 0;
        font-weight: 500;
        font-size: 14px;
        color: #333;
    }

    /* 输入框区域 - 保持一行显示 */
    .table1 td {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0;
        width: 100%;
    }

    /* 输入框自动填满剩余空间 */
    .table1 .inpt,
    .table1 .Input {
        flex: 1;
        width: auto;
        min-width: 0;
        height: 36px;
        font-size: 16px;
    }

    /* 单位文字不换行，紧跟在输入框后面 */
    .table1 td span {
        margin-left: 0;
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 12px;
    }

    /* 按钮区域 */
    .table1 tr:has(.btn-input) td {
        justify-content: center;
        gap: 15px;
    }

    .table1 .btn1 {
        flex: 1;
        margin: 0;
        height: 38px;
        font-size: 14px;
    }

    /* 计算结果标题 */
    .table1 .smallTitle {
        text-align: left;
        padding: 10px 0 8px 0;
        font-size: 14px;
    }

    /* 最后一行结果区域 */
    .table1 tr:last-child td {
        display: flex;
        align-items: center;
        gap: 10px;
    }
}