* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: #f0f2f5; padding-top: 60px; }

/* ========== 顶部横版导航栏 ========== */
.top-nav {
    background: #0d6efd;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: visible;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 60px;
    max-width: 100%;
    gap: 15px;
    overflow: visible;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo span { color: #f39c12; }

/* ========== 菜单容器 - 修复显示问题 ========== */
.menu-wrapper {
    flex: 1;
    display: flex !important;
    justify-content: flex-start;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0;
}

.menu-wrapper::-webkit-scrollbar {
    height: 0;
}

.menu-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

/* 菜单项样式 */
.menu-item {
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: rgba(255,255,255,0.85);
    border-radius: 12px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    position: relative;
    flex-shrink: 0;
}

.menu-item i {
    font-size: 18px;
    width: 22px;
    text-align: center;
    transition: transform 0.2s ease;
}

.menu-item:hover {
    background: rgba(255,255,255,0.12);
    color: white;
    transform: translateY(-1px);
}

.menu-item:hover i {
    transform: scale(1.1);
}

.menu-item.active {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    border-bottom: 2px solid #f39c12;
}

.menu-item.active i {
    color: #f39c12 !important;
}

/* ========== 用户区域 ========== */
.user-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.avatar {
    width: 34px;
    height: 34px;
    background: #f39c12;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

#roleBadge {
    font-size: 10px;
    background: #f39c12;
    color: #0d6efd;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 6px;
}

/* ========== 下拉菜单 ========== */
.dropdown-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    min-width: 140px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 1001;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #f39c12;
}

.dropdown-item i {
    width: 18px;
}

/* ========== 移动端汉堡菜单按钮 ========== */
.mobile-menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px;
    background: rgba(255,255,255,.10);
    color: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: .2s;
}

.mobile-menu-toggle.active,
.mobile-menu-toggle:hover {
    background: rgba(243,156,18,.25);
    border-color: rgba(243,156,18,.65);
    color: #f39c12;
}

/* ========== 主要内容区域 ========== */
.main-content {
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

/* ========== 隐藏旧的侧边栏 ========== */
.sidebar {
    display: none;
}

/* ========== 响应式适配 ========== */

/* 中等屏幕：隐藏菜单文字，只显示图标 */
@media (max-width: 1200px) {
    .menu-item span {
        display: none;
    }
    .menu-item i {
        font-size: 20px;
        margin: 0;
    }
    .menu-item {
        padding: 8px 14px;
    }
    .menu-item:hover {
        transform: translateY(-2px);
    }
}

/* 平板屏幕：紧凑布局 */
@media (min-width: 900px) and (max-width: 1199px) {
    body {
        padding-top: 56px;
    }

    .nav-container {
        height: 56px;
        padding: 0 12px;
        gap: 8px;
    }

    .logo {
        font-size: 18px;
    }

    .menu-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
    }

    .menu-horizontal {
        flex-wrap: nowrap;
        gap: 4px;
        min-width: max-content;
    }

    .menu-item {
        padding: 7px 10px;
        gap: 6px;
        font-size: 12px;
        border-radius: 10px;
    }

    .menu-item span {
        display: inline !important;
    }

    .menu-item i {
        font-size: 15px;
        width: 16px;
    }

    .user-area {
        gap: 6px;
    }

    #adminName {
        max-width: 72px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #roleBadge {
        display: none;
    }

    .main-content {
        padding: 14px;
        max-width: 100%;
    }

    .card {
        padding: 16px;
    }
}

/* 手机屏幕：导航栏换行布局 */
@media (max-width: 768px) {
    body {
        padding-top: 58px;
    }

    .nav-container {
        height: 58px;
        padding: 0 12px;
        gap: 8px;
        position: relative;
    }

    .logo {
        font-size: 18px;
        flex: 1;
    }

    .mobile-menu-toggle {
        display: inline-flex !important;
        order: 2;
    }

    .user-area {
        order: 3;
        gap: 6px;
    }

    .avatar {
        width: 30px;
        height: 30px;
    }

    #adminName,
    #roleBadge,
    .user-info .fa-chevron-down {
        display: none !important;
    }

    /* 移动端菜单 - 默认隐藏 */
    .menu-wrapper {
        display: none !important;
        position: fixed;
        top: 58px;
        left: 10px;
        right: 10px;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        background: #0d6efd;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 16px;
        padding: 10px;
        box-shadow: 0 16px 36px rgba(0,0,0,.28);
        z-index: 1200;
    }

    /* 移动端菜单 - 展开状态 */
    .menu-wrapper.mobile-open {
        display: block !important;
    }

    .menu-horizontal {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 0;
    }

    .menu-item {
        width: 100%;
        justify-content: flex-start;
        padding: 12px;
        border-radius: 12px;
        background: rgba(255,255,255,.06);
    }

    .menu-item span {
        display: inline !important;
    }

    .menu-item i {
        font-size: 17px;
        width: 22px;
    }

    /* 主内容区 */
    .main-content {
        padding: 10px;
        max-width: 100%;
    }

    .card {
        padding: 12px;
        border-radius: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    /* 弹窗移动端适配 */
    .modal {
        align-items: flex-start !important;
        padding: 10px !important;
        padding-top: 20px !important;
        -webkit-overflow-scrolling: touch;
        overflow-y: auto !important;
    }

    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        max-height: 85vh !important;
        margin: 0 auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        position: relative !important;
    }

    .modal-header {
        padding: 12px 14px;
    }

    .modal-body {
        padding: 14px;
    }

    .modal-footer {
        padding: 12px 14px;
        flex-wrap: wrap;
    }

    /* 表格卡片式布局 */
    .data-table, table {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: visible !important;
    }

    .data-table thead, table thead {
        display: none !important;
    }

    .data-table tbody, table tbody {
        display: block !important;
    }

    .data-table tr, table tr {
        display: block !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 10px !important;
        margin-bottom: 10px !important;
        padding: 4px 0 !important;
        background: #fff !important;
        box-shadow: 0 1px 3px rgba(0,0,0,.06);
    }

    .data-table td, table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        padding: 6px 10px !important;
        font-size: 13px !important;
        border-bottom: 1px solid #f3f4f6 !important;
        text-align: left !important;
        word-break: break-word !important;
        white-space: normal !important;
        gap: 10px;
    }

    .data-table td:last-child, table td:last-child {
        border-bottom: none !important;
    }

    .data-table td::before, table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        flex-shrink: 0;
        min-width: 80px;
        font-size: 12px;
    }

    .data-table td > *, table td > * {
        max-width: 100%;
        overflow-wrap: break-word;
    }

    /* 按钮缩小 */
    .btn {
        font-size: 12px !important;
        padding: 6px 12px !important;
        border-radius: 6px;
    }

    .btn-sm {
        font-size: 11px !important;
        padding: 4px 8px !important;
    }

    /* 表单 */
    .form-group {
        margin-bottom: 10px !important;
    }

    .form-group label {
        font-size: 12px !important;
        margin-bottom: 4px !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 7px 10px !important;
        font-size: 13px !important;
    }

    .form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .form-row .form-group {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* 搜索栏适配 */
    .search-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .search-bar input,
    .search-bar select,
    .search-bar .btn {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0 !important;
    }

    /* 卡片header适配 */
    .card-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* 分页 */
    .pagination-container {
        flex-wrap: wrap;
    }
}

/* 超小屏幕：单列菜单 */
@media (max-width: 520px) {
    .menu-horizontal {
        grid-template-columns: 1fr !important;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .modal-footer .btn,
    .message-actions .btn {
        flex: 1 1 100%;
    }
}

/* ========== 微信/手机浏览器强制移动端模式 ========== */
html.is-mobile-admin body {
    padding-top: 58px;
}

html.is-mobile-admin .nav-container {
    height: 58px;
    padding: 0 12px;
    gap: 8px;
    position: relative;
}

html.is-mobile-admin .logo {
    font-size: 18px;
    flex: 1;
}

html.is-mobile-admin .mobile-menu-toggle {
    display: inline-flex !important;
    order: 2;
}

html.is-mobile-admin .user-area {
    order: 3;
    gap: 6px;
}

html.is-mobile-admin .avatar {
    width: 30px;
    height: 30px;
}

html.is-mobile-admin #adminName,
html.is-mobile-admin #roleBadge,
html.is-mobile-admin .user-info .fa-chevron-down {
    display: none !important;
}

html.is-mobile-admin .menu-wrapper {
    display: none !important;
    position: fixed;
    top: 58px;
    left: 10px;
    right: 10px;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #0d6efd;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 16px 36px rgba(0,0,0,.28);
    z-index: 1200;
}

html.is-mobile-admin .menu-wrapper.mobile-open {
    display: flex !important;
    flex-direction: column;
}

html.is-mobile-admin .menu-horizontal {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
    overflow: visible;
}

html.is-mobile-admin .menu-item {
    width: 100%;
    justify-content: flex-start;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.06);
}

html.is-mobile-admin .menu-item span {
    display: inline !important;
}

html.is-mobile-admin .menu-item i {
    font-size: 17px;
    width: 22px;
}

html.is-mobile-admin .main-content {
    padding: 12px;
}

html.is-mobile-admin .card {
    padding: 14px;
    border-radius: 14px;
}

html.is-mobile-admin .card-header,
html.is-mobile-admin .search-bar,
html.is-mobile-admin .message-actions,
html.is-mobile-admin .modal-footer,
html.is-mobile-admin .form-row {
    flex-wrap: wrap;
}

html.is-mobile-admin .search-bar input,
html.is-mobile-admin .search-bar select,
html.is-mobile-admin .search-bar .btn {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0 !important;
}

html.is-mobile-admin .modal {
    align-items: flex-start;
    padding: 10px;
    padding-top: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

html.is-mobile-admin .modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 85vh !important;
    margin: 0 auto;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

html.is-mobile-admin table {
    display: block;
    width: 100%;
    min-width: 0;
    overflow-x: visible;
}

html.is-mobile-admin table thead {
    display: none;
}

html.is-mobile-admin table tbody {
    display: block;
}

html.is-mobile-admin table tr {
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 4px 0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

html.is-mobile-admin table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 10px;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
    word-break: break-word;
    white-space: normal;
    gap: 10px;
}

html.is-mobile-admin table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6b7280;
    flex-shrink: 0;
    min-width: 80px;
    font-size: 12px;
}

html.is-mobile-admin table td:last-child {
    border-bottom: none;
}

html.is-mobile-admin .admin-reply-panel {
    display: none;
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

html.is-mobile-admin .admin-reply-panel.show {
    display: block;
}

html.is-mobile-admin .admin-reply-panel textarea,
html.is-mobile-admin .admin-reply-panel input[type="file"] {
    width: 100%;
}

html.is-mobile-admin .admin-reply-panel .reply-panel-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

html.is-mobile-admin .admin-reply-panel .reply-panel-actions .btn,
html.is-mobile-admin .message-actions .btn {
    flex: 1 1 100%;
}

/* ========== 移动端通用弹窗修复 ========== */
html.is-mobile-admin .modal[style*="flex"],
html.is-mobile-admin .admin-modal-overlay[style*="flex"] {
    padding: 10px !important;
    padding-top: 20px !important;
    overflow-y: auto !important;
    align-items: flex-start !important;
    -webkit-overflow-scrolling: touch;
}

html.is-mobile-admin .modal-content,
html.is-mobile-admin .admin-modal-overlay > div {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 85vh !important;
    margin: 0 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

html.is-mobile-admin .btn {
    font-size: 12px !important;
    padding: 6px 12px !important;
}

html.is-mobile-admin .form-group {
    margin-bottom: 10px !important;
}

html.is-mobile-admin .form-row {
    flex-direction: column !important;
    gap: 0 !important;
}

html.is-mobile-admin .form-row .form-group {
    flex: 1 1 100% !important;
    width: 100% !important;
}

/* ========== 以下保留原有的表格、卡片、按钮等全局样式 ========== */

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: 0.3s;
}

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

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #f39c12;
}

.stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 10px;
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    color: #0d6efd;
}

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
}

/* 表格容器水平滚动保护 */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

th, td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    white-space: nowrap;
}

tr:hover {
    background: #fafafa;
}

/* 按钮 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.3s;
}

.btn-primary {
    background: #f39c12;
    color: white;
}

.btn-primary:hover {
    background: #e67e22;
}

.btn-outline {
    background: transparent;
    border: 1px solid #f39c12;
    color: #f39c12;
}

.btn-outline:hover {
    background: #f39c12;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

html.is-mobile-admin .btn-sm {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

/* 状态标签 */
.status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: #fff3e0;
    color: #f39c12;
}

.status-arrived {
    background: #e3f2fd;
    color: #2196f3;
}

.status-stored {
    background: #e8f5e9;
    color: #4caf50;
}

.status-shipped {
    background: #e3f2fd;
    color: #2196f3;
}

.status-pending_pack {
    background: #fff3e0;
    color: #f39c12;
}

.status-pending_pay {
    background: #e3f2fd;
    color: #2196f3;
}

.status-pending_ship {
    background: #fff3e0;
    color: #f39c12;
}

.status-shipping {
    background: #e8f5e9;
    color: #4caf50;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.search-bar input {
    flex: 1;
    min-width: 200px;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.modal.modal-active,
.modal[style*="flex"] {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: white !important;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 表单 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
}

.batch-input {
    width: 100%;
    height: 150px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: monospace;
    margin-bottom: 15px;
}

/* 时间线 */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
    border-left: 2px solid #f39c12;
    margin-left: 10px;
    padding-left: 20px;
}

.timeline-dot {
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    background: #f39c12;
    border-radius: 50%;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.tab-btn {
    padding: 8px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: 0.3s;
    border-radius: 20px;
}

.tab-btn:hover {
    background: #f39c12;
    color: white;
}

.tab-btn.active {
    background: #f39c12;
    color: white;
}

/* 其他工具类 */
.required-field {
    background-color: #ffe0e0 !important;
    border-color: #ff9999 !important;
}

.new-order-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #f39c12;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

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

.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.small-text {
    font-size: 11px;
    color: #999;
}

.order-print {
    font-family: monospace;
    padding: 20px;
}

.print-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* 包裹管理表格固定布局 */
.packages-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.packages-table th,
.packages-table td {
    padding: 10px 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.packages-table th:nth-child(1) { width: 10%; }
.packages-table th:nth-child(2) { width: 5%; }
.packages-table th:nth-child(3) { width: 11%; }
.packages-table th:nth-child(4) { width: 11%; }
.packages-table th:nth-child(5) { width: 5%; }
.packages-table th:nth-child(6) { width: 5%; }
.packages-table th:nth-child(7) { width: 5%; }
.packages-table th:nth-child(8) { width: 5%; }
.packages-table th:nth-child(9) { width: 5%; }
.packages-table th:nth-child(10) { width: 5%; }
.packages-table th:nth-child(11) { width: 9%; }
.packages-table th:nth-child(12) { width: 9%; }
.packages-table th:nth-child(13) { width: 15%; }

/* 统计页面利润颜色 */
.profit-positive {
    color: #27ae60;
}

.profit-negative {
    color: #e74c3c;
}

.period-btn.active {
    background: #f39c12;
    color: white;
    border-color: #f39c12;
}

.period-btn {
    transition: all 0.3s ease;
}

.period-btn:hover {
    background: #f39c12;
    color: white;
}

/* 管理员修改密码按钮样式 */
.change-pwd-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

#changePwdModal .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

#changePwdModal .form-group input:focus {
    outline: none;
    border-color: #f39c12;
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.2);
}

#pwdErrorMsg {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px 0;
}

/* ========== 表格文字颜色强制可见 ========== */
table td,
table th,
table td *,
table th *,
tbody td,
tbody th,
thead td,
thead th {
    color: #333333 !important;
}

table a,
table a * {
    color: #0d6efd !important;
    text-decoration: none;
}

table a:hover {
    text-decoration: underline !important;
}

table .btn,
table .btn * {
    color: inherit !important;
}

table .btn-primary {
    color: white !important;
}

table .btn-danger {
    color: white !important;
}

table .btn-outline {
    color: #f39c12 !important;
}

table .status,
table .status * {
    color: #333333 !important;
}

table .status-stored {
    color: #2c3e50 !important;
    background: #e8f5e9 !important;
}

table .status-shipping {
    color: #2c3e50 !important;
    background: #fff3e0 !important;
}

table .status-pending {
    color: #2c3e50 !important;
    background: #fff3e0 !important;
}

/* 物流轨迹表格 */
#trackingListTable,
#trackingListTable td,
#trackingListTable th,
#trackingListTable span,
#trackingListTable strong,
#trackingListTable div {
    color: #333333 !important;
}

/* 运单管理表格 */
#ordersTableBody,
#ordersTableBody td,
#ordersTableBody td *,
#ordersTableBody a {
    color: #333333 !important;
}

#ordersTableBody a strong {
    color: #0d6efd !important;
}

/* 客户管理表格 */
#usersTableBody,
#usersTableBody td,
#usersTableBody td *,
#usersTableBody a {
    color: #333333 !important;
}

/* 包裹管理表格 */
#packagesTableBody,
#packagesTableBody td,
#packagesTableBody td * {
    color: #333333 !important;
}

/* 输入框文字 */
input,
select,
textarea,
input *,
select *,
textarea * {
    color: #333333 !important;
}

input::placeholder,
textarea::placeholder {
    color: #999999 !important;
}

/* 卡片文字 */
.card,
.card *,
.card-header,
.card-header *,
.card-title {
    color: #333333 !important;
}

/* 统计卡片 */
.stat-card,
.stat-card * {
    color: #333333 !important;
}

.stat-card .stat-number {
    color: #f39c12 !important;
}

/* 模态框文字 */
.modal,
.modal *,
.modal-content,
.modal-content * {
    color: #333333 !important;
}

.modal-header h3 {
    color: white !important;
}

.modal-header i {
    color: white !important;
}

/* ========== 回收站模块样式 ========== */
#recycleBinTableBody td {
    vertical-align: middle;
}

.expired-warning {
    color: #e74c3c !important;
    font-weight: bold;
}

.expiring-soon {
    color: #e67e22 !important;
}

.recycle-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.recycle-stat-card {
    background: white;
    border-radius: 12px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    flex: 1;
    min-width: 150px;
}

.recycle-stat-card i {
    font-size: 32px;
    color: #f39c12;
}

.recycle-stat-info h4 {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.recycle-stat-info .number {
    font-size: 24px;
    font-weight: bold;
    color: #0d6efd;
}

.recycle-stat-info .warning {
    color: #e67e22;
}

.restore-btn {
    background: #27ae60;
    color: white;
    transition: 0.3s;
}

.restore-btn:hover {
    background: #219a52;
    transform: scale(1.02);
}

.recycle-info {
    background: #f8f9fa;
    border-left: 4px solid #f39c12;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recycle-info i {
    color: #f39c12;
    font-size: 18px;
}

.expires-soon {
    background: #fff3e0;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    color: #e67e22;
    display: inline-block;
}

.expires-overdue {
    background: #ffebee;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    color: #e74c3c;
    display: inline-block;
}

.type-badge-order {
    background: #e3f2fd;
    color: #2196f3;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
}

.type-badge-package {
    background: #e8f5e9;
    color: #4caf50;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
}

.recycle-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

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

.recycle-empty p {
    font-size: 14px;
}

/* 运单详情弹窗标题栏 */
.modal-header,
.modal-header *,
.modal-header i {
    color: white !important;
}

/* ========== 分页样式 ========== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 0;
    flex-wrap: wrap;
    border-top: 1px solid #eee;
}

.pagination-container .btn {
    min-width: 40px;
}

.pagination-container .btn-primary {
    background: #f39c12;
    color: white;
}

.pagination-container .btn-outline {
    background: transparent;
    border: 1px solid #f39c12;
    color: #f39c12;
}

.pagination-container .btn-outline:hover {
    background: #f39c12;
    color: white;
}

/* ========== 首页仪表盘新增模块 ========== */
.dashboard-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 1199px) {
    .dashboard-row-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .dashboard-row-3 { grid-template-columns: 1fr; }
}

/* 运单状态进度条 */
.status-bar-container { margin-bottom: 8px; }
.status-bar-label {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; margin-bottom: 4px; color: #555;
}
.status-bar-label .count { font-weight: 600; color: #333; }
.status-bar-track {
    height: 28px; border-radius: 6px; overflow: hidden;
    display: flex; background: #e9ecef;
}
.status-bar-seg {
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: white; font-weight: 600;
    transition: width 0.4s ease; min-width: 0; overflow: hidden;
    white-space: nowrap; padding: 0 6px;
}
.status-bar-seg:hover { opacity: 0.85; }
.status-bar-legend {
    display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px;
}
.status-bar-legend-item {
    display: flex; align-items: center; gap: 5px; font-size: 12px; color: #666;
}
.status-bar-legend-dot {
    width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}

/* 告警角标 */
.alert-badge {
    background: #e74c3c; color: white; font-size: 12px; font-weight: 600;
    padding: 2px 8px; border-radius: 10px; min-width: 20px; text-align: center;
}

/* 告警列表 */
.alert-list { max-height: 300px; overflow-y: auto; }
.alert-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 15px; border-bottom: 1px solid #f0f0f0;
    cursor: pointer; transition: background 0.2s;
}
.alert-item:hover { background: #f8f9fa; }
.alert-item:last-child { border-bottom: none; }
.alert-icon {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: white; margin-top: 2px;
}
.alert-icon.warn { background: #e67e22; }
.alert-icon.danger { background: #e74c3c; }
.alert-icon.info { background: #3498db; }
.alert-body { flex: 1; min-width: 0; }
.alert-body .alert-label { font-size: 13px; font-weight: 600; color: #333; }
.alert-body .alert-desc { font-size: 12px; color: #888; margin-top: 2px; }
.alert-empty { text-align: center; color: #27ae60; padding: 20px; font-size: 13px; }

/* 紧凑列表（留言/代购） */
.compact-list { max-height: 300px; overflow-y: auto; }
.compact-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 15px; border-bottom: 1px solid #f0f0f0;
    cursor: pointer; transition: background 0.2s;
}
.compact-item:hover { background: #f8f9fa; }
.compact-item:last-child { border-bottom: none; }
.compact-body { flex: 1; min-width: 0; }
.compact-body .c-title {
    font-size: 13px; font-weight: 600; color: #333;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.compact-body .c-sub { font-size: 12px; color: #888; margin-top: 2px; }
.compact-body .c-meta {
    font-size: 11px; color: #aaa; margin-top: 3px;
    display: flex; justify-content: space-between;
}
.compact-empty { text-align: center; color: #27ae60; padding: 20px; font-size: 13px; }

/* 渠道分布柱状图 */
.channel-bar-list { display: flex; flex-direction: column; gap: 10px; }
.channel-bar-row {
    display: flex; align-items: center; gap: 10px;
}
.channel-bar-name {
    width: 120px; flex-shrink: 0; font-size: 13px; color: #555;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right;
}
.channel-bar-track {
    flex: 1; height: 22px; background: #e9ecef; border-radius: 4px; overflow: hidden;
}
.channel-bar-fill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, #0d6efd, #66a3ff);
    transition: width 0.5s ease;
    display: flex; align-items: center; justify-content: flex-end;
    padding-right: 6px; font-size: 11px; color: white; font-weight: 600;
    min-width: 30px;
}
.channel-bar-empty { text-align: center; color: #999; padding: 20px; font-size: 13px; }

@media (max-width: 600px) {
    .channel-bar-name { width: 70px; font-size: 12px; }
    .status-bar-legend-item { font-size: 11px; }
}