* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1d1d1f;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.98);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

header h1 {
    color: #1d1d1f;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

header p {
    color: #86868b;
    font-size: 1.1em;
    font-weight: 400;
}

/* 数据存储提示 */
.data-storage-notice {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid rgba(103, 126, 234, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(103, 126, 234, 0.1);
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.notice-icon {
    font-size: 1.5em;
    flex-shrink: 0;
    margin-top: 2px;
}

.notice-content {
    flex: 1;
}

.notice-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.notice-text {
    font-size: 0.95em;
    color: #4a5568;
    line-height: 1.5;
    font-weight: 400;
}

.notice-text strong {
    color: #667eea;
    font-weight: 600;
}

.notice-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5em;
    color: #86868b;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.notice-close:hover {
    background: rgba(134, 134, 139, 0.1);
    color: #1d1d1f;
}

.data-storage-notice.hidden {
    display: none;
}

.child-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.child-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: rgba(255, 255, 255, 0.25);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.child-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.35);
}

.child-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* 儿童信息概要显示 */
.child-info-summary {
    background: rgba(255, 255, 255, 0.98);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.info-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.no-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #86868b;
    font-size: 1em;
}

.info-icon {
    font-size: 1.2em;
}

.info-text {
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.data-operation-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(134, 134, 139, 0.15);
}

.data-input-btn,
.setup-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.data-input-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.data-input-btn:hover,
.setup-btn:hover {
    transform: translateY(-2px);
}

.data-input-btn:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.setup-btn:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    animation: modalSlideIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.history-modal-content {
    max-width: 800px;
    width: 95%;
    max-height: 80vh;
    overflow-y: auto;
}

/* 自定义滚动条样式 */
.history-modal-content::-webkit-scrollbar {
    width: 8px;
}

.history-modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.history-modal-content::-webkit-scrollbar-thumb {
    background: #c7c7cc;
    border-radius: 4px;
}

.history-modal-content::-webkit-scrollbar-thumb:hover {
    background: #aeaeb2;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 20px;
    border-bottom: 1px solid rgba(134, 134, 139, 0.1);
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.clear-all-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #8e8e93 0%, #aeaeb2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 3px 10px rgba(142, 142, 147, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
}

.clear-all-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8a80 100%);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.modal-header h3 {
    color: #1d1d1f;
    font-size: 1.3em;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8em;
    color: #86868b;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.modal-close:hover {
    background: rgba(134, 134, 139, 0.1);
    color: #1d1d1f;
}

.modal-body {
    padding: 20px 30px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px 30px;
    border-top: 1px solid rgba(134, 134, 139, 0.1);
}

.cancel-btn {
    padding: 12px 24px;
    background: rgba(134, 134, 139, 0.1);
    color: #1d1d1f;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
}

.cancel-btn:hover {
    background: rgba(134, 134, 139, 0.15);
}

.info-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d1d1f;
    font-size: 0.95em;
    letter-spacing: -0.01em;
}

.form-group input {
    padding: 12px 16px;
    border: 1.5px solid #d2d2d7;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #1d1d1f;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.form-group input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.save-btn {
    padding: 12px 24px;
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    height: fit-content;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
}

.save-btn:hover {
    background: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.info-display {
    flex: 1;
    font-size: 0.95em;
    color: #1d1d1f;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.info-display.has-info {
    padding: 15px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

/* 年龄显示 */
.age-display {
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid #6366f1;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.age-info {
    font-size: 1.1em;
    color: #1d1d1f;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.age-calculated {
    color: #6366f1;
    font-weight: 600;
}

/* 图表容器 - 简洁版 */
.charts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.chart-section {
    background: rgba(255, 255, 255, 0.98);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.chart-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

.chart-section h3 {
    color: #1d1d1f;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.01em;
}

.chart-container {
    width: 100%;
    height: 600px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(210, 210, 215, 0.3);
    position: relative;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chart-reset-btn {
    background: rgba(99, 102, 241, 0.9);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.chart-reset-btn:hover {
    background: rgba(99, 102, 241, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.chart-print-btn {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    white-space: nowrap;
}

.chart-print-btn:hover {
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border-color: rgba(102, 126, 234, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 图表说明 - 简洁版 */
.chart-legend {
    margin-top: 15px;
    padding: 15px;
    background: rgba(242, 242, 247, 0.6);
    border-radius: 12px;
}

.chart-legend h4 {
    color: #1d1d1f;
    margin-bottom: 8px;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.chart-legend p {
    color: #86868b;
    font-size: 0.9em;
    margin: 4px 0;
    font-weight: 400;
}

.history-section {
    background: rgba(255, 255, 255, 0.98);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.history-header h3 {
    color: #1d1d1f;
    font-size: 1.4em;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.export-buttons {
    display: flex;
    gap: 10px;
}

.export-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* 次要按钮样式 - 简洁的边框样式 */
#exportExcel {
    background: rgba(255, 255, 255, 0.8);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#exportExcel:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#importData {
    background: rgba(255, 255, 255, 0.8);
    color: #764ba2;
    border: 1px solid rgba(118, 75, 162, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#importData:hover {
    background: rgba(118, 75, 162, 0.1);
    border-color: rgba(118, 75, 162, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#openHistoryModal {
    background: rgba(255, 255, 255, 0.8);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#openHistoryModal:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.table-container {
    overflow-x: auto;
}

#historyTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

#historyTable th,
#historyTable td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f2f2f7;
    font-size: 0.95em;
}

#historyTable th {
    background: #f2f2f7;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.01em;
}

#historyTable tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.delete-btn {
    background: #ff3b30;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    white-space: nowrap;
}

.delete-btn:hover {
    background: #d70015;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.data-info {
    background: rgba(255, 255, 255, 0.98);
    padding: 25px;
    border-radius: 16px;
    margin-top: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.data-info h3 {
    color: #1d1d1f;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.data-info p {
    color: #424245;
    line-height: 1.6;
    margin-bottom: 12px;
    font-size: 0.95em;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

.data-info p strong {
    color: #1d1d1f;
    font-weight: 600;
}

/* 响应式设计 */

/* iPad适配 */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 25px;
        max-width: 95%;
    }

    .charts-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .chart-container {
        height: 400px;
    }

    .form-row {
        gap: 15px;
    }

    .form-group {
        min-width: 180px;
    }

    #historyTable {
        font-size: 0.95em;
    }
}

/* 手机端适配 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        margin: 0;
        max-width: 100%;
    }

    header {
        padding: 20px 15px;
        margin-bottom: 20px;
        border-radius: 15px;
    }

    header h1 {
        font-size: 1.8em;
        margin-bottom: 5px;
    }

    .data-storage-notice {
        padding: 16px;
        gap: 12px;
        margin-bottom: 20px;
        border-radius: 12px;
    }

    .notice-title {
        font-size: 1em;
    }

    .notice-text {
        font-size: 0.9em;
    }

    .notice-close {
        top: 12px;
        right: 12px;
        width: 28px;
        height: 28px;
        font-size: 1.3em;
    }

    .child-selector {
        flex-direction: row;
        gap: 10px;
        margin-bottom: 20px;
        padding: 0 5px;
    }

    .child-btn {
        flex: 1;
        padding: 12px 20px;
        font-size: 1.1em;
        border-radius: 20px;
    }

    .child-info-summary {
        padding: 20px 15px;
        margin-bottom: 20px;
        border-radius: 12px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .info-content {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .action-buttons {
        justify-content: center;
    }
    
    .data-operation-buttons {
        justify-content: center;
    }

    .data-input-btn,
    .setup-btn {
        flex: 1;
        min-width: 140px;
    }

    .info-form {
        flex-direction: column;
        gap: 15px;
    }

    .form-group {
        min-width: auto;
        width: 100%;
    }

    .form-group input {
        padding: 14px 16px;
        font-size: 16px; /* 防止iOS缩放 */
        border-radius: 8px;
    }

    .save-btn {
        padding: 14px 24px;
        width: 100%;
        font-size: 1em;
    }

    .age-display {
        padding: 12px 15px;
        border-radius: 8px;
        font-size: 0.95em;
        text-align: center;
    }

    .charts-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .chart-section {
        margin-bottom: 0;
        padding: 15px;
        border-radius: 12px;
    }

    .chart-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 15px;
    }

    .chart-section h3 {
        font-size: 1.1em;
        text-align: center;
        margin: 0;
    }

    .chart-reset-btn {
        padding: 8px 16px;
        font-size: 0.9em;
        align-self: center;
        min-width: 120px;
    }
    
    .chart-print-btn {
        padding: 8px 16px;
        font-size: 0.9em;
        align-self: center;
        min-width: 80px;
    }
    
    .chart-buttons {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .chart-container {
        height: 280px;
        border-radius: 8px;
    }

    .chart-legend {
        padding: 12px;
        border-radius: 8px;
        margin-top: 10px;
    }

    .chart-legend h4 {
        font-size: 1em;
        margin-bottom: 8px;
    }

    .chart-legend p {
        font-size: 0.85em;
        line-height: 1.4;
        margin-bottom: 6px;
    }

    .history-section {
        padding: 15px;
        border-radius: 12px;
    }

    .history-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        margin-bottom: 15px;
    }

    .history-header h3 {
        font-size: 1.2em;
        text-align: center;
        margin: 0;
    }

    .export-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .export-btn {
        padding: 12px 16px;
        font-size: 0.9em;
        min-width: auto;
        border-radius: 20px;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        margin: 0 -5px;
    }

    #historyTable {
        font-size: 0.8em;
        min-width: 600px;
    }

    #historyTable th,
    #historyTable td {
        padding: 8px 6px;
        white-space: nowrap;
    }

    #historyTable th {
        font-size: 0.85em;
        position: sticky;
        top: 0;
        background: #f8f9fa;
        z-index: 10;
    }

    .delete-btn {
        padding: 4px 8px;
        font-size: 0.8em;
        border-radius: 4px;
    }

    .data-info {
        padding: 15px;
        border-radius: 12px;
    }

    .data-info h3 {
        font-size: 1.1em;
        margin-bottom: 12px;
    }

    .data-info p {
        font-size: 0.85em;
        line-height: 1.5;
        margin-bottom: 8px;
    }
}

/* 小屏手机适配 */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    header {
        padding: 15px 12px;
    }

    header h1 {
        font-size: 1.6em;
    }

    .child-btn {
        padding: 10px 15px;
        font-size: 1em;
    }

    .child-info-summary,
    .chart-section,
    .history-section,
    .data-info {
        padding: 15px 12px;
    }

    .modal-content {
        width: 98%;
        margin: 5% auto;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }

    .chart-container {
        height: 250px;
    }

    .export-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .export-btn {
        width: 100%;
    }

    #historyTable {
        font-size: 0.75em;
        min-width: 550px;
    }

    #historyTable th,
    #historyTable td {
        padding: 6px 4px;
    }
}

/* 横屏适配 */
@media (max-height: 600px) and (orientation: landscape) {
    .container {
        padding: 10px;
    }

    header {
        padding: 15px;
        margin-bottom: 15px;
    }

    header h1 {
        font-size: 1.5em;
        margin-bottom: 5px;
    }

    .child-info-summary {
        padding: 15px;
        margin-bottom: 15px;
    }

    .chart-container {
        height: 200px;
    }

    .chart-legend {
        display: none; /* 横屏时隐藏图例以节省空间 */
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .child-btn,
    .save-btn,
    #dataForm button[type="submit"],
    .chart-reset-btn,
    .export-btn,
    .delete-btn {
        min-height: 44px; /* iOS推荐的最小触摸目标 */
    }

    .form-group input {
        min-height: 44px;
    }

    /* 移除hover效果，避免在触摸设备上的粘滞 */
    .child-btn:hover,
    .save-btn:hover,
    #dataForm button[type="submit"]:hover,
    .chart-reset-btn:hover,
    .chart-print-btn:hover,
    .export-btn:hover,
    .delete-btn:hover {
        transform: none;
    }
}

/* 图表头部 */
 