/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1890ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #f5222d;
    --text-color: #333;
    --text-secondary: #666;
    --border-color: #d9d9d9;
    --bg-color: #f5f5f5;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

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

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* 头部导航 */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {

    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.header-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.header-title-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.2;
    margin: 0;
}

.system-meta {
    font-size: 11px;
    color: #999;
    line-height: 1.2;
}

.header-slogan {
    font-size: 12px;
    color: var(--primary-color);
    opacity: 0.9;
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid rgba(24, 144, 255, 0.4);
}

.nav {
    display: flex;
    gap: 20px;
}

.nav-item {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 4px;
    transition: all 0.3s;
}

.nav-item:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--primary-color);
    color: var(--white);
}

/* 主内容区 */
.main-content {
    flex: 1;
    width: 100%;
    margin: 0;
    padding: 20px;
    display: flex;
    gap: 20px;
    box-sizing: border-box;
    overflow: hidden;
    min-height: 0; /* 允许 flex 子元素收缩 */
}

/* 侧边栏 */
.sidebar {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel {
    background: var(--white);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: var(--shadow);
}

.panel h2 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 6px;
}

/* 门店管理页面侧边栏样式 */
.sidebar-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 auto 20px;
    border: none;
    padding: 0;
    border-bottom: none;
}

.btn-add-store {
    width: 100%;
    padding: 12px;
    font-size: 14px;
}

/* 内容包装器（门店管理页面） */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    overflow: hidden;
}

/* 统计页面的内容区域允许滚动 */
.content-wrapper.statistics-page {
    overflow-y: auto;
    overflow-x: hidden;
}

/* 搜索面板 */
.search-panel {
    flex-shrink: 0;
    background: var(--white);
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    border: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.search-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.search-panel .page-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    border: none;
    padding: 0;
    white-space: nowrap;
    letter-spacing: -0.3px;
    flex-shrink: 0;
}

.search-panel .search-box {
    display: flex;
    gap: 10px;
    width: auto;
    min-width: 280px;
    flex: 1;
    max-width: 400px;
}

.search-panel .search-box .form-control {
    flex: 1;
    padding: 9px 14px;
    font-size: 13px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.search-panel .search-box .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.search-panel .filters {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
    flex: 1;
}

.search-panel .filters .form-control {
    min-width: 120px;
    width: auto;
    padding: 9px 12px;
    font-size: 13px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    background: var(--white);
    transition: all 0.2s ease;
}

.search-panel .filters .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.search-panel-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* 表格面板 */
.table-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    gap: 0;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.table-panel .table-container {
    border-radius: 0;
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: var(--white);
}

.table-panel .pagination-wrapper {
    flex-shrink: 0;
    border-top: 1px solid #f0f0f0;
}

.table-panel .pagination {
    border-radius: 0;
    margin-top: 0;
    border-top: none;
    background: #fafafa;
}

/* 地图滚轮缩放提示（首次打开显示） */
.map-zoom-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 13px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 500;
    cursor: pointer;
    pointer-events: auto;
    animation: mapZoomHintFadeIn 0.4s ease;
}
.map-zoom-hint:hover {
    background: rgba(0, 0, 0, 0.82);
}
.map-zoom-hint-icon {
    font-size: 16px;
}
@keyframes mapZoomHintFadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* 地图容器 */
.map-container {
    flex: 1;
    position: relative;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    min-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 允许 flex 子元素收缩 */
    height: 100%;
}

.map {
    width: 100% !important;
    height: 100% !important;
    min-height: 600px !important;
    min-width: 600px !important;
    position: relative;
    background: #f5f5f5;
    display: block;
    flex: 1;
}

/* 确保地图容器有内容时正确显示 */
.map-container {
    position: relative;
    min-height: 600px;
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--white);
    border-radius: 4px;
    cursor: pointer;
    box-shadow: var(--shadow);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* 表单控件 */
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    background: var(--white);
    color: #1a1a1a;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.form-control::placeholder {
    color: #bfbfbf;
}

.form-control.error {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.1);
}

.form-control.error:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 2px rgba(245, 34, 45, 0.2);
}

.filter-group {
    margin-bottom: 12px;
}
.filter-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}
/* 前置仓特征：标签和下拉放一排 */
.filter-group-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}
.filter-group-row .filter-label-inline {
    display: inline;
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
}
.filter-group-row .filter-multiselect {
    flex: 1;
    min-width: 0;
}

/* 按钮 */
.btn {
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

.btn-primary:hover {
    background: #40a9ff;
    box-shadow: 0 4px 8px rgba(24, 144, 255, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

.btn-secondary {
    background: var(--white);
    color: #595959;
    border: 1px solid #d9d9d9;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #fafafa;
    border-color: #bfbfbf;
    color: #1a1a1a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

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

/* 统计信息 */
.statistics {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: none;
    font-size: 12px;
    line-height: 1.4;
}

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

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 12px;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 24px;
    color: var(--text-color);
}

/* 工具栏 */
.toolbar {
    background: var(--white);
    padding: 16px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 300px;
}

.search-box .form-control {
    flex: 1;
}

.filters {
    display: flex;
    gap: 12px;
}

.filters .form-control {
    width: 150px;
}

/* 表格 */
.table-container {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.table-container .data-table {
    width: 100%;
    display: table;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--white);
}

.data-table thead {
    background: #fafafa;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #e8e8e8;
}

.data-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #595959;
    border-bottom: none;
    white-space: nowrap;
    text-shadow: none;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.3;
    position: relative;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.data-table th.sortable:hover {
    background-color: #f0f0f0;
}

.data-table th.sorting-active {
    background-color: #e6f7ff;
    color: var(--primary-color);
}

.sort-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 12px;
    opacity: 0.3;
    transition: opacity 0.2s ease;
    color: var(--primary-color);
}

.data-table th.sorting-active .sort-icon {
    opacity: 1;
}

.data-table th:first-child {
    border-top-left-radius: 0;
    padding-left: 16px;
}

.data-table th:last-child {
    border-top-right-radius: 0;
    padding-right: 16px;
}

.data-table tbody tr {
    transition: all 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.3;
}

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

.data-table tbody tr:hover {
    background: #f8f9fa;
    transform: none;
    box-shadow: none;
}

.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #1a1a1a;
    vertical-align: middle;
    line-height: 1.3;
}

.data-table td:first-child {
    padding-left: 16px;
}

.data-table td:last-child {
    padding-right: 16px;
}

/* 门店管理表格列宽优化 */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 180px;
    min-width: 180px;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.data-table th:nth-child(5),
.data-table td:nth-child(5) {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.data-table th:nth-child(6),
.data-table td:nth-child(6) {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

.data-table th:nth-child(7),
.data-table td:nth-child(7) {
    width: 180px;
    min-width: 180px;
}

.data-table th:nth-child(8),
.data-table td:nth-child(8) {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
}

.data-table th:nth-child(9),
.data-table td:nth-child(9) {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
}

/* 确保操作列内容不换行 */
.data-table td:nth-child(9) {
    white-space: nowrap;
    overflow: visible;
}

/* 地址列文本截断 */
.data-table td:nth-child(3) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 关联人员列文本截断 */
.data-table td:nth-child(7) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.data-table tbody tr:nth-child(even):hover {
    background: #f8f9fa;
}

.data-table .loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 60px 20px;
    font-size: 14px;
}

/* 门店标签 */
.store-tag {
    display: inline-block;
    padding: 4px 10px;
    margin: 2px 4px 2px 0;
    background: linear-gradient(135deg, #e6f7ff 0%, #bae7ff 100%);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid #91d5ff;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.store-tag:hover {
    background: linear-gradient(135deg, #bae7ff 0%, #91d5ff 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

/* 类型标签 */
.type-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f0f5ff 0%, #d6e4ff 100%);
    color: #2f54eb;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #adc6ff;
}

/* 状态标签 */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.status-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.status-筹备中 {
    background: linear-gradient(135deg, #fff7e6 0%, #ffe7ba 100%);
    color: #d46b08;
    border: 1px solid #ffd591;
}

.status-正常营业 {
    background: linear-gradient(135deg, #f6ffed 0%, #d9f7be 100%);
    color: #389e0d;
    border: 1px solid #b7eb8f;
}

.status-已闭店 {
    background: linear-gradient(135deg, #fff1f0 0%, #ffccc7 100%);
    color: #cf1322;
    border: 1px solid #ffa39e;
}

.status-暂停营业 {
    background: linear-gradient(135deg, #fff7e6 0%, #ffe7ba 100%);
    color: #d46b08;
    border: 1px solid #ffd591;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.action-btn {
    padding: 5px 10px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-btn:hover::before {
    width: 300px;
    height: 300px;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.action-btn-edit {
    background: #e6f7ff;
    color: var(--primary-color);
    border: 1px solid #91d5ff;
}

.action-btn-edit:hover {
    background: #bae7ff;
    color: #0050b3;
    border-color: #69c0ff;
}

.action-btn-delete {
    background: #fff1f0;
    color: var(--danger-color);
    border: 1px solid #ffccc7;
}

.action-btn-delete:hover {
    background: #ffccc7;
    color: #cf1322;
    border-color: #ffa39e;
}

/* 分页 */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fafafa;
    border-radius: 0;
    border-top: 1px solid #f0f0f0;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.page-size-selector label {
    font-size: 13px;
    color: #595959;
    white-space: nowrap;
}

.page-size-select {
    width: 70px;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-size-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
    outline: none;
}

.pagination-btn {
    padding: 7px 14px;
    border: 1px solid #d9d9d9;
    background: var(--white);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #595959;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f0f7ff;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

.pagination-info {
    color: #8c8c8c;
    font-size: 13px;
    margin: 0 8px;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

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

.modal-content {
    background: var(--white);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-large {
    max-width: 900px;
}

/* 人员类型管理弹窗 */
.personnel-types-modal .modal-header {
    flex-shrink: 0;
    padding: 16px 24px;
    border-bottom: 1px solid #e8e8e8;
}

.personnel-types-modal .modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.personnel-types-toolbar {
    flex-shrink: 0;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    z-index: 1;
    background: var(--white);
}

.personnel-types-table-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    max-height: 420px;
    padding: 0 24px 24px;
}

.personnel-types-table {
    width: 100%;
}

.personnel-types-table th:nth-child(1),
.personnel-types-table td:nth-child(1) { min-width: 140px; }

.personnel-types-table th:nth-child(2),
.personnel-types-table td:nth-child(2) { min-width: 100px; }

.personnel-types-table th:nth-child(3),
.personnel-types-table td:nth-child(3) { min-width: 100px; }

.personnel-types-table th:nth-child(4),
.personnel-types-table td:nth-child(4) { min-width: 70px; width: 70px; }

.personnel-types-table th:nth-child(5),
.personnel-types-table td:nth-child(5) { min-width: 80px; width: 80px; }

.personnel-types-table th:nth-child(6),
.personnel-types-table td:nth-child(6) { min-width: 140px; width: 140px; white-space: nowrap; }

.modal-header {
    flex-shrink: 0;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    position: relative;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.close {
    position: relative;
    right: 0;
    top: 0;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    padding: 4px;
    margin-left: 16px;
}

.close:hover {
    color: var(--text-color);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    min-height: 0;
}

.modal-footer {
    flex-shrink: 0;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--white);
}

/* 表单 */
.form {
    margin-top: 0;
}

/* 表单分组 */
.form-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.form-section-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 2px;
    flex-shrink: 0;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.form-row-3 .form-group {
    flex: 0 0 calc(33.333% - 8px);
    max-width: calc(33.333% - 8px);
}

.form-group {
    flex: 1;
    margin-bottom: 12px;
}

.form-group-third {
    flex: 0 0 calc(33.333% - 8px);
    max-width: calc(33.333% - 8px);
}

.form-group-full {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--text-color);
    font-weight: 500;
}

.form-group .required {
    color: var(--danger-color);
    margin-left: 2px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* 如果form-actions在modal-body中，隐藏它（因为按钮在modal-footer中） */
.modal-body .form-actions {
    display: none;
}

/* 人员编辑、人员类型编辑弹窗保留表单内按钮 */
#personnelModal .modal-body .form-actions,
#personnelTypeModal .modal-body .form-actions {
    display: flex;
}

/* 地图控制组 */
.map-control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.map-input-row .form-control {
    flex: 1;
}

.map-picker-container {
    width: 100%;
    height: 350px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

.map-picker-container .map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    text-align: center;
    font-size: 13px;
}

/* 门店详情 */
.store-detail {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

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

.detail-value {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar-title {
        writing-mode: horizontal-tb;
        margin: 0 0 16px 0;
    }

    .content-wrapper {
        flex-direction: column;
    }

    .search-panel {
        flex-wrap: wrap;
    }

    .search-panel .search-box {
        width: 200px;
    }

    .search-panel .filters {
        flex-wrap: wrap;
    }

    .map {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 12px 20px;
    }

    .nav {
        width: 100%;
        justify-content: space-around;
        margin-top: 12px;
    }

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

    .search-box {
        min-width: 100%;
    }

    .filters {
        flex-direction: column;
        width: 100%;
    }

    .filters .form-control {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row-3 .form-group,
    .form-group-third,
    .form-group-full {
        flex: 1;
        max-width: 100%;
    }

    .form-section {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .form-section-title {
        font-size: 14px;
        margin-bottom: 10px;
        padding-bottom: 4px;
    }

    .map-input-row {
        flex-direction: column;
    }

    .map-input-row .btn {
        width: 100%;
    }

    .map-picker-container {
        height: 280px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

/* 地图选择器 */
#mapPickerContainer,
.map-picker-container {
    min-height: 400px;
    width: 100%;
    height: 400px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

#btnGeocode {
    white-space: nowrap;
    transition: all 0.3s ease;
}

#btnGeocode:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#btnGeocode:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: var(--shadow);
    z-index: 3000;
    animation: slideIn 0.3s;
}

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

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

.message-error {
    background: var(--danger-color);
    color: var(--white);
}

.message-info {
    background: var(--primary-color);
    color: var(--white);
}

/* 图标预览 */
.icon-preview {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    color: var(--text-color);
}

/* 表单提示文字 */
/* 前置仓特征多选 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
}
.checkbox-group .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
}
.checkbox-group .checkbox-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.form-text {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 门店选择器容器 */
#storeSelectContainer {
    background: var(--white);
}

#storeSelectContainer label {
    user-select: none;
}

#storeSelectContainer label:hover {
    background: var(--bg-color);
    border-radius: 2px;
}

#storeSelectContainer input[type="checkbox"] {
    cursor: pointer;
}

/* ============================================
   统计页面样式 - 简洁专业版（紧凑布局）
   ============================================ */

/* 页面标题 */
.statistics-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e8e8;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 4px 0;
}

.page-subtitle {
    font-size: 12px;
    color: #8c8c8c;
    margin: 0;
}

/* 统计卡片网格 - 改为三列布局 */
.statistics-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 16px;
}

/* 统计卡片 */
.stat-card {
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 卡片头部 */
.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
}

.stat-card-title h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.stat-card-desc {
    margin: 0;
    font-size: 11px;
    color: #8c8c8c;
}

.btn-refresh {
    width: 24px;
    height: 24px;
    border: 1px solid #d9d9d9;
    background: #ffffff;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #595959;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-refresh:hover {
    border-color: #1890ff;
    color: #1890ff;
    transform: rotate(90deg);
}

/* 卡片主体 */
.stat-card-body {
    padding: 12px 14px;
}

/* 核心指标 */
.stat-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.stat-metric {
    text-align: center;
    padding: 8px 6px;
    background: #fafafa;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
}

.metric-label {
    font-size: 10px;
    color: #8c8c8c;
    margin-bottom: 4px;
    font-weight: 500;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
    color: #1890ff;
    line-height: 1;
}

.metric-success {
    color: #52c41a;
}

.metric-warning {
    color: #faad14;
}

.metric-danger {
    color: #ff4d4f;
}

/* 统计区块 */
.stat-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.stat-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px 0;
}

/* 图表 */
.stat-chart {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-chart-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.stat-chart-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #595959;
    font-weight: 500;
}

.stat-chart-value {
    font-weight: 600;
    color: #1890ff;
    font-size: 11px;
}

.stat-chart-bar {
    height: 14px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.stat-chart-bar-fill {
    height: 100%;
    background: #1890ff;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.stat-chart-empty {
    text-align: center;
    padding: 20px;
    color: #8c8c8c;
    font-size: 12px;
    background: #fafafa;
    border-radius: 4px;
    border: 1px dashed #d9d9d9;
}

/* 人员类型概览（复用stat-metrics样式） */
#personnelTypeOverview.stat-metrics {
    margin-bottom: 0;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}

/* IT人员明细列表 */
.it-personnel-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.it-personnel-item {
    padding: 8px 12px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
    transition: border-color 0.2s ease;
}

.it-personnel-item:hover {
    border-color: #1890ff;
}

.it-personnel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
}

.it-personnel-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.it-personnel-total {
    font-size: 11px;
    color: #1890ff;
    font-weight: 600;
    padding: 2px 6px;
    background: #e6f7ff;
    border-radius: 10px;
}

.it-personnel-section {
    margin-top: 6px;
}

.it-personnel-section:first-of-type {
    margin-top: 0;
}

.it-personnel-section-title {
    font-size: 9px;
    color: #8c8c8c;
    margin-bottom: 3px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.it-personnel-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.store-type-tag {
    display: inline-block;
    padding: 3px 8px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 3px;
    font-size: 10px;
    color: #595959;
    font-weight: 500;
    transition: all 0.2s ease;
}

.store-type-tag[data-personnel-id] {
    cursor: pointer;
}

.store-type-tag[data-personnel-id]:hover {
    background: #e6f7ff;
    border-color: #1890ff;
    color: #1890ff;
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .statistics-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .statistics-dashboard {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-metrics {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .stat-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-card-body {
        padding: 12px;
    }

    .stat-card-header {
        padding: 10px 12px;
    }

    .page-title {
        font-size: 18px;
    }

    .metric-value {
        font-size: 20px;
    }

    #personnelTypeOverview.stat-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}
