/* 全局样式 */
:root {
    --primary-color: #4a6bff;
    --primary-dark: #3a56cc;
    --secondary-color: #ff6b6b;
    --accent-color: #6bffb8;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --text-color: #333;
    --light-text: #f8f9fa;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --underweight-color: #64c5eb;
    --normal-color: #68d391;
    --overweight-color: #f6ad55;
    --obese-color: #fc8181;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    background-image: linear-gradient(to bottom, #f8f9fa, #e9ecef);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 标题样式 */
h1, h2, h3, h4 {
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

h3 {
    font-size: 1.4rem;
    color: var(--dark-bg);
}

p {
    margin-bottom: 1rem;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
}

header h1 {
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

header i {
    margin-right: 10px;
}

/* 语言切换按钮 */
.lang-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.lang-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* 主要内容区域 */
main {
    padding-bottom: 3rem;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 渐变卡片样式 */
.gradient-card {
    background: linear-gradient(to bottom right, #ffffff, #f0f8ff);
    border-left: 4px solid var(--primary-color);
}

.gradient-card-blue {
    background: linear-gradient(to bottom right, #ffffff, #e6f0ff);
    border-left: 4px solid #4a89dc;
}

.gradient-card-green {
    background: linear-gradient(to bottom right, #ffffff, #e6fff0);
    border-left: 4px solid #37bc9b;
}

.gradient-card-purple {
    background: linear-gradient(to bottom right, #ffffff, #f0e6ff);
    border-left: 4px solid #967adc;
}

.gradient-card-orange {
    background: linear-gradient(to bottom right, #ffffff, #fff0e6);
    border-left: 4px solid #f6bb42;
}

.gradient-card-red {
    background: linear-gradient(to bottom right, #ffffff, #ffe6e6);
    border-left: 4px solid #da4453;
}

.gradient-card-yellow {
    background: linear-gradient(to bottom right, #ffffff, #fffde6);
    border-left: 4px solid #ffce54;
}

/* 悬停效果 */
.hover-effect {
    transition: all 0.4s ease;
}

.hover-effect:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* 计算器部分 */
.calculator-section .card {
    text-align: center;
}

.calculator {
    max-width: 500px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.2);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 脉冲按钮 */
.pulse-btn {
    position: relative;
    overflow: hidden;
}

.pulse-btn:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.pulse-btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 1;
    }
    20% {
        transform: scale(25, 25);
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* 结果显示 */
.result-hidden {
    display: none;
}

.result-card {
    background: linear-gradient(to bottom, #f9f9f9, #f0f0f0);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#bmi-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

#bmi-category {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.bmi-scale {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: 1.5rem;
    height: 30px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.scale-item {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    padding: 5px 0;
    position: relative;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.scale-item:hover {
    transform: translateY(-2px);
}

.underweight {
    background-color: var(--underweight-color);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.normal {
    background-color: var(--normal-color);
}

.overweight {
    background-color: var(--overweight-color);
}

.obese {
    background-color: var(--obese-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

#bmi-indicator {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #333;
    border-radius: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    transition: left 0.5s ease;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
    z-index: 10;
}

/* 信息部分 */
.info-section {
    margin-bottom: 2rem;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--primary-dark);
}

tr:hover {
    background-color: #f8f9fa;
}

.note {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* 建议部分 */
.advice-section {
    margin-top: 3rem;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.advice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.card:hover .card-icon {
    transform: scale(1.1);
}

ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* 页脚样式 */
footer {
    background-color: var(--dark-bg);
    color: white;
    padding: 1.5rem 0;
    text-align: center;
    margin-top: 2rem;
}
footer a{
    color: white;
    text-decoration: none;
}

/* 动画类 */
.animate__animated {
    animation-duration: 0.8s;
}

.animate__bounceIn {
    animation-name: bounceIn;
}

@keyframes bounceIn {
    from,
    20%,
    40%,
    60%,
    80%,
    to {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }

    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }

    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }

    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }

    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }

    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }

    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

.animate__pulse {
    animation-name: pulse;
}

@keyframes pulse {
    from {
        transform: scale3d(1, 1, 1);
    }

    50% {
        transform: scale3d(1.05, 1.05, 1.05);
    }

    to {
        transform: scale3d(1, 1, 1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    header {
        padding: 2rem 0;
    }
    
    .advice-grid {
        grid-template-columns: 1fr;
    }
    
    .lang-btn {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* 广告样式 */
.ad-container {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: var(--border-radius);
    background: linear-gradient(to right, #fff8e1, #ffecb3);
    border-left: 4px solid #ffc107;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.ad-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.ad-label {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.1);
    color: #666;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
}

.ad-title {
    font-size: 1.3rem;
    color: #e65100;
    margin-bottom: 0.5rem;
}

.ad-content {
    margin-bottom: 0.8rem;
}

.ad-button {
    display: inline-block;
    background: linear-gradient(to right, #ff9800, #f57c00);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ad-button:hover {
    background: linear-gradient(to right, #f57c00, #e65100);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 响应式广告 */
@media (max-width: 768px) {
    .ad-title {
        font-size: 1.1rem;
    }
    
    .ad-content {
        font-size: 0.9rem;
    }
}