/* 首页样式 */

/* 顶部用户信息栏 */
.app-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-stats {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.user-level {
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-badge {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.user-points {
    font-size: 12px;
    opacity: 0.9;
}

.btn-rank {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-rank:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 主内容区 */
.app-main {
    padding: 20px;
    padding-bottom: 80px;
}

/* 今日进度卡片 */
.progress-card {
    background-color: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.progress-card h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.progress-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.progress-bar {
    height: 8px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 4px;
    transition: width var(--transition-normal);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
}

.encourage-text {
    color: var(--primary-color);
    font-weight: 500;
}

/* 统计卡片 */
.stats-card {
    background-color: var(--bg-primary);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.stats-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-box {
    background-color: var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    font-size: 24px;
    margin-right: 12px;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-desc {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* 快速开始按钮 */
.action-section {
    margin: 32px 0;
    text-align: center;
}

.btn-start-record {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FF8787 100%);
    color: white;
    border: none;
    padding: 20px 48px;
    border-radius: 32px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.3);
    transition: all var(--transition-normal);
}

.btn-start-record:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(255, 107, 107, 0.4);
}

.btn-start-record:active {
    transform: translateY(-1px);
}

.quick-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 16px;
}

.quick-btn {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.quick-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 成就展示 */
.achievement-section {
    background-color: var(--bg-primary);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.achievement-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.achievement-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.achievement-item {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
}

.achievement-icon {
    width: 60px;
    height: 60px;
    background-color: var(--bg-secondary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 8px;
    position: relative;
}

.achievement-icon.unlocked {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%);
}

.achievement-icon.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.achievement-name {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 首次使用引导模态框 */
#welcomeModal .modal-content {
    text-align: center;
}

#welcomeModal .btn-primary {
    width: 100%;
    margin-bottom: 12px;
}

#welcomeModal .btn-secondary {
    width: 100%;
    background-color: transparent;
    border: 1px solid var(--border-color);
}

/* 移动端适配 */
@media screen and (max-width: 375px) {
    .stat-value {
        font-size: 28px;
    }
    
    .btn-start-record {
        padding: 16px 36px;
        font-size: 16px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .app-header {
        background: linear-gradient(135deg, #D32F2F 0%, #0097A7 100%);
    }
}