/* ===== 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #FF9F43;
    --primary-dark: #EE8B2C;
    --primary-light: #FFF3E0;
    --bg: #F5F5F5;
    --white: #FFFFFF;
    --text: #2D3436;
    --text-light: #636E72;
    --text-lighter: #B2BEC3;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-lg: 16px;
    --nav-height: 60px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    padding-bottom: calc(var(--nav-height) + 20px);
}

/* ===== 顶部 ===== */
.header {
    background: linear-gradient(135deg, #FFD89B 0%, #FF9F43 100%);
    padding: 24px 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 24px 24px;
}

.greeting-text {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.greeting-sub {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    margin-top: 4px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
}

/* ===== 搜索框 ===== */
.search-bar {
    padding: 16px 20px 8px;
    margin-top: -10px;
}

.search-input-wrap {
    background: var(--white);
    border-radius: 25px;
    display: flex;
    align-items: center;
    padding: 4px 4px 4px 16px;
    box-shadow: var(--shadow);
}

.search-icon {
    font-size: 16px;
    margin-right: 8px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text);
    background: transparent;
}

.search-input::placeholder {
    color: var(--text-lighter);
}

.ai-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.ai-btn:active {
    transform: scale(0.95);
}

/* ===== 快捷标签 ===== */
.quick-tags {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.quick-tags::-webkit-scrollbar { display: none; }

.tag {
    flex-shrink: 0;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-light);
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.tag.active, .tag:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(255,159,67,0.4);
}

/* ===== 场景推荐 ===== */
.scene-section {
    padding: 8px 20px 16px;
}

.section-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 14px;
}

.scene-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.scene-card {
    border-radius: var(--radius-lg);
    padding: 20px 14px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.scene-card:active {
    transform: scale(0.97);
}

.scene-card .scene-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.scene-card .scene-name {
    font-size: 15px;
    font-weight: 600;
}

.scene-card .scene-desc {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
}

.scene-card::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
}

/* ===== 热门推荐 ===== */
.popular-section {
    padding: 8px 20px 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.see-more {
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
}

.food-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.food-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    transition: transform 0.2s;
    cursor: pointer;
}

.food-card:active {
    transform: scale(0.98);
}

.food-img {
    width: 110px;
    min-height: 110px;
    object-fit: cover;
    flex-shrink: 0;
}

.food-info {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.food-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.food-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.food-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary-dark);
}

.food-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.food-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
}

.food-rating .star {
    color: #FFC107;
}

.food-price {
    font-size: 15px;
    color: var(--primary);
    font-weight: 700;
}

.food-price .unit {
    font-size: 11px;
    font-weight: 400;
}

.food-like {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 2;
}

.food-like:active { transform: scale(1.3); }

.food-like.liked { color: #FF6B6B; }

.food-card .food-img-wrap {
    position: relative;
    flex-shrink: 0;
}

/* ===== AI弹窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 24px 24px 0 0;
    padding: 24px 20px 32px;
    width: 100%;
    max-width: 480px;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.ai-preferences {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.pref-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.pref-item input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.pref-item:has(input:checked) {
    background: var(--primary-light);
}

.ai-go-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.ai-go-btn:active { transform: scale(0.97); }

.ai-result {
    margin-top: 16px;
    display: none;
}

.ai-result.show { display: block; }

.ai-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.ai-result-emoji {
    font-size: 28px;
    flex-shrink: 0;
}

.ai-result-text h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.ai-result-text p {
    font-size: 12px;
    color: var(--text-light);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bg);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover { background: var(--text-lighter); }

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--nav-height);
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
    z-index: 50;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.3s;
}

.nav-icon { font-size: 22px; }
.nav-label { font-size: 11px; color: var(--text-lighter); }

.nav-item.active .nav-label { color: var(--primary); font-weight: 600; }

/* ===== 搜索结果无内容 ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-lighter);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p { font-size: 14px; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 200;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.7s;
    pointer-events: none;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ===== 返回主页 ===== */
.back-home {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 60;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.back-home:active { transform: scale(0.9); }

/* ===== 响应式 ===== */
@media (min-width: 481px) {
    .app-container {
        border-left: 1px solid #eee;
        border-right: 1px solid #eee;
    }
}
