* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f7f8fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    min-height: 100vh;
    padding-bottom: 20px;
}

/* 头部搜索区域 */
.header-section {
    background: #fff;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.search-box {
    margin-bottom: 12px;
}

.difficulty-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #fff 100%);
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 8px;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #646566;
    white-space: nowrap;
}

.difficulty-filter .van-checkbox-group {
    display: flex;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

.difficulty-filter .van-checkbox {
    font-size: 14px;
}

.reset-icon {
    cursor: pointer;
    transition: transform 0.3s;
}

.reset-icon:hover {
    transform: rotate(180deg);
}

.reset-icon:active {
    transform: rotate(180deg) scale(0.9);
}

/* 搜索结果区域 */
.search-results {
    padding: 0;
}

.search-results .van-swipe-cell {
    border-bottom: 1px solid #ebedf0;
}

.search-results .van-swipe-cell:last-child {
    border-bottom: none;
}

.dish-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #fff;
    transition: background 0.3s;
}

.dish-item:hover {
    background: #f7f8fa;
}

.dish-info {
    flex: 1;
    margin-left: 8px;
}

.dish-name {
    font-size: 15px;
    font-weight: 500;
    color: #323233;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dish-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #969799;
    margin-top: 4px;
}

.ingredients {
    flex: 1;
    color: #646566;
}

.cook-time {
    white-space: nowrap;
    color: #646566;
}

.dish-actions {
    display: flex;
    gap: 12px;
    margin-left: 12px;
    align-items: center;
}

.dish-actions .van-icon {
    cursor: pointer;
    transition: opacity 0.3s;
}

.dish-actions .van-icon:hover {
    opacity: 0.7;
}

.dish-actions .van-icon:active {
    opacity: 0.5;
}

/* 功能按钮区 */
.action-buttons {
    padding: 16px;
    background: linear-gradient(180deg, #fff 0%, #f7f8fa 100%);
}

.action-buttons .van-button {
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.action-buttons .van-button:active {
    transform: scale(0.98);
}

/* 每周菜单 */
.weekly-menu-section {
    margin-top: 12px;
    background: #fff;
}

.day-menu {
    padding: 16px;
    background: #f7f8fa;
    min-height: 400px;
}

.meal-section {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.meal-section:last-child {
    margin-bottom: 0;
}

.meal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.meal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #323233;
    display: flex;
    align-items: center;
    gap: 6px;
}

.meal-header-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.meal-dishes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.van-swipe-cell {
    border-radius: 8px;
    overflow: hidden;
}

.empty-meal {
    text-align: center;
    padding: 24px;
    color: #969799;
    font-size: 14px;
}

.menu-dish-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 10px;
    transition: all 0.3s;
    border: 1px solid #e8eaed;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.menu-dish-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #ff976a 0%, #ffd700 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.menu-dish-item:hover {
    background: linear-gradient(135deg, #f8f9fb 0%, #f0f2f5 100%);
    border-color: #d0d3d9;
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.menu-dish-item:hover::before {
    opacity: 1;
}

/* 锁定状态 */
.menu-dish-item.is-locked {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f2 100%);
    border-color: #81c784;
    box-shadow: 0 2px 12px rgba(129, 199, 132, 0.15);
}

.menu-dish-item.is-locked::before {
    background: linear-gradient(180deg, #66bb6a 0%, #81c784 100%);
    opacity: 1;
}

.menu-dish-item.is-locked:hover {
    background: linear-gradient(135deg, #dcedc8 0%, #e8f5e9 100%);
    border-color: #66bb6a;
    box-shadow: 0 4px 16px rgba(102, 187, 106, 0.2);
}

/* 锁定指示器 */
.lock-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #66bb6a 0%, #81c784 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(102, 187, 106, 0.4);
    animation: lockPulse 2s infinite;
}

@keyframes lockPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.dish-left-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.dish-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff976a 0%, #ff6b6b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 151, 106, 0.3);
    transition: transform 0.3s;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.dish-icon-badge::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
}

.menu-dish-item:hover .dish-icon-badge {
    transform: scale(1.08) rotate(5deg);
}

/* 如果有图片 */
.dish-icon-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.dish-info-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.dish-name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dish-name-text {
    font-size: 15px;
    color: #323233;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.3s;
}

.dish-name-text:active {
    color: #1989fa;
}

.dish-meta-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #969799;
}

.difficulty-tag,
.time-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #f0f2f5;
    border-radius: 14px;
    color: #646566;
    font-size: 12px;
    font-weight: 500;
}

.difficulty-tag .van-icon {
    color: #ff976a;
}

.time-tag .van-icon {
    color: #1989fa;
}

.dish-item-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    align-items: center;
}

.dish-item-actions .van-icon {
    cursor: pointer;
    transition: opacity 0.3s;
}

.dish-item-actions .van-icon:hover {
    opacity: 0.7;
}

.dish-item-actions .van-icon:active {
    opacity: 0.5;
}

/* 购物清单 */
.shopping-list-container {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.shopping-list-container h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #323233;
    text-align: center;
}

.shopping-categories {
    margin-bottom: 80px;
}

.category-section {
    margin-bottom: 24px;
}

.category-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1989fa;
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 3px solid #1989fa;
}

.shopping-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

/* 响应式适配 */
@media (min-width: 768px) {
    #app {
        max-width: 768px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
    }

    .header-section,
    .meal-section,
    .menu-dish-item,
    .shopping-list-container {
        background: #2c2c2c;
        color: #e5e5e5;
    }

    .dish-name,
    .dish-name-text,
    .meal-header h3 {
        color: #e5e5e5;
    }

    .dish-meta,
    .empty-meal {
        color: #a0a0a0;
    }

    .day-menu {
        background: #1a1a1a;
    }

    .dish-item {
        background: #2c2c2c;
        border-bottom-color: #3a3a3a;
    }

    .menu-dish-item {
        background: #1a1a1a;
    }

    .menu-dish-item:hover {
        background: #3a3a3a;
    }
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dish-item,
.menu-dish-item {
    animation: fadeIn 0.3s ease-out;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 打印样式 */
@media print {
    .header-section,
    .action-buttons,
    .dish-actions,
    .dish-item-actions,
    .meal-header button,
    .van-tabs__nav {
        display: none !important;
    }

    .day-menu {
        page-break-inside: avoid;
    }

    .meal-section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

