:root {
    --primary: #4361ee;
    --primary-light: #eef1ff;
    --primary-dark: #3a56d4;
    --success: #2ec4b6;
    --warning: #ff9f1c;
    --danger: #e63946;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #2b2d42;
    --text-light: #6c757d;
    --border: #e9ecef;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 10px;
    --sidebar-width: 220px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.login-page {
    display: none;
}

body.auth-locked {
    background: linear-gradient(135deg, #f7f9ff 0%, #edf7f5 48%, #fff7eb 100%);
}

body.auth-locked .top-nav,
body.auth-locked .sidebar,
body.auth-locked .main-content {
    display: none;
}

body.auth-locked .login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-panel {
    width: min(100%, 420px);
    background: #fff;
    border: 1px solid rgba(67, 97, 238, 0.14);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(43, 45, 66, 0.14);
    padding: 28px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.login-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    font-size: 26px;
}

.login-brand h1 {
    font-size: 22px;
    line-height: 1.25;
    margin: 0 0 4px;
    color: var(--text);
}

.login-brand p {
    font-size: 13px;
    color: var(--text-light);
    margin: 0;
}

.login-field {
    display: block;
    margin-bottom: 16px;
}

.login-field span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.login-field input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

.login-message {
    min-height: 20px;
    margin: 2px 0 12px;
    color: var(--danger);
    font-size: 13px;
}

.login-submit {
    width: 100%;
    height: 42px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}

.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.nav-action-button,
.logout-button {
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 8px;
    height: 34px;
    padding: 0 14px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s, border-color 0.2s;
}

.logout-button {
    margin-left: 8px;
}

.sidebar-toggle {
    position: fixed;
    top: 11px;
    left: 12px;
    z-index: 110;
    width: 34px;
    height: 34px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.8);
}

.nav-action-button:hover,
.logout-button:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.8);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(43, 45, 66, 0.42);
}

.modal-overlay.hidden {
    display: none;
}

.modal-panel {
    width: min(100%, 420px);
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(43, 45, 66, 0.2);
    padding: 22px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: #f1f3f5;
    color: var(--text-light);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
    background: #e9ecef;
}

.modal-context {
    margin-bottom: 14px;
    color: var(--text-light);
    font-size: 13px;
}

.fd-carrier-quote-dialog-panel {
    width: min(100%, 720px);
}

.fd-carrier-quote-options {
    display: grid;
    gap: 8px;
    max-height: min(52vh, 440px);
    overflow-y: auto;
    margin-bottom: 18px;
    padding: 2px;
}

.fd-carrier-quote-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
    line-height: 1.45;
}

.fd-carrier-quote-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.fd-carrier-quote-option input {
    margin: 3px 0 0;
    flex: 0 0 auto;
}

.express-export-dialog-panel {
    width: min(100%, 760px);
}

.modal-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.modal-section-actions {
    display: flex;
    gap: 8px;
}

.express-export-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    max-height: min(28vh, 240px);
    overflow-y: auto;
    margin-bottom: 18px;
    padding: 2px;
}

.express-export-options .fd-carrier-quote-option {
    font-size: 13px;
    padding: 8px 10px;
}

#fd-table .fd-group-cell {
    background: #f8fafc;
    font-weight: 600;
    vertical-align: middle;
}

#fd-table .fd-summary-row td {
    background: #f1f5f9;
    border-top: 1px solid #cbd5e1;
    font-weight: 600;
}

/* Freight cockpit: keep the operational table unchanged while giving its frame a denser control-room hierarchy. */
#page-freight-dashboard {
    --fd-ink: #20302f;
    --fd-ink-soft: #455856;
    --fd-accent: #168878;
    --fd-accent-dark: #0f6d60;
    --fd-mint: #e7f3ef;
    --fd-warm: #fcf4e5;
    --fd-line: #dbe5e1;
    --fd-surface: #ffffff;
    --fd-muted: #6b7d7a;
    color: var(--fd-ink);
}

#page-freight-dashboard .fd-cockpit-header {
    min-height: 132px;
    margin-bottom: 14px;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid #2e4542;
    border-radius: 8px;
    background: var(--fd-ink);
    color: #f7fbfa;
    box-shadow: 0 12px 28px rgba(32, 48, 47, 0.12);
}

#page-freight-dashboard .fd-cockpit-title {
    min-width: 0;
    padding-left: 16px;
    border-left: 3px solid #d9a441;
}

#page-freight-dashboard .fd-eyebrow {
    margin-bottom: 7px;
    color: #9db9b3;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
}

#page-freight-dashboard .fd-cockpit-header h2 {
    margin: 0;
    color: #fff;
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: 0;
}

#page-freight-dashboard .fd-cockpit-header p {
    margin: 7px 0 0;
    color: #c8d8d5;
    font-size: 13px;
}

#page-freight-dashboard .fd-cockpit-readout {
    min-width: 234px;
    padding: 12px 0 12px 20px;
    border-left: 1px solid rgba(201, 220, 216, 0.24);
    text-align: right;
}

#page-freight-dashboard .fd-readout-label,
#page-freight-dashboard .fd-refresh-state {
    display: block;
    color: #9db9b3;
    font-size: 11px;
    font-weight: 600;
}

#page-freight-dashboard .fd-cockpit-readout strong {
    display: block;
    margin: 4px 0 6px;
    color: #fff;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

#page-freight-dashboard .fd-refresh-state::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: #6dd5b4;
    vertical-align: 1px;
}

#page-freight-dashboard .fd-control-deck {
    margin-bottom: 14px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: repeat(5, minmax(118px, 1fr)) auto;
    align-items: end;
    gap: 12px;
    border: 1px solid var(--fd-line);
    border-radius: 8px;
    background: var(--fd-surface);
    box-shadow: 0 5px 14px rgba(32, 48, 47, 0.05);
}

#page-freight-dashboard .fd-control-deck .form-field {
    min-width: 0;
    margin: 0;
}

#page-freight-dashboard .fd-control-deck .form-field span {
    margin-bottom: 6px;
    color: var(--fd-muted);
    font-size: 12px;
    font-weight: 700;
}

#page-freight-dashboard .fd-control-deck select,
#page-freight-dashboard .fd-control-deck input {
    width: 100%;
    height: 36px;
    border-color: #cfdcd7;
    border-radius: 5px;
    color: var(--fd-ink);
    background: #fbfdfc;
    font-size: 13px;
}

#page-freight-dashboard .fd-control-deck select:focus,
#page-freight-dashboard .fd-control-deck input:focus {
    border-color: var(--fd-accent);
    box-shadow: 0 0 0 3px rgba(22, 136, 120, 0.12);
    outline: none;
}

#page-freight-dashboard .fd-control-deck .filter-actions {
    margin-left: 2px;
}

#page-freight-dashboard .fd-control-deck .btn-primary {
    min-width: 92px;
    height: 36px;
    border-color: var(--fd-accent);
    background: var(--fd-accent);
    box-shadow: none;
}

#page-freight-dashboard .fd-control-deck .btn-primary:hover {
    border-color: var(--fd-accent-dark);
    background: var(--fd-accent-dark);
}

#page-freight-dashboard .fd-config-card,
#page-freight-dashboard .fd-detail-card,
#page-freight-dashboard .fd-exception-card {
    overflow: hidden;
    border: 1px solid var(--fd-line);
    border-radius: 8px;
    box-shadow: 0 5px 14px rgba(32, 48, 47, 0.05);
}

#page-freight-dashboard .fd-config-card .card-header,
#page-freight-dashboard .fd-detail-card .card-header,
#page-freight-dashboard .fd-exception-card .card-header {
    min-height: 58px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--fd-line);
    background: #fbfdfc;
}

#page-freight-dashboard .fd-detail-card .card-header {
    border-left: 4px solid var(--fd-accent);
}

#page-freight-dashboard .fd-unit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}

#page-freight-dashboard .fd-unit-toggle-control {
    position: relative;
    display: inline-flex;
    width: 38px;
    height: 22px;
}

#page-freight-dashboard .fd-unit-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}

#page-freight-dashboard .fd-unit-toggle-slider {
    width: 100%;
    height: 100%;
    border: 1px solid #b9ccc5;
    border-radius: 999px;
    background: #e5ece9;
    transition: background 180ms ease, border-color 180ms ease;
}

#page-freight-dashboard .fd-unit-toggle-slider::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(32, 48, 47, 0.2);
    content: '';
    transition: transform 180ms ease;
}

#page-freight-dashboard .fd-unit-toggle input:checked + .fd-unit-toggle-slider {
    border-color: var(--fd-accent);
    background: var(--fd-accent);
}

#page-freight-dashboard .fd-unit-toggle input:checked + .fd-unit-toggle-slider::after {
    transform: translateX(16px);
}

#page-freight-dashboard .fd-unit-toggle:focus-within .fd-unit-toggle-slider {
    outline: 2px solid var(--fd-accent);
    outline-offset: 2px;
}

#page-freight-dashboard .card-title {
    color: var(--fd-ink);
    font-size: 15px;
    font-weight: 750;
    letter-spacing: 0;
}

#page-freight-dashboard .card-subtitle {
    margin-top: 4px;
    color: var(--fd-muted);
    font-size: 12px;
}

#page-freight-dashboard .btn-outline {
    border-color: #b9ccc5;
    color: var(--fd-ink-soft);
    background: #fff;
}

#page-freight-dashboard .btn-outline:hover {
    border-color: var(--fd-accent);
    color: var(--fd-accent-dark);
    background: var(--fd-mint);
}

#page-freight-dashboard .fd-config-card .btn-primary {
    border-color: var(--fd-accent);
    background: var(--fd-accent);
}

#page-freight-dashboard .fd-detail-card .data-table-wrapper {
    margin: 0;
    border: 0;
    border-radius: 0;
}

#page-freight-dashboard .fd-detail-card .data-table th,
#page-freight-dashboard .fd-detail-card .data-table td {
    border: 1px solid #d6e2de;
}

#page-freight-dashboard #fd-table {
    min-width: 1360px;
    font-size: 12px;
}

#page-freight-dashboard #fd-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 11px 12px;
    border-color: #3c5551;
    background: #2a403d;
    color: #eff7f5;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

#page-freight-dashboard #fd-table td {
    padding: 10px 12px;
    border-color: #e1ebe7;
    color: #344542;
    white-space: nowrap;
}

#page-freight-dashboard #fd-table th:nth-child(3),
#page-freight-dashboard #fd-table td:nth-child(3) {
    text-align: center;
}

#page-freight-dashboard #fd-table .fd-brand-header,
#page-freight-dashboard #fd-table .fd-brand-cell,
#page-freight-dashboard #fd-table .fd-summary-brand-cell {
    text-align: center;
}

#page-freight-dashboard #fd-table tbody tr:not(.fd-summary-row):hover td {
    background: #f0f8f5;
}

#page-freight-dashboard #fd-table .fd-group-cell {
    border-right-color: #c9d9d4;
    background: var(--fd-mint);
    color: #24564e;
    font-weight: 700;
    text-align: center;
}

#page-freight-dashboard #fd-table .fd-summary-region-cell {
    text-align: center;
}

#page-freight-dashboard #fd-table .fd-summary-row td {
    border-top: 1px solid #ddc48d;
    background: var(--fd-warm);
    color: #6a5426;
    font-weight: 700;
}

#page-freight-dashboard #fd-table .fd-summary-row.fd-regional-summary td {
    border-top-color: #b9d8ca;
    background: #edf7f3;
    color: #24564e;
}

#page-freight-dashboard #fd-table .fd-summary-row.fd-top-summary-row td {
    border-top: 2px solid #78a594;
    background: #dcece5;
    color: #1f5145;
}

#page-freight-dashboard #fd-table .fd-summary-row.fd-top-summary-detail-row td {
    border-top-color: #c7ddd4;
    background: #f3f9f6;
    color: #37675b;
}

#page-freight-dashboard #fd-table .fd-top-summary-label,
#page-freight-dashboard #fd-table .fd-top-summary-region {
    text-align: center;
}

#page-freight-dashboard #fd-table .price-cell {
    font-variant-numeric: tabular-nums;
}

#page-freight-dashboard #fd-table .btn-sm {
    min-width: 52px;
    padding: 5px 9px;
    font-size: 12px;
}

body.freight-dashboard-compact-mode #page-freight-dashboard #fd-table {
    min-width: 920px;
}

#page-freight-dashboard #fd-table .fd-note-cell {
    min-width: 190px;
    padding: 6px 8px;
}

#page-freight-dashboard .fd-note-input {
    display: block;
    width: 100%;
    min-height: 34px;
    resize: vertical;
    border: 1px solid #c9d9d4;
    border-radius: 4px;
    background: #fff;
    color: #344542;
    font: inherit;
    line-height: 1.45;
    padding: 6px 8px;
}

#page-freight-dashboard .fd-note-input:focus {
    outline: 2px solid var(--fd-accent);
    outline-offset: 1px;
    border-color: var(--fd-accent);
}

#page-freight-dashboard .fd-note-input.is-saved {
    border-color: #56a882;
    background: #f0faf5;
}

#page-freight-dashboard .fd-note-input.is-save-failed {
    border-color: var(--danger);
}

#page-freight-dashboard .fd-exception-card {
    border-color: #ecd7bb;
}

#page-freight-dashboard .fd-exception-card .card-header {
    border-left: 4px solid #c98932;
    background: #fffaf2;
}

#page-freight-dashboard #fd-exceptions,
#page-freight-dashboard #fd-admin-alerts {
    min-height: 48px;
    margin: 0;
    padding: 15px 18px;
    background: #fffdf9;
}

#page-freight-dashboard .fd-exception-item + .fd-exception-item {
    margin-top: 7px;
}

@media (max-width: 980px) {
    #page-freight-dashboard .fd-cockpit-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    #page-freight-dashboard .fd-cockpit-readout {
        width: 100%;
        min-width: 0;
        padding: 12px 0 0;
        border-top: 1px solid rgba(201, 220, 216, 0.24);
        border-left: 0;
        text-align: left;
    }

    #page-freight-dashboard .fd-control-deck {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #page-freight-dashboard .fd-control-deck .filter-actions {
        grid-column: 1 / -1;
        margin: 0;
    }

    #page-freight-dashboard .fd-control-deck .btn-primary {
        width: 100%;
    }
}

.schedule-picker-label {
    margin: 2px 0 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.schedule-time-slots {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    max-height: 196px;
    overflow-y: auto;
    margin-bottom: 12px;
    padding-right: 2px;
}

.schedule-time-slot {
    min-height: 30px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
}

.schedule-time-slot:hover:not(:disabled),
.schedule-time-slot.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.schedule-time-slot:disabled {
    border-color: #e1e4e8;
    background: #eef0f2;
    color: #9aa1a8;
    cursor: not-allowed;
}

.login-message.success {
    color: var(--success);
}

.table-actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
}

/* 顶部导航 */
.top-nav {
    background: linear-gradient(135deg, var(--primary) 0%, #6c63ff 100%);
    color: #fff;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(67,97,238,0.3);
}

.top-nav .logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-nav .logo-icon {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    padding: 16px 0;
    z-index: 90;
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    padding: 0 12px;
    margin-bottom: 4px;
}

.sidebar-menu li.is-hidden {
    display: none;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-menu li a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-menu li a.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(67,97,238,0.3);
}

.sidebar-menu li a .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 56px;
    padding: 24px;
    min-height: calc(100vh - 56px);
}

body.app-shell .top-nav .logo {
    margin-left: 46px;
}

body.sidebar-collapsed .sidebar {
    display: none;
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
}

body.freight-dashboard-page.freight-dashboard-compact-mode .main-content {
    margin-left: 0;
}

body.freight-dashboard-page.freight-dashboard-compact-mode .sidebar,
body.freight-dashboard-page.freight-dashboard-compact-mode .sidebar-toggle {
    display: none;
}

.main-content.view-scaled {
    font-size: calc(14px * var(--view-scale, 1));
}

.main-content.view-scaled .page-section.active {
    zoom: var(--view-scale, 1);
}

@supports not (zoom: 1) {
    .main-content.view-scaled .page-section.active {
        width: calc(100% / var(--view-scale, 1));
        transform: scale(var(--view-scale, 1));
        transform-origin: top left;
    }
}

.view-control-bar {
    display: none;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    position: sticky;
    top: 56px;
    z-index: 80;
    margin: -8px 0 16px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 14px rgba(43, 45, 66, 0.08);
}

.main-content.view-controls-visible .view-control-bar {
    display: flex;
}

.view-control-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.view-scale-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-light);
}

.view-scale-control input {
    width: 120px;
    accent-color: var(--primary);
}

.view-scale-control span:last-child {
    min-width: 38px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.view-control-button {
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.view-control-button:hover,
.view-control-button.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

body.workspace-wide .sidebar {
    display: none;
}

body.workspace-wide .main-content {
    margin-left: 0;
}

body.workspace-wide .top-nav {
    height: 44px;
}

body.workspace-wide .sidebar {
    top: 44px;
}

body.workspace-wide .main-content {
    margin-top: 44px;
    min-height: calc(100vh - 44px);
}

body.workspace-wide .view-control-bar {
    top: 44px;
}

/* 页面模块 */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* 首页板块选择 */
.home-welcome {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 40px;
}

.home-welcome h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.home-welcome p {
    font-size: 14px;
    color: var(--text-light);
}

.home-boards {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.home-featured-board-row {
    display: flex;
    justify-content: center;
    padding: 0 20px;
    margin-bottom: 32px;
}

.home-board-card.home-board-card--dashboard {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(460px, 100%);
    min-height: 0;
    padding: 2px 16px;
    border-left-color: #168878;
    color: inherit;
    text-decoration: none;
}

.home-board-compact-title {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.home-board-card--dashboard:hover .home-board-compact-title,
.home-board-card--dashboard:focus-visible .home-board-compact-title {
    color: #168878;
}

.home-board-card--dashboard:focus-visible {
    outline: 3px solid rgba(22, 136, 120, 0.28);
    outline-offset: 3px;
}

.home-board-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 380px;
    min-height: 320px;
    border-left: 4px solid var(--primary);
    padding: 24px;
    transition: transform 0.25s, box-shadow 0.25s;
    cursor: default;
}

.home-board-card:not(.home-board-disabled):hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.home-board-disabled {
    border-left: 4px dashed var(--border);
    background: #fafafa;
    opacity: 0.75;
}

.home-board-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.home-board-icon {
    font-size: 28px;
}

.home-board-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.home-board-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-board-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.home-board-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.home-board-item .item-arrow {
    font-size: 14px;
    color: var(--text-light);
    transition: color 0.2s, transform 0.2s;
}

.home-board-item:hover .item-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

.home-board-coming-soon {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 14px;
}

@media (max-width: 768px) {
    .home-boards {
        flex-direction: column;
        align-items: center;
    }
    .home-board-card {
        width: 100%;
        max-width: 400px;
    }
}

/* 物流费用对比 */
.logistics-lowest {
    background: #e8f5e9 !important;
    color: #2e7d32;
    font-weight: 600;
}

.logistics-lowest-row {
    background: #f5f5f5;
}

.logistics-lowest-row td {
    border-top: 2px solid var(--border);
}

/* 卡片 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.card-title .compare-title-selectors {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    color: var(--text-light);
    vertical-align: middle;
}

.card-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-light);
}

.user-management-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
}

.user-form {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    background: #fff;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.form-field span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-field input {
    width: 100%;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 10px;
    font-size: 14px;
}

.user-switches {
    display: flex;
    gap: 16px;
    margin: 14px 0;
    font-size: 13px;
}

.permission-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

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

.permission-item {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    font-size: 13px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.empty-state-card {
    text-align: center;
    padding: 48px 20px;
}

.operation-log-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

.operation-log-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.operation-log-detail {
    max-width: 560px;
    white-space: normal;
    text-align: left;
    line-height: 1.45;
}

.operation-log-row {
    cursor: pointer;
}

.operation-log-detail-panel {
    width: min(100%, 640px);
}

.operation-log-detail-body {
    display: grid;
    gap: 10px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

.operation-log-detail-full {
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.operation-log-pager {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    color: var(--text-light);
    font-size: 13px;
}

@media (max-width: 1100px) {
    .user-management-layout {
        grid-template-columns: 1fr;
    }
}

.card-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* 快递公司选择按钮区 */
.company-selector {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.company-selector-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.company-selector-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.company-selector-title .preset-btn {
    padding: 3px 14px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-light);
    border-radius: 20px !important;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 1.6;
    white-space: nowrap;
}

.company-selector-title .preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.company-selector-title .preset-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

.company-selector-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.company-selector-actions button {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.company-selector-actions button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.company-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quote-public-page { min-height: 100vh; background: #f5f7f9; color: var(--text); }
.quote-public-shell { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 72px 0; }
.quote-public-panel { background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 32px; box-shadow: 0 10px 28px rgba(31, 41, 55, .08); }
.quote-public-panel h1 { margin: 8px 0 10px; font-size: 28px; }
.quote-public-kicker { color: var(--primary); font-size: 13px; font-weight: 700; }
.quote-public-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.quote-guide { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.quote-guide-title { margin-bottom: 6px; font-size: 15px; font-weight: 700; color: var(--text); }
.quote-guide-image { display: block; width: 100%; max-height: 360px; margin-top: 12px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: zoom-in; }
.quote-guide-image:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.quote-image-lightbox { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 48px 24px 24px; background: rgba(15, 23, 42, .82); }
.quote-image-lightbox[hidden] { display: none; }
.quote-image-lightbox img { max-width: min(1120px, 100%); max-height: calc(100vh - 96px); object-fit: contain; border-radius: 8px; background: #fff; box-shadow: 0 18px 48px rgba(0, 0, 0, .35); }
.quote-image-lightbox-close { position: fixed; top: 16px; right: 18px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fff; color: #111827; font-size: 24px; line-height: 36px; cursor: pointer; box-shadow: 0 8px 22px rgba(0, 0, 0, .22); }
.company-tag.candidate-quote-tag { border-color: #c78a32; color: #8a5c13; }
.company-tag.candidate-quote-tag.selected { background: #b97822; border-color: #b97822; color: #fff; }
#qr-version-payload { font-family: Consolas, monospace; min-height: 260px; }

.page-section.quote-request-page {
    display: none;
}

.page-section.quote-request-page.active {
    display: grid;
    gap: 18px;
}

.quote-request-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 18px;
    align-items: stretch;
    padding: 24px;
    border: 1px solid #dce7f3;
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(67, 97, 238, .08), rgba(46, 196, 182, .06)),
        var(--card-bg);
    box-shadow: 0 12px 32px rgba(31, 41, 55, .07);
}

.quote-request-kicker {
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.quote-request-hero h2 {
    margin: 0;
    color: var(--text);
    font-size: 26px;
    letter-spacing: 0;
}

.quote-request-hero p {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--text-light);
    line-height: 1.7;
}

.quote-request-hero-panel {
    display: grid;
    gap: 10px;
    align-content: center;
    padding: 16px;
    border: 1px solid rgba(67, 97, 238, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .74);
}

.quote-request-hero-panel span {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.quote-request-hero-panel span::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.quote-request-card {
    border-color: #dce7f3;
    box-shadow: 0 8px 24px rgba(31, 41, 55, .05);
}

.quote-request-create-card {
    overflow: hidden;
}

.quote-request-page .card-header {
    gap: 16px;
}

.quote-request-page .form-field input,
.quote-request-page .form-field select {
    background: #fbfdff;
    border-color: #cfdceb;
}

.quote-request-page .form-field input:focus,
.quote-request-page .form-field select:focus,
.quote-request-page textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, .12);
    outline: none;
}

.quote-request-page .data-table-wrapper {
    border: 1px solid #e1e9f3;
    border-radius: 8px;
    overflow: auto;
}

.quote-request-page .data-table th {
    background: #f6f9fc;
    color: #526172;
    font-size: 12px;
    letter-spacing: 0;
}

.quote-request-page .data-table tbody tr:hover td {
    background: #fbfdff;
}

.quote-request-detail-card {
    border-left: 4px solid var(--primary);
}

.qr-version-review {
    display: grid;
    gap: 18px;
}

.qr-version-review-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.qr-review-section {
    display: grid;
    gap: 8px;
}

.qr-review-section-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.qr-review-table-wrapper {
    max-height: 420px;
}

.qr-review-table {
    min-width: 980px;
}

.qr-review-table th,
.qr-review-table td {
    white-space: nowrap;
}

.qr-review-table input {
    width: 92px;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid #cfdceb;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
}

.qr-review-table .qr-rule-input[data-field="rounding_mode"],
.qr-review-table .qr-rule-input[data-field="remark"] {
    width: 120px;
}

.qr-review-table input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, .12);
    outline: none;
}

.quote-request-form {
    max-width: 900px;
}

.quote-request-name-field,
.quote-request-company-field {
    display: block;
    max-width: 620px;
}

.quote-request-project-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.7fr) minmax(110px, .55fr) minmax(110px, .65fr) minmax(190px, .9fr);
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

.quote-request-project-row .quote-request-name-field {
    max-width: none;
}

.quote-request-company-field {
    margin-top: 4px;
}

.quote-request-form .form-actions {
    justify-content: flex-start;
    margin-top: 18px;
}

@media (max-width: 640px) {
    .quote-request-hero { grid-template-columns: 1fr; padding: 18px; }
    .quote-request-hero h2 { font-size: 22px; }
    .quote-request-project-row { grid-template-columns: 1fr; }
    .quote-request-name-field,
    .quote-request-company-field { max-width: none; }
}
@media (max-width: 640px) { .quote-public-shell { width: min(100% - 24px, 760px); padding: 24px 0; } .quote-public-panel { padding: 20px; } .quote-image-lightbox { padding: 56px 12px 16px; } .quote-image-lightbox img { max-height: calc(100vh - 88px); } }

.order-management-months {
    margin-bottom: 12px;
}

.company-tags-row {
    display: flex;
    align-items: flex-start;
    width: 100%;
    gap: 8px;
    margin-bottom: 4px;
}

.company-tags-row-label {
    flex: 0 0 auto;
    padding: 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.zone-select-button {
    flex: 0 0 auto;
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.zone-select-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.zone-select-button.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.zone-select-button.selected:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
    color: #fff;
}

.company-tags-row-items {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 8px;
}

.company-tag {
    padding: 3px 10px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.company-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.company-tag.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.company-tag.selected:hover {
    background: var(--primary-dark);
}

.filter-loading-text {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    color: var(--text-light);
    font-size: 13px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(46, 196, 182, 0.12);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(230, 57, 70, 0.12);
    color: var(--danger);
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.filter-bar:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group-stacked {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.filter-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-inline-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.compare-company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.compare-company-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.compare-company-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.compare-company-label-with-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.compare-company-block .company-tag.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f3f4f6;
    color: var(--text-light);
    border-color: var(--border);
}

.compare-company-block .company-tag.disabled:hover {
    background: #f3f4f6;
    color: var(--text-light);
    border-color: var(--border);
}

.sub-workbench-tabs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    margin: 0 0 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.sub-workbench-tab {
    min-width: 88px;
    height: 34px;
    padding: 0 16px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.sub-workbench-tab:hover,
.sub-workbench-tab.active {
    background: var(--primary);
    color: #fff;
}

.sub-workbench-panel {
    display: none;
}

.sub-workbench-panel.active {
    display: block;
}

.price-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
}

.price-mode-button {
    height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-light);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.price-mode-button.active,
.price-mode-button:hover {
    background: var(--primary);
    color: #fff;
}

.diff-positive {
    background: rgba(230, 57, 70, 0.12);
    color: var(--danger);
    font-weight: 700;
}

.diff-negative {
    background: rgba(46, 196, 182, 0.12);
    color: var(--success);
    font-weight: 700;
}

.diff-neutral {
    background: rgba(67, 97, 238, 0.08);
    color: var(--text-light);
}

.cost-compare-diff-totals {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    font-size: 12px;
    vertical-align: middle;
}

.cost-compare-diff-totals > span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.filter-group .company-tags {
    gap: 6px;
}

.filter-group .company-tag {
    padding: 4px 10px;
    font-size: 12px;
}

#page-cost-calc .company-selector,
#page-cost-compare .company-selector,
#page-lowest-freight .company-selector,
#page-logistics-compare .card:first-of-type,
#page-logistics-price-compare .card:first-of-type {
    resize: vertical;
    overflow: auto;
    min-height: 72px;
    max-height: 42vh;
}

#page-cost-calc .filter-group-stacked > .company-tags,
#page-cost-calc #cost-calc-companies,
#page-cost-compare .filter-group-stacked > .company-tags,
#page-cost-compare .compare-company-block > .company-tags,
#page-lowest-freight .filter-group-stacked > .company-tags,
#page-lowest-freight #lowest-freight-companies,
#page-logistics-compare #logistics-company-filter,
#page-logistics-compare #logistics-province-filter,
#page-logistics-price-compare #lpc-company-tags,
#page-logistics-price-compare #lpc-selected-provinces,
#page-logistics-price-compare #lpc-selected-cities {
    max-height: 22vh;
    overflow: auto;
    padding-right: 4px;
}

#page-cost-calc .data-table-wrapper,
#page-cost-compare .data-table-wrapper,
#page-lowest-freight .data-table-wrapper,
#page-logistics-compare .table-wrapper,
#page-logistics-compare .data-table-wrapper,
#page-logistics-price-compare .table-wrapper,
#page-logistics-price-compare .data-table-wrapper {
    overflow: auto;
    resize: vertical;
    min-height: 120px;
    max-height: 62vh;
}

#page-cost-calc .result-table,
#page-cost-compare .data-table,
#page-lowest-freight .data-table,
#page-logistics-compare .data-table,
#page-logistics-price-compare .data-table {
    min-width: max-content;
}

.main-content.compact-view {
    padding: 12px;
}

.main-content.compact-view .view-control-bar {
    margin-bottom: 10px;
}

.main-content.compact-view .stats-row {
    gap: 8px;
    margin-bottom: 10px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.main-content.compact-view .stat-card {
    padding: 8px 10px;
    gap: 8px;
}

.main-content.compact-view .stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 16px;
}

.main-content.compact-view .stat-label {
    min-height: auto !important;
    font-size: 11px;
}

.main-content.compact-view .stat-value {
    min-height: auto !important;
    font-size: 15px;
}

.main-content.compact-view .card,
.main-content.compact-view .company-selector {
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 8px;
}

.main-content.compact-view .card-header,
.main-content.compact-view .company-selector-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
}

.main-content.compact-view .filter-bar {
    gap: 6px;
    margin-bottom: 6px;
}

.main-content.compact-view .filter-group-stacked {
    gap: 5px;
}

.main-content.compact-view .company-tags,
.main-content.compact-view .company-tags-row-items {
    gap: 4px;
}

.main-content.compact-view .company-tags-row {
    gap: 5px;
    margin-bottom: 2px;
}

.main-content.compact-view .company-tag,
.main-content.compact-view .zone-select-button,
.main-content.compact-view .company-selector-actions button {
    padding: 2px 7px;
    font-size: 11px;
    line-height: 1.35;
}

.main-content.compact-view .btn-sm {
    min-height: 24px;
    padding: 4px 9px;
    font-size: 12px;
}

.main-content.compact-view .data-table-wrapper,
.main-content.compact-view .table-wrapper {
    margin: 0 -12px;
    padding: 0 12px;
}

.main-content.compact-view .data-table th,
.main-content.compact-view .data-table td,
.main-content.compact-view .result-table th,
.main-content.compact-view .result-table td {
    padding: 6px 8px;
    font-size: 12px;
}

.main-content.compact-view .result-table {
    margin-top: 8px;
}

.main-content.compact-view #page-cost-calc .filter-group-stacked > .company-tags,
.main-content.compact-view #page-cost-calc #cost-calc-companies,
.main-content.compact-view #page-cost-compare .filter-group-stacked > .company-tags,
.main-content.compact-view #page-cost-compare .compare-company-block > .company-tags,
.main-content.compact-view #page-lowest-freight .filter-group-stacked > .company-tags,
.main-content.compact-view #page-lowest-freight #lowest-freight-companies {
    max-height: 14vh;
}

.filter-label {
    font-size: 13px;
    color: var(--text-light);
    white-space: nowrap;
}

.carrier-tags-row .company-tags-row-label {
    min-width: 92px;
}

.carrier-mapping-table input,
.carrier-mapping-table select {
    width: 100%;
    min-width: 120px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
}

.carrier-mapping-table input:focus,
.carrier-mapping-table select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.12);
}

.carrier-mapping-table .raw-carrier-name {
    font-weight: 600;
}

.filter-select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text);
    background: var(--card-bg);
    min-width: 120px;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67,97,238,0.15);
}

/* 数据表格 */
.data-table-wrapper {
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table th {
    background: #f8f9fb;
    font-weight: 600;
    color: var(--text);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th:first-child,
.data-table td:first-child {
    text-align: left;
    font-weight: 600;
    position: sticky;
    left: 0;
    background: var(--card-bg);
    z-index: 5;
}

.data-table th:first-child {
    background: #f8f9fb;
    z-index: 15;
}

#lpc-table .lpc-location-col {
    width: 1%;
    min-width: 0;
    white-space: nowrap;
    text-align: left;
    padding-left: 8px;
    padding-right: 8px;
}

.data-table tbody tr:hover {
    background: var(--primary-light);
}

.data-table tbody tr:hover td:first-child {
    background: var(--primary-light);
}

#order-stats-table tbody tr.order-stats-zone-0,
#order-stats-table tbody tr.order-stats-zone-0 td:first-child {
    background: rgba(67, 97, 238, 0.07);
}

#order-stats-table tbody tr.order-stats-zone-1,
#order-stats-table tbody tr.order-stats-zone-1 td:first-child {
    background: rgba(46, 196, 182, 0.08);
}

#order-stats-table tbody tr.order-stats-zone-2,
#order-stats-table tbody tr.order-stats-zone-2 td:first-child {
    background: rgba(255, 159, 28, 0.09);
}

#order-stats-table tbody tr.order-stats-zone-3,
#order-stats-table tbody tr.order-stats-zone-3 td:first-child {
    background: rgba(239, 71, 111, 0.08);
}

#order-stats-table tbody tr.order-stats-zone-0:hover,
#order-stats-table tbody tr.order-stats-zone-0:hover td:first-child,
#order-stats-table tbody tr.order-stats-zone-1:hover,
#order-stats-table tbody tr.order-stats-zone-1:hover td:first-child,
#order-stats-table tbody tr.order-stats-zone-2:hover,
#order-stats-table tbody tr.order-stats-zone-2:hover td:first-child,
#order-stats-table tbody tr.order-stats-zone-3:hover,
#order-stats-table tbody tr.order-stats-zone-3:hover td:first-child {
    background: var(--primary-light);
}

#order-stats-table th {
    min-width: 104px;
}

.order-stats-sort-button {
    width: 100%;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.order-stats-sort-button:hover,
.order-stats-sort-button.active {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.order-stats-sort-button .sort-indicator {
    min-width: 14px;
    font-size: 12px;
    line-height: 1;
    color: var(--text-light);
}

.order-stats-sort-button.active .sort-indicator {
    color: var(--primary);
}

#order-stats-table td.order-stats-min {
    background: rgba(46, 196, 182, 0.18);
    color: var(--success);
    font-weight: 700;
}

#order-stats-table td.order-stats-max {
    background: rgba(230, 57, 70, 0.16);
    color: var(--danger);
    font-weight: 700;
}

/* 最低价高亮 */
.price-lowest {
    color: var(--success);
    font-weight: 700;
    background: rgba(46,196,182,0.1);
    border-radius: 4px;
    padding: 2px 6px;
}

.price-cell {
    font-variant-numeric: tabular-nums;
}

/* 颜色开关 */
.color-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.color-toggle input {
    display: none;
}

.color-toggle-slider {
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
}

.color-toggle-slider::after {
    content: '';
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.color-toggle input:checked + .color-toggle-slider {
    background: var(--primary);
}

.color-toggle input:checked + .color-toggle-slider::after {
    transform: translateX(16px);
}

.color-toggle-label {
    font-size: 13px;
    color: var(--text-light);
}

/* 全局浮动提示框 */
.float-tooltip {
    position: fixed;
    background: #2b2d42;
    color: #fff;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.15s;
}

/* 对比区域 */
.compare-section {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.compare-table-area {
    flex: 1;
}

.range-toggle {
    display: inline-flex;
    margin-left: 12px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8f9fb;
    vertical-align: middle;
}

.range-toggle button {
    min-width: 42px;
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-light);
    font-size: 12px;
    cursor: pointer;
}

.range-toggle button.active {
    background: var(--primary);
    color: #fff;
}

#compare-table,
#slp-compare-table {
    min-width: max-content;
}

#compare-table thead tr:first-child th,
#slp-compare-table thead tr:first-child th {
    border-bottom: 1px solid var(--border);
}

#compare-table thead tr:nth-child(2) th,
#slp-compare-table thead tr:nth-child(2) th {
    top: 38px;
}

#compare-table th:first-child,
#compare-table td:first-child,
#slp-compare-table th:first-child,
#slp-compare-table td:first-child {
    min-width: 90px;
}

#compare-table td,
#slp-compare-table td {
    min-width: 72px;
}

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

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue { background: rgba(67,97,238,0.1); color: var(--primary); }
.stat-icon.green { background: rgba(46,196,182,0.1); color: var(--success); }
.stat-icon.orange { background: rgba(255,159,28,0.1); color: var(--warning); }
.stat-icon.red { background: rgba(230,57,70,0.1); color: var(--danger); }

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

#page-cost-calc .stat-card {
    align-items: flex-start;
}

#page-cost-calc .stat-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 48px;
}

#page-cost-calc .stat-label {
    min-height: 32px;
    display: flex;
    align-items: flex-start;
}

#page-cost-calc .stat-value {
    min-height: 24px;
    display: flex;
    align-items: flex-end;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

/* 运费测算输入 */
.calc-input-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.calc-input-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calc-input-item label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.calc-input-item input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s;
}

.calc-input-item input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67,97,238,0.15);
}

.calc-input-item input::placeholder {
    color: #adb5bd;
}

/* 按钮 */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(67,97,238,0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* 结果表格 */
.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 16px;
}

.result-table th,
.result-table td {
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.result-table th {
    background: #f8f9fb;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

.result-table th:first-child,
.result-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.result-table th:not(:first-child),
.result-table td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.result-table tbody tr:hover {
    background: var(--primary-light);
}

.result-highlight {
    color: var(--success);
    font-weight: 700;
}

.result-cell-lowest {
    color: var(--success);
    font-weight: 700;
    background: rgba(46,196,182,0.12);
}

.card-title-with-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.unit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    user-select: none;
}

.unit-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.unit-toggle-slider {
    position: relative;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.unit-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s ease;
}

.unit-toggle input:checked + .unit-toggle-slider {
    background: var(--primary);
}

.unit-toggle input:checked + .unit-toggle-slider::after {
    transform: translateX(16px);
}

.unit-toggle input:focus-visible + .unit-toggle-slider {
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.18);
}

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

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

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

/* 价格输入框 */
.price-input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    transition: all 0.2s;
}

.price-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67,97,238,0.15);
}

.price-input::placeholder {
    color: #dee2e6;
}

/* 筛选标签紧凑模式 */
.filter-group .company-tags {
    gap: 6px;
}

.filter-group .company-tag {
    padding: 4px 10px;
    font-size: 12px;
}

/* 响应式 */
@media (max-width: 1200px) {
    .compare-section {
        flex-direction: column;
    }
}

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

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: none;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

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

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loading-overlay.hidden { display: none; }
.loading-spinner {
    width: 40px; height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
    margin-top: 12px;
    font-size: 15px;
    color: var(--text-light);
}

/* Enterprise workspace redesign */
:root {
    --primary: #087e8b;
    --primary-light: #e7f4f5;
    --primary-dark: #05616c;
    --success: #2f855a;
    --warning: #b7791f;
    --danger: #c2413a;
    --bg: #f3f6f6;
    --card-bg: #ffffff;
    --text: #17363b;
    --text-light: #60757a;
    --border: #d9e4e3;
    --shadow: 0 1px 2px rgba(20, 59, 64, 0.06);
    --radius: 6px;
    --sidebar-width: 252px;
}

body {
    background: var(--bg);
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
    line-height: 1.45;
}

body.auth-locked {
    background: #eef4f3;
}

.login-panel {
    border: 1px solid #d6e3e1;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(22, 69, 73, 0.12);
    padding: 32px;
}

.login-logo,
.top-nav .logo-icon {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #cbe1df;
}

.login-logo img,
.top-nav .logo-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-logo {
    border-radius: 8px;
}

.login-field input,
.filter-select,
.carrier-mapping-table input,
.carrier-mapping-table select,
.price-input,
.form-field input,
.form-field select {
    border-color: #cbdad8;
    border-radius: 5px;
    box-shadow: none;
}

.login-field input:focus,
.filter-select:focus,
.carrier-mapping-table input:focus,
.carrier-mapping-table select:focus,
.price-input:focus,
.form-field input:focus,
.form-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 126, 139, 0.14);
}

.top-nav {
    height: 64px;
    padding: 0 20px;
    background: #ffffff;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}

.top-nav .logo {
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0;
    gap: 10px;
}

.top-nav .logo-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
}

.nav-action-button,
.logout-button {
    height: 32px;
    margin-left: 8px;
    padding: 0 12px;
    border: 1px solid #cbdad8;
    border-radius: 5px;
    background: #ffffff;
    color: #36555a;
    font-weight: 600;
}

.nav-action-button {
    margin-left: auto;
}

.logout-button {
    border-color: #dfc7c3;
    color: #a33b34;
}

.nav-action-button:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.logout-button:hover {
    border-color: var(--danger);
    background: #fff4f3;
    color: var(--danger);
}

.sidebar-toggle {
    position: fixed;
    top: 15px;
    left: 12px;
    width: 32px;
    height: 32px;
    border: 1px solid #cbdad8;
    border-radius: 5px;
    background: #ffffff;
    color: #36555a;
    font-size: 17px;
}

.sidebar-toggle:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

body.app-shell .top-nav .logo {
    margin-left: 42px;
}

.sidebar {
    top: 64px;
    width: var(--sidebar-width);
    padding: 14px 0 22px;
    background: #17484f;
    border-right: 0;
    box-shadow: 4px 0 16px rgba(18, 54, 59, 0.08);
}

.sidebar-menu li {
    padding: 0 10px;
    margin-bottom: 2px;
}

.sidebar-menu li a {
    min-height: 40px;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 5px;
    color: #cfe3e1;
    font-size: 13px;
    font-weight: 600;
}

.sidebar-menu li a:hover {
    background: rgba(231, 244, 245, 0.12);
    color: #ffffff;
}

.sidebar-menu li a.active {
    background: #e1f1ef;
    color: #165960;
    box-shadow: inset 3px 0 0 #20a39e;
}

.sidebar-menu li a .icon {
    width: 18px;
    color: #9cc5c2;
    font-family: "Segoe UI Symbol", "Microsoft YaHei", sans-serif;
    font-size: 17px;
    font-weight: 400;
}

.sidebar-menu li a.active .icon,
.sidebar-menu li a:hover .icon {
    color: currentColor;
}

.main-content {
    margin-top: 64px;
    padding: 22px 28px 36px;
    min-height: calc(100vh - 64px);
}

.workspace-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    margin: -2px 0 18px;
    padding: 0 2px 12px;
    border-bottom: 1px solid var(--border);
}

.workspace-context-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.workspace-context-title span,
.workspace-context-meta {
    color: var(--text-light);
    font-size: 12px;
}

.workspace-context-title strong {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.workspace-context-meta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.workspace-context-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2f9e7a;
}

.view-control-bar {
    top: 72px;
    border-color: var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.page-section {
    animation: workspace-enter 180ms ease-out;
}

@keyframes workspace-enter {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.card,
.company-selector {
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin-bottom: 16px;
}

.card-header,
.company-selector-header {
    min-height: 34px;
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom-color: var(--border);
}

.card-title,
.company-selector-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.card-subtitle {
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.65;
}

.stats-row {
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    min-height: 88px;
    padding: 16px;
    border: 1px solid var(--border);
    border-top: 3px solid #68aeb1;
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.stat-card:nth-child(2) { border-top-color: #70a982; }
.stat-card:nth-child(3) { border-top-color: #d5a453; }
.stat-card:nth-child(4) { border-top-color: #cf776c; }

.stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 5px;
    font-size: 0;
    background: #edf6f5 !important;
}

.stat-icon::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.stat-icon.blue { color: #087e8b; }
.stat-icon.green { color: #2f855a; }
.stat-icon.orange { color: #b7791f; }
.stat-icon.red { color: #c2413a; }
.stat-icon.purple { color: #4b7882; }

.stat-label {
    color: var(--text-light);
    font-size: 12px;
}

.stat-value {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.btn {
    min-height: 34px;
    border-radius: 5px;
    font-weight: 700;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.btn:active,
.view-control-button:active,
.company-tag:active,
.sidebar-menu li a:active {
    transform: scale(0.98);
}

.btn-primary {
    border-color: var(--primary);
    background: var(--primary);
}

.btn-primary:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
}

.btn-outline {
    border-color: #b9d2cf;
    color: #17636a;
    background: #ffffff;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: var(--primary-light);
}

.filter-bar {
    gap: 10px 16px;
    margin-bottom: 14px;
}

.filter-group {
    gap: 8px;
}

.filter-group-stacked {
    gap: 8px;
    padding: 12px;
    border: 1px solid #dce9e7;
    border-radius: 5px;
    background: #fbfdfd;
}

.filter-group-header {
    min-height: 28px;
    gap: 10px;
}

.filter-label,
.form-field > span {
    color: #4e666b;
    font-size: 12px;
    font-weight: 700;
}

.company-selector-actions button,
.zone-select-button,
.company-tag {
    min-height: 27px;
    border-radius: 4px !important;
    border-color: #cbdad8;
    background: #ffffff;
    color: #36555a;
    font-weight: 600;
}

.company-tag {
    padding: 4px 9px;
}

.company-tag:hover,
.zone-select-button:hover,
.company-selector-actions button:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.company-tag.selected,
.zone-select-button.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
    box-shadow: none;
}

.data-table-wrapper,
.table-wrapper {
    margin: 0 -20px;
    padding: 0 20px 2px;
    scrollbar-color: #9dbab8 transparent;
}

.data-table,
.result-table {
    font-size: 13px;
}

.data-table th,
.data-table td,
.result-table th,
.result-table td {
    padding: 10px 12px;
    border-bottom-color: #e1e9e8;
}

.data-table th,
.result-table th {
    background: #edf4f3;
    color: #35575b;
    font-size: 12px;
    font-weight: 700;
}

.data-table tbody tr:hover td,
.result-table tbody tr:hover td {
    background: #f4faf9;
}

.data-table th:first-child,
.data-table td:first-child {
    background: inherit;
}

.data-table th:first-child {
    background: #edf4f3;
}

.result-highlight,
.result-cell-lowest,
.logistics-lowest {
    background: #eaf7ee !important;
    color: #216c43;
}

.home-welcome {
    margin: 0 0 20px;
    padding: 4px 0 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.home-welcome h2 {
    color: var(--text);
    font-size: 24px;
    letter-spacing: 0;
}

.home-welcome p {
    margin-top: 6px;
    color: var(--text-light);
    font-size: 13px;
}

.home-boards {
    gap: 16px;
}

.home-board-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.home-board-icon {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    background: var(--primary-light);
    color: transparent;
    font-size: 0;
}

.home-board-icon::after {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    margin: 9px;
    border: 2px solid #087e8b;
    border-radius: 2px;
}

.home-board-item {
    border-radius: 4px;
}

.modal-overlay {
    background: rgba(14, 44, 48, 0.38);
}

.modal-panel {
    border-radius: 7px;
    box-shadow: 0 20px 48px rgba(13, 49, 54, 0.2);
}

.loading-overlay {
    background: rgba(243, 246, 246, 0.8);
    backdrop-filter: blur(2px);
}

.loading-spinner {
    border-color: #d7e7e5;
    border-top-color: var(--primary);
}

.loading-text {
    color: #36555a;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .main-content {
        padding: 18px 18px 28px;
    }

    .workspace-context {
        margin-bottom: 14px;
    }

    .card,
    .company-selector {
        padding: 16px;
    }

    .data-table-wrapper,
    .table-wrapper {
        margin: 0 -16px;
        padding: 0 16px 2px;
    }
}

@media (max-width: 768px) {
    body.auth-locked .login-page {
        width: 100%;
        padding: 16px;
        overflow: hidden;
    }

    body.auth-locked .login-panel {
        width: min(100%, 320px) !important;
        max-width: 320px;
        padding: 22px;
    }

    .top-nav {
        height: 56px;
        padding: 0 12px;
    }

    .top-nav .logo {
        margin-left: 38px !important;
        font-size: 15px;
    }

    .top-nav .logo-icon {
        width: 26px;
        height: 26px;
    }

    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        top: 12px;
        left: 10px;
        z-index: 130;
    }

    .nav-action-button {
        display: none;
    }

    .logout-button {
        padding: 0 8px;
        font-size: 12px;
    }

    .sidebar {
        display: block;
        top: 56px;
        width: min(278px, 82vw);
        transform: translateX(-100%);
        transition: transform 180ms ease;
        z-index: 120;
    }

    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-collapsed .sidebar {
        display: block;
    }

    .main-content,
    body.sidebar-collapsed .main-content {
        margin-top: 56px;
        margin-left: 0;
        padding: 16px 12px 24px;
    }

    .workspace-context {
        min-height: 38px;
        margin: 0 0 14px;
        padding-bottom: 10px;
    }

    .workspace-context-meta {
        display: none;
    }

    .workspace-context-title strong {
        font-size: 16px;
    }

    .filter-bar {
        align-items: stretch;
    }

    .filter-group:not(.filter-group-stacked),
    .form-field {
        width: 100%;
    }

    .filter-select,
    .form-field input,
    .form-field select {
        flex: 1;
        min-width: 0;
    }

    .card,
    .company-selector {
        padding: 14px;
        margin-bottom: 12px;
    }

    .card-header,
    .company-selector-header {
        gap: 8px;
    }

    .card-header-actions {
        width: 100%;
    }

    .data-table-wrapper,
    .table-wrapper {
        margin: 0 -14px;
        padding: 0 14px 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* 名称映射配置 tab（快递导入 → 名称映射配置） */
.cm-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.cm-status-ok { background: #e8f5e9; color: #1b7f3b; }
.cm-status-warn { background: #fff3e0; color: #b26a00; }
.cm-status-danger { background: #fdecea; color: #c0392b; }

.cm-summary { margin: 4px 0 12px; }
.cm-summary .cm-status { margin-right: 10px; }

.cm-dirty-tip {
    align-self: center;
    color: #c0392b;
    font-size: 12px;
    font-weight: 600;
}

.cm-section-title { margin: 18px 0 8px; font-weight: 600; }

.cm-quote-toolbar {
    padding: 8px 0 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.cm-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}
