/**
 * 采购导航专用样式
 * 零售采购专属导航网站 - 价格智能+采购效率
 * Version: 1.0.0
 */

/* ========== 全局CSS变量 ========== */
:root {
    --procurement-primary: #667eea;
    --procurement-secondary: #764ba2;
    --procurement-success: #22c55e;
    --procurement-warning: #f59e0b;
    --procurement-danger: #ef4444;
    --procurement-info: #3b82f6;
    
    /* 品类颜色 */
    --color-grain-oil: #f4a460;
    --color-fresh: #32cd32;
    --color-meat: #ff6b6b;
    --color-import: #4169e1;
    
    /* 间距 */
    --section-padding: 24px;
    --card-radius: 12px;
    --card-radius-lg: 16px;
}

/* ========== 采购模块通用样式 ========== */
.procurement-section,
.price-monitor-section,
.daily-briefing-section,
.dashboard-section {
    margin-bottom: 24px;
}

/* ========== 渐变按钮 ========== */
.btn-gradient-primary {
    background: linear-gradient(135deg, var(--procurement-primary) 0%, var(--procurement-secondary) 100%);
    border: none;
    color: #fff;
    transition: all 0.3s ease;
}

.btn-gradient-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    color: #fff;
}

/* ========== 脉冲动画徽章 ========== */
.badge-pulse {
    position: relative;
}

.badge-pulse::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
}

/* ========== 价格变化标识 ========== */
.price-up {
    color: var(--procurement-danger);
}

.price-down {
    color: var(--procurement-success);
}

.price-up::before {
    content: '↑';
    margin-right: 4px;
}

.price-down::before {
    content: '↓';
    margin-right: 4px;
}

/* ========== 卡片悬浮效果 ========== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* ========== 图标容器 ========== */
.icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.icon-box-sm {
    width: 32px;
    height: 32px;
}

.icon-box-md {
    width: 40px;
    height: 40px;
}

.icon-box-lg {
    width: 48px;
    height: 48px;
}

.icon-box-xl {
    width: 56px;
    height: 56px;
}

/* ========== 数据源卡片动画 ========== */
.price-source-card,
.tool-item,
.quick-link-card,
.opportunity-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 分类标签颜色 ========== */
.tag-grain-oil {
    background: rgba(244, 164, 96, 0.1);
    color: var(--color-grain-oil);
    border: 1px solid rgba(244, 164, 96, 0.3);
}

.tag-fresh {
    background: rgba(50, 205, 50, 0.1);
    color: var(--color-fresh);
    border: 1px solid rgba(50, 205, 50, 0.3);
}

.tag-meat {
    background: rgba(255, 107, 107, 0.1);
    color: var(--color-meat);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.tag-import {
    background: rgba(65, 105, 225, 0.1);
    color: var(--color-import);
    border: 1px solid rgba(65, 105, 225, 0.3);
}

/* ========== 紧急程度标识 ========== */
.urgency-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.urgency-high {
    background: var(--procurement-danger);
    box-shadow: 0 0 8px var(--procurement-danger);
}

.urgency-medium {
    background: var(--procurement-warning);
}

.urgency-low {
    background: var(--procurement-success);
}

/* ========== 数字计数器动画 ========== */
.stat-counter {
    font-variant-numeric: tabular-nums;
}

/* ========== 加载骨架屏 ========== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========== 采购日历样式 ========== */
.procurement-calendar {
    background: var(--card-bg, #fff);
    border-radius: var(--card-radius);
    padding: 16px;
}

.procurement-calendar .calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.procurement-calendar .calendar-date {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #333);
}

.procurement-calendar .calendar-weekday {
    font-size: 14px;
    color: var(--text-muted, #999);
}

/* ========== 滚动条美化 ========== */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ========== 暗色模式适配 ========== */
.io-black-mode {
    --procurement-primary: #8b9eff;
    --procurement-secondary: #a78bfa;
}

.io-black-mode .skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
    background-size: 200% 100%;
}

.io-black-mode .custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

.io-black-mode .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========== 响应式断点 ========== */
@media (max-width: 1200px) {
    :root {
        --section-padding: 20px;
    }
}

@media (max-width: 992px) {
    :root {
        --section-padding: 16px;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 12px;
        --card-radius: 10px;
        --card-radius-lg: 12px;
    }
    
    .price-monitor-section,
    .procurement-section,
    .daily-briefing-section,
    .dashboard-section {
        margin-left: -8px;
        margin-right: -8px;
        border-radius: 0;
    }
}

/* ========== 打印样式 ========== */
@media print {
    .procurement-section,
    .price-monitor-section,
    .daily-briefing-section,
    .dashboard-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .badge-pulse::after {
        display: none;
    }
}

/* ========== 无障碍辅助 ========== */
@media (prefers-reduced-motion: reduce) {
    .hover-lift,
    .price-source-card,
    .tool-item,
    .quick-link-card,
    .opportunity-item {
        transition: none;
    }
    
    .badge-pulse::after,
    .skeleton {
        animation: none;
    }
}

/* ========== 高对比度模式 ========== */
@media (prefers-contrast: high) {
    .price-source-card,
    .tool-item,
    .quick-link-card {
        border-width: 2px;
    }
}

/* ========== 侧边栏采购专区样式 ========== */
.sidebar-section-header {
    padding: 8px 18px !important;
    margin-top: 8px;
}

.sidebar-section-header .section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(178, 184, 190, 0.6);
    display: block;
    line-height: 1.5;
}

.sidebar-section-header:hover {
    background: transparent !important;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 18px;
}

/* 采购专区图标颜色增强 */
.sidebar-menu-inner .sidebar-item a .fa-newspaper {
    color: #667eea;
}

.sidebar-menu-inner .sidebar-item a .fa-chart-line {
    color: #f59e0b;
}

.sidebar-menu-inner .sidebar-item a .fa-toolbox {
    color: #3b82f6;
}

.sidebar-menu-inner .sidebar-item:hover a .fa-newspaper,
.sidebar-menu-inner .sidebar-item:hover a .fa-chart-line,
.sidebar-menu-inner .sidebar-item:hover a .fa-toolbox {
    color: #fff;
}

/* 迷你侧边栏时隐藏分组标题和分隔线 */
.mini-sidebar .sidebar-section-header,
.mini-sidebar .sidebar-divider {
    display: none;
}

/* 侧边栏采购专区高亮 */
.sidebar-item.procurement-highlight > a {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, transparent 100%);
    border-left: 3px solid #667eea;
}

.sidebar-item.procurement-highlight > a:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.25) 0%, transparent 100%);
}

