@charset "utf-8";

/* =========================
   通用样式重置
   ========================= */
.mcon.pb10 {
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-sizing: border-box;
}

/* ===== 表格基础样式 ===== */
.table1 {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
}

.table1 th,
.table1 td {
    padding: 12px 15px;
    border: none; /* 移除老式边框 */
    font-size: 14px;
    line-height: 1.6;
    vertical-align: middle;
}

/* 左侧标题列 */
.table1 th {
    width: 200px;
    text-align: right;
    color: #5e6d82;
    font-weight: 500;
}

/* 右侧内容列 */
.table1 td {
    text-align: left;
    color: #333;
}

/* ===== 输入框样式 ===== */
.inpt {
    width: 180px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    transition: all .2s;
    box-sizing: border-box;
    outline: none;
}

.inpt:focus {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22,119,255,.1);
}

/* 日期提示文字 */
#last-dates {
    font-style: normal;
    color: #909399;
    font-size: 12px;
    margin-left: 10px;
}

/* 结果展示标签 */
#znts, #znje {
    font-weight: 600;
    font-size: 18px;
    color: #ff4d4f; /* 结果红色高亮 */
    font-family: Arial, sans-serif;
}

/* ===== 按钮区域 ===== */
.btn1 {
    min-width: 110px;
    height: 38px;
    padding: 0 20px;
    margin: 10px 8px;
    border-radius: 20px; /* 椭圆按钮更现代 */
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .3s;
    border: 1px solid transparent;
    display: inline-block;
}

/* 计算按钮 */
#btnCalculat {
    background: #1677ff;
    color: #fff;
}

#btnCalculat:hover {
    background: #4096ff;
    box-shadow: 0 4px 10px rgba(22,119,255,0.2);
}

/* 重置按钮 */
#btnReset {
    background: #f5f7fa;
    border: 1px solid #dcdfe6;
    color: #606266;
}

#btnReset:hover {
    background: #e6f0ff;
    color: #1677ff;
}

/* =========================
   📱 移动端彻底修复
   ========================= */
@media screen and (max-width: 768px) {
    .mcon.pb10 {
        padding: 15px;
    }

    /* 将表格转为块状布局 */
    .table1, 
    .table1 tr, 
    .table1 th, 
    .table1 td {
        display: block;
        width: 100% !important;
        text-align: left !important;
        box-sizing: border-box;
    }

    .table1 th {
        padding-bottom: 5px;
        padding-top: 15px;
        color: #333;
    }

    .table1 td {
        padding-top: 5px;
        padding-bottom: 10px;
        border-bottom: 1px solid #f0f2f5; /* 手机端增加分隔线 */
    }

    /* 输入框全宽 */
    .inpt {
        width: 100% !important;
        height: 42px; /* 手机端高度增加方便点击 */
        font-size: 16px; /* 防止iOS输入时自动缩放 */
    }

    /* 按钮居中排列 */
    .table1 td[colspan="2"] {
        text-align: center !important;
        border-bottom: none;
        padding-top: 25px;
    }

    .btn1 {
        width: 45%; /* 两个按钮并排 */
        margin: 5px 2%;
        height: 44px;
    }

    /* 日期提示文字换行 */
    #last-dates {
        display: block;
        margin-left: 0;
        margin-top: 5px;
    }
}

/* 防止手机端点击日期输入框时弹出虚拟键盘 */
.inpt[readonly] {
    cursor: pointer;
    background-color: #fff !important; /* 保持白色背景 */
}

/* 结果高亮样式 */
#znts, #znje {
    color: #ff4d4f;
    font-size: 20px;
    font-weight: bold;
    margin-right: 4px;
}

@media screen and (max-width: 768px) {
    /* 1. 确保TD里的内容保持一行 */
    .table1 td {
        display: block !important;
        width: 100% !important;
        padding-top: 5px;
    }

    /* 2. 把输入框和单位包裹在一个 Flex 容器中 */
    /* 请确保 HTML 中把 input 和 "元" 用 <div class="input-wrapper"> 包裹 */
    .input-wrapper {
        display: flex;
        align-items: center;
        gap: 8px; /* 输入框和"元"之间的间距 */
    }

    .inpt {
        flex: 1; /* 让输入框自动填满剩余空间 */
        width: auto !important; /* 取消固定宽度 */
    }

    /* 3. 防止单位换行 */
    .unit-text {
        white-space: nowrap;
        flex-shrink: 0; /* 关键：不准压缩单位文字 */
    }
}

@media screen and (max-width: 768px) {
    /* 让按钮行成为一个居中容器 */
    .table1 td[colspan="2"] {
        display: flex !important;
        justify-content: center;
        gap: 10px; /* 按钮间距 */
        padding-top: 20px;
    }

    .btn1 {
        flex: 1; /* 平分空间 */
        min-width: 0 !important; /* 允许按钮变窄 */
        margin: 0 !important;    /* 清除左右间距，改用 gap */
        padding: 0 10px;
    }
}

/* ===== 紧凑模式覆盖 ===== */

/* 1. 缩小单元格上下间距 (原12px 15px -> 改为 8px 12px) */
.table1 th,
.table1 td {
    padding: 8px 12px !important; 
    line-height: 1.4 !important; /* 缩小行高 */
}

/* 2. 缩小输入框高度 (原36px -> 改为 32px) */
.inpt {
    height: 32px !important;
    font-size: 13px !important; /* 字体稍微缩小一点更精致 */
}

/* 3. 缩小移动端下的行间距 */
@media screen and (max-width: 768px) {
    .table1 th {
        padding-top: 10px !important; /* 手机端标题上方间距 */
        padding-bottom: 2px !important;
    }
    .table1 td {
        padding-top: 2px !important;
        padding-bottom: 8px !important;
    }
    
    /* 缩小按钮在手机上的高度 */
    .btn1 {
        height: 38px !important;
        margin-top: 15px !important;
    }
}

/* 4. 移除多余的空格感 */
.mcon.pb10 {
    padding: 12px !important; /* 减少外层大框的留白 */
}