/* ===== 后台管理 ===== */
.admin-container {
    padding-top: calc(30px + var(--safe-top));
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
}
.admin-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 24px;
}
.role-badge {
    display: none;
    background: #2c3e6b;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
    margin-right: 12px;
}
.role-badge:not(:empty) {
    display: inline-block;
}
.nav-links-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-links-right a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}
.nav-links-right a:hover {
    background: #f0f2f5;
}

/* ===== 标签页 ===== */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e8edf5;
    margin-bottom: 24px;
}
.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    font-family: inherit;
}
.tab-btn:hover { color: #1a1a2e; }
.tab-btn.active {
    color: #1a1a2e;
    border-bottom-color: #1a1a2e;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== 白名单卡片 ===== */
.wl-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.wl-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wl-game-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}
.wl-meta {
    font-size: 13px;
    color: #999;
}
.wl-features {
    margin-top: 4px;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.wl-feat-label {
    color: #999;
    flex-shrink: 0;
}
.wl-feat-tag {
    display: inline-block;
    background: #e8f0fe;
    color: #1a73e8;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.wl-card-actions {
    display: flex;
    gap: 8px;
}
.btn-approve {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}
.btn-approve:hover { background: #c8e6c9; }
.btn-reject {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}
.btn-reject:hover { background: #ffcdd2; }

/* ===== 白名单成员卡片 ===== */
.wl-member-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e8f5e9;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    border-left: 4px solid #4caf50;
}
.wl-member-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wl-member-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}
.wl-member-meta {
    font-size: 13px;
    color: #999;
}
.wl-member-actions {
    display: flex;
    gap: 8px;
}

/* ===== 服务器状态栏 ===== */
.server-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 12px;
    font-size: 13px;
    color: #888;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f9a825;
}

/* ===== 聊天框 ===== */
.chat-box {
    max-height: 500px;
    overflow-y: auto;
    background: #1a1a2e;
    border-radius: 12px;
    padding: 16px;
    font-family: "Courier New", monospace;
    font-size: 13px;
    color: #ccc;
    line-height: 1.8;
}
.chat-line {
    padding: 2px 0;
    word-break: break-all;
}
.chat-line .time {
    color: #666;
    margin-right: 8px;
}

/* ===== 玩家卡片 ===== */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.player-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.player-name {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a2e;
}
.player-three-dot {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    color: #888;
    font-size: 18px;
    line-height: 1;
    font-family: inherit;
}
.player-three-dot:hover { background: #f0f2f5; color: #333; }

/* ===== 下拉菜单 ===== */
.dropdown-menu {
    position: fixed;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    min-width: 160px;
    padding: 4px 0;
}
.dropdown-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    background: none;
    border: none;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.dropdown-menu button:hover { background: #f5f5f5; }

/* ===== 管理员管理 ===== */
.add-admin-form {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}
.add-admin-form input {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fafafa;
    outline: none;
}
.add-admin-form input:focus {
    border-color: #1a1a2e;
    box-shadow: 0 0 0 3px rgba(26,26,46,0.08);
}
.admin-table-wrapper { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}
.admin-table th, .admin-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}
.admin-table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
}
.admin-table td { color: #333; }
.role-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.role-owner { background: #e8edf5; color: #2c3e6b; }
.role-admin { background: #e8f5e9; color: #2e7d32; }
.role-user { background: #f5f5f5; color: #888; }

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 14px;
}

/* ===== 管理员登录遮罩 ===== */
.admin-login-overlay {
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(15, 15, 25, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: adminFadeIn 0.35s ease;
}
.admin-login-card {
    background: #fff;
    border-radius: 20px;
    padding: 44px 40px 36px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.06);
    animation: adminScaleIn 0.35s ease;
}
.admin-login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}
.admin-login-logo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.admin-login-title {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: 1px;
}
.admin-login-icon {
    color: #2c3e6b;
    margin-bottom: 12px;
    opacity: 0.8;
}
.admin-login-heading {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 6px;
}
.admin-login-desc {
    font-size: 14px;
    color: #999;
    margin: 0 0 28px;
}
.admin-login-form {
    text-align: left;
}
.admin-login-field {
    margin-bottom: 20px;
}
.admin-login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.admin-login-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e4e7ed;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #f8f9fb;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
}
.admin-login-field input:focus {
    border-color: #1a1a2e;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.06);
}
.admin-login-field input::placeholder {
    color: #c0c4cc;
}
.admin-login-error {
    display: none;
    color: #d32f2f;
    text-align: center;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 500;
}
.admin-login-btn {
    width: 100%;
    padding: 13px 0;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 4px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.admin-login-btn:hover {
    background: #2c3e6b;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26, 26, 46, 0.25);
}
.admin-login-btn:active {
    transform: translateY(0);
}
.admin-login-back {
    display: inline-block;
    margin-top: 20px;
    font-size: 13px;
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s;
}
.admin-login-back:hover {
    color: #1a1a2e;
}
@keyframes adminFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes adminScaleIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== TCP 断连 & 无权限遮罩 ===== */
.tcp-disconnect-overlay {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}
.tcp-disconnect-card {
    background: #fff;
    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.tcp-disconnect-icon {
    font-size: 56px;
    color: #d32f2f;
    margin-bottom: 16px;
}
.tcp-disconnect-card h2 {
    color: #1a1a2e;
    margin: 0 0 12px;
    font-size: 22px;
}
.tcp-disconnect-card p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 24px;
}
.tcp-disconnect-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff9800;
    margin-right: 8px;
    animation: tcp-pulse 1.2s infinite;
}
.tcp-disconnect-actions {
    margin-bottom: 20px;
}
.tcp-back-btn {
    display: inline-block;
    padding: 10px 32px;
    background: #1a1a2e;
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}
.tcp-back-btn:hover {
    background: #333;
}
@keyframes tcp-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
#tcp-reconnect-text {
    color: #888;
    font-size: 13px;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
    .tab-btn { padding: 10px 14px; font-size: 13px; }
    .wl-card { flex-direction: column; align-items: flex-start; gap: 12px; }
    .wl-member-card { flex-direction: column; align-items: flex-start; gap: 12px; }
    .wl-card-actions, .wl-member-actions { width: 100%; justify-content: flex-end; }
    .player-grid { grid-template-columns: repeat(2, 1fr); }
    .add-admin-form { flex-direction: column; }
    .tab-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; padding-bottom: calc(4px + var(--safe-bottom)); }
}

/* 底部安全区：给页面底部留出空间 */
.tab-content {
    padding-bottom: var(--safe-bottom);
}

/* 全屏遮罩层不应受安全区影响（inset:0 正确覆盖整个屏幕） */
.tcp-disconnect-overlay,
.admin-login-overlay,
.modal-overlay {
    /* inset:0 保持不变 */
}
