/* ============================================================
   家用临期物品管理 - 公共样式 v2.0
   设计理念：温暖、品质感、家庭风格
   ============================================================ */

/* 安全区域适配 (刘海屏、底部横条) */
html {
    padding-top: env(safe-area-inset-top);
}

/* 全局温暖背景 */
body {
    background-color: #FFFBF7;
}

/* 底部导航安全区域 + 毛玻璃效果 */
nav.bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* 顶部导航毛玻璃效果 */
header.glass-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: none;
}

/* 主内容区底部留白 */
main.main-content {
    padding-bottom: 5rem;
}

/* 隐藏滚动条 */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ============================================================
   卡片样式 - 柔和阴影、大圆角
   ============================================================ */
.card-premium {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 12px 28px rgba(0, 0, 0, 0.06);
}

/* ============================================================
   状态指示器动画
   ============================================================ */

/* 临期预警 - 柔和呼吸灯 */
@keyframes warning-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
    }
}

.warning-pulse {
    animation: warning-glow 2.5s ease-in-out infinite;
}

/* 已过期 - 柔和呼吸灯 */
@keyframes expired-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
    }
}

.expired-pulse {
    animation: expired-glow 2s ease-in-out infinite;
}

/* ============================================================
   按钮样式
   ============================================================ */
.btn-primary {
    background: linear-gradient(135deg, #059669, #10B981);
    color: white;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(135deg, #DC2626, #EF4444);
    color: white;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    border-color: #D1D5DB;
    background: #F9FAFB;
}

/* ============================================================
   倒计时等宽数字
   ============================================================ */
.countdown-timer {
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   状态筛选标签 - 胶囊样式
   ============================================================ */
.status-filter {
    opacity: 0.55;
    transition: all 0.25s ease;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.status-filter.active {
    opacity: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transform: scale(1.02);
}

/* ============================================================
   文本截断
   ============================================================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   提醒横幅动画
   ============================================================ */
@keyframes slide-down {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-slide-down {
    animation: slide-down 0.4s ease-out;
}

@keyframes gentle-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.alert-shake {
    animation: gentle-shake 0.5s ease-in-out 1s 2;
}

/* ============================================================
   底部导航激活态
   ============================================================ */
nav.bottom-nav .nav-item.active {
    position: relative;
}

nav.bottom-nav .nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(135deg, #059669, #10B981);
}

/* ============================================================
   问候区域渐变
   ============================================================ */
.greeting-gradient {
    background: linear-gradient(135deg, #ECFDF5 0%, #FFF7ED 50%, #FEF3C7 100%);
    border: 1px solid rgba(5, 150, 105, 0.1);
}

/* ============================================================
   统计卡片
   ============================================================ */
.stat-card {
    background: white;
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    text-align: center;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-1px);
}

/* ============================================================
   表单输入框增强
   ============================================================ */
.input-premium {
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    padding: 0.625rem 0.875rem;
    transition: all 0.2s ease;
    background: white;
}

.input-premium:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
    outline: none;
}

/* ============================================================
   分类标签 - 胶囊式
   ============================================================ */
.category-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ============================================================
   对话框增强
   ============================================================ */
.dialog-overlay {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.dialog-content {
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   通知提示增强
   ============================================================ */
.notification-toast {
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* ============================================================
   空状态插画风格
   ============================================================ */
.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
