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

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.status.online {
    background: #4caf50;
    color: white;
}

.status.offline {
    background: #f44336;
    color: white;
}

.main-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.panel.full-width {
    width: 100%;
}

.panel h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.panel h3 {
    color: #555;
    margin: 15px 0 10px 0;
    font-size: 16px;
}

.panel-content {
    /* 移除高度限制，让内容自然展开 */
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 5px;
    overflow: hidden;
    table-layout: auto;
    min-width: 100%;
}

/* 订单表格容器 - 添加横向滚动 */
.orders-section {
    overflow-x: auto;
    overflow-y: visible;
}

#ordersTable {
    min-width: 1400px; /* 确保表格有足够的最小宽度 */
    white-space: nowrap;
}

table thead {
    background: #667eea;
    color: white;
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 订单表格特定列宽设置 */
#ordersTable th:nth-child(1),
#ordersTable td:nth-child(1) {
    min-width: 100px; /* 订单ID */
}

#ordersTable th:nth-child(2),
#ordersTable td:nth-child(2) {
    min-width: 150px; /* 标题 */
    max-width: 200px;
}

#ordersTable th:nth-child(3),
#ordersTable td:nth-child(3) {
    min-width: 80px; /* 金额 */
    width: 80px;
}

#ordersTable th:nth-child(4),
#ordersTable td:nth-child(4) {
    min-width: 70px; /* 分类 */
    width: 70px;
}

#ordersTable th:nth-child(5),
#ordersTable td:nth-child(5) {
    min-width: 60px; /* 人数 */
    width: 60px;
}

#ordersTable th:nth-child(6),
#ordersTable td:nth-child(6) {
    min-width: 120px; /* 老板ID - 允许较宽 */
    max-width: 250px;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
}

#ordersTable th:nth-child(7),
#ordersTable td:nth-child(7) {
    min-width: 70px; /* 类型 */
    width: 70px;
}

#ordersTable th:nth-child(8),
#ordersTable td:nth-child(8) {
    min-width: 80px; /* 状态 */
    width: 80px;
}

#ordersTable th:nth-child(9),
#ordersTable td:nth-child(9) {
    min-width: 150px; /* 接单客户端 */
    max-width: 200px;
}

#ordersTable th:nth-child(10),
#ordersTable td:nth-child(10) {
    min-width: 90px; /* 审核状态 */
    width: 90px;
}

#ordersTable th:nth-child(11),
#ordersTable td:nth-child(11) {
    min-width: 100px; /* 结单证明 */
    width: 100px;
}

#ordersTable th:nth-child(12),
#ordersTable td:nth-child(12) {
    min-width: 150px; /* 创建时间 */
    width: 150px;
}

#ordersTable th:nth-child(13),
#ordersTable td:nth-child(13) {
    min-width: 120px; /* 操作 */
    width: 120px;
}

table tbody tr:hover {
    background: #f5f5f5;
}

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

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

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.idle {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.working {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge.offline {
    background: #efebe9;
    color: #5d4037;
}

.status-badge.pending {
    background: #e8f5e9;
    color: #388e3c;
}

.status-badge.accepted {
    background: #fff3e0;
    color: #f57c00;
}

.form-section {
    background: white;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    background: white;
}

.proof-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.proof-link:hover {
    text-decoration: underline;
}

.form-group textarea {
    resize: vertical;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-danger {
    background: #f44336;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

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

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-info {
    background: #3b82f6;
    color: white;
}

.btn-info:hover {
    background: #2563eb;
}

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

.status-badge.success {
    background: #e8f5e9;
    color: #388e3c;
}

.status-badge.warning {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge.danger {
    background: #ffebee;
    color: #c62828;
}

.orders-section {
    background: white;
    padding: 20px;
    border-radius: 5px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.data-log {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 5px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

.log-entry {
    margin-bottom: 10px;
    padding: 8px;
    background: #252526;
    border-radius: 3px;
    border-left: 3px solid #667eea;
}

.log-entry .timestamp {
    color: #858585;
    font-size: 11px;
}

.log-entry .client-id {
    color: #4ec9b0;
    font-weight: 600;
}

.log-entry .data {
    color: #ce9178;
    margin-top: 5px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    padding: 0;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
}

.modal-close:hover {
    color: #1f2937;
}

.modal-body {
    padding: 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
