/* 高级现代界面设计 - 全新样式 */
/* 基础设置与字体 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #ff8e71;
    --accent-color: #ffd166;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --bg-primary: #fff;
    --bg-secondary: #f9f9f9;
    --bg-gradient: linear-gradient(135deg, #fff6f6, #fff9f0);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.8);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

/* 页眉设计 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 100;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://picsum.photos/id/42/1000/300');
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    z-index: -1;
}

header h1 {
    margin: 0;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
}

header h1::after {
    content: "🍽️";
    font-size: 0.8em;
    position: absolute;
    margin-left: 10px;
    animation: float 3s ease-in-out infinite;
}

/* 主容器设计 */
.container {
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 20px;
}

/* 两栏布局 */
.main-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    position: relative;
}

/* 侧边栏设计 */
.sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
    align-self: start;
}

/* 卡片通用样式 */
.card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    margin-bottom: 30px;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.5rem;
    background: linear-gradient(to right, rgba(255, 107, 107, 0.1), transparent);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header h2, .card-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2::before, .card-header h3::before {
    font-size: 1.2em;
}

.card-body {
    padding: 1.5rem;
}

/* 主决策按钮区域 */
.main-decision {
    composes: card;
}

.main-decision .card-header h2::before {
    content: "🎯";
}

.decision-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1.2rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    width: 100%;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.decision-button:hover {
    box-shadow: 0 7px 20px rgba(255, 107, 107, 0.4);
    transform: translateY(-2px);
}

.decision-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
}

.decision-button::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.decision-button:hover::after {
    opacity: 1;
    transform: scale(1);
}

#recommendation-result {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    font-size: 1.3rem;
    color: var(--text-primary);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--accent-color);
}

/* 美食轮盘 */
.food-roulette {
    composes: card;
}

.food-roulette .card-header h2::before {
    content: "🎡";
}

.roulette-wheel-container {
    position: relative;
    padding: 20px;
    margin: 1.5rem auto;
    width: fit-content;
}

.roulette-wheel {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1), inset 0 0 60px rgba(255, 255, 255, 0.5);
    overflow: hidden;
    background: conic-gradient(
        #ff6b6b 0% 12.5%, 
        #ff8e71 12.5% 25%, 
        #ffd166 25% 37.5%, 
        #06d6a0 37.5% 50%, 
        #118ab2 50% 62.5%, 
        #073b4c 62.5% 75%, 
        #ef476f 75% 87.5%, 
        #ffd166 87.5% 100%
    );
    transition: transform 4s cubic-bezier(0.25, 0.1, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center;
}

.roulette-wheel.spinning {
    animation: spin 4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(1800deg);
    }
}

.roulette-wheel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    z-index: 1;
}

.roulette-wheel::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.roulette-display span {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    z-index: 3;
    position: relative;
    font-weight: 600;
}

.roulette-pointer {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid var(--primary-color);
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    filter: drop-shadow(0 3px 5px rgba(0,0,0,0.2));
}

.roulette-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    width: 100%;
    letter-spacing: 1px;
}

.roulette-button:hover {
    box-shadow: 0 7px 20px rgba(255, 107, 107, 0.4);
    transform: translateY(-2px);
}

.roulette-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
}

#roulette-result {
    margin-top: 1.5rem;
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 500;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border-left: 4px solid var(--accent-color);
}

/* 主内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 美食轮播 */
.food-carousel {
    composes: card;
}

.food-carousel .card-header h2::before {
    content: "🍳";
}

.carousel-container {
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    max-width: 700px;
    height: auto;
}

.carousel-slide {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    min-width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    height: 350px;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    display: block;
    transition: transform 0.5s ease;
    object-fit: cover;
}

.carousel-item:hover img {
    transform: scale(1.05);
}

.carousel-item::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel-item:hover::after {
    opacity: 1;
}

.carousel-dots {
    text-align: center;
    padding: 1rem 0 0.5rem;
}

.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 6px;
    background-color: #ddd;
    border-radius: 50%;
    display: inline-block;
    transition: all var(--transition-normal);
}

.dot:hover {
    background-color: var(--secondary-color);
    transform: scale(1.2);
}

.dot.active {
    background-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
}

/* 内容区块通用样式 */
.section {
    composes: card;
}

/* 智能推荐系统 */
#smart-recommendation .card-header h2::before {
    content: "✨";
}

/* 标签筛选 */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.filter-tags strong {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-tag {
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 30px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-tag:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-tag.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
}

#filtered-recommendations-container {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all var(--transition-normal);
}

#filtered-recommendations-container h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: 600;
    position: relative;
    display: inline-block;
}

#filtered-recommendations-container ul {
    list-style: none;
    padding: 0;
}

#filtered-recommendations-container li {
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    padding-left: 2rem;
    border-left: 3px solid var(--accent-color);
}

#filtered-recommendations-container li::before {
    content: "🍽️";
    position: absolute;
    left: 0.7rem;
    top: 1rem;
    color: var(--primary-color);
}

#filtered-recommendations-container li:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

#filtered-recommendations-container li strong {
    color: var(--primary-color);
    font-size: 1.1rem;
}

#filtered-recommendations-container li small {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 30px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

#filtered-recommendations-container li span {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

#filtered-recommendations-container .no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* 冰箱余料模式 */
.fridge-ingredients {
    margin-top: 1.5rem;
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid #06d6a0;
}

.fridge-ingredients h3 {
    color: #06d6a0;
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fridge-ingredients h3::before {
    content: "🧊";
}

.fridge-ingredients label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.fridge-ingredients textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
    transition: all var(--transition-normal);
    background: white;
}

.fridge-ingredients textarea:focus {
    outline: none;
    border-color: #06d6a0;
    box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.2);
}

.fridge-ingredients button {
    background: linear-gradient(135deg, #06d6a0, #1b9aaa);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(6, 214, 160, 0.3);
    margin-top: 1rem;
    width: 100%;
}

.fridge-ingredients button:hover {
    box-shadow: 0 7px 20px rgba(6, 214, 160, 0.4);
    transform: translateY(-2px);
}

.fridge-ingredients button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(6, 214, 160, 0.3);
}

#recipe-suggestion {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border-left: 4px solid #06d6a0;
}

#recipe-suggestion:hover {
    box-shadow: var(--shadow-md);
}

#recipe-suggestion p strong {
    color: #06d6a0;
    font-weight: 600;
}

/* 饮食计划体系 */
#diet-plan .card-header h2::before {
    content: "📅";
}

.weekly-plan-placeholder {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 1.5rem;
}

.plan-day {
    background: white;
    border-radius: var(--border-radius-sm);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.plan-day::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.plan-day:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.plan-day h4 {
    margin-top: 0;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.plan-day p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.8;
}

/* 页脚设计 */
footer {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    position: relative;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://picsum.photos/id/42/1000/300');
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    z-index: 0;
}

footer p {
    position: relative;
    z-index: 1;
    margin: 0;
    font-weight: 300;
    letter-spacing: 1px;
}

/* 漂浮食物动画 */
.floating-food {
    position: fixed;
    font-size: 1.5rem;
    color: var(--primary-color);
    opacity: 0.7;
    pointer-events: none;
    z-index: 100;
    text-shadow: 0 2px 5px rgba(0,0,0,0.1);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.decision-button.wiggle-effect {
    animation: wiggle 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 1100px) {
    .main-layout {
        grid-template-columns: 280px 1fr;
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .main-decision, .food-roulette {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
        margin: 20px auto;
    }
    
    .sidebar {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .weekly-plan-placeholder {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 10px;
        margin: 15px auto;
    }
    
    .card-header h2, .card-header h3 {
        font-size: 1.3rem;
    }
    
    .decision-button {
        font-size: 1.2rem;
        padding: 1rem;
    }
    
    #recommendation-result {
        font-size: 1.1rem;
        padding: 1rem;
    }
    
    .filter-tag {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .roulette-wheel {
        width: 200px;
        height: 200px;
    }
} 