/* 基础样式和CSS变量 */
:root {
    --primary-color: #4A90E2;
    --secondary-color: #5BA8F5;
    --accent-color: #7EC8E3;
    --light-bg: #F0F8FF;
    --white: #FFFFFF;
    --text-dark: #2C3E50;
    --text-light: #6C7A89;
    --success-color: #2ECC71;
    --shadow: 0 4px 20px rgba(74, 144, 226, 0.15);
    --shadow-hover: 0 8px 30px rgba(74, 144, 226, 0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #E8F5FF 0%, #F0F8FF 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 页面容器 */
.page {
    display: none;
    min-height: 100vh;
    padding: 40px 20px;
    animation: pageSlideIn 0.6s ease-out;
}

.page.active {
    display: block;
}

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

/* 动画效果 */
@keyframes pageSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

/* 欢迎页面 */
.welcome-content {
    text-align: center;
    padding: 60px 20px;
}

.main-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(74, 144, 226, 0.2);
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 60px;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.feature-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: scaleIn 0.5s ease-out backwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.feature-card .icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-light);
    font-size: 1rem;
}

/* 按钮样式 */
.btn {
    padding: 16px 48px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.btn-outline {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--text-light);
}

.btn-outline:hover {
    background: var(--text-light);
    color: var(--white);
}

.btn-back {
    background: var(--white);
    color: var(--text-dark);
    margin-top: 40px;
}

.btn-back:hover {
    background: var(--light-bg);
}

/* 页面标题 */
.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.page-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.page-header p {
    font-size: 1.2rem;
    color: var(--text-light);
}

/* 角色选择卡片 */
.role-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.role-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.5s ease-out backwards;
}

.role-card:nth-child(1) { animation-delay: 0.1s; }
.role-card:nth-child(2) { animation-delay: 0.2s; }
.role-card:nth-child(3) { animation-delay: 0.3s; }

.role-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: var(--transition);
}

.role-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.role-card:hover::before {
    opacity: 0.05;
}

.role-card.selected {
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.2);
}

.role-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.role-card h3 {
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.role-card p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
}

.card-badge {
    display: inline-block;
    margin-top: 20px;
    padding: 8px 20px;
    background: var(--light-bg);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* 目标选择卡片 */
.goal-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.goal-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    animation: scaleIn 0.5s ease-out backwards;
}

.goal-card:nth-child(1) { animation-delay: 0.1s; }
.goal-card:nth-child(2) { animation-delay: 0.2s; }
.goal-card:nth-child(3) { animation-delay: 0.3s; }

.goal-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.goal-card.selected {
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.2);
}

.goal-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.goal-card h3 {
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.goal-card p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.goal-features {
    list-style: none;
    text-align: left;
}

.goal-features li {
    color: var(--text-light);
    padding: 8px 0;
    font-size: 0.95rem;
}

/* 问卷进度条 */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(74, 144, 226, 0.2);
    border-radius: 10px;
    margin-bottom: 40px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

/* 问题容器 */
.question-container {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out;
}

.question-item {
    background: var(--white);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.question-item h3 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 30px;
    text-align: center;
}

.options {
    display: grid;
    gap: 15px;
}

.option-btn {
    width: 100%;
    padding: 20px 30px;
    background: var(--light-bg);
    border: 2px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.option-btn:hover {
    background: var(--white);
    border-color: var(--primary-color);
    transform: translateX(10px);
}

.option-btn.selected {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* 结果页面 */
.result-content {
    background: var(--white);
    border-radius: 20px;
    padding: 50px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.result-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--light-bg);
}

.result-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.result-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
}

.result-section {
    margin-bottom: 40px;
}

.result-section h3 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recipe-card {
    background: var(--light-bg);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.recipe-card h4 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.recipe-card ul {
    list-style: none;
    padding-left: 0;
}

.recipe-card li {
    padding: 8px 0;
    color: var(--text-dark);
    line-height: 1.6;
}

.recipe-card li::before {
    content: "✓ ";
    color: var(--success-color);
    font-weight: bold;
    margin-right: 8px;
}

.impact-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

.action-list {
    list-style: none;
}

.action-list li {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.restaurant-list {
    display: grid;
    gap: 15px;
}

.restaurant-item {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.restaurant-info h5 {
    color: var(--text-dark);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.restaurant-info p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.restaurant-distance {
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .feature-cards,
    .role-cards,
    .goal-cards {
        grid-template-columns: 1fr;
    }

    .result-content {
        padding: 30px 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .impact-stats {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(74, 144, 226, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--text-dark);
    color: var(--white);
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1000;
}

