/* ==================== 历史页面 ==================== */
.history-date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.history-date-nav button {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text);
    min-height: var(--touch-target);
    min-width: var(--touch-target);
}

.history-date-nav .date-display {
    flex: 1;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}

.date-selector {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    outline: none;
    text-align: center;
    background: var(--bg);
    min-height: var(--touch-target);
}

/* ==================== 登录页面 ==================== */
.login-page {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
}

.login-container {
    width: 100%;
    max-width: 380px;
}

.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 28px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo svg {
    margin-bottom: 6px;
}

.login-logo h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 12px;
    color: var(--text-secondary);
}

.login-tabs {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 20px;
}

.login-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
    min-height: var(--touch-target);
}

.login-tab.active {
    background: #fff;
    color: var(--primary-dark);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    font-weight: 600;
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
    animation: fadeInForm 0.3s ease;
}

@keyframes fadeInForm {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 0;
}

.login-loading p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ==================== 字段级错误提示 ==================== */
.field-error {
    display: none;
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
    line-height: 1.4;
}

.field-error.show {
    display: block;
    animation: fadeInForm 0.3s ease;
}

/* ==================== iOS 风格日期栏 ==================== */
.date-btn-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 4px 0;
}

.date-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.2s;
    flex-shrink: 0;
}

.date-nav-btn:active {
    background: var(--bg);
    transform: scale(0.95);
}

.date-display-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f0f0f5;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
    transition: all 0.2s;
    min-height: 42px;
}

.date-display-btn:active {
    background: #e0e0e8;
    transform: scale(0.97);
}

.date-display-btn svg {
    flex-shrink: 0;
    opacity: 0.5;
}

/* ==================== 运动消耗面板 ==================== */
.exercise-panel {
    margin-top: 12px;
}

.exercise-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exercise-upload-area:hover, .exercise-upload-area.dragover {
    border-color: var(--warning);
    background: #fff8f0;
}

.exercise-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
}

.exercise-upload-placeholder svg {
    width: 32px;
    height: 32px;
}

.exercise-upload-placeholder p {
    font-size: 13px;
    font-weight: 500;
}

.exercise-upload-placeholder span {
    font-size: 11px;
    color: var(--text-muted);
}

.exercise-preview {
    max-width: 100%;
    max-height: 180px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    display: none;
}

/* ==================== 运动消耗进度条 ==================== */
.exercise-progress-section {
    margin: 12px 0 8px;
    padding: 12px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: var(--radius-sm);
    border: 1px solid #ffe0b2;
}

.exercise-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #e65100;
}

.exercise-progress-pct {
    font-size: 16px;
    font-weight: 700;
    color: #ff9800;
}

.exercise-progress-bar {
    height: 10px;
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 6px;
}

.exercise-progress-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #ff9800 0%, #ff5722 100%);
    transition: width 0.6s ease;
    min-width: 0;
}

.exercise-progress-label {
    font-size: 11px;
    color: #bf360c;
    text-align: center;
}

.exercise-result-card {
    margin-top: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #fff8f0 0%, #fff3e0 100%);
    border-radius: var(--radius);
    border: 1px solid #ffe0b2;
    animation: slideUp 0.3s ease;
}

.exercise-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.exercise-result-header h3 {
    font-size: 16px;
    color: var(--text);
}

.exercise-result-calories {
    text-align: center;
    padding: 8px;
    margin-bottom: 8px;
}

.exercise-result-calories span {
    font-size: 38px;
    font-weight: 700;
    color: #ff9800;
}

.exercise-result-calories small {
    font-size: 14px;
    color: var(--text-secondary);
}

.exercise-result-info {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.exercise-info-item {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.exercise-info-label {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.exercise-info-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.exercise-info-unit {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 1px;
}

/* 运动记录列表 */
.exercise-list-section {
    margin-top: 14px;
}

.exercise-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding: 6px 10px;
    background: #fff3e0;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: #e65100;
}

.exercise-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 10px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.exercise-item:last-child {
    border-bottom: none;
}

.exercise-item-info strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}

.exercise-item-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
}

.exercise-item-note {
    font-size: 10px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
    font-style: italic;
}

.exercise-del {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    font-size: 12px;
    flex-shrink: 0;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.exercise-del:hover {
    color: var(--danger);
    background: #fef0f0;
}

/* ==================== 摄入 vs 消耗对比 ==================== */
.calorie-compare {
    display: flex;
    gap: 8px;
    margin: 14px 0 10px;
}

.compare-item {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    border-radius: var(--radius-sm);
}

.compare-item.intake {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.compare-item.burned {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.compare-item.net {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.compare-val {
    display: block;
    font-size: 20px;
    font-weight: 700;
}

.compare-item.intake .compare-val { color: #2e7d32; }
.compare-item.burned .compare-val { color: #e65100; }
.compare-item.net .compare-val { color: #1565c0; }

.compare-label {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

