
/* ========================================
   蔬菜配送系统 - APK 风格 UI 美化
   配色方案：蓝色主题 #006BC9
   ======================================== */

/* ==================== 全局变量定义 ==================== */
:root {
    /* 主色调 - APK 蓝色主题 */
    --primary-color: #006BC9;
    --primary-light: #0080FF;
    --primary-dark: #0056A3;
    --primary-gradient: linear-gradient(135deg, #006BC9 0%, #0080FF 100%);
    --primary-gradient-light: linear-gradient(135deg, #4DA3FF 0%, #0080FF 100%);

    /* 辅助色 */
    --success-color: #00B578;
    --success-light: #E6FFF4;
    --warning-color: #FF6B35;
    --warning-light: #FFF7E6;
    --danger-color: #FF4D4F;
    --danger-light: #FFF1F0;
    --info-color: #006BC9;

    /* 背景色 */
    --bg-primary: #F5F5F5;
    --bg-secondary: #FFFFFF;
    --bg-gradient: linear-gradient(180deg, #E6F4FF 0%, #F5F5F5 100%);
    --bg-card: #FFFFFF;

    /* 文字色 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-light: #CCCCCC;
    --text-white: #FFFFFF;

    /* 边框与阴影 */
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --border-radius-lg: 24px;
    --border-radius-full: 50px;

    --shadow-sm: 0 2px 8px rgba(0, 107, 201, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 107, 201, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 107, 201, 0.15);
    --shadow-hover: 0 6px 20px rgba(0, 107, 201, 0.25);

    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;

    /* 动画 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s ease;
}

/* ==================== 基础重置与全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 顶部导航栏 ==================== */
.navbar, .top-navbar {
    background: var(--primary-gradient) !important;
    box-shadow: var(--shadow-md);
    border: none;
}

.navbar-brand, .top-navbar .brand {
    color: #FFFFFF !important;
    font-weight: 700;
    font-size: 20px;
}

.navbar-nav .nav-link, .top-navbar .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-radius: 8px;
    padding: 8px 16px;
    margin: 2px 4px;
}

.navbar-nav .nav-link:hover, .top-navbar .nav-link:hover {
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.15);
}

.navbar-nav .nav-link.active, .top-navbar .nav-link.active {
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== 侧边导航菜单 ==================== */
.mobile-sidebar, .sidebar {
    background: var(--primary-gradient) !important;
    box-shadow: var(--shadow-lg);
}

.mobile-sidebar .nav-link, .sidebar .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 14px 20px;
    border-radius: 12px;
    margin: 4px 12px;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.mobile-sidebar .nav-link:hover, .sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF !important;
    transform: translateX(4px);
}

.mobile-sidebar .nav-link.active, .sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==================== 统计卡片 ==================== */
.stat-card, .stats-card, .card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: none;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.stat-card:hover, .stats-card:hover, .card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-number, .stats-card .stat-number {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 32px;
}

.stat-card .stat-label, .stats-card .stat-label {
    color: var(--text-muted);
    font-size: 14px;
}

/* ==================== 按钮样式 ==================== */
.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    padding: 12px 24px;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
}

.btn-primary, .btn-outline-primary {
    background: var(--primary-gradient);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 107, 201, 0.3);
}

.btn-primary:hover, .btn-outline-primary:hover {
    background: var(--primary-gradient-light);
    box-shadow: 0 6px 16px rgba(0, 107, 201, 0.4);
    transform: translateY(-1px);
}

.btn-success, .btn-outline-success {
    background: linear-gradient(135deg, #00B578 0%, #01B755 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 181, 120, 0.3);
}

.btn-success:hover, .btn-outline-success:hover {
    box-shadow: 0 6px 16px rgba(0, 181, 120, 0.4);
    transform: translateY(-1px);
}

.btn-danger, .btn-outline-danger {
    background: linear-gradient(135deg, #FF4D4F 0%, #FF6B6B 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.3);
}

.btn-danger:hover, .btn-outline-danger:hover {
    box-shadow: 0 6px 16px rgba(255, 77, 79, 0.4);
    transform: translateY(-1px);
}

.btn-warning, .btn-outline-warning {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8F6B 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-warning:hover, .btn-outline-warning:hover {
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
    transform: translateY(-1px);
}

/* ==================== 表单样式 ==================== */
.form-control, .form-select {
    border: 2px solid #E8E8E8;
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
    transition: all var(--transition-fast);
    background: #F8F9FA;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 107, 201, 0.1);
    background: #FFFFFF;
}

.form-label {
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}

/* ==================== 表格样式 ==================== */
.table {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: var(--primary-gradient);
    color: #FFFFFF;
    font-weight: 600;
    padding: 16px;
    border: none;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #F0F0F0;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #F8F9FA;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ==================== 模态框样式 ==================== */
.modal-content {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: var(--primary-gradient);
    color: #FFFFFF;
    border: none;
    padding: 20px 24px;
}

.modal-header .modal-title {
    color: #FFFFFF;
    font-weight: 600;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid #F0F0F0;
    padding: 16px 24px;
}

/* ==================== 标签样式 ==================== */
.badge, .tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
}

.badge-primary, .tag-blue {
    background: #E6F4FF;
    color: #006BC9;
}

.badge-success, .tag-green {
    background: #E6FFF4;
    color: #00B578;
}

.badge-danger, .tag-red {
    background: #FFF1F0;
    color: #FF4D4F;
}

.badge-warning, .tag-orange {
    background: #FFF7E6;
    color: #FF6B35;
}

.badge-secondary, .tag-gray {
    background: #F5F5F5;
    color: #999999;
}

/* ==================== 卡片列表 ==================== */
.list-group-item {
    border: none;
    border-bottom: 1px solid #F0F0F0;
    padding: 16px 20px;
    transition: all var(--transition-fast);
}

.list-group-item:hover {
    background: #F8F9FA;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* ==================== 页面内容区域 ==================== */
.page-wrapper, .main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== 工作台统计卡片 ==================== */
.main-stats, .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-item {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.stat-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.stat-item:nth-child(1) { border-top: 4px solid #006BC9; }
.stat-item:nth-child(2) { border-top: 4px solid #00B578; }
.stat-item:nth-child(3) { border-top: 4px solid #FF6B35; }
.stat-item:nth-child(4) { border-top: 4px solid #FF4D4F; }

/* ==================== 快捷功能入口 ==================== */
.quick-actions, .function-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.quick-action-item, .function-item {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.quick-action-item:hover, .function-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quick-action-item .icon, .function-item .icon {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
}

.quick-action-item .text, .function-item .text {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

/* ==================== 底部导航栏 ==================== */
.bottom-nav, .mobile-bottom-nav {
    background: #FFFFFF;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    border-top: 1px solid #F0F0F0;
}

.bottom-nav .nav-link, .mobile-bottom-nav .nav-link {
    color: var(--text-muted);
    padding: 12px 0;
    transition: all var(--transition-fast);
}

.bottom-nav .nav-link.active, .mobile-bottom-nav .nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* ==================== 搜索框 ==================== */
.search-box, .search-bar {
    background: #FFFFFF;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box input, .search-bar input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: 15px;
    outline: none;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state .text {
    font-size: 16px;
    margin-bottom: 20px;
}

/* ==================== 加载状态 ==================== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #E8E8E8;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 12px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 提示框 ==================== */
.toast {
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-md);
    border: none;
}

.toast-success { border-left: 4px solid var(--success-color); }
.toast-error { border-left: 4px solid var(--danger-color); }
.toast-warning { border-left: 4px solid var(--warning-color); }
.toast-info { border-left: 4px solid var(--info-color); }

/* ==================== 响应式优化 ==================== */
@media (max-width: 768px) {
    .main-stats, .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions, .function-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .page-wrapper, .main-content {
        padding: 12px;
    }

    .stat-item {
        padding: 16px;
    }

    .stat-item .stat-number {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .quick-actions, .function-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-slide-in { animation: slideIn 0.3s ease; }
.animate-scale-in { animation: scaleIn 0.3s ease; }

