* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        Inter,
        "Microsoft YaHei",
        Arial,
        sans-serif;
    background: #f5f7fb;
    color: #172033;
}

button,
input {
    font: inherit;
}

button,
.button-link {
    border: 0;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    background: #2563eb;
    color: white;
    text-decoration: none;
}

input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d6dbea;
    border-radius: 8px;
    margin: 7px 0 18px;
}

.muted {
    color: #697386;
}

.error-message {
    color: #c62828;
    min-height: 24px;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(420px, 92vw);
    padding: 34px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 16px 45px rgba(20, 32, 60, 0.12);
}

.login-card button {
    width: 100%;
}

.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 230px 1fr;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 28px 20px;
    background: #111827;
    color: white;
}

.sidebar a:hover,
.sidebar a.active {
    background: #243046;
    color: white;
}

.secondary-button {
    background: #374151;
}

.sidebar > .secondary-button {
    margin-top: auto;
}

.content {
    min-width: 0;
    padding: 32px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.card,
.panel {
    background: white;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 5px 20px rgba(20, 32, 60, 0.06);
}

.button-row {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.danger-button {
    background: #c62828;
}

pre {
    min-height: 120px;
    overflow: auto;
    padding: 16px;
    border-radius: 10px;
    background: #111827;
    color: #e5e7eb;
}

.import-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 24px;
}

.import-cards .card p {
    margin: 8px 0 0;
    font-size: 28px;
    font-weight: 700;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

@media (max-width: 1000px) {
    .import-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .import-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

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

    .content {
        padding: 20px;
    }
}

.address-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.tab-buttons,
.search-group {
    display: flex;
    gap: 8px;
}

.tab-button {
    background: #e5e7eb;
    color: #374151;
}

.tab-button.active {
    background: #2563eb;
    color: white;
}

.search-group input {
    width: 320px;
    margin: 0;
}


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

th,
td {
    max-width: 260px;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th {
    background: #f8fafc;
    font-weight: 600;
}

tbody tr:hover {
    background: #f8fafc;
}

.small-button {
    padding: 7px 11px;
    font-size: 13px;
}

/* =========================================================
   链接形式按钮
   ========================================================= */

a.small-button,
a.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    text-decoration: none;
    line-height: 1.2;
}

a.small-button {
    padding: 7px 11px;
    font-size: 13px;
}

a.secondary-button {
    background: #374151;
}

a.secondary-button:hover {
    background: #4b5563;
    color: white;
    text-decoration: none;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.55);
}

.modal.hidden {
    display: none;
}

.modal-card {
    width: min(980px, 96vw);
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    border-radius: 14px;
    background: white;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
}

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

.icon-button {
    padding: 4px 12px;
    background: transparent;
    color: #374151;
    font-size: 28px;
}

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

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

.edit-field input {
    margin: 0;
}

.edit-field input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
}

.modal-actions {
    justify-content: flex-end;
    margin-top: 24px;
}

@media (max-width: 850px) {
    .address-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-group input {
        width: 100%;
    }

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

.user-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    max-width: none;
}

.user-modal-card {
    width: min(520px, 96vw);
}

.user-modal-card label {
    display: block;
    margin-bottom: 16px;
    font-weight: 600;
}

.user-modal-card select {
    width: 100%;
    margin-top: 7px;
    padding: 11px 12px;
    border: 1px solid #d6dbea;
    border-radius: 8px;
    background: white;
    font: inherit;
}

.status-badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-disabled {
    background: #f3f4f6;
    color: #6b7280;
}

.warning-button {
    background: #d97706;
}

.user-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.log-filters {
    display: grid;
    grid-template-columns:
        minmax(130px, 0.8fr)
        minmax(160px, 1fr)
        minmax(120px, 0.6fr)
        minmax(220px, 1.5fr)
        auto
        auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.log-filters input,
.log-filters select {
    width: 100%;
    margin: 0;
    padding: 10px 11px;
    border: 1px solid #d6dbea;
    border-radius: 8px;
    background: white;
    font: inherit;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 1100px) {
    .log-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .log-filters {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Dashboard 地图
   ========================================================= */

.map-page-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow: hidden;
}

.map-page-content .page-header {
    flex: 0 0 auto;
}

.map-control-panel {
    flex: 0 0 auto;
    margin-bottom: 18px;
}

.map-filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.map-filter-field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 190px;
    font-weight: 600;
}

.map-filter-field select {
    width: auto;
    min-width: 110px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #d6dbea;
    border-radius: 8px;
    background: white;
    font: inherit;
}

.map-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    cursor: pointer;
}

.map-checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.map-result-count {
    margin-left: auto;
    color: #697386;
}

.map-container-panel {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    border: 1px solid #dce2ec;
    border-radius: 14px;
    background: white;
}

#address-map {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.map-message {
    position: absolute;
    z-index: 600;
    right: 16px;
    bottom: 16px;
    max-width: min(420px, calc(100% - 32px));
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.88);
    color: white;
}

.map-message:empty {
    display: none;
}

.map-popup {
    display: grid;
    gap: 6px;
    min-width: 230px;
}

.map-popup strong {
    font-size: 15px;
}

.map-popup-link {
    margin-top: 5px;
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.map-popup-link:hover {
    text-decoration: underline;
}

@media (max-width: 760px) {
    .map-container-panel,
    #address-map {
        height: 560px;
        min-height: 560px;
    }

    .map-result-count {
        width: 100%;
        margin-left: 0;
    }

    .map-filter-field {
        width: 100%;
    }
}

.multi-select-input {
    width: 100%;
    min-height: 150px;
    padding: 8px;
    border: 1px solid #d6dbea;
    border-radius: 8px;
    background: white;
    font: inherit;
}

.weekday-vehicle-field {
    grid-column: 1 / -1;
    margin: 0;
    padding: 16px;
    border: 1px solid #d6dbea;
    border-radius: 10px;
}

.weekday-vehicle-field legend {
    padding: 0 6px;
    font-weight: 600;
}

.weekday-vehicle-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(90px, 1fr));
    gap: 10px;
}

.weekday-vehicle-grid label {
    display: grid;
    gap: 6px;
}

.weekday-vehicle-grid select {
    width: 100%;
    padding: 9px 8px;
    border: 1px solid #d6dbea;
    border-radius: 8px;
    background: white;
}

@media (max-width: 1000px) {
    .weekday-vehicle-grid {
        grid-template-columns: repeat(4, minmax(90px, 1fr));
    }
}

@media (max-width: 600px) {
    .weekday-vehicle-grid {
        grid-template-columns: repeat(2, minmax(90px, 1fr));
    }
}

.customer-tags-field {
    grid-column: 1 / -1;
    margin: 0;
    padding: 16px;
    border: 1px solid #d6dbea;
    border-radius: 10px;
}

.customer-tags-field legend {
    padding: 0 7px;
    font-weight: 600;
}

.customer-tag-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(120px, 1fr));
    gap: 10px;
}

.customer-tag-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #d6dbea;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
}

.customer-tag-option:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}

.customer-tag-option input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.custom-tag-field {
    display: block;
    margin-top: 16px;
}

.custom-tag-field span {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.edit-field select {
    width: 100%;
    margin: 0;
    padding: 11px 12px;
    border: 1px solid #d6dbea;
    border-radius: 8px;
    background: white;
    font: inherit;
}

@media (max-width: 900px) {
    .customer-tag-grid {
        grid-template-columns:
            repeat(2, minmax(120px, 1fr));
    }
}

@media (max-width: 520px) {
    .customer-tag-grid {
        grid-template-columns: 1fr;
    }
}

.related-alias-section {
    grid-column: 1 / -1;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #d6dbea;
}

#related-alias-section.hidden,
#alias-history-section.hidden {
    display: none !important;
}

.related-alias-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.related-alias-header h3 {
    margin: 0 0 5px;
}

.related-alias-header p {
    margin: 0;
}

.related-alias-actions {
    display: flex;
    gap: 7px;
    max-width: none;
}

@media (max-width: 700px) {
    .related-alias-header {
        align-items: stretch;
        flex-direction: column;
    }

    .related-alias-actions {
        flex-direction: column;
    }
}

/* 表格中的彩色标签 */
.table-badge-cell {
    overflow: visible;
}

.table-badge-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 80px;
}

.table-value-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 150px;
    min-height: 25px;
    padding: 3px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.customer-tag-badge {
    max-width: 130px;
}

.vehicle-badge {
    min-width: 54px;
    font-weight: 600;
}

.table-empty-value {
    color: #9ca3af;
}


/* 标签颜色 1：蓝色 */
.table-badge-color-0 {
    border-color: #bae6fd;
    background: #e0f2fe;
    color: #075985;
}


/* 标签颜色 2：绿色 */
.table-badge-color-1 {
    border-color: #bbf7d0;
    background: #dcfce7;
    color: #166534;
}


/* 标签颜色 3：紫色 */
.table-badge-color-2 {
    border-color: #ddd6fe;
    background: #ede9fe;
    color: #5b21b6;
}


/* 标签颜色 4：橙色 */
.table-badge-color-3 {
    border-color: #fed7aa;
    background: #ffedd5;
    color: #9a3412;
}


/* 标签颜色 5：红色 */
.table-badge-color-4 {
    border-color: #fecaca;
    background: #fee2e2;
    color: #991b1b;
}


/* 标签颜色 6：青色 */
.table-badge-color-5 {
    border-color: #a5f3fc;
    background: #cffafe;
    color: #155e75;
}


/* 标签颜色 7：黄色 */
.table-badge-color-6 {
    border-color: #fde68a;
    background: #fef3c7;
    color: #92400e;
}


/* 标签颜色 8：粉色 */
.table-badge-color-7 {
    border-color: #fbcfe8;
    background: #fce7f3;
    color: #9d174d;
}

.vehicle-badge-53 {
    border-color: #bae6fd;
    background: #dff3fb;
    color: #155e75;
}

.vehicle-badge-26 {
    border-color: #bbf7d0;
    background: #dcfce7;
    color: #166534;
}

.vehicle-badge-16 {
    border-color: #ddd6fe;
    background: #ede9fe;
    color: #5b21b6;
}

.vehicle-badge-cargo {
    border-color: #fed7aa;
    background: #ffedd5;
    color: #9a3412;
}

.vehicle-badge-closed {
    border-color: #e5e7eb;
    background: #f3f4f6;
    color: #6b7280;
}

.search-group {
    position: relative;
    flex-wrap: wrap;
    align-items: center;
}

.filter-dropdown {
    position: relative;
}

.filter-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    background: white;
    color: #374151;
    border: 1px solid #d6dbea;
}

.filter-button:hover,
.filter-button.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.filter-button span:not(:empty) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    background: #2563eb;
    color: white;
    font-size: 12px;
}

.filter-panel {
    position: absolute;
    z-index: 200;
    top: calc(100% + 8px);
    left: 0;
    display: grid;
    gap: 9px;
    min-width: 210px;
    max-height: 340px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #d6dbea;
    border-radius: 10px;
    background: white;
    box-shadow: 0 14px 35px rgba(20, 32, 60, 0.18);
}

.filter-panel.hidden {
    display: none;
}

.filter-panel strong {
    margin-bottom: 3px;
}

.filter-panel label {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border-radius: 7px;
    cursor: pointer;
}

.filter-panel label:hover {
    background: #f3f6fb;
}

.filter-panel input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.filter-clear-button {
    min-height: 42px;
    background: #f3f4f6;
    color: #4b5563;
}

.filter-clear-button:hover {
    background: #e5e7eb;
}

@media (max-width: 850px) {
    .filter-dropdown {
        flex: 1;
    }

    .filter-button {
        width: 100%;
        justify-content: center;
    }

    .filter-panel {
        width: min(280px, 90vw);
    }
}

/* =========================================================
   地址表格滚动与固定操作列
   ========================================================= */

.table-wrapper {
    width: 100%;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
}

.main-address-table-wrapper {
    max-height: calc(100vh - 290px);
    min-height: 300px;
    overflow: auto;
    scroll-behavior: smooth;
}

.related-alias-table-wrapper {
    max-height: 320px;
    margin-top: 12px;
}

#address-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
}

#related-alias-table {
    width: 100%;
    min-width: 1300px;
    border-collapse: collapse;
    table-layout: auto;
}

/* ---------- 固定表头 ---------- */

#address-table thead th,
#related-alias-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f8fafc;
    box-shadow: 0 1px 0 #e5e7eb;
}

/* ---------- 主地址操作列 ---------- */

#address-table th:last-child,
#address-table td:last-child {
    position: sticky;
    right: 0;
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    background: #ffffff;
    box-shadow: -5px 0 8px rgba(15, 23, 42, 0.08);
}

/* ---------- 关联从地址列宽 ---------- */

#related-alias-table th:nth-child(1),
#related-alias-table td:nth-child(1) {
    width: 90px;
    min-width: 90px;
}

#related-alias-table th:nth-child(2),
#related-alias-table td:nth-child(2) {
    width: auto;
    min-width: 260px;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#related-alias-table th:nth-child(3),
#related-alias-table td:nth-child(3) {
    width: 135px;
    min-width: 135px;
}

#related-alias-table th:nth-child(4),
#related-alias-table td:nth-child(4) {
    width: 85px;
    min-width: 85px;
}

#related-alias-table th:nth-child(5),
#related-alias-table td:nth-child(5) {
    width: 160px;
    min-width: 160px;
}

#related-alias-table th:nth-child(6),
#related-alias-table td:nth-child(6) {
    width: 110px;
    min-width: 110px;
}

#related-alias-table th:nth-child(7),
#related-alias-table td:nth-child(7) {
    width: 75px;
    min-width: 75px;
    text-align: center;
}

#related-alias-table th:nth-child(8),
#related-alias-table td:nth-child(8) {
    width: 170px;
    min-width: 170px;
}

/* ---------- 关联从地址操作列：动态宽度 ---------- */

#related-alias-table th:last-child,
#related-alias-table td:last-child {
    position: sticky;
    right: 0;

    width: 1%;
    min-width: max-content;
    max-width: none;

    padding-left: 14px;
    padding-right: 14px;

    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;

    background: #ffffff;

    box-shadow:
        -5px 0 8px rgba(15, 23, 42, 0.08);
}

/* ---------- sticky 层级 ---------- */

#address-table th:last-child,
#related-alias-table th:last-child {
    z-index: 20;
    background: #f8fafc;
}

#address-table td:last-child,
#related-alias-table td:last-child {
    z-index: 10;
}

/* ---------- hover ---------- */

#address-table tbody tr:hover td:last-child,
#related-alias-table tbody tr:hover td:last-child {
    background: #f8fafc;
}

/* ---------- 操作按钮间距 ---------- */

#address-table td:last-child button,
#related-alias-table td:last-child button {
    margin-right: 5px;
}

#address-table td:last-child button:last-child,
#related-alias-table td:last-child button:last-child {
    margin-right: 0;
}

.phone-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 38px;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
}

.phone-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    background: #eef2ff;
    font-size: 13px;
}

.phone-chip-remove {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.phone-add-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.phone-add-row input {
    flex: 1;
}

/* =========================================================
   从地址主地址映射轨迹
   ========================================================= */

.alias-history-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.alias-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.alias-history-header h3 {
    margin: 0 0 4px 0;
}


/* 当前关联卡片 */

.alias-current-card {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fbff;
}

.alias-current-label {
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.alias-current-code {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.alias-current-address {
    font-size: 14px;
}


/* 时间轴 */

.alias-history-list {
    position: relative;
}

.alias-history-item {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    min-height: 105px;
}

.alias-history-marker {
    position: relative;
    display: flex;
    justify-content: center;
}

.alias-history-dot {
    position: relative;
    z-index: 2;
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    background: #94a3b8;
}

.alias-history-line {
    position: absolute;
    top: 16px;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.alias-history-item:last-child
.alias-history-line {
    display: none;
}

.alias-history-item.current
.alias-history-dot {
    width: 12px;
    height: 12px;
    background: #2563eb;
}

.alias-history-content {
    padding-bottom: 20px;
}

.alias-history-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 5px;
}

.alias-history-code {
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: 12px;
}

.alias-history-item.current
.alias-history-code {
    background: #dbeafe;
}

.alias-history-address {
    margin-bottom: 4px;
    font-size: 14px;
}

.alias-history-time {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
}

.alias-history-meta {
    margin-top: 5px;
    font-size: 12px;
    color: #64748b;
}

.alias-history-note {
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 12px;
}

.alias-history-empty,
.alias-history-loading,
.alias-history-error {
    padding: 18px 0;
    color: #64748b;
}

.alias-history-error {
    color: #b91c1c;
}

/* =========================================================
   操作日志卡片
   ========================================================= */

.log-detail-container {
    min-height: 100px;
}

.log-card-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}


/* =========================================================
   基础卡片
   ========================================================= */

.log-detail-card {
    padding: 16px 18px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: #ffffff;
}

.log-card-title {
    margin-bottom: 12px;

    font-size: 15px;
    font-weight: 700;

    color: #172033;
}


/* =========================================================
   操作基本信息
   ========================================================= */

.log-meta-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 12px;
}

.log-meta-item {
    min-width: 0;

    padding: 10px 12px;

    border-radius: 8px;

    background: #f8fafc;
}

.log-meta-item span {
    display: block;

    margin-bottom: 4px;

    font-size: 12px;

    color: #697386;
}

.log-meta-item strong {
    display: block;

    overflow-wrap: anywhere;

    font-size: 13px;
}


/* =========================================================
   字段变更
   ========================================================= */

.log-field-change-list {
    display: flex;
    flex-direction: column;
}

.log-field-change-row {
    display: grid;

    grid-template-columns:
        130px
        minmax(0, 1fr)
        30px
        minmax(0, 1fr);

    align-items: center;

    gap: 10px;

    padding: 10px 0;

    border-bottom:
        1px solid #f1f5f9;
}

.log-field-change-row:last-child {
    border-bottom: 0;
}

.log-field-name {
    font-weight: 600;

    color: #374151;
}

.log-field-old {
    min-width: 0;

    padding: 7px 9px;

    border-radius: 7px;

    background: #f8fafc;

    color: #64748b;

    overflow-wrap: anywhere;
}

.log-field-new {
    min-width: 0;

    padding: 7px 9px;

    border-radius: 7px;

    background: #eff6ff;

    color: #1e40af;

    font-weight: 600;

    overflow-wrap: anywhere;
}

.log-field-arrow {
    text-align: center;

    color: #94a3b8;

    font-size: 17px;
}


/* =========================================================
   映射变更
   ========================================================= */

.log-mapping-card {
    border-color: #bfdbfe;

    background: #f8fbff;
}

.log-mapping-change {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        50px
        minmax(0, 1fr);

    align-items: center;

    gap: 12px;
}

.log-mapping-node {
    min-width: 0;

    padding: 13px 14px;

    border: 1px solid #e2e8f0;
    border-radius: 9px;

    background: white;

    overflow-wrap: anywhere;
}

.log-mapping-node.old {
    color: #64748b;
}

.log-mapping-node.new {
    border-color: #bfdbfe;

    background: #eff6ff;

    color: #1d4ed8;
}

.log-value-label {
    display: block;

    margin-bottom: 5px;

    font-size: 11px;
    font-weight: 500;

    color: #64748b;
}

.log-mapping-arrow {
    text-align: center;

    font-size: 22px;

    color: #94a3b8;
}


/* =========================================================
   导入统计
   ========================================================= */

.log-import-card {
    background: #fbfdff;
}

.log-stat-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(130px, 1fr)
        );

    gap: 10px;
}

.log-stat-item {
    padding: 12px;

    border-radius: 9px;

    background: #f8fafc;
}

.log-stat-item span {
    display: block;

    margin-bottom: 5px;

    font-size: 12px;

    color: #64748b;
}

.log-stat-item strong {
    font-size: 20px;

    color: #172033;
}


/* =========================================================
   新增 / 删除
   ========================================================= */

.log-create-card {
    border-color: #bbf7d0;

    background: #f7fef9;
}

.log-delete-card {
    border-color: #fecaca;

    background: #fffafa;
}


/* =========================================================
   错误
   ========================================================= */

.log-error-card {
    border-color: #fecaca;

    background: #fff7f7;
}

.log-error-message {
    padding: 10px 12px;

    border-radius: 8px;

    background: #fee2e2;

    color: #991b1b;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}


/* =========================================================
   通用详情
   ========================================================= */

.log-generic-row {
    display: grid;

    grid-template-columns:
        150px
        minmax(0, 1fr);

    gap: 12px;

    padding: 8px 0;

    border-bottom:
        1px solid #f1f5f9;
}

.log-generic-row:last-child {
    border-bottom: 0;
}

.log-generic-key {
    font-weight: 600;

    color: #475569;
}

.log-generic-value {
    min-width: 0;

    overflow-wrap: anywhere;
}

.log-null-value {
    color: #94a3b8;
}

.log-inline-badge {
    display: inline-flex;

    margin:
        2px 5px
        2px 0;

    padding: 3px 8px;

    border-radius: 999px;

    background: #eef2ff;

    color: #3730a3;

    font-size: 12px;
}

.log-object-value {
    display: inline-block;

    max-width: 100%;

    padding: 4px 7px;

    border-radius: 5px;

    background: #f1f5f9;

    color: #334155;

    white-space: normal;
    overflow-wrap: anywhere;
}

.log-empty {
    color: #94a3b8;
}


/* =========================================================
   日志弹窗稍微放宽
   ========================================================= */

#log-modal .modal-card {
    width: min(
        1050px,
        96vw
    );
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 800px) {

    .log-meta-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

    .log-field-change-row {
        grid-template-columns:
            1fr;
    }

    .log-field-arrow {
        text-align: left;
    }

    .log-mapping-change {
        grid-template-columns:
            1fr;
    }

    .log-mapping-arrow {
        transform:
            rotate(90deg);
    }

}


@media (max-width: 520px) {

    .log-meta-grid {
        grid-template-columns:
            1fr;
    }

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

}

.redirect-modal-card {
    width: min(720px, 96vw);
}

.redirect-search input {
    margin: 0 0 10px;
}

.redirect-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;

    max-height: 360px;

    margin-top: 12px;

    overflow-y: auto;
}

.redirect-result-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 4px;

    width: 100%;

    padding: 12px 14px;

    border: 1px solid #e2e8f0;
    border-radius: 9px;

    background: white;
    color: #172033;

    text-align: left;
}

.redirect-result-item:hover {
    border-color: #2563eb;

    background: #eff6ff;
}

.redirect-result-item strong {
    color: #1d4ed8;
}

.redirect-result-item small {
    color: #64748b;
}

.redirect-selected-target {
    margin-top: 16px;
}

.redirect-selected-target.hidden {
    display: none;
}

.redirect-target-card {
    padding: 14px 16px;

    border: 1px solid #bfdbfe;
    border-radius: 10px;

    background: #eff6ff;
}

.redirect-target-card strong {
    display: block;

    margin: 4px 0;

    color: #1d4ed8;
}

.redirect-record-button {
    background: #7c3aed;
}

/* =========================================================
   地址合并审核
   ========================================================= */

.merge-review-header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.merge-review-count {
    padding: 7px 12px;

    border-radius: 999px;

    background: #fff7ed;
    color: #c2410c;

    font-size: 13px;
    font-weight: 700;
}


.merge-review-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;

    margin-bottom: 16px;
}

.merge-review-toolbar h2 {
    margin-bottom: 4px;
}


.merge-review-list {
    display: flex;
    flex-direction: column;

    gap: 18px;

    margin-top: 16px;
}


/* =========================================================
   审核卡片
   ========================================================= */

.merge-review-card {
    padding: 18px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: #ffffff;
}

.merge-review-card-warning {
    border-color: #fed7aa;

    background: #fffdf8;
}


.merge-review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;

    margin-bottom: 16px;
}


.merge-review-status {
    display: inline-flex;

    padding: 4px 9px;

    border-radius: 999px;

    background: #fff7ed;
    color: #c2410c;

    font-size: 12px;
    font-weight: 700;
}


.merge-review-time {
    margin-top: 6px;

    font-size: 12px;

    color: #64748b;
}


.merge-alias-count {
    display: flex;
    align-items: baseline;

    gap: 5px;

    color: #64748b;
}

.merge-alias-count strong {
    font-size: 24px;

    color: #172033;
}


/* =========================================================
   地址对比
   ========================================================= */

.merge-address-comparison {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        50px
        minmax(0, 1fr);

    align-items: stretch;

    gap: 12px;
}


.merge-address-side {
    min-width: 0;

    padding: 15px;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #f8fafc;
}


.merge-target-address {
    border-color: #bfdbfe;

    background: #eff6ff;
}


.merge-address-invalid {
    border-color: #fecaca;

    background: #fff7f7;
}


.merge-address-label {
    margin-bottom: 6px;

    font-size: 11px;
    font-weight: 600;

    color: #64748b;
}


.merge-address-code {
    margin-bottom: 6px;

    font-size: 16px;
    font-weight: 700;

    color: #1d4ed8;

    overflow-wrap: anywhere;
}


.merge-address-main {
    margin-bottom: 5px;

    font-weight: 600;

    color: #172033;
}


.merge-address-secondary {
    margin-bottom: 10px;

    font-size: 13px;

    color: #475569;
}


.merge-address-meta {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 8px;

    margin-top: 12px;
}


.merge-address-meta > div {
    padding: 8px;

    border-radius: 7px;

    background: rgba(
        255,
        255,
        255,
        0.75
    );
}


.merge-address-meta span {
    display: block;

    margin-bottom: 3px;

    font-size: 11px;

    color: #64748b;
}


.merge-address-meta strong {
    display: block;

    font-size: 12px;

    overflow-wrap: anywhere;
}


.merge-review-arrow {
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 24px;

    color: #94a3b8;
}


.merge-target-error {
    margin: 10px 0;

    color: #b91c1c;

    font-weight: 700;
}


.merge-review-warning {
    margin-top: 12px;

    padding: 10px 12px;

    border-radius: 8px;

    background: #fee2e2;

    color: #991b1b;
}


/* =========================================================
   标签
   ========================================================= */

.merge-review-tag {
    display: inline-flex;

    margin:
        2px 4px
        2px 0;

    padding: 2px 6px;

    border-radius: 999px;

    background: #eef2ff;

    color: #3730a3;

    font-size: 11px;
}


/* =========================================================
   操作区
   ========================================================= */

.merge-review-actions {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-top: 16px;
}


.merge-review-action-spacer {
    flex: 1;
}


.merge-review-actions a {
    text-decoration: none;
}


.merge-review-actions button:disabled {
    opacity: 0.45;

    cursor: not-allowed;
}


/* =========================================================
   空状态
   ========================================================= */

.merge-review-empty {
    padding: 48px 20px;

    border: 1px dashed #cbd5e1;
    border-radius: 12px;

    text-align: center;

    color: #64748b;
}

.merge-review-empty strong {
    display: block;

    margin-bottom: 6px;

    color: #334155;
}


/* =========================================================
   审核确认弹窗
   ========================================================= */

.merge-review-modal-card {
    width: min(
        760px,
        96vw
    );
}


.merge-confirm-content {
    margin-top: 10px;
}


.merge-confirm-warning {
    margin-bottom: 14px;

    padding: 10px 12px;

    border-radius: 8px;

    background: #fff7ed;

    color: #9a3412;

    font-weight: 600;
}


.merge-confirm-route {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        50px
        minmax(0, 1fr);

    align-items: center;

    gap: 10px;
}


.merge-confirm-route > div:not(
    .merge-confirm-arrow
) {
    min-width: 0;

    padding: 12px;

    border: 1px solid #e2e8f0;
    border-radius: 9px;

    background: #f8fafc;
}


.merge-confirm-route span {
    display: block;

    margin-bottom: 5px;

    font-size: 11px;

    color: #64748b;
}


.merge-confirm-route strong {
    display: block;

    margin-bottom: 5px;

    overflow-wrap: anywhere;
}


.merge-confirm-route small {
    display: block;

    margin-top: 3px;

    color: #64748b;

    overflow-wrap: anywhere;
}


.merge-confirm-arrow {
    text-align: center;

    font-size: 22px;

    color: #94a3b8;
}


.merge-confirm-stat {
    margin-top: 14px;

    padding: 12px;

    border-radius: 8px;

    background: #eff6ff;

    color: #1e40af;
}


.merge-confirm-stat strong {
    font-size: 20px;
}


.merge-confirm-danger {
    margin-top: 10px;

    padding: 12px;

    border-radius: 8px;

    background: #fee2e2;

    color: #991b1b;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 800px) {

    .merge-address-comparison,
    .merge-confirm-route {
        grid-template-columns: 1fr;
    }

    .merge-review-arrow,
    .merge-confirm-arrow {
        transform: rotate(90deg);
    }

    .merge-address-meta {
        grid-template-columns: 1fr;
    }

    .merge-review-actions {
        flex-wrap: wrap;
    }

    .merge-review-action-spacer {
        display: none;
    }

    .merge-review-header-right {
        align-items: flex-end;
        flex-direction: column;
        gap: 5px;
    }
}

.merge-request-button {
    border: 1px solid #f59e0b;

    background: #fff7ed;

    color: #c2410c;
}

.merge-request-button:hover {
    background: #ffedd5;
}

.merge-review-readonly {
    display: inline-flex;
    align-items: center;

    padding: 7px 11px;

    border-radius: 999px;

    background: #f1f5f9;
    color: #64748b;

    font-size: 12px;
    font-weight: 600;
}

/* =========================================================
   从地址：客户名称 / 业务来源 / 命中
   ========================================================= */

.alias-customer-badge {
    max-width: 160px;

    border-color: #bae6fd;
    background: #e0f2fe;
    color: #075985;

    font-weight: 600;
}


/* 业务来源 */

.business-source-badge {
    min-width: 54px;

    font-weight: 600;
}


/* 下单 */

.business-source-order {
    border-color: #bbf7d0;
    background: #dcfce7;
    color: #166534;
}


/* 预约 */

.business-source-reservation {
    border-color: #ddd6fe;
    background: #ede9fe;
    color: #5b21b6;
}


/* 手动整理 */

.business-source-manual {
    border-color: #fed7aa;
    background: #ffedd5;
    color: #9a3412;
}


/* 其他 */

.business-source-other {
    border-color: #e5e7eb;
    background: #f3f4f6;
    color: #4b5563;
}


/* 命中次数 */

.hit-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 30px;
    height: 26px;

    padding: 0 8px;

    border-radius: 999px;

    background: #eef2ff;
    color: #3730a3;

    font-size: 13px;
    font-weight: 700;
}

/* =========================================================
   地址审核统一页面
   ========================================================= */

.review-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.review-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    background: #e5e7eb;
    color: #374151;
}

.review-tab.active {
    background: #2563eb;
    color: white;
}

.review-tab span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 22px;
    height: 22px;

    padding: 0 6px;

    border-radius: 999px;

    background: rgba(
        255,
        255,
        255,
        0.22
    );

    font-size: 12px;
}

#refresh-review-button {
    margin-left: auto;
}


.review-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.review-list.hidden {
    display: none;
}


.review-card {
    padding: 18px;

    border: 1px solid #e2e8f0;
    border-radius: 12px;

    background: #ffffff;
}

.review-card-warning {
    border-color: #fed7aa;
    background: #fffdf8;
}


.review-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 18px;

    margin-bottom: 15px;
}


.review-status {
    display: inline-flex;

    padding: 4px 9px;

    border-radius: 999px;

    background: #fff7ed;
    color: #c2410c;

    font-size: 12px;
    font-weight: 700;
}


.review-applicant {
    margin-top: 7px;

    color: #64748b;

    font-size: 13px;
}

.review-applicant strong {
    color: #172033;
}


.review-time {
    margin-top: 4px;

    color: #64748b;

    font-size: 12px;
}


.review-request-id {
    color: #64748b;

    font-size: 13px;
}


.create-review-address {
    padding: 15px;

    border: 1px solid #dbeafe;
    border-radius: 10px;

    background: #f8fbff;
}


.create-review-address > strong {
    display: block;

    margin-bottom: 9px;

    font-size: 16px;
}


.review-field-grid,
.review-detail-grid {
    display: grid;

    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );

    gap: 8px;

    margin-top: 12px;
}


.review-field {
    min-width: 0;

    padding: 9px 10px;

    border-radius: 8px;

    background: #f8fafc;
}


.review-field span {
    display: block;

    margin-bottom: 3px;

    color: #64748b;

    font-size: 11px;
}


.review-field strong {
    display: block;

    overflow-wrap: anywhere;

    font-size: 12px;
}


.review-details {
    margin-top: 12px;
}


.review-details summary {
    cursor: pointer;

    color: #2563eb;

    font-size: 13px;
    font-weight: 600;
}


.review-actions {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-top: 16px;
}


.review-action-spacer {
    flex: 1;
}


.review-empty {
    padding: 42px 20px;

    border: 1px dashed #cbd5e1;
    border-radius: 10px;

    text-align: center;

    color: #64748b;
}


.review-confirm-modal-card {
    width: min(
        700px,
        96vw
    );
}


.review-confirm-address {
    margin: 14px 0;

    padding: 12px;

    border-radius: 8px;

    background: #eff6ff;

    font-weight: 600;
}


@media (max-width: 1000px) {

    .review-field-grid,
    .review-detail-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

}


@media (max-width: 600px) {

    .review-field-grid,
    .review-detail-grid {
        grid-template-columns: 1fr;
    }

    .review-tabs {
        flex-wrap: wrap;
    }

    #refresh-review-button {
        margin-left: 0;
    }

}

.review-source-badge {
    display: inline-flex;
    align-items: center;

    padding: 3px 8px;

    border-radius: 999px;

    background: #eef2ff;
    color: #4338ca;

    font-size: 11px;
    font-weight: 700;
}

/* =========================================================
   统一审核 - 主地址合并卡片补强
   ========================================================= */

.merge-address-comparison {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        50px
        minmax(0, 1fr);

    align-items: stretch;

    gap: 14px;

    margin-top: 14px;
}


.merge-address-side {
    min-width: 0;

    padding: 14px;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #f8fafc;
}


.merge-target-address {
    border-color: #bfdbfe;
    background: #eff6ff;
}


.merge-address-label {
    margin-bottom: 6px;

    font-size: 11px;
    font-weight: 600;

    color: #64748b;
}


.merge-address-code {
    margin-bottom: 5px;

    color: #1d4ed8;

    font-size: 15px;
    font-weight: 700;

    overflow-wrap: anywhere;
}


.merge-address-main {
    margin-bottom: 5px;

    font-size: 15px;
    font-weight: 600;

    overflow-wrap: anywhere;
}


.merge-address-secondary {
    margin-bottom: 10px;

    color: #64748b;

    font-size: 13px;

    overflow-wrap: anywhere;
}


.merge-address-meta {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;

    margin-top: 12px;
}


.merge-address-meta > div {
    min-width: 0;

    padding: 8px 10px;

    border-radius: 8px;

    background: rgba(
        255,
        255,
        255,
        0.8
    );
}


.merge-address-meta span {
    display: block;

    margin-bottom: 3px;

    color: #64748b;

    font-size: 11px;
}


.merge-address-meta strong {
    display: block;

    font-size: 12px;

    overflow-wrap: anywhere;
}


.merge-review-arrow {
    display: flex;

    align-items: center;
    justify-content: center;

    color: #94a3b8;

    font-size: 24px;
}


.merge-review-actions {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-top: 14px;
}


.merge-review-action-spacer {
    flex: 1;
}


@media (max-width: 800px) {

    .merge-address-comparison {
        grid-template-columns: 1fr;
    }

    .merge-review-arrow {
        transform: rotate(90deg);
    }

    .merge-address-meta {
        grid-template-columns: 1fr;
    }

    .merge-review-actions {
        flex-wrap: wrap;
    }

    .merge-review-action-spacer {
        display: none;
    }
}

/* =========================================================
   新增映射 Excel 导入
   ========================================================= */

.new-mapping-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.new-mapping-stat-grid {
    display: grid;
    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );
    gap: 12px;
    margin-top: 18px;
}

.new-mapping-stat-card {
    padding: 14px 16px;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #f8fafc;
}

.new-mapping-stat-card span {
    display: block;
    margin-bottom: 6px;

    color: #64748b;
    font-size: 12px;
}

.new-mapping-stat-card strong {
    display: block;

    color: #172033;
    font-size: 24px;
}

.new-mapping-stat-card.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.new-mapping-stat-card.warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.new-mapping-stat-card.danger {
    border-color: #fecaca;
    background: #fef2f2;
}


.mapping-preview-section {
    margin-top: 20px;
}

.mapping-preview-section h3 {
    margin-bottom: 10px;
}


.mapping-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mapping-conflict-chip {
    display: inline-flex;

    padding: 5px 9px;

    border-radius: 999px;

    background: #fee2e2;
    color: #b91c1c;

    font-size: 12px;
    font-weight: 700;
}


.mapping-main-preview-list {
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
    gap: 10px;
}

.mapping-main-preview-card {
    min-width: 0;

    padding: 13px;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #ffffff;
}

.mapping-main-preview-card.conflict {
    border-color: #fecaca;
    background: #fff7f7;
}

.mapping-main-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-bottom: 7px;
}

.mapping-main-preview-header > strong {
    color: #1d4ed8;
    overflow-wrap: anywhere;
}


.mapping-preview-badge {
    flex: 0 0 auto;

    padding: 3px 7px;

    border-radius: 999px;

    background: #fff7ed;
    color: #c2410c;

    font-size: 11px;
    font-weight: 700;
}

.mapping-preview-badge.danger {
    background: #fee2e2;
    color: #b91c1c;
}


.mapping-main-address {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.mapping-main-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;

    margin-top: 9px;

    color: #64748b;
    font-size: 12px;
}


.mapping-alias-preview-row {
    display: grid;
    grid-template-columns:
        180px
        minmax(0, 1fr)
        150px;

    gap: 12px;

    padding: 9px 10px;

    border-bottom: 1px solid #e5e7eb;
}

.mapping-alias-preview-row strong,
.mapping-alias-preview-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}


.mapping-import-success {
    margin-top: 18px;

    padding: 18px;

    border: 1px solid #bbf7d0;
    border-radius: 10px;

    background: #f0fdf4;
}


.mapping-result-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 10px;

    margin: 12px 0 16px;
}

.mapping-result-grid > div {
    padding: 10px;

    border-radius: 8px;

    background: rgba(
        255,
        255,
        255,
        0.75
    );
}

.mapping-result-grid span {
    display: block;

    margin-bottom: 4px;

    color: #64748b;
    font-size: 11px;
}


@media (max-width: 1000px) {

    .new-mapping-stat-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

    .mapping-main-preview-list {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 650px) {

    .new-mapping-stat-grid,
    .mapping-result-grid {
        grid-template-columns: 1fr;
    }

    .mapping-alias-preview-row {
        grid-template-columns: 1fr;
    }
}

.hidden {
    display: none !important;
}

/* =========================================================
   Excel新增映射审核 - 相似地址
   ========================================================= */

.mapping-review-extra {
    margin-top: 14px;
}

.mapping-review-summary {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
    gap: 8px;
    margin-bottom: 12px;
}

.mapping-review-summary > div {
    padding: 9px 10px;
    border-radius: 8px;
    background: #f8fafc;
}

.mapping-review-summary span {
    display: block;
    color: #64748b;
    font-size: 11px;
}

.mapping-review-summary strong {
    display: block;
    margin-top: 3px;
    overflow-wrap: anywhere;
}


.candidate-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 14px;

    border: 1px dashed #cbd5e1;
    border-radius: 10px;

    color: #64748b;
}


.best-candidate-card {
    padding: 15px;

    border: 1px solid #cbd5e1;
    border-radius: 10px;

    background: #f8fafc;
}

.best-candidate-card.high {
    border-color: #fecaca;
    background: #fff7f7;
}

.best-candidate-card.medium {
    border-color: #fed7aa;
    background: #fffaf5;
}

.best-candidate-card.low {
    border-color: #fde68a;
    background: #fffdf5;
}


.best-candidate-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 10px;
}

.best-candidate-header span {
    display: block;

    color: #64748b;
    font-size: 11px;
}

.best-candidate-header strong {
    display: block;

    margin-top: 2px;

    font-size: 22px;
}


.candidate-address-code {
    color: #1d4ed8;

    font-weight: 700;
}

.candidate-main-address {
    margin-top: 4px;

    font-size: 15px;
    font-weight: 600;
}

.candidate-secondary {
    margin-top: 4px;

    color: #64748b;
    font-size: 12px;
}


.candidate-score-grid {
    display: grid;

    grid-template-columns:
        repeat(
            5,
            minmax(0, 1fr)
        );

    gap: 8px;

    margin-top: 12px;
}

.candidate-score-grid > div {
    padding: 8px;

    border-radius: 8px;

    background: rgba(
        255,
        255,
        255,
        0.78
    );
}

.candidate-score-grid span {
    display: block;

    color: #64748b;

    font-size: 11px;
}

.candidate-score-grid strong {
    display: block;

    margin-top: 3px;
}


.candidate-evidence {
    display: inline-flex !important;

    margin-top: 4px;
    padding: 2px 6px;

    border-radius: 999px;

    font-size: 11px !important;
    font-weight: 700;
}

.candidate-evidence.success {
    background: #dcfce7;
    color: #166534;
}

.candidate-evidence.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.candidate-evidence.unknown {
    background: #f1f5f9;
    color: #64748b;
}


.candidate-code-match {
    margin-top: 10px;

    padding: 8px 10px;

    border-radius: 8px;

    background: #fee2e2;
    color: #991b1b;

    font-size: 12px;
    font-weight: 700;
}


.candidate-list {
    margin-top: 10px;
}

.candidate-list-row {
    display: grid;

    grid-template-columns:
        80px
        minmax(0, 1fr)
        90px;

    gap: 10px;

    align-items: center;

    padding: 9px 0;

    border-bottom:
        1px solid #e5e7eb;
}

.candidate-list-row a {
    display: block;

    color: #2563eb;
    font-weight: 600;
}

.candidate-list-row span {
    display: block;

    margin-top: 2px;

    color: #64748b;
    font-size: 12px;
}


.mapping-linked-alias-list {
    margin-top: 10px;
}

.mapping-linked-alias-row {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        140px
        140px;

    gap: 10px;

    padding: 8px 0;

    border-bottom:
        1px solid #e5e7eb;
}


@media (max-width: 900px) {

    .candidate-score-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

    .mapping-review-summary {
        grid-template-columns: 1fr;
    }

    .mapping-linked-alias-row {
        grid-template-columns: 1fr;
    }
}

.review-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.review-action-spacer {
    flex: 1;
}

/* =========================================================
   Excel审核 - 重定向候选弹窗
   ========================================================= */

.excel-redirect-modal-card {
    width: min(
        980px,
        calc(100vw - 40px)
    );

    max-height:
        calc(100vh - 60px);

    overflow-y: auto;
}

.excel-redirect-modal-card .modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 16px;

    padding-bottom: 14px;

    border-bottom: 1px solid #e2e8f0;
}


.excel-redirect-modal-card .modal-header h2 {
    margin: 0;

    color: #172033;

    font-size: 20px;
    font-weight: 700;
}


.excel-redirect-candidate-list {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 12px;

    margin-top: 16px;
}


.excel-redirect-candidate {
    min-width: 0;

    padding: 14px;

    border:
        1px solid #e2e8f0;

    border-radius: 10px;

    background: #ffffff;
}


.excel-redirect-candidate.high {
    border-color: #fecaca;
    background: #fff7f7;
}

.excel-redirect-candidate.medium {
    border-color: #fed7aa;
    background: #fffaf5;
}

.excel-redirect-candidate.low {
    border-color: #fde68a;
    background: #fffdf5;
}


.excel-redirect-candidate-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 8px;
}


.excel-redirect-rank {
    display: block;

    color: #64748b;

    font-size: 11px;
}


.excel-redirect-score {
    display: block;

    margin-top: 2px;

    font-size: 22px;
}


.excel-redirect-evidence {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 7px;

    margin-top: 12px;
}


.excel-redirect-evidence > span {
    padding: 7px 8px;

    border-radius: 7px;

    background:
        rgba(
            248,
            250,
            252,
            0.9
        );

    color: #64748b;

    font-size: 11px;
}


.excel-redirect-evidence strong {
    color: #172033;
}


.excel-redirect-candidate-actions {
    display: flex;

    justify-content: flex-end;

    gap: 8px;

    margin-top: 12px;
}


@media (
    max-width: 800px
) {

    .excel-redirect-candidate-list {
        grid-template-columns:
            1fr;
    }
}

/* =========================================================
   重定向弹窗 - 搜索工具栏
   ========================================================= */

.excel-redirect-search {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 14px;
}


.excel-redirect-search input {
    flex: 1;
    min-width: 0;

    height: 38px;
    box-sizing: border-box;

    padding: 0 12px;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: #ffffff;

    color: #172033;
    font-size: 13px;
}

.excel-redirect-search input::placeholder {
    color: #94a3b8;
}

.excel-redirect-search input:focus {
    outline: none;

    border-color: #3b82f6;

    box-shadow:
        0 0 0 3px
        rgba(59, 130, 246, 0.12);
}

#excel-redirect-search-button,
#excel-redirect-show-recommended {
    height: 38px;
    box-sizing: border-box;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 16px;

    border-radius: 8px;

    font-size: 13px;
    font-weight: 600;
    line-height: 1;

    white-space: nowrap;

    cursor: pointer;
}

#excel-redirect-search-button {
    border: 1px solid #2563eb;

    background: #2563eb;
    color: #ffffff;
}


#excel-redirect-search-button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}


#excel-redirect-show-recommended {
    border: 1px solid #cbd5e1;

    background: #ffffff;
    color: #334155;
}


#excel-redirect-show-recommended:hover {
    background: #f1f5f9;
}

.excel-redirect-list-title {
    margin:
        18px 0 10px;

    font-size: 14px;
}

#close-excel-redirect-modal {
    height: 36px;

    padding: 0 14px;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: #ffffff;
    color: #475569;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}


#close-excel-redirect-modal:hover {
    background: #f1f5f9;
}

@media (max-width: 650px) {

    .excel-redirect-search {
        flex-direction: column;
    }

}

/* =========================================================
   重定向弹窗 - 待处理地址
   ========================================================= */

#excel-redirect-source {
    display: grid;
    grid-template-columns:
        auto
        minmax(0, 1fr);

    gap: 4px 12px;

    margin: 12px 0 0;
    padding: 12px 14px;

    border: 1px solid #dbeafe;
    border-radius: 10px;

    background: #f8fbff;
}


.redirect-source-label {
    grid-column: 1 / -1;

    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}


.redirect-source-code {
    color: #2563eb;

    font-size: 14px;
    font-weight: 700;

    overflow-wrap: anywhere;
}


.redirect-source-address {
    color: #172033;

    font-size: 14px;
    font-weight: 600;

    overflow-wrap: anywhere;
}

/* =========================================================
   重定向 - 同仓库多个主地址
   ========================================================= */

.redirect-warehouse-members {
    display: flex;
    flex-direction: column;

    gap: 7px;

    margin-top: 12px;
}


.redirect-warehouse-member {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto
        auto;

    align-items: center;

    gap: 10px;

    padding: 9px 10px;

    border:
        1px solid #e2e8f0;

    border-radius: 8px;

    background:
        rgba(
            255,
            255,
            255,
            0.85
        );
}


.redirect-warehouse-member.code-match {
    border-color:
        #fecaca;

    background:
        #fff7f7;
}


.redirect-member-info {
    min-width: 0;
}


.redirect-member-info strong {
    display: block;

    color:
        #2563eb;

    overflow-wrap:
        anywhere;
}


.redirect-member-info span {
    display: block;

    margin-top: 2px;

    color:
        #64748b;

    font-size:
        11px;

    overflow-wrap:
        anywhere;
}


@media (
    max-width: 650px
) {

    .redirect-warehouse-member {
        grid-template-columns:
            1fr;
    }

}

/* =========================================================
   地址审核筛选栏
   ========================================================= */

.review-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;

    margin: 12px 0 16px;
    padding: 12px 14px;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #f8fafc;
}


/* 下拉框统一 */
.review-filter-bar select {
    min-width: 150px;
    height: 36px;

    padding: 0 34px 0 12px;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: #ffffff;

    color: #172033;
    font-size: 13px;

    cursor: pointer;
}

/* hover */
.review-filter-bar select:hover {
    border-color: #94a3b8;
}


/* focus */
.review-filter-bar select:focus {
    outline: none;
    border-color: #3b82f6;

    box-shadow:
        0 0 0 3px
        rgba(59, 130, 246, 0.12);
}

/* 清除筛选 */
#reset-create-review-filters {
    height: 36px;

    padding: 0 14px;

    border: none;
    border-radius: 8px;

    background: #334155;
    color: #ffffff;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}

#reset-create-review-filters:hover {
    background: #1e293b;
}


/* 右侧数量 */
#create-filter-result-count {
    margin-left: auto;

    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}


@media (
    max-width: 800px
) {

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

    .review-filter-bar select,
    .review-filter-bar button {
        flex:
            1 1 180px;
    }

    #create-filter-result-count {
        width:
            100%;

        margin-left:
            0;
    }

}

/* =========================================================
   重定向搜索栏 - 最终对齐修正
   必须放在 style.css 最底部
   ========================================================= */

.excel-redirect-search {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-top: 14px;
}


/* 输入框 */
.excel-redirect-search
#excel-redirect-search-input {
    flex: 1 1 auto;
    min-width: 0;

    width: auto;
    height: 38px;

    margin: 0 !important;
    padding: 0 12px;

    box-sizing: border-box;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: #ffffff;

    color: #172033;
    font-size: 13px;
    line-height: 36px;

    position: static;
    top: auto;
    transform: none;
}


/* 两个按钮 */
.excel-redirect-search
#excel-redirect-search-button,

.excel-redirect-search
#excel-redirect-show-recommended {
    flex: 0 0 auto;

    height: 38px;

    margin: 0 !important;
    padding: 0 16px;

    box-sizing: border-box;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    position: static;
    top: auto;
    transform: none;

    border-radius: 8px;

    font-size: 13px;
    font-weight: 600;
    line-height: 1;

    white-space: nowrap;

    vertical-align: middle;

    cursor: pointer;
}


/* 搜索 */
.excel-redirect-search
#excel-redirect-search-button {
    border: 1px solid #2563eb;

    background: #2563eb;
    color: #ffffff;
}


.excel-redirect-search
#excel-redirect-search-button:hover {
    border-color: #1d4ed8;
    background: #1d4ed8;
}


/* 返回推荐 */
.excel-redirect-search
#excel-redirect-show-recommended {
    border: 1px solid #cbd5e1;

    background: #ffffff;
    color: #334155;
}


.excel-redirect-search
#excel-redirect-show-recommended:hover {
    background: #f1f5f9;
}

/* =========================================================
   新增映射批次管理
   ========================================================= */

.batch-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 14px;
}


.batch-toolbar select {
    height: 36px;

    padding:
        0 34px
        0 12px;

    border:
        1px solid #cbd5e1;

    border-radius:
        8px;

    background:
        #ffffff;
}


.batch-count {
    margin-left: auto;
}


.mapping-batch-list {
    display: flex;
    flex-direction: column;

    gap: 12px;

    margin-top: 14px;
}


.mapping-batch-card {
    padding: 16px;

    border:
        1px solid #e2e8f0;

    border-radius:
        10px;

    background:
        #ffffff;
}


.mapping-batch-header {
    display: flex;

    justify-content:
        space-between;

    align-items:
        flex-start;

    gap: 16px;
}


.mapping-batch-id {
    color:
        #64748b;

    font-size:
        11px;

    font-weight:
        600;
}


.mapping-batch-header h3 {
    margin:
        3px 0 4px;

    font-size:
        16px;
}


.batch-status-badge {
    padding:
        4px 8px;

    border-radius:
        999px;

    font-size:
        11px;

    font-weight:
        700;
}


.batch-status-badge.pending {
    background:
        #fff7ed;

    color:
        #c2410c;
}


.batch-status-badge.completed {
    background:
        #dcfce7;

    color:
        #166534;
}


.mapping-batch-stat-grid {
    display: grid;

    grid-template-columns:
        repeat(
            9,
            minmax(
                0,
                1fr
            )
        );

    gap: 8px;

    margin-top: 14px;
}


.mapping-batch-stat-grid > div {
    padding:
        9px 10px;

    border-radius:
        8px;

    background:
        #f8fafc;
}


.mapping-batch-stat-grid span {
    display: block;

    color:
        #64748b;

    font-size:
        10px;
}


.mapping-batch-stat-grid strong {
    display: block;

    margin-top:
        3px;

    font-size:
        16px;
}


.batch-progress-row {
    display: grid;

    grid-template-columns:
        auto
        minmax(100px, 1fr)
        auto;

    align-items:
        center;

    gap: 10px;

    margin-top:
        14px;
}


.batch-progress-info {
    display: flex;

    gap: 6px;

    font-size:
        12px;
}


.batch-progress-track {
    height: 7px;

    overflow:
        hidden;

    border-radius:
        999px;

    background:
        #e2e8f0;
}


.batch-progress-fill {
    height: 100%;

    border-radius:
        999px;

    background:
        #2563eb;
}


.mapping-batch-actions {
    display: flex;

    justify-content:
        flex-end;

    gap: 8px;

    margin-top:
        14px;
}


@media (
    max-width: 1200px
) {

    .mapping-batch-stat-grid {
        grid-template-columns:
            repeat(
                3,
                minmax(
                    0,
                    1fr
                )
            );
    }

}


@media (
    max-width: 650px
) {

    .mapping-batch-stat-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(
                    0,
                    1fr
                )
            );
    }

}

.batch-filter-notice {
    margin-bottom: 12px;
    padding: 10px 12px;

    border: 1px solid #bfdbfe;
    border-radius: 8px;

    background: #eff6ff;
    color: #1e3a8a;

    font-size: 13px;
}

.batch-filter-notice a {
    margin-left: 8px;
    color: #2563eb;
    font-weight: 600;
}

.batch-alias-modal-card {
    width: min(
        1200px,
        calc(100vw - 40px)
    );

    max-height:
        calc(100vh - 60px);

    overflow: hidden;

    display: flex;
    flex-direction: column;
}


.batch-alias-table-wrap {
    margin-top: 14px;

    overflow: auto;

    border:
        1px solid #e2e8f0;

    border-radius: 8px;
}


.batch-alias-table {
    width: 100%;

    border-collapse:
        collapse;

    white-space:
        nowrap;
}


.batch-alias-table th,
.batch-alias-table td {
    padding:
        9px 10px;

    border-bottom:
        1px solid #e5e7eb;

    text-align: left;

    font-size: 12px;
}


.batch-alias-table th {
    position: sticky;
    top: 0;

    background: #f8fafc;

    color: #475569;

    z-index: 1;
}


.batch-alias-table td:nth-child(3) {
    min-width: 280px;
    white-space: normal;
}

/* =========================================================
   批次管理 - 操作按钮统一
   ========================================================= */

.mapping-batch-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;

    margin-top: 14px;
}


/* 查看审核：a 标签做成真正按钮 */
.mapping-batch-actions a.small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;
    box-sizing: border-box;

    padding: 0 12px;

    border: 1px solid #2563eb;
    border-radius: 8px;

    background: #2563eb;
    color: #ffffff !important;

    font-size: 12px;
    font-weight: 600;
    line-height: 1;

    text-decoration: none !important;
    white-space: nowrap;

    cursor: pointer;
}


.mapping-batch-actions a.small-button:hover {
    border-color: #1d4ed8;
    background: #1d4ed8;
    color: #ffffff !important;

    text-decoration: none;
}


/* 查看从地址 */
.mapping-batch-actions button.small-button {
    min-height: 34px;
    box-sizing: border-box;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 12px;

    border-radius: 8px;

    font-size: 12px;
    font-weight: 600;
    line-height: 1;

    white-space: nowrap;
}

.primary-button {
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff !important;
}

.batch-alias-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 14px;
}

.batch-alias-toolbar input {
    flex: 1;
    min-width: 0;

    height: 36px;

    padding: 0 12px;

    box-sizing: border-box;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: #ffffff;

    font-size: 13px;
}

.batch-alias-toolbar input:focus {
    outline: none;

    border-color: #3b82f6;

    box-shadow:
        0 0 0 3px
        rgba(59, 130, 246, 0.12);
}

/* =========================================================
   新版公共侧边栏
   ========================================================= */

:root {
    --sidebar-width: 190px;
    --sidebar-collapsed-width: 64px;
}


/* 页面整体 */

.app-layout {
    display: flex;

    min-height: 100vh;

    width: 100%;
}


/* =========================================================
   Sidebar
   ========================================================= */

.sidebar {
    position: relative;

    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);

    min-height: 100vh;

    box-sizing: border-box;

    display: flex;
    flex-direction: column;

    padding: 14px 10px;

    border-right:
        1px solid #e2e8f0;

    background: #ffffff;

    overflow: visible;

    transition:
        width 0.2s ease,
        flex-basis 0.2s ease;
}


/* 折叠 */

.sidebar.collapsed {
    width:
        var(--sidebar-collapsed-width);

    flex-basis:
        var(--sidebar-collapsed-width);
}


/* =========================================================
   Header
   ========================================================= */

.sidebar-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 8px;

    min-height: 42px;

    margin-bottom: 14px;
}


.sidebar-brand {
    display: flex;
    align-items: center;

    gap: 8px;

    min-width: 0;

    padding-left: 7px;

    color: #172033;

    font-weight: 700;
}


.sidebar-brand-icon {
    width: 26px;

    flex: 0 0 26px;

    text-align: center;

    font-size: 17px;
}


.sidebar-brand-text {
    white-space: nowrap;
}


.sidebar-toggle {
    width: 30px;
    height: 30px;

    flex: 0 0 30px;

    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border:
        1px solid #e2e8f0;

    border-radius: 7px;

    background: #ffffff;

    color: #64748b;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}


.sidebar-toggle:hover {
    background: #f1f5f9;

    border-color: #cbd5e1;
}


.sidebar-toggle-icon {
    line-height: 1;

    font-size: 20px;
}


/* =========================================================
   Navigation
   ========================================================= */

.sidebar-nav {
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 4px;

    min-height: 0;
}


.sidebar-item {
    position: relative;

    width: 100%;
    min-height: 40px;

    box-sizing: border-box;

    display: flex;
    align-items: center;

    gap: 9px;

    padding: 0 10px;

    border: none;
    border-radius: 8px;

    background: transparent;

    color: #475569;

    font-family: inherit;
    font-size: 13px;
    font-weight: 500;

    text-align: left;
    text-decoration: none;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


.sidebar-item:hover {
    background: #f1f5f9;

    color: #172033;
}


.sidebar-item.active {
    background: #eff6ff;

    color: #2563eb;

    font-weight: 600;
}


.sidebar-icon {
    width: 24px;

    flex: 0 0 24px;

    text-align: center;

    line-height: 1;

    font-size: 16px;
}


.sidebar-label {
    min-width: 0;

    overflow: hidden;

    white-space: nowrap;
}


/* =========================================================
   文件导入二级菜单
   ========================================================= */

.sidebar-group {
    width: 100%;
}


.sidebar-group-button {
    position: relative;
}


.sidebar-group-arrow {
    margin-left: auto;

    color: #94a3b8;

    line-height: 1;

    font-size: 18px;

    transition:
        transform 0.2s ease;
}


.sidebar-group.open
.sidebar-group-arrow {
    transform:
        rotate(90deg);
}


.sidebar-submenu {
    display: none;

    flex-direction: column;

    gap: 2px;

    margin:
        3px 0
        5px 35px;

    padding-left: 8px;

    border-left:
        1px solid #e2e8f0;
}


.sidebar-group.open
.sidebar-submenu {
    display: flex;
}


.sidebar-subitem {
    min-height: 32px;

    box-sizing: border-box;

    display: flex;
    align-items: center;

    padding: 0 9px;

    border-radius: 7px;

    color: #64748b;

    font-size: 12px;

    text-decoration: none;

    white-space: nowrap;
}


.sidebar-subitem:hover {
    background: #f8fafc;

    color: #172033;
}


.sidebar-subitem.active {
    background: #eff6ff;

    color: #2563eb;

    font-weight: 600;
}


/* =========================================================
   Footer
   ========================================================= */

.sidebar-footer {
    margin-top: auto;

    padding-top: 10px;

    border-top:
        1px solid #e2e8f0;
}


.sidebar-logout {
    color: #64748b;
}


/* =========================================================
   折叠状态
   ========================================================= */

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


.sidebar.collapsed
.sidebar-header {
    justify-content: center;
}


.sidebar.collapsed
.sidebar-label,

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


.sidebar.collapsed
.sidebar-item {
    justify-content: center;

    padding-left: 0;
    padding-right: 0;
}


.sidebar.collapsed
.sidebar-icon {
    width: 24px;

    flex-basis: 24px;
}


.sidebar.collapsed
.sidebar-submenu {
    display: none !important;
}


/* =========================================================
   折叠状态 Tooltip
   ========================================================= */

.sidebar.collapsed
.sidebar-item[data-tooltip]::after {
    content:
        attr(data-tooltip);

    position: absolute;

    left:
        calc(
            100% + 10px
        );

    top: 50%;

    z-index: 1000;

    padding: 6px 9px;

    border-radius: 6px;

    background: #172033;

    color: #ffffff;

    font-size: 12px;
    font-weight: 500;

    line-height: 1;

    white-space: nowrap;

    opacity: 0;

    pointer-events: none;

    transform:
        translateY(-50%)
        translateX(-4px);

    transition:
        opacity 0.12s ease,
        transform 0.12s ease;
}


.sidebar.collapsed
.sidebar-item[data-tooltip]:hover::after {
    opacity: 1;

    transform:
        translateY(-50%)
        translateX(0);
}


/* =========================================================
   Content
   ========================================================= */

.content {
    flex: 1;

    min-width: 0;

    box-sizing: border-box;

    padding:
        20px 24px 32px;
}

/* =========================================================
   新版 Sidebar - 清除旧样式干扰
   必须放 style.css 最底部
   ========================================================= */

.sidebar {
    display: flex !important;
    flex-direction: column !important;

    width: var(--sidebar-width) !important;
    flex: 0 0 var(--sidebar-width) !important;

    min-height: 100vh !important;

    padding: 14px 10px !important;

    box-sizing: border-box !important;

    overflow: visible !important;
}


/* 折叠 */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width) !important;
    flex-basis: var(--sidebar-collapsed-width) !important;
}


/* =========================================================
   关键：导航必须从顶部连续排列
   ========================================================= */

.sidebar .sidebar-nav {
    display: flex !important;
    flex-direction: column !important;

    justify-content: flex-start !important;
    align-items: stretch !important;

    flex: 1 1 auto !important;

    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;

    gap: 4px !important;

    margin: 0 !important;
    padding: 0 !important;
}


/* 清除旧 nav a 样式 */
.sidebar .sidebar-nav > a,
.sidebar .sidebar-nav .sidebar-group {
    flex: 0 0 auto !important;

    margin: 0 !important;
}


/* =========================================================
   一级菜单
   ========================================================= */

.sidebar .sidebar-item {
    position: relative !important;

    width: 100% !important;
    min-height: 40px !important;
    height: 40px !important;

    flex: 0 0 40px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;

    gap: 9px !important;

    margin: 0 !important;
    padding: 0 10px !important;

    box-sizing: border-box !important;

    border-radius: 8px !important;

    text-decoration: none !important;
}


/* =========================================================
   文件导入 group
   ========================================================= */

.sidebar .sidebar-group {
    display: block !important;

    width: 100% !important;
    height: auto !important;

    margin: 0 !important;
    padding: 0 !important;
}


.sidebar .sidebar-group-button {
    width: 100% !important;

    margin: 0 !important;
}


/* =========================================================
   二级菜单
   ========================================================= */

.sidebar .sidebar-submenu {
    height: auto !important;

    margin: 3px 0 5px 35px !important;
}


.sidebar .sidebar-subitem {
    min-height: 32px !important;

    margin: 0 !important;
}


/* =========================================================
   Footer 固定在底部
   只有退出登录应该被推到底
   ========================================================= */

.sidebar .sidebar-footer {
    margin-top: auto !important;

    flex: 0 0 auto !important;
}


/* =========================================================
   折叠
   ========================================================= */

.sidebar.collapsed .sidebar-item {
    justify-content: center !important;

    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sidebar-icon svg {
    width: 18px;
    height: 18px;

    display: block;
}

/* =========================================================
   全局页面高度框架
   ========================================================= */

html,
body {
    height: 100%;
    margin: 0;
}


body {
    overflow: hidden;
}


.app-layout {
    display: flex;

    width: 100%;
    height: 100dvh;

    min-height: 0;

    overflow: hidden;
}


/* =========================================================
   Sidebar
   ========================================================= */

.sidebar {
    height: 100dvh;
    min-height: 0;

    box-sizing: border-box;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


/*
 * 菜单区域自己可以滚动，
 * 但 footer 永远保留在底部。
 */
.sidebar-nav {
    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;
}


/* 退出登录永远可见 */
.sidebar-footer {
    flex: 0 0 auto;

    margin-top: 10px;

    padding-top: 10px;
    padding-bottom: 4px;

    background: inherit;
}

/* =========================================================
   主内容区域
   ========================================================= */

.content {
    flex: 1 1 auto;

    min-width: 0;
    min-height: 0;

    height: 100dvh;

    box-sizing: border-box;

    display: flex;
    flex-direction: column;

    padding:
        20px
        24px
        16px;

    overflow: hidden;
}

.page-header {
    flex: 0 0 auto;
}

.content > .panel {
    flex: 1 1 auto;

    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

/* =========================================================
   地址管理表格
   ========================================================= */

.main-address-table-wrapper {
    flex: 1 1 auto;

    min-height: 0;

    overflow: auto;

    border:
        1px solid #e2e8f0;

    border-radius: 8px;
}

.address-toolbar,
#page-info {
    flex: 0 0 auto;
}

/* =========================================================
   地址审核
   ========================================================= */

.review-filter-bar,
.review-tabs,
#review-message,
.batch-filter-notice {
    flex: 0 0 auto;
}


.review-list {
    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    padding-right: 4px;
}

/* =========================================================
   新增映射批次
   ========================================================= */

.batch-toolbar,
#batch-message {
    flex: 0 0 auto;
}


.mapping-batch-list {
    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    padding-right: 4px;
}

.import-page-panel {
    display: block !important;

    overflow-y: auto !important;
    overflow-x: hidden;

    min-height: 0;
}

.scroll-content {
    flex: 1 1 auto;

    min-height: 0;

    overflow: auto;
}

/* =========================================================
   用户管理 / 操作日志
   ========================================================= */

.content > .panel {
    flex: 1 1 auto;
    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


/* 表格区域吃掉剩余高度，并内部滚动 */
.table-wrapper {
    flex: 1 1 auto;
    min-height: 0;

    overflow: auto;

    border: 1px solid #e2e8f0;
    border-radius: 8px;
}


/* 固定表头 */
.table-wrapper thead th {
    position: sticky;
    top: 0;

    z-index: 5;

    background: #f8fafc;
}


/* =========================================================
   操作日志分页
   ========================================================= */

.pagination {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    margin-top: 10px;
    padding-top: 10px;

    border-top: 1px solid #e2e8f0;
}

/* =========================================================
   用户管理 / 操作日志顶部工具栏
   ========================================================= */

.user-toolbar,
.log-filters {
    flex: 0 0 auto;
}

.main-address-table-wrapper thead th,
.scroll-content thead th {
    position: sticky;
    top: 0;

    z-index: 5;

    background: #f8fafc;
}

/* =========================================================
   地图页布局修正
   ========================================================= */

.map-page-content {
    height: 100dvh;
    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


/* 页面标题固定高度 */
.map-page-content > .page-header {
    flex: 0 0 auto;
}


/*
 * 地图筛选区：
 * 只占内容本身需要的高度
 * 不能吃剩余空间
 */
.map-page-content > .map-control-panel {
    flex: 0 0 auto !important;

    min-height: auto !important;
    height: auto !important;

    display: block !important;

    overflow: visible !important;
}


/*
 * 地图区域：
 * 吃掉筛选区下面所有剩余高度
 */
.map-page-content > .map-container-panel {
    flex: 1 1 auto;

    min-height: 0;

    position: relative;

    overflow: hidden;

    margin-top: 12px;

    border-radius: 10px;
}


/* Leaflet 地图铺满剩余区域 */
.map-container-panel #address-map {
    width: 100%;
    height: 100% !important;

    min-height: 0;
}

/* =========================================================
   新增映射批次详情
   ========================================================= */

.batch-detail-back-row {
    margin-bottom: 6px;
}


.batch-detail-back {
    color: #64748b;

    font-size: 12px;
    font-weight: 600;

    text-decoration: none;
}


.batch-detail-back:hover {
    color: #2563eb;
}


.batch-detail-panel {
    flex: 1 1 auto;

    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


.batch-detail-summary {
    flex: 0 0 auto;

    display: grid;

    grid-template-columns:
        repeat(
            9,
            minmax(0, 1fr)
        );

    gap: 8px;

    margin: 12px 0 16px;
}


.batch-detail-stat {
    padding: 10px;

    border: 1px solid #e2e8f0;
    border-radius: 8px;

    background: #f8fafc;
}


.batch-detail-stat span {
    display: block;

    color: #64748b;

    font-size: 10px;
}


.batch-detail-stat strong {
    display: block;

    margin-top: 3px;

    font-size: 17px;
}


.batch-detail-stat small {
    color: #94a3b8;

    font-size: 10px;
}


.batch-detail-review-header {
    flex: 0 0 auto;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 10px;
}


.batch-detail-review-header h2 {
    margin: 0;

    font-size: 16px;
}


.batch-detail-review-header p {
    margin:
        3px 0 0;
}


.batch-detail-review-filters {
    display: flex;
    align-items: center;

    gap: 8px;
}


.batch-detail-review-filters select,
.batch-detail-review-filters input {
    height: 36px;

    box-sizing: border-box;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: #ffffff;

    font-size: 12px;
}


.batch-detail-review-filters select {
    padding:
        0 30px
        0 10px;
}


.batch-detail-review-filters input {
    width: 230px;

    padding:
        0 10px;
}


.batch-detail-review-list {
    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    display: flex;
    flex-direction: column;

    gap: 10px;

    padding-right: 4px;
}


.batch-review-card {
    flex: 0 0 auto;

    padding: 14px;

    border: 1px solid #e2e8f0;
    border-left-width: 4px;

    border-radius: 9px;

    background: #ffffff;
}


.batch-review-card.created {
    border-left-color: #16a34a;
}


.batch-review-card.redirected {
    border-left-color: #2563eb;
}


.batch-review-card.deleted {
    border-left-color: #dc2626;
}


.batch-review-card.pending {
    border-left-color: #f59e0b;
}


.batch-review-card.rejected {
    border-left-color: #64748b;
}


.batch-review-card-header {
    display: flex;
    justify-content: space-between;

    gap: 12px;
}


.batch-review-id {
    display: block;

    color: #94a3b8;

    font-size: 10px;
}


.batch-review-original-code {
    display: block;

    margin-top: 2px;

    color: #2563eb;

    font-size: 13px;
}


.batch-review-badges {
    display: flex;

    gap: 6px;
}


.batch-review-result-badge {
    padding:
        4px 8px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
}


.batch-review-result-badge.created {
    background: #dcfce7;
    color: #166534;
}


.batch-review-result-badge.redirected {
    background: #dbeafe;
    color: #1d4ed8;
}


.batch-review-result-badge.deleted {
    background: #fee2e2;
    color: #b91c1c;
}


.batch-review-result-badge.pending {
    background: #fef3c7;
    color: #92400e;
}


.batch-review-result-badge.rejected {
    background: #f1f5f9;
    color: #475569;
}


.batch-review-address {
    margin-top: 9px;

    font-size: 13px;
    font-weight: 600;
}


.batch-review-flow {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr);

    align-items: center;

    gap: 12px;

    margin-top: 12px;

    padding: 10px;

    border-radius: 8px;

    background: #f8fafc;
}


.batch-review-flow > div:not(
    .batch-review-flow-arrow
) {
    min-width: 0;
}


.batch-review-flow span,
.batch-review-flow small {
    display: block;

    color: #64748b;

    font-size: 10px;
}


.batch-review-flow strong {
    display: block;

    margin-top: 2px;

    font-size: 12px;
}


.batch-review-flow a {
    display: block;

    margin-top: 3px;

    color: #2563eb;

    font-size: 11px;

    text-decoration: none;

    overflow-wrap: anywhere;
}


.batch-review-flow-arrow {
    color: #94a3b8;

    font-size: 18px;
}


.batch-review-meta {
    display: flex;
    flex-wrap: wrap;

    gap:
        6px 18px;

    margin-top: 10px;

    color: #64748b;

    font-size: 10px;
}


.batch-review-meta strong {
    color: #334155;
}


.batch-review-note {
    margin-top: 8px;

    padding: 8px 10px;

    border-radius: 7px;

    background: #fffbeb;

    color: #92400e;

    font-size: 11px;
}


@media (
    max-width: 1100px
) {

    .batch-detail-summary {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }

}


@media (
    max-width: 760px
) {

    .batch-detail-review-header {
        align-items: stretch;
        flex-direction: column;
    }


    .batch-detail-review-filters {
        flex-wrap: wrap;
    }


    .batch-detail-review-filters input {
        flex: 1;

        width: auto;
    }


    .batch-review-flow {
        grid-template-columns:
            1fr;
    }


    .batch-review-flow-arrow {
        transform: rotate(90deg);
    }

}

.batch-detail-tabs {
    flex: 0 0 auto;

    display: flex;

    gap: 4px;

    margin-bottom: 12px;

    border-bottom:
        1px solid #e2e8f0;
}


.batch-detail-tab {
    min-height: 38px;

    padding: 0 12px;

    border: none;
    border-bottom:
        2px solid transparent;

    background: transparent;

    color: #64748b;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}


.batch-detail-tab.active {
    border-bottom-color:
        #2563eb;

    color: #2563eb;
}


.batch-detail-tab span {
    margin-left: 4px;

    padding: 2px 6px;

    border-radius: 999px;

    background: #f1f5f9;

    font-size: 10px;
}


.batch-detail-section {
    flex: 1 1 auto;

    min-height: 0;

    display: flex;
    flex-direction: column;
}


.batch-alias-detail-list {
    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;

    display: flex;
    flex-direction: column;

    gap: 9px;

    padding-right: 4px;
}


.batch-alias-detail-card {
    flex: 0 0 auto;

    padding: 12px 14px;

    border:
        1px solid #e2e8f0;

    border-radius: 9px;

    background: #ffffff;
}


.batch-alias-detail-id {
    color: #94a3b8;

    font-size: 10px;
}


.batch-alias-detail-address {
    margin-top: 3px;

    font-size: 13px;
    font-weight: 600;
}


.batch-alias-detail-meta {
    display: flex;

    flex-wrap: wrap;

    gap:
        4px 16px;

    margin-top: 7px;

    color: #64748b;

    font-size: 10px;
}


.batch-alias-current-target {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-top: 9px;

    padding: 7px 9px;

    border-radius: 7px;

    background: #f8fafc;

    font-size: 11px;
}


.batch-alias-current-target span {
    color: #64748b;
}


.batch-alias-current-target a {
    color: #2563eb;

    font-weight: 600;

    text-decoration: none;
}


.batch-alias-history-button {
    margin-top: 8px;
}


.batch-alias-history-container {
    margin-top: 10px;

    padding: 10px 12px;

    border-top:
        1px solid #e2e8f0;
}


.batch-alias-history-title {
    margin-bottom: 8px;

    font-size: 11px;
    font-weight: 700;
}


.batch-alias-history-item {
    position: relative;

    display: grid;

    grid-template-columns:
        14px
        minmax(0, 1fr);

    gap: 8px;

    padding-bottom: 12px;
}


.batch-alias-history-item::before {
    content: "";

    position: absolute;

    left: 6px;
    top: 12px;
    bottom: 0;

    width: 1px;

    background: #e2e8f0;
}


.batch-alias-history-item:last-child::before {
    display: none;
}


.batch-alias-history-dot {
    width: 8px;
    height: 8px;

    margin-top: 3px;

    border-radius: 50%;

    background: #94a3b8;

    z-index: 1;
}


.batch-alias-history-item.current
.batch-alias-history-dot {
    background: #2563eb;
}


.batch-alias-history-content {
    font-size: 11px;
}


.batch-alias-history-time {
    margin-top: 4px;

    color: #64748b;

    font-size: 10px;
}


.batch-alias-current-badge {
    margin-left: 5px;

    padding: 2px 5px;

    border-radius: 999px;

    background: #dbeafe;

    color: #1d4ed8;

    font-size: 9px;
    font-weight: 700;
}

/* =========================================================
   特殊营业日
   ========================================================= */

.special-hours-panel {
    flex: 1 1 auto;

    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


.special-hours-toolbar {
    flex: 0 0 auto;

    display: flex;
    align-items: center;

    gap: 8px;

    margin-bottom: 10px;
}


.special-hours-toolbar select {
    height: 36px;

    padding:
        0 30px
        0 10px;

    border:
        1px solid #cbd5e1;

    border-radius: 8px;

    background: #ffffff;
}


.special-hours-count {
    margin-left: auto;
}


.special-hours-list {
    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    display: flex;
    flex-direction: column;

    gap: 10px;

    margin-top: 10px;
    padding-right: 4px;
}


.special-hours-card {
    flex: 0 0 auto;

    padding: 14px;

    border:
        1px solid #e2e8f0;

    border-radius: 9px;

    background: #ffffff;
}


.special-hours-card-header {
    display: flex;

    justify-content:
        space-between;

    align-items:
        flex-start;

    gap: 12px;
}


.special-hours-batch-id {
    color: #94a3b8;

    font-size: 10px;
}


.special-hours-card h3 {
    margin:
        3px 0 4px;

    font-size: 15px;
}


.special-hours-status {
    padding:
        4px 8px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
}


.special-hours-status.draft {
    background: #fef3c7;
    color: #92400e;
}


.special-hours-status.published {
    background: #dcfce7;
    color: #166534;
}


.special-hours-status.finished {
    background: #e0e7ff;
    color: #3730a3;
}


.special-hours-status.cancelled {
    background: #f1f5f9;
    color: #64748b;
}


.special-hours-description {
    margin-top: 8px;

    color: #475569;

    font-size: 11px;
}


.special-hours-stat-grid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 8px;

    margin-top: 12px;
}


.special-hours-stat-grid > div {
    padding: 9px 10px;

    border-radius: 8px;

    background: #f8fafc;
}


.special-hours-stat-grid span {
    display: block;

    color: #64748b;

    font-size: 10px;
}


.special-hours-stat-grid strong {
    display: block;

    margin-top: 3px;

    font-size: 16px;
}


.special-hours-card-actions {
    display: flex;

    justify-content: flex-end;

    gap: 8px;

    margin-top: 12px;
}


.special-hours-detail-link {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    text-decoration: none !important;
}


.special-hours-date-row {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 10px;
}


.special-hours-batch-modal-card {
    width: min(
        560px,
        calc(100vw - 40px)
    );
}


.special-hours-detail-panel {
    flex: 1 1 auto;
    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


.special-batch-summary {
    flex: 0 0 auto;

    display: grid;

    grid-template-columns:
        repeat(
            6,
            minmax(0, 1fr)
        );

    gap: 8px;

    margin: 10px 0 14px;
}


.special-batch-summary > div {
    padding: 9px 10px;

    border-radius: 8px;

    background: #f8fafc;
}


.special-batch-summary span {
    display: block;

    color: #64748b;

    font-size: 10px;
}


.special-batch-summary strong {
    display: block;

    margin-top: 3px;

    font-size: 16px;
}


.special-rule-toolbar {
    flex: 0 0 auto;

    display: flex;
    align-items: center;

    gap: 8px;

    margin-bottom: 10px;
}


.special-rule-toolbar select,
.special-rule-toolbar input {
    height: 36px;

    box-sizing: border-box;

    border:
        1px solid #cbd5e1;

    border-radius: 8px;

    background: #ffffff;

    font-size: 12px;
}


.special-rule-toolbar select {
    padding:
        0 30px
        0 10px;
}


.special-rule-toolbar input {
    width: 250px;

    padding: 0 10px;
}


#special-rule-count {
    margin-left: auto;
}


.special-rule-list {
    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;

    display: flex;
    flex-direction: column;

    gap: 9px;

    padding-right: 4px;
}


.special-rule-card {
    flex: 0 0 auto;

    padding: 12px 14px;

    border:
        1px solid #e2e8f0;

    border-left-width: 4px;

    border-radius: 9px;

    background: #ffffff;
}


.special-rule-card.open {
    border-left-color: #16a34a;
}


.special-rule-card.closed {
    border-left-color: #dc2626;
}


.special-rule-card-header {
    display: flex;

    justify-content:
        space-between;

    gap: 12px;
}


.special-rule-date {
    margin-bottom: 3px;

    color: #64748b;

    font-size: 10px;
}


.special-rule-status {
    padding: 4px 8px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
}


.special-rule-status.open {
    background: #dcfce7;
    color: #166534;
}


.special-rule-status.closed {
    background: #fee2e2;
    color: #b91c1c;
}


.special-rule-code {
    margin-top: 7px;

    color: #2563eb;

    font-size: 11px;
    font-weight: 600;
}


.special-rule-meta {
    display: flex;
    flex-wrap: wrap;

    gap:
        5px 18px;

    margin-top: 8px;

    color: #64748b;

    font-size: 10px;
}


.special-rule-note {
    margin-top: 8px;

    padding: 7px 9px;

    border-radius: 7px;

    background: #f8fafc;

    color: #475569;

    font-size: 10px;
}


.special-rule-actions {
    display: flex;

    justify-content: flex-end;

    margin-top: 8px;
}


.special-rule-modal-card {
    width: min(
        600px,
        calc(100vw - 40px)
    );
}


.special-conflict-modal-card {
    width: min(
        900px,
        calc(100vw - 40px)
    );

    max-height:
        calc(100dvh - 60px);

    overflow-y: auto;
}


.special-conflict-row {
    display: grid;

    grid-template-columns:
        180px
        100px
        minmax(0, 1fr)
        minmax(180px, 1fr);

    gap: 10px;

    padding: 9px 0;

    border-bottom:
        1px solid #e2e8f0;

    font-size: 11px;
}


/* =========================================================
   特殊营业 Excel 导入
   ========================================================= */

.special-hours-import-panel {
    flex: 0 0 auto;

    margin-bottom: 14px;

    padding: 12px 14px;

    border: 1px solid #e2e8f0;
    border-radius: 9px;

    background: #f8fafc;
}


.special-hours-import-header h3 {
    margin: 0;

    font-size: 14px;
}


.special-hours-import-header p {
    margin:
        3px 0 0;
}


.special-hours-import-toolbar {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-top: 10px;
}


.special-hours-import-toolbar input[type="file"] {
    flex: 1;

    min-width: 0;
}


.special-hours-import-preview {
    margin-top: 12px;
}


.special-hours-import-summary {
    display: grid;

    grid-template-columns:
        repeat(
            8,
            minmax(0, 1fr)
        );

    gap: 7px;
}


.special-hours-import-summary > div {
    padding: 8px 9px;

    border-radius: 7px;

    background: #ffffff;

    border:
        1px solid #e2e8f0;
}


.special-hours-import-summary span {
    display: block;

    color: #64748b;

    font-size: 9px;
}


.special-hours-import-summary strong {
    display: block;

    margin-top: 3px;

    font-size: 15px;
}


.special-hours-import-errors {
    margin-top: 10px;
}


.special-import-error-section {
    margin-top: 7px;

    padding: 8px 10px;

    border:
        1px solid #fecaca;

    border-radius: 7px;

    background: #fef2f2;

    color: #991b1b;

    font-size: 10px;
}


.special-import-error-section h4 {
    margin:
        0 0 5px;

    font-size: 11px;
}


.special-import-success {
    padding: 8px 10px;

    border:
        1px solid #bbf7d0;

    border-radius: 7px;

    background: #f0fdf4;

    color: #166534;

    font-size: 10px;
}


@media (
    max-width: 1100px
) {

    .special-hours-import-summary {
        grid-template-columns:
            repeat(
                4,
                minmax(0, 1fr)
            );
    }

}




.special-address-edit-date {
    align-self: center;
}


/* =========================================================
   特殊营业地址卡片
   ========================================================= */

.special-address-card {
    flex: 0 0 auto;

    padding: 14px;

    border: 1px solid #e2e8f0;
    border-radius: 10px;

    background: #ffffff;
}


.special-address-card-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 14px;
}


.special-address-code {
    margin-bottom: 3px;

    color: #2563eb;

    font-size: 11px;
    font-weight: 700;
}


.special-address-name {
    display: block;

    font-size: 13px;
}


.special-address-summary {
    display: flex;

    gap: 6px;
}


.special-address-summary span {
    padding: 4px 8px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
}


.special-address-summary .open {
    background: #dcfce7;
    color: #166534;
}


.special-address-summary .closed {
    background: #fee2e2;
    color: #b91c1c;
}


/* =========================================================
   日期卡
   ========================================================= */

.special-address-days {
    display: flex;
    flex-wrap: wrap;

    gap: 7px;

    margin-top: 12px;
}


.special-address-day {
    min-width: 112px;

    padding: 8px 10px;

    border: 1px solid #e2e8f0;
    border-radius: 8px;

    background: #f8fafc;
}


.special-address-day span {
    display: block;

    color: #64748b;

    font-size: 9px;
}


.special-address-day strong {
    display: block;

    margin-top: 2px;

    font-size: 11px;
}


.special-address-day small {
    display: block;

    margin-top: 2px;

    color: #64748b;

    font-size: 9px;
}


.special-address-day.open {
    border-color: #bbf7d0;

    background: #f0fdf4;
}


.special-address-day.open strong {
    color: #166534;
}


.special-address-day.closed {
    border-color: #fecaca;

    background: #fef2f2;
}


.special-address-day.closed strong {
    color: #b91c1c;
}


.special-address-actions {
    display: flex;

    justify-content: flex-end;

    gap: 7px;

    margin-top: 10px;
}


.special-batch-header-actions {
    display: flex;
    align-items: center;

    gap: 8px;
}


.special-batch-header-status {
    padding: 5px 9px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
}


.special-batch-header-status.draft {
    background: #fef3c7;
    color: #92400e;
}


.special-batch-header-status.published {
    background: #dcfce7;
    color: #166534;
}


.special-batch-header-status.finished {
    background: #e0e7ff;
    color: #3730a3;
}


.special-batch-header-status.cancelled {
    background: #f1f5f9;
    color: #64748b;
}


.special-publish-modal-card {
    width: min(
        720px,
        calc(100vw - 40px)
    );
}


.special-publish-summary {
    display: grid;

    grid-template-columns:
        repeat(
            5,
            minmax(0, 1fr)
        );

    gap: 8px;

    margin-top: 12px;
}


.special-publish-summary > div {
    padding: 10px;

    border-radius: 8px;

    background: #f8fafc;
}


.special-publish-summary span {
    display: block;

    color: #64748b;

    font-size: 10px;
}


.special-publish-summary strong {
    display: block;

    margin-top: 3px;

    font-size: 17px;
}


.special-publish-warning,
.special-publish-success {
    margin-top: 12px;

    padding: 10px 12px;

    border-radius: 8px;

    font-size: 11px;
}


.special-publish-warning {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}


.special-publish-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}


/* =========================================================
   特殊营业 - 整体编辑弹窗
   ========================================================= */

.special-address-edit-modal-card {
    width: min(980px, calc(100vw - 40px));
    max-height: calc(100dvh - 60px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.special-address-edit-days {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    padding-right: 4px;
}

.special-address-edit-day {
    flex: 0 0 auto;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.special-address-edit-day.normal {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.special-address-edit-day.open {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.special-address-edit-day.closed {
    border-color: #fecaca;
    background: #fef2f2;
}

.special-address-edit-day-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.special-address-edit-day-header strong {
    display: block;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.2;
}

.special-address-edit-status-badge {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.special-address-edit-status-badge.normal {
    background: #e2e8f0;
    color: #475569;
}

.special-address-edit-status-badge.open {
    background: #dcfce7;
    color: #166534;
}

.special-address-edit-status-badge.closed {
    background: #fee2e2;
    color: #b91c1c;
}

.special-address-edit-fields {
    width: 100%;
    display: grid;
    grid-template-columns: 120px 90px 120px 120px minmax(180px, 1fr);
    gap: 10px;
    align-items: start;
}

.special-address-edit-fields > label {
    min-width: 0;
    display: grid;
    grid-template-rows: 16px 36px;
    gap: 4px;
    align-self: start;
    margin: 0;
    padding: 0;
}

.special-address-edit-fields > label > span {
    height: 16px;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    color: #64748b;
    font-size: 10px;
    line-height: 16px;
    white-space: nowrap;
}

.special-address-edit-fields input,
.special-address-edit-fields select {
    width: 100%;
    height: 36px;
    min-width: 0;
    min-height: 36px;
    max-height: 36px;
    display: block;
    margin: 0;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    font-size: 12px;
    line-height: normal;
}

.special-address-edit-fields input:disabled,
.special-address-edit-fields select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.special-address-edit-day-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.address-edit-delete-day {
    width: auto;
    min-width: 86px;
    margin: 0;
    white-space: nowrap;
}

.special-address-edit-modal-card .modal-actions {
    flex: 0 0 auto;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 900px) {
    .special-address-edit-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .special-address-edit-note {
        grid-column: 1 / -1;
    }
}


/* 地址审核 - 新增主地址记录编辑弹窗 */
.review-data-edit-modal-card {
    width: min(980px, calc(100vw - 40px));
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
}

.review-customer-tags-field {
    grid-column: 1 / -1;
}

#review-data-edit-message {
    min-height: 24px;
    margin: 14px 0 0;
}


/* 侧边栏折叠 tooltip：使用 body 级浮层，避免 overflow 裁剪 */
.sidebar.collapsed .sidebar-item[data-tooltip]::after {
    display: none;
}

.sidebar-floating-tooltip {
    position: fixed;
    z-index: 10000;
    padding: 7px 10px;
    border-radius: 6px;
    background: #172033;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(-4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.sidebar-floating-tooltip.visible {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
