/**
 * iPhone 健康应用样式
 * 完全参考iOS原生设计 - 白色主题
 */

.iphone-health-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.36, 0.66, 0.04, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.iphone-health-page.show {
    transform: translateX(0);
}

/* 头部 */
.health-header {
    position: relative;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: #ffffff;
    border-bottom: 0.33px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.health-back-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #000000;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
}

.health-back-btn:active {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(0.95);
}

.health-back-btn i {
    font-size: 18px;
}

.health-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 17px;
    font-weight: 600;
    color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    letter-spacing: -0.4px;
}

.health-generate-btn {
    background: none;
    border: none;
    color: #007AFF;
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s ease;
}

.health-generate-btn:active {
    opacity: 0.4;
}

.health-generate-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.health-generate-btn.generating {
    opacity: 0.6;
    pointer-events: none;
}

/* 内容区域 */
.health-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #f2f2f7;
    -webkit-overflow-scrolling: touch;
}

/* 空状态 */
.health-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
    text-align: center;
    color: #8e8e93;
}

.health-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.health-empty-text {
    font-size: 17px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    letter-spacing: -0.4px;
    margin-bottom: 8px;
    color: #000000;
}

.health-empty-hint {
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    letter-spacing: -0.4px;
    opacity: 0.7;
    line-height: 1.4;
}

/* 加载状态 */
.health-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
}

.health-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 122, 255, 0.2);
    border-top-color: #007aff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.health-loading-text {
    margin-top: 16px;
    font-size: 15px;
    color: #8e8e93;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    letter-spacing: -0.4px;
}

/* 健康数据 */
.health-data {
    padding: 8px 16px;
}

/* 主要指标卡片 */
.health-main-card {
    background: linear-gradient(135deg, #ff3b30 0%, #ff453a 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.15);
}

.health-main-title {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    letter-spacing: -0.4px;
    margin-bottom: 8px;
}

.health-main-value {
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    letter-spacing: -0.6px;
    margin-bottom: 4px;
}

.health-main-unit {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.8);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

.health-main-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    letter-spacing: -0.4px;
    margin-top: 8px;
}

/* 指标网格 */
.health-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.health-metric-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.health-metric-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.health-metric-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.health-metric-icon.heart {
    background: linear-gradient(135deg, #ff2d55 0%, #ff375f 100%);
}

.health-metric-icon.sleep {
    background: linear-gradient(135deg, #5e5ce6 0%, #7c7aff 100%);
}

.health-metric-icon.exercise {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
}

.health-metric-icon.mind {
    background: linear-gradient(135deg, #0a84ff 0%, #5ac8fa 100%);
}

.health-metric-title {
    font-size: 15px;
    color: #000000;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    letter-spacing: -0.4px;
}

.health-metric-value {
    font-size: 28px;
    font-weight: 700;
    color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    letter-spacing: -0.6px;
    margin-bottom: 4px;
}

.health-metric-subtitle {
    font-size: 13px;
    color: #8e8e93;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

/* 活动记录 */
.health-activities {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.health-activities-title {
    font-size: 17px;
    font-weight: 600;
    color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    letter-spacing: -0.4px;
    margin-bottom: 16px;
}

.health-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 0.33px solid rgba(0, 0, 0, 0.1);
}

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

.health-activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.health-activity-info {
    flex: 1;
}

.health-activity-name {
    font-size: 17px;
    color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    letter-spacing: -0.4px;
    margin-bottom: 2px;
}

.health-activity-detail {
    font-size: 15px;
    color: #8e8e93;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    letter-spacing: -0.4px;
}

.health-activity-time {
    font-size: 15px;
    color: #8e8e93;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    letter-spacing: -0.4px;
}

/* 睡眠图表 */
.health-sleep-chart {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.health-sleep-title {
    font-size: 17px;
    font-weight: 600;
    color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    letter-spacing: -0.4px;
    margin-bottom: 16px;
}

.health-sleep-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100px;
    margin-bottom: 12px;
}

.health-sleep-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    justify-content: flex-end;
}

.health-sleep-bar-fill {
    width: 20px;
    background: linear-gradient(180deg, #5e5ce6 0%, #7c7aff 100%);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
    max-height: 100%;
}

.health-sleep-bar-label {
    font-size: 11px;
    color: #8e8e93;
}

/* 心理健康 */
.health-mindfulness {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.health-mindfulness-title {
    font-size: 17px;
    font-weight: 600;
    color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    letter-spacing: -0.4px;
    margin-bottom: 12px;
}

.health-mindfulness-score {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.health-mindfulness-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(#0a84ff 0deg, #0a84ff calc(var(--score) * 3.6deg), #f2f2f7 calc(var(--score) * 3.6deg));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.health-mindfulness-circle::before {
    content: '';
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #ffffff;
    position: absolute;
}

.health-mindfulness-value {
    font-size: 32px;
    font-weight: 700;
    color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    z-index: 1;
}

.health-mindfulness-desc {
    font-size: 15px;
    color: #8e8e93;
    text-align: center;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    letter-spacing: -0.4px;
}

/* 滚动条样式 */
.health-content::-webkit-scrollbar {
    width: 0;
}