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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 排序图标样式 */
.sort-icon {
    cursor: pointer;
    color: #666;
    font-size: 12px;
    margin-left: 5px;
    user-select: none;
    transition: color 0.2s ease;
    padding: 5px;
    display: inline-block;
}

.sort-icon:hover {
    color: #007bff;
}

/* 头部样式 */
.header {
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #666;
    font-size: 14px;
}

/* 搜索区域样式 */
.search-section {
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.search-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.search-right {
    display: flex;
    gap: 10px;
}

.search-value-container {
    position: relative;
    display: inline-block;
}

.merchant-search-container {
    position: relative;
    display: inline-block;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    min-width: 150px;
}

.search-select:disabled {
    background: #f5f5f5;
    color: #999;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
}

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

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

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

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

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

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

/* 主要内容区域 */
.main {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}



/* 楼层标签 */
.floor-tabs {
    padding: 15px 30px;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
}

.floor-tab {
    display: inline-block;
    padding: 8px 16px;
    margin-right: 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.floor-tab:hover {
    background: #e9ecef;
}

.floor-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* 楼层选择按钮区域 */
.floor-filter-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.floor-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.floor-buttons .filter-label {
    font-weight: 600;
    color: #495057;
    margin-right: 10px;
    font-size: 14px;
}

.floor-btn {
    padding: 8px 16px;
    border: 1px solid #007bff;
    background: white;
    color: #007bff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.floor-btn:hover {
    background: #e3f2fd;
    transform: translateY(-1px);
}

.floor-btn.active {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.floor-btn.all-floors {
    border-color: #28a745;
    color: #28a745;
}

.floor-btn.all-floors:hover {
    background: #e8f5e8;
}

.floor-btn.all-floors.active {
    background: #28a745;
    color: white;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

/* 账号类型切换标签 */
.account-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 14px;
    color: #6c757d;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-btn.active {
    color: #007bff;
    background: white;
    border-bottom-color: #007bff;
    font-weight: 500;
}

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

.data-table th,
.data-table td {
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
    text-align: center;
}.data-table tr:hover {
    background: #f8f9fa;
}

.data-table .status-active {
    color: #28a745;
    font-weight: 500;
}

/* 管理员列表样式 */
.admin-list {
    margin-bottom: 20px;
}

.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 8px;
}

.admin-item:last-child {
    margin-bottom: 0;
}

.admin-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-username {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

/* 站点颜色点与标签 */
.site-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}
.site-label {
    font-weight: 600;
}

/* 颜色预设小圆点选择器 */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
    cursor: pointer;
}
.color-swatch.selected {
    box-shadow: 0 0 0 2px #007bff;
}

/* 美化原生颜色选择器尺寸 */
input[type="color"] {
    width: 48px;
    height: 32px;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.admin-meta {
    font-size: 12px;
    color: #6c757d;
}

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

.admin-actions .btn {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.admin-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 8px;
}

.admin-status.active {
    background: #d4edda;
    color: #155724;
}

.admin-status.disabled {
    background: #f8d7da;
    color: #721c24;
}

/* 自动完成样式 */
.autocomplete-container {
    position: relative;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

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

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item.not-found {
    color: #dc3545;
    font-style: italic;
    cursor: default;
}

.suggestion-item.not-found:hover {
    background-color: white;
}

.data-table .status-frozen {
    color: #dc3545;
    font-weight: bold;
}

.data-table .btn {
    padding: 4px 8px;
    font-size: 12px;
    margin-right: 5px;
}

.data-table .actions-cell .btn {
    display: inline-block;
    vertical-align: middle;
    margin: 2px;
}

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

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-height: 90vh;
    overflow: auto;
    animation: zoomIn 0.22s cubic-bezier(0.2, 0.6, 0.4, 1);
}

/* 站点管理弹窗尺寸与滚动优化 */
#siteModal .modal-content { max-width: 720px; }
#siteModal .admin-list {
    max-height: 360px;
    overflow-y: auto;
}

/* 现代化确认对话框样式 */
.confirm-dialog {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

.confirm-dialog-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 32px;
    min-width: 320px;
    max-width: 480px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 
                0 8px 16px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: confirmSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-dialog-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.confirm-dialog-icon.warning {
    background: linear-gradient(135deg, #ffa726, #ff9800);
    box-shadow: 0 4px 12px rgba(255, 167, 38, 0.3);
}

.confirm-dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.4;
}

.confirm-dialog-message {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
    white-space: pre-line; /* 支持换行符显示 */
}

.confirm-dialog-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-dialog-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    position: relative;
    overflow: hidden;
}

.confirm-dialog-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.confirm-dialog-btn:hover::before {
    left: 100%;
}

.confirm-dialog-btn.cancel {
    background: rgba(148, 163, 184, 0.1);
    color: #64748b;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.confirm-dialog-btn.cancel:hover {
    background: rgba(148, 163, 184, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(148, 163, 184, 0.2);
}

.confirm-dialog-btn.confirm {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.confirm-dialog-btn.confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.confirm-dialog-btn.warning {
    background: linear-gradient(135deg, #ffa726, #ff9800);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 167, 38, 0.3);
}

.confirm-dialog-btn.warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 167, 38, 0.4);
}

@keyframes confirmSlideIn {
    from { 
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
    to { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

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

@keyframes zoomIn {
    from { transform: translate(-50%, -50%) scale(0.96); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.2s ease;
}

.close:hover {
    color: #333;
}

.modal h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    /*font-size: 20px;*/
    text-align: center;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

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

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

/* 登录表单特殊样式 - 标签和输入框在同一行 */
#loginForm .form-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

#loginForm .form-group label {
    display: inline-block;
    margin-bottom: 0;
    margin-right: 10px;
    min-width: 60px;
    flex-shrink: 0;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group select {
    background-color: #fff;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    appearance: none;
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 管理员设置区域 */
.admin-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.admin-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.admin-section h3 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .search-box {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .floor-tabs {
        padding: 10px 15px;
    }
    
    .floor-tab {
        margin-bottom: 5px;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
    
    .modal-content { padding: 20px; }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示 */
.message {
    padding: 12px 20px;
    margin: 10px 0;
    border-radius: 6px;
    font-size: 14px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 空数据提示 */
.empty-data {
    text-align: center;
    padding: 80px 20px;
    color: #e38323;
    font-size: 16px;
    vertical-align: middle;
    position: relative;
}

/* 空数据图标 */
.empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 5px;
    /*opacity: 0.7;*/
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* 表格单元格居中 */
table tbody td.empty-data {
    text-align: center !important;
    vertical-align: middle !important;
    width: 100% !important;
}

/* 确保表格行也居中 */
table tbody tr td.empty-data {
    text-align: center !important;
}



/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons .btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* 状态标签 */
/* 通用状态徽章（按截图样式：浅底+有色文字） */
.status-chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    border: 1px solid transparent;
}
.status-chip.success {
    color: #2e7d32;
    background: #e9f7ef; /* very light green */
    border-color: #b7e0c2;
}
.status-chip.primary {
    color: #0d47a1;
    background: #e3f2fd; /* very light blue */
    border-color: #bbdefb;
}
.status-chip.warning {
    color: #b26a00;
    background: #fff4e5;
    border-color: #ffddb0;
}
.status-chip.danger {
    color: #c62828;
    background: #fdecea;
    border-color: #f5c6cb;
}

/* 状态和操作列样式 */
.status-column,
.action-column {
    font-weight: bold !important;
}

.data-table .status-frozen {
    color: #dc3545;
    font-weight: bold;
}

.data-table .status-new {
    color: #28a745;
    font-weight: bold;
}

.data-table .status-activated {
    color: #007bff;
    font-weight: bold;
}

.data-table .status-active {
    color: #28a745;
    font-weight: 500;
}