/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* 登录/注册框 */
.auth-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.auth-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 28px;
}

.auth-box h2 {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 20px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-normal {
    padding: 10px 20px;
    font-size: 14px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-edit {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    margin-right: 5px;
}

.btn-edit:hover {
    background: #218838;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
}

.form-footer p {
    color: #666;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* 控制台样式 */
.dashboard {
    min-height: 100vh;
    background: #f5f7fa;
}

.header {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #667eea;
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info span {
    color: #555;
}

.user-info #username {
    font-weight: bold;
    color: #667eea;
}

.main-content {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.action-bar {
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.stats-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.stats-value {
    color: #667eea;
    font-size: 24px;
    font-weight: bold;
}

.services-list {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.services-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.services-header h2 {
    color: #333;
    margin-bottom: 0;
}

.services-header .btn {
    width: auto;
}

.services-list h2 {
    color: #333;
    margin-bottom: 20px;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: #667eea;
    color: white;
}

table th,
table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    white-space: nowrap;
}

table th {
    font-size: 13px;
    font-weight: 600;
}

table tbody tr:hover {
    background: #f8f9fa;
}

table tbody tr td {
    color: #555;
}

/* 游戏盾服务列表 - 更紧凑 */
#servicesTable th,
#servicesTable td {
    padding: 8px 10px;
    font-size: 12px;
}

#servicesTable .btn {
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 4px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* 紧凑模态框 */
.modal-compact {
    padding: 30px;
    max-width: 700px;
}

.modal-compact h2 {
    margin-bottom: 20px;
    font-size: 22px;
}

/* 表单行布局 */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group-half {
    flex: 1;
    margin-bottom: 0;
}

.form-group-full {
    flex: 1;
    margin-bottom: 0;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-row .form-group label {
    margin-bottom: 6px;
    font-size: 14px;
}

.form-row .form-group input,
.form-row .form-group select {
    padding: 10px;
    font-size: 14px;
}

.close,
.close-sdk,
.close-server-manage,
.close-add-server,
.close-server-select {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus,
.close-sdk:hover,
.close-sdk:focus,
.close-server-manage:hover,
.close-server-manage:focus,
.close-add-server:hover,
.close-add-server:focus,
.close-server-select:hover,
.close-server-select:focus {
    color: #000;
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 30px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.modal-actions .btn {
    flex: 1;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    font-size: 16px;
}

/* Proxy Protocol 选项样式 */
.proxy-protocol-option {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
    padding-left: 32px;
    margin-bottom: 12px;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-custom {
    position: absolute;
    left: 0;
    top: 2px;
    height: 20px;
    width: 20px;
    background-color: white;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox-label:hover .checkbox-custom {
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
    background-color: #667eea;
    border-color: #667eea;
}

.checkbox-custom:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom:after {
    display: block;
}

.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checkbox-text strong {
    color: #333;
    font-size: 15px;
    font-weight: 600;
}

.checkbox-desc {
    color: #6c757d;
    font-size: 13px;
    font-weight: normal;
}

.info-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #e7f3ff;
    border-left: 3px solid #2196F3;
    border-radius: 4px;
    font-size: 13px;
    color: #0d47a1;
    line-height: 1.5;
}

.info-box svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* 游戏盾服务器管理 */
.modal-wide {
    max-width: 1000px;
    width: 95%;
}

.server-manage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px 0;
    border-bottom: 2px solid #e9ecef;
}

.server-count {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.server-count span {
    color: #667eea;
    font-weight: bold;
    font-size: 15px;
}

#serverListTable {
    width: 100%;
    margin-top: 10px;
    font-size: 13px;
}

#serverListTable th,
#serverListTable td {
    padding: 8px 10px;
    text-align: left;
    white-space: nowrap;
}

#serverListTable th {
    font-size: 13px;
    font-weight: 600;
}

#serverListTable td {
    font-size: 13px;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-maintenance {
    background: #fff3cd;
    color: #856404;
}

/* 搜索框样式 */
.search-box {
    margin-bottom: 20px;
}

.search-box input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 盾机选择操作栏 */
.server-select-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.server-select-actions .checkbox-label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.server-select-actions .checkbox-label:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.server-select-actions .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.server-select-actions .checkbox-text {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.server-select-actions #confirmSelectServers {
    margin-left: auto;
    padding: 10px 24px;
    background: #fff;
    color: #667eea;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.server-select-actions #confirmSelectServers:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.server-select-actions #confirmSelectServers:active {
    transform: translateY(0);
}

.selected-count {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 100px;
    text-align: center;
}

/* 表格中的复选框样式 */
#serverSelectTable input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

#serverSelectTable tbody tr:hover {
    background-color: #f8f9fa;
}

#serverSelectTable tbody tr.selected {
    background-color: #e7f3ff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }

    .main-content {
        padding: 20px;
    }

    table {
        font-size: 12px;
    }

    table th,
    table td {
        padding: 10px 5px;
    }
    
    /* 移动端模态框垂直布局 */
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-compact {
        padding: 20px;
    }
}
