/* GAG Recipes - 食材页面布局层次感增强 */

/* === 页面整体布局优化 === */
.ingredients-page {
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
    min-height: 100vh;
    padding: var(--space-8) 0;
}

/* === 搜索和过滤区域增强 === */
.search-filter-section {
    background: white;
    border-radius: var(--border-radius-2xl);
    padding: var(--space-8);
    margin-bottom: var(--space-8);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.8);
}

.search-container {
    position: relative;
    margin-bottom: var(--space-6);
}

.search-input {
    width: 100%;
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-14);
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-xl);
    font-size: var(--font-size-lg);
    font-weight: 500;
    background: var(--gray-50);
    transition: all 0.3s ease;
    
    /* 文字清晰度 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--gray-900);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    background: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.search-icon {
    position: absolute;
    left: var(--space-5);
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    color: var(--gray-400);
    pointer-events: none;
}

/* 过滤器按钮网格 */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.filter-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    
    /* 文字增强 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.filter-select {
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-base);
    font-weight: 500;
    background: white;
    transition: all 0.2s ease;
    
    /* 文字清晰度 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--gray-800);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* === 页面标题区域增强 === */
.page-hero {
    text-align: center;
    margin-bottom: var(--space-12);
    padding: var(--space-8) 0;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--secondary-500) 100%);
    color: white;
    border-radius: var(--border-radius-2xl);
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.page-hero h1 {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    margin-bottom: var(--space-4);
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    
    /* 文字增强 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page-hero p {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    line-height: var(--line-height-relaxed);
}

/* === 食材信息卡片设计 === */
.ingredient-card {
    background: white;
    border-radius: var(--border-radius-2xl);
    padding: var(--space-8);
    margin-bottom: var(--space-8);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.8);
    transition: all 0.3s ease;
}

.ingredient-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 食材头部信息 */
.ingredient-header {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 2px solid var(--gray-100);
}

.ingredient-image {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-xl);
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border: 3px solid white;
    position: relative;
}

.ingredient-title {
    flex: 1;
}

.ingredient-title h2 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
    
    /* 文字增强 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.ingredient-subtitle {
    font-size: var(--font-size-lg);
    color: var(--gray-600);
    font-weight: 500;
    line-height: var(--line-height-relaxed);
    
    /* 文字清晰度 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === 数据统计卡片网格 === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-radius: var(--border-radius-xl);
    padding: var(--space-6);
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-500), var(--secondary-500));
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.stat-card.primary {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
    border-color: var(--primary-200);
}

.stat-card.secondary {
    background: linear-gradient(135deg, var(--secondary-50) 0%, var(--secondary-100) 100%);
    border-color: var(--secondary-200);
}

.stat-card.accent {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: var(--accent-300);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-300);
}

.stat-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-4);
    background: white;
    border-radius: var(--border-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: var(--font-size-2xl);
}

.stat-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
    
    /* 文字增强 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
    
    /* 文字增强 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.stat-description {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    font-weight: 500;
    line-height: var(--line-height-relaxed);
}

/* === 内容分区布局 === */
.content-sections {
    display: grid;
    gap: var(--space-8);
}

.content-section {
    background: white;
    border-radius: var(--border-radius-2xl);
    padding: var(--space-8);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(229, 231, 235, 0.8);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--gray-100);
}

.section-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-xl);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.section-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--gray-900);
    
    /* 文字增强 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.section-content {
    line-height: var(--line-height-relaxed);
    color: var(--gray-700);
    font-size: var(--font-size-base);
    font-weight: 500;
    
    /* 文字清晰度 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === 用途列表增强 === */
.usage-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.usage-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    background: var(--gray-50);
    border-radius: var(--border-radius-lg);
    border-left: 4px solid var(--primary-500);
    transition: all 0.2s ease;
}

.usage-item:hover {
    background: var(--primary-50);
    transform: translateX(4px);
}

.usage-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-600);
    font-size: var(--font-size-lg);
}

.usage-text {
    flex: 1;
    font-weight: 500;
    color: var(--gray-800);
    
    /* 文字清晰度 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === 稀有度标签 === */
.rarity-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    
    /* 文字增强 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 在食材图片容器内的稀有度标签定位 */
.ingredient-image .rarity-badge,
.ingredient-showcase .rarity-badge {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    z-index: 10;
    font-size: var(--font-size-xs);
    padding: var(--space-1) var(--space-2);
    min-width: auto;
}

/* 确保图片容器具有相对定位 */
.ingredient-showcase {
    position: relative;
    display: inline-block;
}

/* 传奇食材头部布局特殊处理 */
.legendary-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.legendary-header .rarity-badge {
    position: static;
    margin-left: auto;
}

.rarity-badge.common {
    background: linear-gradient(135deg, #ffffff, #f9f9f9);
    color: #64748b;
    border: 2px solid #cbd5e1;
}

.rarity-badge.rare {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    border: 2px solid #3b82f6;
}

.rarity-badge.epic {
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
    color: #7c3aed;
    border: 2px solid #8b5cf6;
}

.rarity-badge.prismatic {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    color: #ea580c;
    border: 2px solid #f97316;
}

.rarity-badge.divine {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
    border: 2px solid #f59e0b;
}

/* === 响应式设计 === */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ingredient-header {
        flex-direction: column;
        text-align: center;
        gap: var(--space-4);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .page-hero h1 {
        font-size: var(--font-size-3xl);
    }
    
    .ingredient-card,
    .content-section {
        padding: var(--space-6);
    }
}

@media (max-width: 640px) {
    .ingredients-page {
        padding: var(--space-4) 0;
    }
    
    .search-filter-section,
    .ingredient-card,
    .content-section {
        padding: var(--space-4);
        margin-bottom: var(--space-6);
    }
    
    .page-hero {
        padding: var(--space-6) 0;
        margin-bottom: var(--space-8);
    }
    
    .ingredient-image {
        width: 60px;
        height: 60px;
    }
    
    .ingredient-title h2 {
        font-size: var(--font-size-2xl);
    }
    
    .stat-value {
        font-size: var(--font-size-2xl);
    }
}

/* === 高对比度支持 === */
@media (prefers-contrast: high) {
    .ingredient-card,
    .content-section,
    .stat-card {
        border: 3px solid #000000;
    }
    
    .section-title,
    .ingredient-title h2 {
        color: #000000;
        text-shadow: none;
    }
    
    .stat-value {
        color: #000000;
        text-shadow: none;
    }
}

/* === 减少动画偏好 === */
@media (prefers-reduced-motion: reduce) {
    .ingredient-card,
    .content-section,
    .stat-card,
    .usage-item {
        transition: none;
        transform: none;
    }
    
    .ingredient-card:hover,
    .content-section:hover,
    .stat-card:hover,
    .usage-item:hover {
        transform: none;
    }
}
