/**
 * 爱减肥 - 公共样式文件
 * 网站: aijianfei.cc
 * 版本: 1.0
 */

/* ==================== 基础样式重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b6b;
    --primary-dark: #ee5a5a;
    --secondary-color: #4ecdc4;
    --accent-color: #ffe66d;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #fff5f5 0%, #f0f9ff 50%, #f0fff4 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

/* ==================== 导航栏样式 ==================== */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 20px;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--text-light);
}

.nav-links {
    display: flex;
    gap: 8px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.nav-links a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-dark);
}

/* ==================== 主内容区域 ==================== */
.main-content {
    padding-top: 90px;
    min-height: 100vh;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== 通用卡片样式 ==================== */
.card {
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 40px;
    margin-bottom: 30px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==================== 测试卡片样式 ==================== */
.test-card {
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 40px;
    margin-bottom: 30px;
    animation: fadeInUp 0.5s ease;
}

/* ==================== 测试头部 ==================== */
.test-header {
    text-align: center;
    margin-bottom: 35px;
}

.test-header h1 {
    font-size: 28px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.test-header h1 span {
    color: var(--primary-color);
}

.test-header p {
    color: var(--text-light);
    font-size: 16px;
}

/* ==================== 进度指示器 ==================== */
.progress-section {
    margin-bottom: 30px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-text {
    font-size: 14px;
    color: var(--text-light);
}

.progress-text strong {
    color: var(--primary-color);
    font-size: 16px;
}

.progress-count {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.progress-bar {
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
    transition: width 0.4s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

/* ==================== 问题样式 ==================== */
.question-wrapper {
    display: none;
}

.question-wrapper.active {
    display: block;
    animation: slideIn 0.4s ease;
}

.question-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.question-text {
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 25px;
    line-height: 1.6;
    font-weight: 500;
}

/* ==================== 选项样式 ==================== */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.option-item:hover {
    border-color: var(--primary-color);
    background: #fff5f5;
    transform: translateX(5px);
}

.option-item.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    transform: scale(1.02);
}

.option-letter {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.option-item:hover .option-letter {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.option-item.selected .option-letter {
    background: white;
    border-color: white;
    color: var(--primary-color);
}

.option-text {
    flex: 1;
    font-size: 16px;
}

.option-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.option-item.selected .option-check {
    opacity: 1;
    transform: scale(1);
}

/* ==================== 导航按钮 ==================== */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-light);
}

.btn-secondary:hover {
    background: #e9ecef;
    color: var(--text-dark);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    flex: 1;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-outline {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* ==================== 结果页面样式 ==================== */
.result-section {
    display: none;
}

.result-section.active {
    display: block;
}

.result-header {
    text-align: center;
    padding: 30px 0;
}

.result-icon-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    animation: bounceIn 0.6s ease;
}

.result-badge {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.result-type-name {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
}

.result-score {
    color: var(--text-light);
    font-size: 16px;
}

.result-card {
    background: var(--white);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.result-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.result-card p {
    color: var(--text-light);
    line-height: 1.8;
}

.tips-list {
    list-style: none;
}

.tips-list li {
    padding: 12px 0;
    padding-left: 30px;
    position: relative;
    color: var(--text-light);
    border-bottom: 1px dashed #eee;
}

.tips-list li:last-child {
    border-bottom: none;
}

.tips-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 12px;
    width: 20px;
    height: 20px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.encouragement {
    background: linear-gradient(135deg, #fff5f5, #f0f9ff);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    margin-bottom: 20px;
}

.encouragement-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.encouragement p {
    color: var(--text-dark);
    font-size: 16px;
    line-height: 1.8;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-buttons .btn {
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

/* ==================== 内容页面样式 ==================== */
.page-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.page-header h1 {
    font-size: 32px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.page-header p {
    color: var(--text-light);
    font-size: 16px;
}

.content-card {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.content-card h2 {
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-card h3 {
    font-size: 18px;
    color: var(--primary-color);
    margin: 25px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.content-card h3:first-of-type {
    margin-top: 0;
}

.content-card p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 15px;
}

.content-card ul {
    padding-left: 0;
    list-style: none;
}

.content-card li {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 12px;
    padding-left: 28px;
    position: relative;
}

.content-card li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 18px;
}

.content-card li strong {
    color: var(--text-dark);
}

/* 警示样式 */
.warning-card {
    background: linear-gradient(135deg, #fff5f5, #fff);
    border-left: 4px solid var(--primary-color);
}

.warning-card li::before {
    content: "❌";
    font-size: 14px;
}

/* 提示框样式 */
.tip-box {
    background: linear-gradient(135deg, #f0fff4, #fff);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid var(--secondary-color);
}

.tip-box p {
    margin: 0;
    color: var(--text-dark);
}

/* BMI 计算器样式 */
.bmi-calculator {
    background: var(--bg-light);
    border-radius: 16px;
    padding: 25px;
    margin: 20px 0;
}

.bmi-calculator h4 {
    color: var(--text-dark);
    margin-bottom: 15px;
}

.bmi-input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.bmi-input-group input {
    flex: 1;
    min-width: 120px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.bmi-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.bmi-result {
    padding: 15px;
    background: white;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    color: var(--text-dark);
}

/* ==================== 页脚样式 ==================== */
.footer {
    background: var(--text-dark);
    color: rgba(255,255,255,0.7);
    padding: 30px 20px;
    text-align: center;
    margin-top: 50px;
}

.footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer p {
    margin: 5px 0;
}

.footer .disclaimer {
    font-size: 12px;
    margin-top: 10px;
    opacity: 0.8;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .navbar-container {
        height: 60px;
    }

    .logo-icon {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .logo-title {
        font-size: 18px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 15px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links a {
        padding: 15px 20px;
        border-radius: 12px;
    }

    .mobile-menu-btn {
        display: block;
    }

    .main-content {
        padding-top: 80px;
    }

    .container {
        padding: 15px;
    }

    .test-card,
    .card {
        padding: 25px 20px;
        border-radius: 20px;
    }

    .content-card {
        padding: 25px 20px;
    }

    .test-header h1,
    .page-header h1 {
        font-size: 24px;
    }

    .question-text {
        font-size: 18px;
    }

    .option-item {
        padding: 15px;
    }

    .result-type-name {
        font-size: 26px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .nav-buttons {
        flex-direction: column-reverse;
    }

    .btn-secondary {
        align-self: flex-start;
    }

    .bmi-input-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .logo-subtitle {
        display: none;
    }

    .content-card h2 {
        font-size: 20px;
    }

    .content-card h3 {
        font-size: 16px;
    }
}
