/* ========== FitPulse 品牌样式 ========== */
/* 品牌色板 */
:root {
    --primary: #FF6B35;
    --primary-light: #FF8C42;
    --primary-dark: #E55A2B;
    --gradient: linear-gradient(135deg, #FF6B35, #FF8C42);
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2D3436;
    --text-secondary: #636e72;
    --text-muted: #b2bec3;
    --border: #e5e5e5;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
}

/* ========== APP容器 ========== */
.app-container {
    max-width: 450px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background: var(--bg);
}

/* ========== 状态栏 ========== */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px 4px;
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.status-bar .time {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.status-icons {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ========== 主内容区 ========== */
.main-content {
    padding: 0 16px 80px;
    min-height: calc(100vh - 60px);
}

/* ========== 欢迎区域 ========== */
.welcome-section {
    padding: 16px 0;
}

.welcome-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.welcome-header .logo-icon {
    width: 44px;
    height: 44px;
}

.welcome-text {
    flex: 1;
}

.welcome-text h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

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

.notification-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    color: var(--text-secondary);
}

.notification-btn:active {
    transform: scale(0.9);
}

/* ========== 今日状态卡片 ========== */
.today-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 14px 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.stat-card:active {
    transform: scale(0.97);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.stat-card.steps .stat-icon {
    background: #FFF0E6;
    color: var(--primary);
}

.stat-card.calories .stat-icon {
    background: #FFE8E0;
    color: #E55A2B;
}

.stat-card.duration .stat-icon {
    background: #E8F4FD;
    color: #3498db;
}

.stat-info {
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-progress {
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 2px;
    background: var(--gradient);
    transition: width 0.8s ease;
}

/* ========== 快速开始 ========== */
.quick-start {
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 80px;
    font-family: var(--font);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn.run {
    background: linear-gradient(135deg, #FF6B35, #FF8C42);
}

.action-btn.yoga {
    background: linear-gradient(135deg, #9B59B6, #8E44AD);
}

.action-btn.strength {
    background: linear-gradient(135deg, #2ECC71, #27AE60);
}

.action-btn.custom {
    background: linear-gradient(135deg, #3498DB, #2980B9);
}

.action-btn svg {
    width: 24px;
    height: 24px;
}

/* ========== 推荐训练 ========== */
.recommended {
    margin-bottom: 20px;
}

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

.see-all {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.workout-cards {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.workout-cards::-webkit-scrollbar {
    display: none;
}

.workout-card {
    min-width: 200px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.workout-card:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-hover);
}

.workout-card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 24px;
}

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

.workout-card p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.workout-card .card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.workout-card .card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========== 训练记录 ========== */
.recent-workouts {
    margin-bottom: 20px;
}

.record-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.record-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.record-item:active {
    transform: scale(0.98);
}

.record-item .record-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
}

.record-info {
    flex: 1;
}

.record-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.record-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.record-stats {
    text-align: right;
}

.record-stats .calories {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.record-stats .duration {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== 底部导航栏 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 450px;
    margin: 0 auto;
    height: 64px;
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
    z-index: 1000;
    border-top: 1px solid var(--border);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.3s;
    min-width: 56px;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    transition: all 0.3s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active svg {
    stroke: var(--primary);
    fill: none;
}

.nav-item:active {
    transform: scale(0.9);
}

/* ========== 页面头部 ========== */
.page-header {
    padding: 16px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========== 训练分类 ========== */
.workout-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.category-btn {
    padding: 8px 16px;
    border: 2px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--card-bg);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    font-family: var(--font);
}

.category-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: #FFF5F0;
}

.category-btn:active {
    transform: scale(0.95);
}

/* ========== 训练网格 ========== */
.workout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.workout-grid .workout-card {
    min-width: auto;
}

/* ========== 搜索框 ========== */
.search-box {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    gap: 10px;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text-primary);
    background: transparent;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* ========== 文章列表 ========== */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.article-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.article-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-hover);
}

.article-card .article-category {
    display: inline-block;
    padding: 4px 10px;
    background: #FFF0E6;
    color: var(--primary);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}

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

.article-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ========== 个人中心 ========== */
.profile-header {
    text-align: center;
    padding: 24px 0;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.avatar img {
    width: 40px;
    height: 40px;
    filter: brightness(0) invert(1);
}

.username {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-level {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 16px;
}

.user-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
}

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

.user-stat .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.user-stat .stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== 功能菜单 ========== */
.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    gap: 12px;
}

.menu-item:active {
    transform: scale(0.98);
}

.menu-item svg:first-child {
    color: var(--primary);
}

.menu-item span {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.menu-item svg:last-child {
    color: var(--text-muted);
}

/* ========== 响应式 ========== */
@media (min-width: 768px) {
    .app-container {
        max-width: 450px;
        margin: 0 auto;
        box-shadow: 0 0 40px rgba(0,0,0,0.1);
        min-height: 100vh;
    }
    
    body {
        background: #e8e8e8;
    }
}

@media (max-width: 374px) {
    .today-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }
    
    .workout-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 动画 ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > section {
    animation: fadeInUp 0.5s ease forwards;
}

.main-content > section:nth-child(2) {
    animation-delay: 0.1s;
}

.main-content > section:nth-child(3) {
    animation-delay: 0.2s;
}

.main-content > section:nth-child(4) {
    animation-delay: 0.3s;
}

.main-content > section:nth-child(5) {
    animation-delay: 0.4s;
}

/* ========== 工具类 ========== */
.text-primary {
    color: var(--primary);
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.bg-primary {
    background: var(--gradient);
}

.shadow {
    box-shadow: var(--shadow);
}

.shadow-hover:hover {
    box-shadow: var(--shadow-hover);
}

.rounded {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}