/* ===== 基础样式重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF6B6B;
    --primary-hover: #FF5252;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --meat-color: #E74C3C;
    --veg-color: #27AE60;
    --bg-color: #FFF9F0;
    --card-bg: #FFFFFF;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --text-light: #95A5A6;
    --border-color: #F0E6D8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* ===== 美食背景装饰 ===== */
.food-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-food {
    position: absolute;
    font-size: 3rem;
    opacity: 0.08;
    animation: float 20s infinite ease-in-out;
    filter: blur(1px);
}

.floating-food:nth-child(2n) {
    animation-delay: -5s;
    animation-duration: 25s;
}

.floating-food:nth-child(3n) {
    animation-delay: -10s;
    animation-duration: 30s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(20px) rotate(-5deg);
    }
}

/* ===== 头部样式 ===== */
.header {
    position: relative;
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 50%, #FF6B6B 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    color: white;
    overflow: hidden;
}

.header-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-icon {
    font-size: 52px;
    animation: bounce 2s infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
    margin-bottom: 25px;
}

/* ===== 拍照识图区域 ===== */
.camera-section {
    position: relative;
    z-index: 1;
    margin-top: 20px;
}

.btn-camera {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 36px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.btn-camera:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.camera-icon {
    font-size: 1.5rem;
}

.camera-hint {
    margin-top: 12px;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* ===== 食材选择区域 ===== */
.ingredients-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.title-icon {
    font-size: 2rem;
}

.section-title h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.title-hint {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-left: auto;
}

/* ===== 食材选择器布局 ===== */
.ingredients-selector {
    display: grid;
    grid-template-columns: 1fr 280px 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.ingredient-column {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 500px;
}

.meat-column {
    border-color: rgba(231, 76, 60, 0.2);
}

.meat-column .column-header {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%);
}

.veg-column {
    border-color: rgba(39, 174, 96, 0.2);
}

.veg-column .column-header {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1) 0%, rgba(39, 174, 96, 0.05) 100%);
}

.column-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.column-icon {
    font-size: 1.5rem;
}

.column-header h3 {
    font-size: 1.1rem;
    flex: 1;
}

.column-count {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.column-search {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.column-search input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.column-search input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.ingredient-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.ingredient-list::-webkit-scrollbar {
    width: 6px;
}

.ingredient-list::-webkit-scrollbar-track {
    background: transparent;
}

.ingredient-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.ingredient-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 6px;
}

.ingredient-item:hover {
    background: rgba(255, 107, 107, 0.08);
}

.ingredient-item.selected {
    background: var(--primary-color);
    color: white;
}

.ingredient-item .emoji {
    font-size: 1.4rem;
}

.ingredient-item .name {
    flex: 1;
    font-size: 0.95rem;
}

.ingredient-item .check {
    opacity: 0;
    transition: var(--transition);
}

.ingredient-item.selected .check {
    opacity: 1;
}

/* ===== 已选食材面板 ===== */
.selected-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.btn-clear {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-clear:hover {
    background: rgba(231, 76, 60, 0.1);
    border-color: var(--meat-color);
    color: var(--meat-color);
}

.selected-category {
    margin-bottom: 15px;
}

.category-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.selected-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
}

.selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
}

.selected-chip.meat {
    background: rgba(231, 76, 60, 0.12);
    color: var(--meat-color);
}

.selected-chip.veg {
    background: rgba(39, 174, 96, 0.12);
    color: var(--veg-color);
}

.selected-chip .remove {
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
}

.selected-chip .remove:hover {
    opacity: 1;
    transform: scale(1.2);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== 生成按钮 ===== */
.btn-generate {
    margin-top: auto;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.btn-generate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

/* ===== 快速标签区域 ===== */
.quick-tags-section {
    padding-top: 25px;
    border-top: 2px solid var(--border-color);
}

.quick-tags-section h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-tag {
    padding: 10px 18px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.quick-tag.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ===== 加载动画 ===== */
.loading {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.loading-spinner {
    width: 70px;
    height: 70px;
    border: 5px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

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

.loading p {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 500;
}

.loading-sub {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 8px;
}

/* ===== 菜谱区域 ===== */
.recipes-section {
    animation: fadeIn 0.5s ease;
}

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

.section-header {
    background: var(--card-bg);
    padding: 25px 30px;
    border-radius: var(--radius-lg);
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
}

.section-header h2 {
    font-size: 1.5rem;
    margin-bottom: 18px;
    color: var(--text-primary);
}

#recipeCount {
    color: var(--primary-color);
}

/* ===== 分类标签 ===== */
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tab {
    padding: 10px 22px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
    color: var(--text-secondary);
}

.tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

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

/* ===== 菜谱卡片 ===== */
.recipe-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.recipe-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5rem;
    position: relative;
    overflow: hidden;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-image .placeholder-emoji {
    z-index: 1;
}

.recipe-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}

.recipe-category {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    z-index: 1;
}

.recipe-time {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    z-index: 1;
}

.recipe-content {
    padding: 22px;
}

.recipe-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.recipe-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-ingredients {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.recipe-ingredient {
    padding: 5px 11px;
    background: var(--bg-color);
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.recipe-ingredient.matched {
    background: rgba(78, 205, 196, 0.15);
    color: #2A9D8F;
}

.recipe-match {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.match-score {
    color: var(--primary-color);
    font-weight: 700;
}

/* ===== 弹窗样式 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    max-width: 750px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.preview-content {
    max-width: 500px;
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
}

.modal-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    position: relative;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 32px;
}

.modal-title {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.modal-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.modal-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-section {
    margin-bottom: 28px;
}

.modal-section h3 {
    font-size: 1.15rem;
    margin-bottom: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.ingredient-item-detail {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.ingredient-item-detail.matched {
    background: rgba(78, 205, 196, 0.12);
    border-left: 3px solid var(--secondary-color);
}

.ingredient-item-detail .name {
    color: var(--text-primary);
}

.ingredient-item-detail .amount {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.step-item {
    display: flex;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
}

.step-item:last-child {
    border-bottom: none;
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    color: var(--text-primary);
    line-height: 1.8;
    padding-top: 6px;
}

.tips-box {
    background: linear-gradient(135deg, rgba(255, 230, 109, 0.15) 0%, rgba(255, 230, 109, 0.05) 100%);
    border-left: 4px solid var(--accent-color);
    padding: 18px 22px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.tips-box h3 {
    color: #D4A017;
    margin-bottom: 10px;
}

.tips-box p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ===== 图片预览弹窗 ===== */
.preview-body {
    padding: 28px;
}

.preview-body h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-align: center;
}

#previewImage {
    width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.recognition-result {
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 20px;
}

.recognition-result h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.recognized-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recognized-item {
    padding: 8px 14px;
    background: white;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 2px solid var(--border-color);
}

.preview-actions {
    display: flex;
    gap: 12px;
}

.preview-actions button {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-confirm:hover {
    background: var(--primary-hover);
}

.btn-retake {
    background: var(--bg-color);
    color: var(--text-secondary);
}

.btn-retake:hover {
    background: var(--border-color);
}

/* ===== 社交媒体食谱推荐区域 ===== */
.social-recipes-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: var(--radius-lg);
    padding: 40px 35px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
}

.social-header {
    text-align: center;
    margin-bottom: 30px;
}

.social-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.social-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 平台切换标签 */
.social-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.social-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    color: var(--text-secondary);
}

.social-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.social-tab.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-md);
}

.platform-icon {
    font-size: 1.2rem;
}

/* 平台内容区域 */
.social-content {
    min-height: 400px;
}

.platform-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.platform-content.active {
    display: block;
}

/* 视频卡片网格 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.video-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #000;
}

.video-thumbnail.xiaohongshu-style {
    border-radius: 12px 12px 0 0;
}

.video-thumbnail.douyin-style {
    border-radius: 8px 8px 0 0;
}

.video-thumbnail.bilibili-style {
    border-radius: 6px 6px 0 0;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .cover-image {
    transform: scale(1.05);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 107, 107, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    z-index: 3;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.play-button.douyin-play {
    background: rgba(254, 44, 85, 0.9);
    width: 45px;
    height: 45px;
    font-size: 1rem;
}

.play-button.bilibili-play {
    background: rgba(251, 114, 153, 0.9);
    width: 55px;
    height: 55px;
    font-size: 1.3rem;
}

.video-card:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 107, 107, 1);
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 2;
}

.video-placeholder {
    font-size: 4rem;
    z-index: 1;
}

.video-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 14px;
    background: rgba(255, 107, 107, 0.95);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.video-tag.douyin-tag {
    background: rgba(0, 0, 0, 0.8);
}

.video-tag.bilibili-tag {
    background: rgba(251, 114, 153, 0.95);
}

.video-views {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    z-index: 2;
}

.video-info {
    padding: 20px;
}

.video-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.author {
    font-size: 0.85rem;
    color: var(--text-light);
}

.likes {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* 社交媒体区域底部 */
.social-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

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

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 50px 20px;
    position: relative;
    z-index: 1;
}

.footer-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.footer-main {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.footer-sub {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ===== 工具类 ===== */
.hidden {
    display: none !important;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results p:first-child {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .ingredients-selector {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    .selected-panel {
        grid-column: 1 / -1;
        order: -1;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 12px;
    }

    .header {
        padding: 35px 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .logo-icon {
        font-size: 40px;
    }

    .btn-camera {
        padding: 14px 28px;
        font-size: 1rem;
    }

    .ingredients-section {
        padding: 22px;
    }

    .ingredients-selector {
        grid-template-columns: 1fr;
    }

    .ingredient-column {
        max-height: 350px;
    }

    .selected-panel {
        order: -1;
    }

    .quick-tags {
        gap: 8px;
    }

    .quick-tag {
        padding: 8px 14px;
        font-size: 0.9rem;
    }

    .recipes-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .filter-tabs {
        gap: 8px;
    }

    .tab {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }

    .modal-info {
        padding: 22px;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    .ingredients-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .section-title h2 {
        font-size: 1.2rem;
    }

    .title-hint {
        display: none;
    }

    .recipe-image {
        height: 180px;
    }

    .preview-actions {
        flex-direction: column;
    }
}

/* ===== 打印样式 ===== */
@media print {
    .header, .ingredients-section, .filter-tabs, .btn-generate, 
    .modal-close, .camera-section, .footer, .food-background {
        display: none !important;
    }

    .recipe-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ===== PWA 相关样式 ===== */

/* 离线模式提示 */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

body.offline .offline-indicator {
    transform: translateY(0);
}

.offline-indicator::before {
    content: '📡';
    font-size: 16px;
}

/* PWA 安装按钮 */
.pwa-install-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(100px);
    pointer-events: none;
}

.pwa-install-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.pwa-install-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.pwa-install-btn:active {
    transform: translateY(0) scale(0.98);
}

.pwa-install-btn::before {
    content: '📱';
    font-size: 18px;
}

/* PWA 安装提示弹窗 */
.pwa-install-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pwa-install-modal.active {
    opacity: 1;
    visibility: visible;
}

.pwa-install-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.pwa-install-modal.active .pwa-install-content {
    transform: scale(1);
}

.pwa-install-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.pwa-install-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pwa-install-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.pwa-install-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.pwa-install-actions {
    display: flex;
    gap: 12px;
}

.pwa-install-actions button {
    flex: 1;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-install-confirm {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
}

.btn-install-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.btn-install-cancel {
    background: var(--bg-color);
    color: var(--text-secondary);
}

.btn-install-cancel:hover {
    background: var(--border-color);
}

/* iOS Safari 安装提示 */
.ios-install-hint {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 10002;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.ios-install-hint.active {
    transform: translateY(0);
}

.ios-install-hint-content {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.ios-install-hint-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
}

.ios-install-hint-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ios-install-hint-text {
    flex: 1;
}

.ios-install-hint-text h4 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}

.ios-install-hint-text p {
    font-size: 14px;
    color: var(--text-secondary);
}

.ios-install-steps {
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.ios-install-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

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

.ios-install-step-icon {
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.ios-install-hint-close {
    width: 100%;
    padding: 14px;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ios-install-hint-close:hover {
    opacity: 0.9;
}

/* 添加到主屏幕提示 (Android Chrome) */
.add-to-homescreen-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 10002;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.add-to-homescreen-banner.active {
    transform: translateY(0);
}

.add-to-homescreen-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.add-to-homescreen-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.add-to-homescreen-text {
    flex: 1;
}

.add-to-homescreen-text h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.add-to-homescreen-text p {
    font-size: 13px;
    color: var(--text-secondary);
}

.add-to-homescreen-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-to-homescreen-btn:hover {
    background: var(--primary-hover);
}

.add-to-homescreen-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.add-to-homescreen-close:hover {
    color: var(--text-primary);
}

/* 响应式调整 */
@media (max-width: 480px) {
    .pwa-install-btn {
        bottom: 16px;
        right: 16px;
        left: 16px;
        justify-content: center;
    }
    
    .pwa-install-content {
        padding: 24px;
    }
    
    .pwa-install-title {
        font-size: 20px;
    }
    
    .ios-install-hint {
        padding: 16px;
    }
}

/* 安全区域适配 (iPhone X+) */
@supports (padding-top: env(safe-area-inset-top)) {
    .offline-indicator {
        padding-top: calc(12px + env(safe-area-inset-top));
    }
    
    .pwa-install-btn {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .ios-install-hint {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .add-to-homescreen-banner {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* 独立模式下的样式优化 (已安装为PWA) */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }
    
    .header {
        padding-top: calc(20px + env(safe-area-inset-top));
    }
    
    /* 隐藏浏览器UI相关的元素 */
    .pwa-install-btn,
    .add-to-homescreen-banner,
    .ios-install-hint {
        display: none !important;
    }
}

/* 全屏模式 */
@media (display-mode: fullscreen) {
    body {
        padding: 0;
    }
}