/* 健康查询网站样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 独立页面样式 */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.calculator-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.result-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-left: 4px solid #3498db;
}

.result-display {
    text-align: center;
}

.interpretation {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
}

/* 信息图表样式 */
.info-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.bmi-chart, .heart-chart {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.chart-item {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    color: white;
    font-weight: 500;
}

.chart-range {
    display: block;
    font-size: 1.1rem;
    font-weight: bold;
}

.chart-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
}

.category-excellent { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.category-good { background: linear-gradient(135deg, #3498db, #2980b9); }
.category-average { background: linear-gradient(135deg, #f39c12, #e67e22); }
.category-below-average { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.category-poor { background: linear-gradient(135deg, #8e44ad, #9b59b6); }

/* 工具说明样式 */
.tool-explanation {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.explanation-content h3 {
    color: #2c3e50;
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.3rem;
}

.explanation-content h3:first-child {
    margin-top: 0;
}

.explanation-content ul, .explanation-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

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

/* 健康指南样式 */
.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.guide-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-5px);
}

.guide-card h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.guide-card h2 a {
    color: inherit;
    text-decoration: none;
}

.guide-card h2 a:hover {
    color: #3498db;
}

.guide-card ul {
    margin-top: 1rem;
    padding-left: 1.5rem;
}

.guide-card li {
    margin-bottom: 0.5rem;
    color: #7f8c8d;
}

/* 健康资源样式 */
.health-resources {
    text-align: center;
    margin-top: 4rem;
}

.health-resources h2 {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.resource-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.resource-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.resource-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.resource-card p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.resource-link {
    color: #3498db;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.resource-card:hover .resource-link {
    color: #2980b9;
    transform: translateX(5px);
}

/* 导航样式 */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.nav-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    margin: 0;
    border-bottom: 1px solid #f0f0f0;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-menu .nav-link:last-child {
    border-bottom: none;
}

.dropdown-menu .nav-link:hover {
    background: #f8f9fa;
    color: #3498db;
}

/* 导航链接样式 */
.nav-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: #3498db;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
}

.lang-switch {
    background: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lang-switch:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* 主内容区 */
.main {
    padding: 2rem 0;
}

.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.welcome-section h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.welcome-section p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 工具网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tool-card-link {
    text-decoration: none;
    color: inherit;
}

.tool-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.tool-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.tool-card p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.tool-link {
    color: #3498db;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.tool-card:hover .tool-link {
    color: #2980b9;
    transform: translateX(5px);
}

/* 计算器区域 */
.calculator-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.calculator-form {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

/* 结果展示 */
.result {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-left: 4px solid #3498db;
}

.result h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
    color: #e74c3c;
    margin: 1rem 0;
}

.result-category {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    display: inline-block;
}

.category-underweight { background: #f39c12; color: white; }
.category-normal { background: #27ae60; color: white; }
.category-overweight { background: #e67e22; color: white; }
.category-obese { background: #e74c3c; color: white; }

/* 食品营养查询 */
.food-search {
    margin-bottom: 1.5rem;
}

.food-results {
    max-height: 400px;
    overflow-y: auto;
}

.food-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid #27ae60;
}

.food-item h5 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.nutrition-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    font-size: 0.9rem;
}

.nutrition-item {
    text-align: center;
    padding: 0.5rem;
    background: white;
    border-radius: 5px;
}

.nutrition-value {
    font-weight: bold;
    color: #e74c3c;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .calculator-section {
        padding: 1rem;
        margin: 1rem;
    }
    
    .nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-main {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }
    
    .nav-dropdown:hover .dropdown-menu {
        display: block;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 底部样式 */
.footer {
    background: rgba(44, 62, 80, 0.9);
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

.footer a {
    color: #4fc3f7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #81d4fa;
    text-decoration: underline;
}

.footer small {
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer a {
    color: #4fc3f7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #81d4fa;
    text-decoration: underline;
}

.footer small {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 标签页导航 */
.tab-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.tab-button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.tab-button.active {
    background: white;
    color: #667eea;
    border-color: white;
}

/* 标签页内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 结果项样式 */
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #e9ecef;
}

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

.result-item.highlight {
    background: #e8f4fd;
    margin: 0 -1rem;
    padding: 1rem;
    border-radius: 8px;
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: #495057;
}

.result-value {
    font-weight: 700;
    color: #3498db;
    font-size: 1.1rem;
}

.result-item.highlight .result-value {
    color: #e74c3c;
    font-size: 1.2rem;
}

/* 标签页导航 */
.tab-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.tab-button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.tab-button.active {
    background: white;
    color: #667eea;
    border-color: white;
}

/* 标签页内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 结果项样式 */
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #e9ecef;
}

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

.result-item.highlight {
    background: #e8f4fd;
    margin: 0 -1rem;
    padding: 1rem;
    border-radius: 8px;
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: #495057;
}

.result-value {
    font-weight: 700;
    color: #3498db;
    font-size: 1.1rem;
}

.result-item.highlight .result-value {
    color: #e74c3c;
    font-size: 1.2rem;
}