/* 菜谱页面样式 */

/* ===== 欢迎区域 ===== */
.welcome-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.welcome-title {
    font-size: 32px;
    font-weight: bold;
    margin: 0 0 15px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.welcome-desc {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 搜索区域 */
.search-section {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* 防止内容溢出 */
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
    box-sizing: border-box;
    min-width: 0; /* 防止flex子元素超出容器 */
    max-width: 100%;
}

.search-box input:focus {
    border-color: #4CAF50;
}

.search-btn, .random-btn, .clear-btn, .start-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn {
    background: #4CAF50;
    color: white;
    flex-shrink: 0; /* 防止按钮被压缩 */
    white-space: nowrap; /* 防止文字换行 */
}

.search-btn:hover {
    background: #45a049;
}

.random-btn {
    background: #FF9800;
    color: white;
}

.random-btn:hover {
    background: #e68900;
}

.clear-btn {
    background: #f5f5f5;
    color: #666;
}

.clear-btn:hover {
    background: #e0e0e0;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ===== 分类区域 ===== */
.category-section {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.section-title {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.category-tag {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    border: 2px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-tag:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.popular-btn {
    background: #ff6b6b;
    color: white;
}

.popular-btn:hover {
    background: #ff5252;
}

/* ===== 搜索结果区域 ===== */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
}

.results-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.results-count {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ===== 现代分页组件样式 ===== */
.pagination-container {
    margin-top: 30px;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.2);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #495057;
    border: 1px solid #e9ecef;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 44px;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}

.page-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transition: left 0.5s;
}

.page-btn:hover:not(:disabled)::before {
    left: 100%;
}

.page-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

.page-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.page-btn:disabled {
    background: #f1f3f4;
    color: #9aa0a6;
    border-color: #f1f3f4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.page-arrow {
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.page-btn:hover:not(:disabled) .page-arrow {
    transform: scale(1.1);
}

.page-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.page-number {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #495057;
    border: 1px solid #e9ecef;
    padding: 0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}

.page-number::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-number span {
    position: relative;
    z-index: 1;
}

.page-number:hover:not(.active) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.page-number:hover:not(.active)::before {
    opacity: 0.1;
}

.page-number.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.page-ellipsis {
    color: #9aa0a6;
    font-weight: 600;
    padding: 8px 4px;
    font-size: 16px;
}

.pagination-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(233, 236, 239, 0.5);
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.page-info, .total-info {
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.page-info:hover, .total-info:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* 分页加载动画 */
.pagination-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.pagination-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 页码切换动画 */
.page-numbers {
    position: relative;
}

.page-numbers.updating {
    opacity: 0.5;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

/* 响应式分页优化 */
@media (max-width: 480px) {
    .pagination-container {
        padding: 12px;
        margin-top: 16px;
    }

    .page-btn {
        max-width: 100%;
        padding: 12px 20px;
        font-size: 15px;
    }

    .page-numbers {
        gap: 3px;
        padding: 4px 0;
    }

    .page-number {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .page-ellipsis {
        font-size: 14px;
        padding: 6px 2px;
    }
}

.page-info {
    font-weight: 500;
}

.total-info {
    color: #495057;
}

/* 菜谱卡片 */
.recipe-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.recipe-card.featured {
    border: 2px solid #4CAF50;
    background: linear-gradient(135deg, #f8fff8 0%, #ffffff 100%);
}

.recipe-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.recipe-card-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.recipe-card-dish {
    background: #4CAF50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.recipe-card-desc {
    color: #666;
    margin-bottom: 10px;
    line-height: 1.5;
}

.recipe-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #666;
    font-size: 13px;
    margin-top: 8px;
}

.recipe-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    font-weight: 500;
}

.recipe-card-meta .time-info {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #bbdefb;
}

.recipe-card-meta .ingredients-count {
    background: #e8f5e8;
    color: #2e7d32;
    border-color: #c8e6c9;
}

.recipe-card-meta .steps-count {
    background: #fff3e0;
    color: #f57c00;
    border-color: #ffcc02;
}

.recipe-card-meta .author {
    background: #f3e5f5;
    color: #7b1fa2;
    border-color: #e1bee7;
}

/* 菜谱网格 */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* ===== 菜谱详情页 ===== */
.recipe-detail {
    background: #fff;
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.recipe-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.recipe-title-section {
    margin-bottom: 25px;
}

.recipe-name {
    font-size: 32px;
    font-weight: bold;
    margin: 0 0 15px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.recipe-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.dish-type {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.author, .create-time {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.recipe-description {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: flex-start;
    gap: 15px;
    text-align: left;
}

.desc-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.desc-content h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: white;
}

.desc-content p {
    margin: 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.recipe-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 25px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-icon {
    font-size: 24px;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    color: white;
}

/* 头部操作按钮 */
.header-actions {
    display: flex;
    gap: 10px;
}

.share-btn, .collect-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.share-btn:hover, .collect-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ===== 菜谱内容区域重新设计 ===== */
.recipe-content {
    margin-top: 20px;
}

.content-section {
    background: #fff;
    margin-bottom: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

.section-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 25px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    font-size: 20px;
}

.section-text {
    font-weight: 600;
}

.section-count {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ===== 食材清单新样式 ===== */
.ingredients-grid {
    padding: 25px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.ingredient-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
}

.ingredient-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ingredient-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ingredient-name {
    font-weight: 500;
    color: #333;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
}

/* ===== 制作步骤新样式 ===== */
.steps-container {
    padding: 25px;
}

.step-card {
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.step-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.step-card:last-child {
    margin-bottom: 0;
}

.step-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-number {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.step-title {
    font-weight: 600;
    font-size: 14px;
}

.step-instruction {
    padding: 20px;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
}

/* ===== 关键词标签新样式 ===== */
.keywords-container {
    padding: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.keyword-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.keyword-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4c93 100%);
}

/* 操作按钮 */
.recipe-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.action-btn.secondary {
    background: #ff6b6b;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.action-btn.secondary:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.action-btn:not(.primary):not(.secondary) {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
}

.action-btn:not(.primary):not(.secondary):hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
}

/* ===== 移动端优化 ===== */
@media (max-width: 768px) {
    /* 容器优化 */
    .container {
        padding: 10px;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden; /* 防止水平滚动 */
    }

    /* 欢迎区域移动端优化 */
    .welcome-section {
        padding: 25px 15px;
        margin-bottom: 20px;
    }

    .welcome-title {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .welcome-desc {
        font-size: 14px;
    }

    /* 搜索区域移动端优化 */
    .search-section {
        padding: 10px 15px 15px 15px;
        margin: 0;
    }

    .search-box {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 15px;
    }

    .search-box input {
        width: 100%;
        margin-bottom: 0;
        box-sizing: border-box;
        min-width: 0;
        flex: none; /* 移动端不使用flex */
        padding: 14px 16px; /* 增加触摸区域 */
        font-size: 16px; /* 防止iOS缩放 */
    }

    .search-btn {
        width: 100%;
        padding: 14px 20px;
        box-sizing: border-box;
        flex-shrink: 0;
        margin: 0;
    }

    .action-buttons {
        justify-content: center;
        gap: 8px;
    }

    .action-buttons button {
        flex: 1;
        min-width: 0;
        padding: 8px 12px;
        font-size: 12px;
    }

    /* 额外的搜索框修复 */
    .search-box input::placeholder {
        font-size: 14px; /* 移动端占位符字体 */
    }

    /* 防止输入框在某些移动设备上超出 */
    .search-box input {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        border-radius: 8px !important;
        max-width: calc(100% - 4px) !important;
    }

    /* 确保搜索按钮不会太小 */
    .search-btn {
        min-height: 48px; /* 符合移动端触摸标准 */
        font-size: 14px !important;
    }

    /* 分类标签移动端优化 */
    .category-section {
        padding: 15px;
        margin-bottom: 15px;
    }

    .section-title {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .category-tags {
        gap: 8px;
    }

    .category-tag {
        padding: 6px 12px;
        font-size: 12px;
        flex: 1;
        text-align: center;
        min-width: 0;
    }

    /* 菜谱详情页移动端优化 */
    .recipe-header {
        padding: 25px 15px;
    }

    .recipe-name {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .recipe-meta {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    .recipe-description {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 15px;
        margin: 15px 0;
    }

    .desc-content h3 {
        font-size: 16px;
    }

    .recipe-stats {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .stat-item {
        min-width: 80px;
    }

    .stat-icon {
        font-size: 20px;
    }

    .stat-value {
        font-size: 14px;
    }

    /* 内容区域移动端优化 */
    .content-section {
        margin-bottom: 15px;
        border-radius: 12px;
    }

    .section-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .section-title {
        font-size: 16px;
    }

    .section-icon {
        font-size: 18px;
    }

    .section-count {
        align-self: flex-end;
        margin-top: -25px;
    }

    /* 食材移动端优化 */
    .ingredients-grid {
        padding: 15px;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .ingredient-card {
        padding: 12px;
    }

    .ingredient-name {
        font-size: 13px;
    }

    /* 步骤移动端优化 */
    .steps-container {
        padding: 15px;
    }

    .step-card {
        margin-bottom: 12px;
    }

    .step-header {
        padding: 10px 15px;
        gap: 8px;
    }

    .step-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .step-title {
        font-size: 13px;
    }

    .step-instruction {
        padding: 15px;
        font-size: 13px;
        line-height: 1.5;
    }

    /* 关键词移动端优化 */
    .keywords-container {
        padding: 15px;
        gap: 8px;
    }

    .keyword-badge {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* 操作按钮移动端优化 */
    .recipe-actions {
        flex-direction: column;
        gap: 10px;
        padding: 0 15px;
    }

    .action-btn {
        width: 100%;
        max-width: none;
        padding: 12px 20px;
        font-size: 14px;
    }

    /* 头部操作按钮移动端优化 */
    .header-actions {
        flex-direction: column;
        gap: 5px;
    }

    .share-btn, .collect-btn {
        padding: 6px 10px;
        font-size: 11px;
        min-width: 60px;
    }

    /* 分页移动端优化 */
    .pagination-container {
        padding: 16px;
        margin-top: 20px;
        border-radius: 16px;
    }

    .pagination {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .page-btn {
        width: 100%;
        max-width: 280px;
        padding: 14px 24px;
        font-size: 16px;
        border-radius: 14px;
        min-height: 48px;
    }

    .page-btn .page-text {
        display: block;
    }

    .page-btn .page-arrow {
        font-size: 18px;
    }

    .page-numbers {
        order: -1;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        max-width: 100%;
        overflow-x: auto;
        padding: 8px 0;
    }

    .page-number {
        min-width: 44px;
        height: 44px;
        font-size: 16px;
        border-radius: 12px;
        flex-shrink: 0;
    }

    .pagination-info {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding-top: 16px;
    }

    .page-info, .total-info {
        padding: 10px 20px;
        border-radius: 16px;
        font-size: 14px;
        width: 100%;
        max-width: 280px;
        text-align: center;
        box-sizing: border-box;
    }

    .results-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .results-count {
        align-self: flex-end;
    }
}

/* ===== 页脚声明样式 ===== */
.recipe-footer {
    margin-top: 40px;
    padding: 25px 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px;
    border-left: 3px solid rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.footer-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-left-color: rgba(102, 126, 234, 0.5);
}

.footer-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.footer-text {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* 移动端页脚优化 */
@media (max-width: 768px) {
    .recipe-footer {
        margin-top: 30px;
        padding: 20px 0;
    }

    .footer-content {
        padding: 0 15px;
        gap: 10px;
    }

    .footer-item {
        padding: 6px 12px;
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }

    .footer-text {
        font-size: 12px;
    }
}

/* ===== 超小屏幕优化 (320px以下) ===== */
@media (max-width: 320px) {
    .container {
        padding: 5px;
    }

    .search-section {
        padding: 10px;
        margin-bottom: 15px;
    }

    .search-box {
        gap: 8px;
    }

    .search-box input {
        padding: 12px 14px;
        font-size: 14px;
        max-width: calc(100% - 2px) !important;
    }

    .search-btn {
        padding: 12px 16px;
        font-size: 13px;
    }

    .action-buttons {
        gap: 6px;
    }

    .action-buttons button {
        padding: 6px 8px;
        font-size: 11px;
    }
}

/* 关键词 */
.recipe-keywords {
    margin-bottom: 30px;
}

.recipe-keywords h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
}

/* 食材列表 */
.recipe-ingredients {
    margin-bottom: 30px;
}

.recipe-ingredients h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.ingredients-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.ingredients-list li {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

/* 制作步骤 */
.recipe-steps {
    margin-bottom: 30px;
}

.recipe-steps h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.steps-list {
    counter-reset: step-counter;
    padding: 0;
}

.steps-list li {
    counter-increment: step-counter;
    margin-bottom: 20px;
    position: relative;
    padding-left: 60px;
}

.steps-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: #4CAF50;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    line-height: 1.6;
}

/* 相似菜谱推荐 */
.similar-recipes {
    margin-top: 30px;
}

.similar-recipes h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
}

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

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #333;
}

.start-btn {
    background: #4CAF50;
    color: white;
    margin-top: 20px;
}

.start-btn:hover {
    background: #45a049;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .recipes-grid {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .recipe-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .ingredients-list {
        grid-template-columns: 1fr;
    }
    
    .recipe-detail {
        padding: 20px;
    }
    
    .steps-list li {
        padding-left: 50px;
    }
    
    .steps-list li::before {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}
