* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
body {
    background: url('https://images.unsplash.com/photo-1513002749550-c59d786b8e6c?q=80&w=1920&auto=format&fit=crop') no-repeat center center fixed; 
    background-size: cover;
    padding: 0;
    margin: 0;
}
/* ========================================== */
/* 顶部 Header：PC、移动端全部横向排列 */
/* ========================================== */
.site-header {
    background-color: #ffffff; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 10px 20px;
    margin-bottom: 20px;
}
.header-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center; 
    justify-content: flex-start; 
    flex-wrap: nowrap;
    overflow: hidden;
}
.logo-icon {
    height: 32px;
    width: auto;
    margin-right: 10px;
    object-fit: contain;
    flex-shrink: 0;
}
.site-title {
    font-size: 22px;
    color: #2a3b4c; 
    font-weight: 900; 
    letter-spacing: 1px;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
    display: inline-block;
}
/* ========================================== */
/* 页面主体通用样式 */
/* ========================================== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
}
.top-desc {
    margin: 0 auto 20px auto;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    text-align: justify;
}
.main-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}
.form-panel {
    background: #fff;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    flex: 1;
}
.form-panel h2 {
    font-size: 18px;
    font-weight: normal;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}
.form-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    font-size: 14px;
}
.form-group label {
    width: 100px;
    color: #333;
}
.form-group input[type="number"] {
    flex: 1;
    max-width: 250px;
    padding: 8px 10px;
    border: 1px solid #bce1f8;
    background-color: #f4fbff;
    border-radius: 3px;
    outline: none;
}
.form-group select {
    flex: 1;
    max-width: 250px;
    padding: 8px 10px;
    border: 1px solid #bce1f8;
    background-color: #f4fbff;
    border-radius: 3px;
    outline: none;
}
.radio-options {
    display: flex;
    align-items: center;
}
.radio-label {
    width: auto !important;
    margin-right: 20px;
    cursor: pointer;
}
.unit {
    color: #333;
}
.checkbox-group {
    justify-content: flex-start;
    margin-top: 20px;
    margin-bottom: 20px;
}
.checkbox-group label {
    width: auto;
    margin-left: 5px;
    cursor: pointer;
}
.result-box {
    text-align: center;
    margin: 20px 0;
    font-size: 15px;
}
.submit-group {
    justify-content: center;
}
.btn-calc {
    background-color: #3aa0f7;
    color: #fff;
    border: none;
    padding: 12px 40px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
}
.btn-calc:hover {
    background-color: #288ee3;
}
.table-panel {
    width: 380px;
    background: #fff;
    padding: 20px 20px 20px 50px; 
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    position: relative;
}
.table-panel p {
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: bold;
    color: #333;
}
.bmi-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 14px;
}
.bmi-table th, .bmi-table td {
    padding: 12px 10px;
}
.bmi-table th {
    background-color: #8bd1ff;
    color: #333;
}
.bmi-table .thin { background-color: #dcdcdc; }
.bmi-table .normal { background-color: #5cb85c; color: #fff; }
.bmi-table .overweight { background-color: #ffff00; }
.bmi-table .obese { background-color: #f59f00; color: #fff; }
.bmi-table tr {
    position: relative;
}
.bmi-table tr.active-row::before {
    content: "";
    position: absolute;
    left: -32px; 
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 14px;
    background-color: #64b52c; 
    border-radius: 2px;
    box-shadow: -2px 2px 4px rgba(0,0,0,0.2); 
    z-index: 10;
}
.bmi-table tr.active-row::after {
    content: "";
    position: absolute;
    left: -13px; 
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 14px solid #64b52c; 
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.2)); 
    z-index: 10;
}
.history-container {
    margin: 30px auto 0;
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.history-container h3 {
    font-size: 15px;
    font-weight: normal;
    margin-bottom: 15px;
    color: #333;
}
.table-responsive {
    overflow-x: auto; 
}
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: center;
    min-width: 500px; 
}
.history-table th, .history-table td {
    border: 1px solid #eaeaea;
    padding: 10px;
}
.history-table th {
    background-color: #f8f9fa;
    color: #666;
    font-weight: normal;
}
.delete-link {
    color: #e74c3c;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s;
}
.delete-link:hover {
    background-color: #ffeaea;
    text-decoration: underline;
}
.footer-links {
    max-width: 1000px;
    margin: 30px auto 20px auto;
    text-align: center;
    font-size: 14px;
    color: #666;
    padding: 15px 0;
    border-top: 1px solid #eaeaea;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.footer-links {
    max-width: 1000px;
    margin: 30px auto 20px auto;
    text-align: center;
    font-size: 14px;
    color: #666;
    padding: 15px 0;
    border-top: 1px solid #eaeaea;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.footer-links a {
    color: #ff0000; /* 友情链接文字改为红色 */
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: #cc0000; /* 悬停深红色 */
    text-decoration: underline;
}
.footer-links .divider {
    margin: 0 10px;
    color: #ccc;
}

/* ========================================== */
/* 移动端适配 max-width:768px */
/* ========================================== */
@media screen and (max-width: 768px) {
    .site-header {
        padding: 8px 10px;
    }
    /* 移动端保持LOGO+标题横向一排，禁止上下列 */
    .header-content {
        flex-direction: row !important;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow: hidden;
    }
    .logo-icon {
        height: 24px;
        margin-right: 8px;
    }
    .site-title {
        font-size: 16px;
        letter-spacing: 0px;
        white-space: nowrap;
    }

    .container {
        padding: 0 10px 20px 10px;
    }
    /* 移动端：表单在上，对照表在计算器下方 */
    .main-container {
        flex-direction: column; 
        gap: 15px;
    }
    
    .form-panel {
        width: 100%;
        padding: 20px 15px;
    }
    .form-panel h2 {
        margin-bottom: 15px;
    }
    .form-group.input-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-group.input-group label {
        width: 100%;
        margin-bottom: 8px;
    }
    .form-group input[type="number"],
    .form-group select {
        width: 100%;
        max-width: 100%;
        padding: 10px;
    }
    .form-group.radio-group {
        flex-direction: row;
        align-items: center;
    }
    
    .form-group.radio-group label {
        width: auto;
        margin-right: 15px;
        margin-bottom: 0;
    }
    .checkbox-group {
        justify-content: flex-start;
        margin-top: 15px;
    }
    .btn-calc {
        width: 100%; 
        padding: 12px;
    }
    /* 移动端对照表宽度100% */
    .table-panel {
        width: 100%;
        padding: 20px;
    }
    /* 移动端隐藏对照表左侧箭头标记 */
    .bmi-table tr.active-row::before,
    .bmi-table tr.active-row::after {
        display: none; 
    }
    .history-container {
        padding: 15px 10px;
        margin-top: 20px;
    }
    .footer-links {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 30px;
    }
    .footer-links .divider {
        display: none;
    }
}
