/* 机厅管理界面样式 */
.arcade-management {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* 页面头部 */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-title i {
    font-size: 1.5rem;
}

.header-stats {
    display: flex;
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 控制栏 */
.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-controls {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-width: 300px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.clear-search {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 50%;
    transition: color 0.2s ease;
}

.clear-search:hover {
    color: #dc3545;
}

.sort-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.sort-controls select {
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.sort-controls select:focus {
    outline: none;
    border-color: #667eea;
}

.sort-order-btn {
    padding: 0.75rem;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
}

.sort-order-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.add-arcade-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.add-arcade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* 添加机厅表单 */
.add-arcade-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.section-header h3 {
    margin: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.close-form-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-form-btn:hover {
    color: #dc3545;
    background: #fff5f5;
}

.add-arcade-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 管理员设置 */
.owners-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.owner-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.owner-input-row select {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    font-size: 0.95rem;
}

.remove-owner-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.remove-owner-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* 设置网格 */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.setting-label {
    font-weight: 500;
    color: #333;
}

/* 切换开关 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #28a745;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f8f9fa;
}

.submit-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cancel-btn:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-1px);
}

/* 机厅列表 */
.arcades-section {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

/* 机厅卡片(移动端) */
.arcade-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.arcade-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.arcade-card.editing {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.arcade-info {
    flex: 1;
}

.arcade-name {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.name-text {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

.arcade-id {
    font-size: 0.8rem;
    color: #6c757d;
}

.card-actions {
    flex-shrink: 0;
}

.card-content .field-group {
    margin-bottom: 1rem;
}

.card-content .field-group label {
    display: block;
    font-weight: 500;
    color: #666;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.arcade-description {
    color: #333;
}

.placeholder {
    color: #6c757d;
    font-style: italic;
}

.settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
}

.settings-row .setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.settings-row .setting-item label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #666;
    margin-bottom: 0;
}

/* 桌面端表格 */
.arcade-table-form {
    padding: 1rem;
}

.arcade-table {
    width: 100%;
    border-collapse: collapse;
}

.arcade-table th,
.arcade-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: middle;
}

.arcade-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.arcade-table tr:hover {
    background: #f8f9fa;
}

/* 行内编辑 */
.inline-edit-input,
.inline-edit-textarea {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #667eea;
    border-radius: 4px;
    font-size: 0.95rem;
    background: white;
}

.inline-edit-input:focus,
.inline-edit-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 管理员显示 */
.owners-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.owners-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.owner-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.owners-edit {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.owner-select-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.owner-select-row select {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    background: white;
}

/* 状态指示器 */
.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-enabled {
    color: #28a745;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-disabled {
    color: #dc3545;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.action-buttons.disabled {
    opacity: 0.3;
}

.edit-btn,
.delete-btn,
.save-btn,
.cancel-btn {
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.edit-btn {
    background: #17a2b8;
    color: white;
}

.edit-btn:hover {
    background: #138496;
    transform: scale(1.1);
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.save-btn {
    background: #28a745;
    color: white;
}

.save-btn:hover:not(:disabled) {
    background: #218838;
    transform: scale(1.1);
}

.cancel-btn {
    background: #6c757d;
    color: white;
}

.cancel-btn:hover:not(:disabled) {
    background: #5a6268;
    transform: scale(1.1);
}

.action-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 通知组件 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notification.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.notification.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.notification-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 确认对话框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.confirm-dialog {
    background: white;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.2s ease;
}

.dialog-header {
    padding: 1.5rem 1.5rem 0;
}

.dialog-header h3 {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.dialog-content {
    padding: 1rem 1.5rem;
}

.dialog-content p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.dialog-actions {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.confirm-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.confirm-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.dialog-actions .cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dialog-actions .cancel-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .arcade-management {
        padding: 1rem;
    }
    
    .page-header {
        padding: 1.5rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-controls {
        flex-direction: column;
        min-width: auto;
    }
    
    .add-arcade-form .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .notification {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .confirm-dialog {
        margin: 1rem;
    }
    
    .dialog-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .arcade-management {
        padding: 0.5rem;
    }
    
    .page-header {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .add-arcade-section {
        padding: 1rem;
    }
    
    .owners-list {
        flex-direction: column;
    }
    
    .settings-row {
        grid-template-columns: 1fr;
    }
}
