h1, h2, h3 {
    color: #e74c3c;
    margin-bottom: 15px;
}

h1 {
    text-align: center;
    font-size: 28px;
}

.container {
    margin: 1.2rem 0.18rem;
    background-color: white;
    border-radius: 10px;
    padding: 0.2rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.intro {
    margin-bottom: 25px;
    font-size: 15px;
    color: #666;
    text-align: justify;
    line-height: 1.8;
}

.calculator {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 35px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-weight: bold;
    color: #555;
    font-size: 16px;
}

input, select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

button {
    background-color: #e74c3c;
    color: white !important;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

button:hover {
    background-color: #c0392b;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.result {
    margin: 25px 0;
    padding: 18px;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.boy {
    background-color: #d4e6ff;
    color: #2980b9;
    border: 2px solid #2980b9;
}

.girl {
    background-color: #ffd4e5;
    color: #e84393;
    border: 2px solid #e84393;
}

/* 移动端月份卡片布局优化 */
.month-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.month-item {
    padding: 15px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid;
    transition: all 0.3s;
}

.month-item.boy {
    background-color: #d4e6ff;
    color: #2980b9;
    border-color: #2980b9;
}

.month-item.girl {
    background-color: #ffd4e5;
    color: #e84393;
    border-color: #e84393;
}

.month-name {
    font-size: 0.32rem;
    margin-bottom: 5px;
    color: #666;
}

.month-gender {
    font-size: 0.52rem;
    font-weight: bold;
}

.current-month {
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
    transform: scale(1.05);
}

@keyframes pulse {
    0% { box-shadow: 0 0 10px rgba(46, 204, 113, 0.5); }
    50% { box-shadow: 0 0 20px rgba(46, 204, 113, 0.8); }
    100% { box-shadow: 0 0 10px rgba(46, 204, 113, 0.5); }
}

/* 移动端年龄标题 */
.mobile-age-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #e74c3c;
    margin: 25px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #e74c3c;
}

/* 移动端统计表标题 */
.mobile-stats-title {
    text-align: center;
    font-size: 20px;
    color: #555;
    margin: 20px 0;
    font-weight: bold;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

th, td {
    border: 1px solid #ddd;
    padding: 0.1rem;
    text-align: center;
    font-size: 0.16rem;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 高亮样式 */
.highlight-row {
    border: 3px solid #e74c3c !important;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.3);
}

.highlight-cell {
    background-color: #2ecc71 !important;
    color: white !important;
    font-weight: bold;
    border: none !important;
}

/* 响应式设计 */
@media (max-width: 767px) {
    table {
        display: none;
    }

    .mobile-stats {
        display: block;
    }
}

@media (min-width: 768px) {
    .mobile-stats {
        display: none;
    }

    .calculator {
        flex-direction: row;
        justify-content: center;
        align-items: flex-end;
    }

    .input-group {
        width: 220px;
    }

    button {
        width: 140px;
    }

}

/* 小屏幕设备调整为3列布局 */
@media (max-width: 480px) {
    .month-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    .chart-header{
        display: none;
    }
}

/* 图例样式 */
.legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 25px 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
}

.legend-color {
    width: 25px;
    height: 25px;
    border-radius: 3px;
}

.boy-color {
    background-color: #d4e6ff;
    border: 2px solid #2980b9;
}

.girl-color {
    background-color: #ffd4e5;
    border: 2px solid #e84393;
}

/* 说明内容样式 */
.explanation {
    margin-top: 35px;
    padding: 25px;
    background-color: #f9f9f9;
    border-radius: 10px;
}

.explanation h3 {
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    font-size: 20px;
}

.explanation p {
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 1.7;
}

/* 小技巧样式 */
.tips-section {
    margin-top: 30px;
    padding: 10px 6px;
    background-color: #f0f8ff;
    border-radius: 6px;
    border-left: 5px solid #2980b9;
}

.tips-section h3 {
    color: #2980b9;
    margin-bottom: 18px;
    font-size: 20px;
}

.tips-list li {
    margin-bottom: 10px;
    line-height: 1.7;
}
.chart-header{
    text-align: center;
}

.tips-list li {
    font-size: 18px;
}
