/* ========== 冰箱卡片组件 ========== */
.fridge-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.fridge-card .icon {
    width: 56px;
    height: 56px;
    background: #d1fae5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.fridge-card .icon i {
    font-size: 24px;
    color: #10b981;
}

.fridge-card .info {
    flex: 1;
}

.fridge-card .name {
    font-weight: 600;
    color: #1f2937;
    font-size: 16px;
}

.fridge-card .meta {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.fridge-card .badge {
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
}

.fridge-card .arrow {
    color: #d1d5db;
}

/* ========== 食材卡片组件 ========== */
.food-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.food-card .image-wrapper {
    position: relative;
    width: 100%;
    height: 128px;
}

.food-card .image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.food-card .status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 9999px;
    color: white;
    font-size: 11px;
    font-weight: 600;
}

.food-card .content {
    padding: 12px;
}

.food-card .name {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.food-card .quantity {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.food-card .days {
    font-size: 12px;
    margin-top: 4px;
}

/* ========== 悬浮按钮 ========== */
.fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
    border: none;
}

.fab:active {
    transform: scale(0.95);
}

.fab i {
    font-size: 20px;
}

/* ========== 弹窗通用样式 ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media (min-width: 640px) {
    .modal-overlay {
        align-items: center;
    }
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 448px;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 640px) {
    .modal-content {
        border-radius: 24px;
    }
}

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

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 18px;
}

/* ========== 图片上传框 ========== */
.image-upload-box {
    width: 100%;
    height: 128px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-upload-box:active {
    border-color: #10b981;
    background: #ecfdf5;
}

.image-upload-box i {
    font-size: 28px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.image-upload-box span {
    font-size: 13px;
    color: #6b7280;
}

.image-preview {
    position: relative;
    width: 100%;
}

.image-preview img {
    width: 100%;
    height: 192px;
    object-fit: cover;
    border-radius: 12px;
}

.image-preview .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 12px;
}

/* ========== 分类标签 ========== */
.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.category-tab {
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.category-tab.active {
    background: #10b981;
    color: white;
}

.category-tab:not(.active) {
    background: #f1f5f9;
    color: #4b5563;
}

/* ========== 统计卡片 ========== */
.stats-card {
    border-radius: 16px;
    padding: 16px;
    color: white;
}

.stats-card .number {
    font-size: 24px;
    font-weight: 700;
}

.stats-card .label {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

/* ========== 登录页样式 ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.login-logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.login-logo i {
    font-size: 40px;
    color: #10b981;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 48px;
}

.login-form {
    width: 100%;
    max-width: 320px;
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.login-tabs {
    display: flex;
    margin-bottom: 24px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: none;
    color: #6b7280;
}

.login-tab.active {
    background: white;
    color: #10b981;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.login-input-group {
    margin-bottom: 16px;
}

.login-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 8px;
}

.login-input-group input {
    width: 100%;
    padding: 12px 16px;
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.login-input-group input:focus {
    border-color: #10b981;
    background: white;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.login-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
