:root {
    --primary-color: #4CAF50;
    --primary-light: #81C784;
    --primary-dark: #388E3C;
    --secondary-color: #FFA726;
    --text-color: #333;
    --light-text: #666;
    --lightest-text: #999;
    --background-color: #f8f8f8;
    --card-background: #fff;
    --border-color: #e0e0e0;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: white;
    box-shadow: var(--shadow);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.logo {
    width: 40px;
    height: 40px;
    margin-right: 1rem;
}

h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

nav button {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--light-text);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

nav button.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

section {
    margin-bottom: 3rem;
}

/* 首页样式 */
.hero {
    display: flex;
    align-items: center;
    margin-bottom: 3rem;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-content {
    flex: 1;
    padding: 2rem;
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.hero p {
    margin-bottom: 2rem;
    color: var(--light-text);
    font-size: 1.1rem;
}

.hero-image {
    flex: 1;
    padding: 1rem;
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
}

.cta-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: bold;
}

.cta-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.feature-card p {
    color: var(--light-text);
}

/* 食谱推荐样式 */
.recipes-section h2,
.calories-section h2,
.nutrition-section h2,
.checkin-section h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
    text-align: center;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: bold;
    color: var(--light-text);
}

.filter-group select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.primary-button:hover {
    background-color: var(--primary-dark);
}

.secondary-button {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.secondary-button:hover {
    background-color: var(--primary-light);
    color: white;
}

.recipes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.recipe-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.recipe-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.recipe-info {
    padding: 1.5rem;
}

.recipe-info h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background-color: var(--primary-light);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.recipe-description {
    margin-bottom: 1.5rem;
    color: var(--light-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--card-background);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--border-radius);
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--light-text);
}

.detail-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.nutrition-info {
    margin-bottom: 2rem;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.nutrition-item {
    text-align: center;
    background-color: var(--background-color);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.nutrition-value {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nutrition-label {
    color: var(--light-text);
    font-size: 0.9rem;
}

.ingredients, .steps {
    margin-bottom: 2rem;
}

.ingredients ul, .steps ol {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.ingredients li, .steps li {
    margin-bottom: 0.5rem;
    color: var(--light-text);
}

/* 卡路里计算样式 */
.calculator-container {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.food-search {
    margin-bottom: 2rem;
    position: relative;
}

.food-search input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
}

.search-result-item {
    padding: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background-color: var(--background-color);
}

.meal-container h3 {
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.meal-list {
    margin-bottom: 2rem;
}

.meal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.meal-info {
    display: flex;
    flex: 1;
}

.meal-name {
    flex: 2;
    font-weight: bold;
}

.meal-quantity, .meal-calories {
    flex: 1;
    text-align: right;
}

.meal-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-button {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.quantity-input {
    width: 60px;
    padding: 0.3rem;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.remove-button {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
}

.total-calories {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.calorie-target {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.calorie-target input {
    width: 100px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.progress-bar {
    height: 20px;
    background-color: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress {
    height: 100%;
    transition: var(--transition);
}

.calorie-status {
    text-align: right;
    color: var(--light-text);
}

/* 营养分析样式 */
.time-range {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.time-range button {
    background: none;
    border: none;
    padding: 0.5rem 1.5rem;
    margin: 0 0.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.time-range button.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.nutrition-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.chart-container {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.chart-container h3 {
    margin-bottom: 1rem;
    color: var(--primary-dark);
    text-align: center;
}

.chart {
    width: 100%;
    height: 300px;
}

.nutrition-details {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.nutrition-table {
    width: 100%;
    border-collapse: collapse;
}

.nutrition-header {
    display: flex;
    font-weight: bold;
    border-bottom: 2px solid var(--border-color);
    padding: 0.8rem 0;
}

.nutrition-row {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 0;
}

.nutrition-cell {
    flex: 1;
    padding: 0 0.5rem;
}

.mini-progress {
    width: 100px;
    height: 8px;
    background-color: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 0.5rem;
    display: inline-block;
}

.mini-progress-bar {
    height: 100%;
    transition: var(--transition);
}

.nutrition-recommendation {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.recommendation-content {
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.recommendation-content ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.recommendation-content li {
    margin-bottom: 0.5rem;
}

/* 饮食打卡样式 */
.calendar-container {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-nav {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--primary-color);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.day-header {
    text-align: center;
    font-weight: bold;
    padding: 0.5rem;
    color: var(--light-text);
}

.calendar-day {
    position: relative;
    height: 60px;
    border-radius: var(--border-radius);
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.calendar-day:hover {
    background-color: var(--primary-light);
    color: white;
}

.other-month {
    opacity: 0.5;
}

.today {
    border: 2px solid var(--primary-color);
}

.checked-in {
    background-color: var(--primary-light);
    color: white;
}

.day-number {
    font-weight: bold;
}

.checkin-mark {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 0.8rem;
}

.streak-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.streak-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
}

.streak-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.streak-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.checkin-trends {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.checkin-trends h3 {
    margin-bottom: 1rem;
    color: var(--primary-dark);
    text-align: center;
}

.daily-note {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.daily-note h3 {
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.daily-note textarea {
    width: 100%;
    height: 150px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    resize: vertical;
}

/* 页脚样式 */
footer {
    background-color: var(--primary-dark);
    color: white;
    padding: 3rem 2rem 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.copyright {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* 响应式设计 */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .hero {
        flex-direction: column;
    }
    
    .hero-content {
        padding: 1.5rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .nutrition-charts {
        grid-template-columns: 1fr;
    }
    
    .streak-info {
        grid-template-columns: 1fr;
    }
    
    .nutrition-header, .nutrition-row {
        font-size: 0.9rem;
    }
    
    .calendar-day {
        height: 50px;
    }
    
    .filter-options {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .nutrition-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .calendar-days {
        gap: 0.2rem;
    }
    
    .calendar-day {
        height: 40px;
        font-size: 0.8rem;
    }
}

