* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 导航栏样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.nav-logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2196f3;
    text-decoration: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0 1rem;
}

.nav-menu a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #2196f3;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-btn, .register-btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
}

.login-btn {
    color: #666;
}

.register-btn {
    background-color: #2196f3;
    color: #fff;
}

.register-btn:hover {
    background-color: #1976d2;
}

/* 主要内容区样式 */
main {
    margin-top: 60px;
    padding: 2rem 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

h1 {
    text-align: center;
    color: #2196f3;
    margin-bottom: 1rem;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

.calculator-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.calculator-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #2196f3;
    border-bottom-color: #2196f3;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.input-group select {
    background-color: #fff;
}

.calculate-btn {
    width: 100%;
    padding: 1rem;
    background-color: #2196f3;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.calculate-btn:hover {
    background-color: #1976d2;
}

.result {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.result h3 {
    color: #333;
    margin-bottom: 1rem;
}

.result p {
    color: #666;
}

.result span {
    color: #2196f3;
    font-weight: bold;
}

.tips-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
}

.tips-container h3 {
    color: #333;
    margin-bottom: 1rem;
}

.tips-container ul {
    list-style-position: inside;
    color: #666;
}

.tips-container li {
    margin-bottom: 0.5rem;
}

/* 广告容器样式 */
.ad-container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    padding: 0 15px;
}

.ad-content {
    border: 1px dashed #ccc;
    padding: 40px;
    border-radius: 4px;
    text-align: center;
    color: #666;
    font-size: 14px;
    background-color: #fff;
}

/* 底部版权样式 */
.footer {
    background-color: #fff;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer p {
    margin: 0.5rem 0;
    color: #666;
}

.footer a {
    color: #666;
    text-decoration: none;
}

.footer a:hover {
    color: #2196f3;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #fff;
        padding: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .nav-menu.active {
        display: block;
    }

    .nav-menu ul {
        flex-direction: column;
    }

    .nav-menu li {
        margin: 0.5rem 0;
    }

    .calculator-tabs {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        text-align: center;
    }
}

/* 饮食计划样式 */
.meal-planner {
    padding: 1rem 0;
}

.meal-distribution {
    margin: 2rem 0;
    text-align: center;
}

.meal-chart {
    display: flex;
    height: 200px;
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.chart-segment {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    transition: all 0.3s;
}

.chart-segment:hover {
    transform: translateY(-5px);
}

.breakfast { background-color: #FF9800; width: 30%; }
.lunch { background-color: #4CAF50; width: 40%; }
.dinner { background-color: #2196F3; width: 30%; }

.meal-label {
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.meal-details {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.meal-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

/* 营养卡片样式 */
.nutrition-tips {
    margin-top: 3rem;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.nutrition-card {
    padding: 1.5rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.3s;
}

.nutrition-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background-size: 60%;
    background-position: center;
    background-repeat: no-repeat;
}

.protein { background-color: #FF9800; background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2L2 7v10l10 5 10-5V7z"/></svg>'); }
.carbs { background-color: #4CAF50; background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"/></svg>'); }
.fat { background-color: #2196F3; background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/></svg>'); }

.nutrition-card h4 {
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
}

.nutrition-card ul {
    margin-top: 1rem;
    padding-left: 1.5rem;
}

.nutrition-card li {
    color: #666;
    margin-bottom: 0.5rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .meal-chart {
        flex-direction: column;
        height: auto;
    }
    
    .chart-segment {
        width: 100% !important;
        height: 60px;
    }
    
    .nutrition-grid {
        grid-template-columns: 1fr;
    }
} 