﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #F5F6FF;
    color: #2E3A59;
    line-height: 1.6;
    min-height: 100vh;
    overflow: hidden;
}

/* ==================== 整体布局 ==================== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: 240px;
    min-width: 240px;
    background: linear-gradient(180deg, #F0F3FF 0%, #E8ECFF 100%);
    display: flex;
    flex-direction: column;
    box-shadow:
        2px 0 8px rgba(75, 92, 251, 0.06),
        4px 0 16px rgba(75, 92, 251, 0.04);
    transition: all 0.3s ease;
    z-index: 100;
}

.sidebar.collapsed {
    width: 60px;
    min-width: 60px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #4B5CFB 0%, #6366F1 50%, #818CF8 100%);
    position: relative;
    overflow: hidden;
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(-30%, -30%); }
    50% { transform: translate(30%, 30%); }
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed .sidebar-title {
    opacity: 0;
    width: 0;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

/* 侧边栏导航 */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #C5CAD9;
    border-radius: 2px;
}

.sidebar.collapsed .sidebar-nav {
    overflow-y: hidden;
}

/* 一级菜单样式 */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem 0;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem;
    color: #6D7688;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-menu li a:hover {
    background: #E8EBFF;
    color: #4B5CFB;
    border-left-color: #4B5CFB;
}

.nav-menu li a.active {
    background: linear-gradient(90deg, rgba(75, 92, 251, 0.12) 0%, rgba(75, 92, 251, 0.05) 100%);
    color: #4B5CFB;
    border-left-color: #4B5CFB;
    font-weight: 600;
}

.menu-icon {
    width: 24px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1rem;
    flex-shrink: 0;
}

.menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 侧边栏收起时一级菜单 */
.sidebar.collapsed .nav-menu li a {
    padding: 0.7rem;
    justify-content: center;
}

.sidebar.collapsed .nav-menu li a .menu-text {
    display: none;
}

.sidebar.collapsed .nav-menu li a .menu-icon {
    margin-right: 0;
}

.sidebar.collapsed .nav-menu li {
    position: relative;
}

.sidebar.collapsed .nav-menu li a:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #2E3A59;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1000;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(75, 92, 251, 0.12);
}

.nav-group {
    margin-bottom: 0.5rem;
    border-top: 1px solid #E2E6F5;
    padding-top: 0.5rem;
}

.nav-group-title {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: #6D7688;
    font-weight: 600;
    transition: all 0.2s ease;
    user-select: none;
}

.nav-group-title:hover {
    background: #E8EBFF;
    color: #4B5CFB;
}

.group-icon {
    width: 24px;
    text-align: center;
    margin-right: 0.5rem;
    font-size: 1rem;
}

.group-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .group-text,
.sidebar.collapsed .arrow {
    display: none;
}

.arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    color: #C5CAD9;
}

.nav-group.collapsed .arrow {
    transform: rotate(-90deg);
}

.nav-group-items {
    list-style: none;
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 500px;
}

.nav-group.collapsed .nav-group-items {
    max-height: 0;
}

.nav-group-items li a {
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem;
    padding-left: 1.5rem;
    color: #6D7688;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-group-items li a .menu-icon {
    width: 24px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-group-items li a .menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-group-items li a:hover {
    background: #E8EBFF;
    color: #4B5CFB;
    border-left-color: #4B5CFB;
}

.nav-group-items li a.active {
    background: linear-gradient(90deg, rgba(75, 92, 251, 0.12) 0%, rgba(75, 92, 251, 0.05) 100%);
    color: #4B5CFB;
    border-left-color: #4B5CFB;
    font-weight: 600;
}

/* 侧边栏收起时的菜单项 */
.sidebar.collapsed .nav-group-items li a {
    padding: 0.7rem;
    justify-content: center;
}

.sidebar.collapsed .nav-group-items li a .menu-text {
    display: none;
}

.sidebar.collapsed .nav-group-items li a .menu-icon {
    margin-right: 0;
}

.sidebar.collapsed .nav-group-items {
    max-height: 500px !important;
}

.sidebar.collapsed .nav-group-title {
    justify-content: center;
    padding: 0.7rem;
    position: relative;
}

.sidebar.collapsed .nav-group-title:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #2E3A59;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1000;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(75, 92, 251, 0.12);
}

/* 收起时隐藏菜单项文字，使用 tooltip 显示 */
.sidebar.collapsed .nav-group-items li {
    position: relative;
}

.sidebar.collapsed .nav-group-items li a:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #2E3A59;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1000;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(75, 92, 251, 0.12);
}

/* ==================== 主区域 ==================== */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ==================== 标签栏 ==================== */
.tab-bar {
    display: flex;
    align-items: center;
    background: #FFFFFF;
    min-height: 42px;
    padding: 0 0.5rem;
    box-shadow: 0 2px 8px rgba(75, 92, 251, 0.06);
    border-bottom: 1px solid #E2E6F5;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
}

.tab-bar:empty {
    display: none;
}

.tab-bar::-webkit-scrollbar {
    height: 4px;
}

.tab-bar::-webkit-scrollbar-track {
    background: transparent;
}

.tab-bar::-webkit-scrollbar-thumb {
    background: #C5CAD9;
    border-radius: 2px;
}

.tab-bar::-webkit-scrollbar-thumb:hover {
    background: #4B5CFB;
}

.tab-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6D7688;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    gap: 0.5rem;
    margin: 0 2px;
    border-radius: 6px 6px 0 0;
    flex-shrink: 0;
}

.tab-item:hover {
    background: #E8EBFF;
    color: #2E3A59;
}

.tab-item.active {
    background: linear-gradient(180deg, #E8EBFF 0%, #F5F6FF 100%);
    color: #4B5CFB;
    border-bottom-color: #4B5CFB;
    font-weight: 600;
}

.tab-title {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.75rem;
    color: #C5CAD9;
    transition: all 0.2s ease;
}

.tab-close:hover {
    background: rgba(230, 90, 107, 0.15);
    color: #E65A6B;
}

/* 空标签提示 */
.empty-tabs-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #C5CAD9;
    font-size: 1.2rem;
    padding: 2rem;
    text-align: center;
}

@media (max-width: 768px) {
    .empty-tabs-hint {
        font-size: 1rem;
    }
}

/* ==================== 内容区域 ==================== */
.tab-content-area {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

/* ==================== 旧样式兼容 ==================== */
.container {
    max-width: 100%;
    margin: 0 auto;
}

/* 页面标题 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    background: linear-gradient(145deg, #FFFFFF 0%, #FAFBFF 100%);
    padding: 0.75rem 1rem;
    border-radius: 16px;
    box-shadow:
        0 1px 3px rgba(75, 92, 251, 0.08),
        0 8px 24px rgba(75, 92, 251, 0.06);
    border: 1px solid rgba(75, 92, 251, 0.08);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4B5CFB, #818CF8, #4B5CFB);
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.page-header h2 {
    font-size: 1.8rem;
    color: #2E3A59;
    font-weight: 700;
    background: linear-gradient(135deg, #2E3A59 0%, #4B5CFB 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 按钮 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:active::after {
    width: 200px;
    height: 200px;
}

.btn-primary {
    background: linear-gradient(135deg, #4B5CFB 0%, #6366F1 100%);
    color: white;
    box-shadow:
        0 2px 4px rgba(75, 92, 251, 0.2),
        0 4px 12px rgba(75, 92, 251, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3A4BE8 0%, #5558E8 100%);
    transform: translateY(-3px);
    box-shadow:
        0 6px 12px rgba(75, 92, 251, 0.3),
        0 12px 28px rgba(75, 92, 251, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: linear-gradient(135deg, #34C88A 0%, #4ADE9F 100%);
    color: white;
    box-shadow:
        0 2px 4px rgba(52, 200, 138, 0.2),
        0 4px 12px rgba(52, 200, 138, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-success:hover {
    background: linear-gradient(135deg, #2DB87D 0%, #3FD492 100%);
    transform: translateY(-3px);
    box-shadow:
        0 6px 12px rgba(52, 200, 138, 0.3),
        0 12px 28px rgba(52, 200, 138, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: linear-gradient(135deg, #E65A6B 0%, #F87171 100%);
    color: white;
    box-shadow:
        0 2px 4px rgba(230, 90, 107, 0.2),
        0 4px 12px rgba(230, 90, 107, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #D94A5B 0%, #EF6363 100%);
    transform: translateY(-3px);
    box-shadow:
        0 6px 12px rgba(230, 90, 107, 0.3),
        0 12px 28px rgba(230, 90, 107, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-secondary {
    background: linear-gradient(135deg, #E2E6F5 0%, #D1D5E8 100%);
    color: #2E3A59;
    box-shadow:
        0 2px 4px rgba(197, 202, 217, 0.2),
        0 4px 12px rgba(197, 202, 217, 0.15);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #D1D5E8 0%, #C5CAD9 100%);
    transform: translateY(-3px);
    box-shadow:
        0 6px 12px rgba(197, 202, 217, 0.3),
        0 12px 28px rgba(197, 202, 217, 0.2);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* 表格 */
.table-container {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow:
        0 1px 3px rgba(75, 92, 251, 0.08),
        0 8px 24px rgba(75, 92, 251, 0.06);
    border: 1px solid rgba(75, 92, 251, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.table-container:hover {
    box-shadow:
        0 2px 6px rgba(75, 92, 251, 0.1),
        0 12px 32px rgba(75, 92, 251, 0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(135deg, #4B5CFB 0%, #6366F1 50%, #818CF8 100%);
    color: white;
    position: relative;
}

thead::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #E2E6F5;
}

th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4B5CFB 0%, #6366F1 100%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    margin-left: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(75, 92, 251, 0.3);
}

.help-icon:hover {
    background: linear-gradient(135deg, #3A4BE8 0%, #5558E8 100%);
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(75, 92, 251, 0.4);
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: linear-gradient(90deg, rgba(75, 92, 251, 0.06) 0%, rgba(75, 92, 251, 0.02) 100%);
}

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

/* 发货管理表格文本截断样式 */
#inventory-table td.product-name-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#inventory-table td.sku-name-cell {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 表单 */
.form-container {
    background: linear-gradient(145deg, #FFFFFF 0%, #FAFBFF 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow:
        0 1px 3px rgba(75, 92, 251, 0.08),
        0 8px 24px rgba(75, 92, 251, 0.06);
    border: 1px solid rgba(75, 92, 251, 0.08);
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2E3A59;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid #E2E6F5;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFF 100%);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4B5CFB;
    background: #FFFFFF;
    box-shadow:
        0 0 0 4px rgba(75, 92, 251, 0.12),
        0 4px 20px rgba(75, 92, 251, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.5;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* 开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #E65A6B 0%, #F87171 100%);
    transition: all 0.3s ease;
    border-radius: 28px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked + .slider {
    background: linear-gradient(135deg, #34C88A 0%, #4ADE9F 100%);
}

input:checked + .slider:before {
    transform: translateX(28px);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(46, 58, 89, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #FFFFFF 0%, #FAFBFF 100%);
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow:
        0 4px 8px rgba(75, 92, 251, 0.08),
        0 16px 48px rgba(75, 92, 251, 0.12);
    border: 1px solid rgba(75, 92, 251, 0.08);
    animation: slideIn 0.4s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E2E6F5;
}

.modal-header h3 {
    margin: 0;
    color: #2E3A59;
    font-weight: 700;
    font-size: 1.5rem;
}

.close {
    font-size: 2rem;
    font-weight: bold;
    color: #C5CAD9;
    cursor: pointer;
    border: none;
    background: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close:hover {
    background: rgba(230, 90, 107, 0.1);
    color: #E65A6B;
}

/* 消息提示 */
.alert {
    padding: 1.2rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    animation: slideIn 0.4s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #34C88A 0%, #4ADE9F 100%);
    color: #ffffff;
    border-left: 4px solid #2DB87D;
}

.alert-error {
    background: linear-gradient(135deg, #E65A6B 0%, #F87171 100%);
    color: #ffffff;
    border-left: 4px solid #D94A5B;
}

.alert-warning {
    background: linear-gradient(135deg, #F3953F 0%, #FBBF24 100%);
    color: #ffffff;
    border-left: 4px solid #E0852F;
}

.alert-info {
    background: linear-gradient(135deg, #4B5CFB 0%, #6366F1 100%);
    color: #ffffff;
    border-left: 4px solid #3A4BE8;
}

/* 提示信息容器 */
#alert-container {
    position: fixed !important;
    top: 60px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 2000 !important;
    max-width: 600px !important;
    width: 90% !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#alert-container .alert {
    pointer-events: auto !important;
    margin-bottom: 0 !important;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6D7688;
}

.empty-state p {
    font-size: 1.1rem;
    margin-top: 1rem;
    font-weight: 500;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 3rem 2rem;
    color: #6D7688;
    font-weight: 500;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    top: 50%;
    left: 50%;
    margin-left: -20px;
    margin-top: 20px;
    border: 4px solid rgba(75, 92, 251, 0.15);
    border-top-color: #4B5CFB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(75, 92, 251, 0.1);
}

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

/* JSON编辑器样式 */
.json-editor {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 0.875rem;
    min-height: 120px;
    background: #F5F6FF;
    border: 2px solid #E2E6F5 !important;
    padding: 1rem !important;
    line-height: 1.6;
}

.json-editor:focus {
    background: white;
    border-color: #4B5CFB !important;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #F5F6FF 0%, #EBEEFF 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #C5CAD9 0%, #B5BAC9 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4B5CFB 0%, #6366F1 100%);
}

/* 表格操作按钮组 */
td .btn {
    margin: 0 0.25rem;
}

/* 页面切换动画 */
.tab-pane {
    animation: fadeIn 0.3s ease;
}

/* 增强小提示文本 */
small {
    color: #6D7688;
    font-size: 0.875rem;
}

/* 标签页样式（页面内的 tabs，如订单页面的状态切换） */
.tab-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6D7688;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #4B5CFB;
    background: #E8EBFF;
}

.tab-btn.active {
    color: #4B5CFB;
    border-bottom-color: #4B5CFB;
    background: linear-gradient(180deg, #E8EBFF 0%, #F5F6FF 100%);
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

.tab-content:not(.active) {
    display: none;
}

/* 仓库复选框列表样式 */
.warehouse-checkbox-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 2px solid #E2E6F5;
    border-radius: 8px;
    background: linear-gradient(135deg, #FFFFFF 0%, #FAFBFF 100%);
    transition: all 0.2s ease;
    cursor: pointer;
}

.warehouse-checkbox-item:hover {
    border-color: #4B5CFB;
    background: linear-gradient(135deg, #E8EBFF 0%, #F0F2FF 100%);
    box-shadow: 0 2px 8px rgba(75, 92, 251, 0.1);
}

.warehouse-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: #4B5CFB;
}

.warehouse-checkbox-item label {
    flex: 1;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #2E3A59;
}

.warehouse-checkbox-item:has(input:checked) {
    border-color: #E65A6B;
    background: linear-gradient(135deg, rgba(230, 90, 107, 0.08) 0%, rgba(230, 90, 107, 0.03) 100%);
}

/* 供应商商品下拉框样式 */
.supplier-product-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFF 100%);
    border: 1px solid rgba(75, 92, 251, 0.1);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow:
        0 4px 8px rgba(75, 92, 251, 0.08),
        0 12px 24px rgba(75, 92, 251, 0.06);
}

.supplier-product-option {
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #E2E6F5;
    transition: background-color 0.2s;
}

.supplier-product-option:hover {
    background: linear-gradient(90deg, rgba(75, 92, 251, 0.08) 0%, rgba(75, 92, 251, 0.03) 100%);
}

.supplier-product-option:last-child {
    border-bottom: none;
}

.supplier-product-option.highlight {
    background: linear-gradient(90deg, rgba(75, 92, 251, 0.1) 0%, rgba(75, 92, 251, 0.04) 100%);
}

.supplier-product-name {
    font-weight: 600;
    color: #2E3A59;
    margin-bottom: 0.2rem;
}

.supplier-product-meta {
    font-size: 0.85rem;
    color: #6D7688;
}

/* 加载转圈动画 */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(75, 92, 251, 0.15);
    border-top-color: #4B5CFB;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 10px rgba(75, 92, 251, 0.1);
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -240px;
        height: 100vh;
        z-index: 200;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .sidebar.collapsed {
        left: -60px;
    }

    .sidebar.collapsed.mobile-open {
        left: 0;
    }

    .main-area {
        width: 100%;
    }

    .tab-bar {
        min-height: 38px;
        padding: 0 0.25rem;
    }

    .tab-item {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    .tab-title {
        max-width: 80px;
    }

    .tab-close {
        width: 16px;
        height: 16px;
        font-size: 0.7rem;
    }

    .tab-content-area {
        padding: 10px;
        overflow-x: auto;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }

    /* 表格容器支持横向滚动 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.8rem;
        min-width: 600px;
    }

    th, td {
        padding: 0.5rem 0.4rem;
        white-space: nowrap;
    }

    /* 按钮在移动端更紧凑 */
    .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .btn-small {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    /* 表单在移动端全宽 */
    .form-container {
        padding: 1rem;
        max-width: 100%;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.7rem 0.8rem;
        font-size: 0.9rem;
    }

    /* 模态框在移动端 */
    .modal-content {
        width: 98%;
        padding: 1.5rem;
        max-height: 95vh;
    }

    #alert-container {
        top: 50px !important;
        width: 95% !important;
        max-width: 95% !important;
    }

    /* 筛选区域在移动端换行 */
    .filter-section,
    .page-header {
        flex-wrap: wrap;
    }

    .filter-section select,
    .filter-section input {
        min-width: 120px;
        flex: 1;
    }
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4B5CFB 0%, #6366F1 100%);
    color: white;
    border: none;
    box-shadow:
        0 4px 8px rgba(75, 92, 251, 0.3),
        0 8px 24px rgba(75, 92, 251, 0.2);
    cursor: pointer;
    z-index: 150;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 12px rgba(75, 92, 251, 0.35),
        0 12px 32px rgba(75, 92, 251, 0.25);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

@media (max-width: 768px) {
    .sidebar-overlay.show {
        display: block;
    }

    /* 使用 JS 添加的 class 替代 :has() 以获得更好的浏览器兼容性 */
    body.sidebar-open {
        overflow: hidden;
    }
}

/* 触摸设备上禁用悬停效果的粘滞 */
@media (hover: none) {
    .nav-menu li a:hover:not(.active),
    .nav-group-items li a:hover:not(.active),
    .nav-group-title:hover {
        background: transparent;
        color: inherit;
    }

    .nav-menu li a:active:not(.active),
    .nav-group-items li a:active:not(.active) {
        background: #E8EBFF;
    }
}

/* Firefox 滚动条兼容 */
.tab-bar {
    scrollbar-width: thin;
    scrollbar-color: #C5CAD9 transparent;
}

.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: #C5CAD9 transparent;
}

/* ==================== 用户菜单 ==================== */
.user-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(75, 92, 251, 0.08) 0%, rgba(75, 92, 251, 0.03) 100%);
    border-top: 1px solid #E2E6F5;
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4B5CFB 0%, #6366F1 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(75, 92, 251, 0.3);
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: #2E3A59;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-account {
    font-size: 0.75rem;
    color: #6D7688;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #E65A6B 0%, #F87171 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #D94A5B 0%, #EF6363 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(230, 90, 107, 0.3);
}

/* 侧边栏收起时用户菜单 */
.sidebar.collapsed .user-menu {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
}

.sidebar.collapsed .user-info {
    justify-content: center;
}

.sidebar.collapsed .user-details {
    display: none;
}

.sidebar.collapsed .btn-logout {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
}

/* 移动端用户菜单 */
@media (max-width: 768px) {
    .user-menu {
        padding: 0.6rem 0.8rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .user-name {
        font-size: 0.85rem;
    }

    .btn-logout {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
    }
}
