/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000000;
    color: #ffffff;
    font-family: 'Oxanium', -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.4;
    min-height: 100vh;
}

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

/* 头部 */
header {
    text-align: left;
    margin-bottom: 30px;
    border-bottom: 1px solid #333333;
    padding-bottom: 20px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

/* 主体布局 */
main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 图表区域 */
.chart-section {
    background-color: #111111;
    border: 1px solid #333333;
    border-radius: 16px;
    padding: 20px;
}

.chart-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #ffffff;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 500px;
    width: 100%;
    /* iOS Safari优化 */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    overflow: hidden;
}

.chart-container canvas {
    /* 移动端触摸优化 */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    max-width: 100%;
    height: auto !important;
    /* iOS Safari canvas优化 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* 数据输入区域 */
.data-entry-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.weight-record-section,
.calorie-record-section {
    background-color: #111111;
    border: 1px solid #333333;
    border-radius: 16px;
    padding: 20px;
}

.weight-record-section h2,
.calorie-record-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #ffffff;
    text-align: center;
}

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

.record-form .input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.record-form .input-group label {
    font-size: 0.9rem;
    color: #8b8b8b;
    font-weight: 500;
}

.record-form .input-group input {
    padding: 12px;
    background-color: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
}

.record-form .input-group input:focus {
    outline: none;
    border-color: #1d9bf0;
    background-color: #222222;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.save-btn, .sync-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.save-btn {
    background-color: #2c2c2c;
    color: #ffffff;
}

.save-btn:hover {
    background-color: #404040;
    transform: translateY(-1px);
}

.sync-btn {
    background-color: #1d9bf0;
    color: #ffffff;
}

.sync-btn:hover {
    background-color: #1a8cd8;
    transform: translateY(-1px);
}

.save-btn:active, .sync-btn:active {
    transform: translateY(0);
}

/* 底部版权信息 */
footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #333333;
    text-align: center;
}

footer p {
    font-size: 0.85rem;
    color: #8b8b8b;
    margin: 0;
}

footer a {
    color: #1d9bf0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #1a8cd8;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chart-container {
        height: 350px;
    }

    .data-entry-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .container {
        padding: 15px;
    }

    main {
        gap: 20px;
    }
}