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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #22222f;
    --border-color: #2a2a38;
    --text-primary: #e8e6e3;
    --text-secondary: #8a8a9a;
    --accent: #c8a45c;
    --accent-dim: #a08440;
    --accent-glow: rgba(200, 164, 92, 0.15);
    --online: #4ade80;
    --full: #ef4444;
    --private: #a78bfa;
    --favorite: #fbbf24;
    --favorite-glow: rgba(251, 191, 36, 0.3);
}

body {
    font-family: 'Noto Sans SC', 'Rajdhani', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    font-weight: 400;
    letter-spacing: 0.3px;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(200, 164, 92, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(200, 164, 92, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 20px 30px;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.header-left h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 2px 20px rgba(200, 164, 92, 0.3);
}

.header-left .subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 8px;
    letter-spacing: 2px;
    font-weight: 500;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.user-panel:hover {
    border-color: var(--accent-dim);
    background: var(--bg-card);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
    padding: 4px;
    min-width: 120px;
}

.dropdown-logout-btn {
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: 'Noto Sans SC', sans-serif;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.dropdown-logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--bg-primary);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 22px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    min-width: 110px;
    transition: all 0.2s;
}

.stat-item:hover {
    border-color: var(--accent-dim);
    transform: translateY(-2px);
}

.stat-item .value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-item .label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    font-weight: 500;
}

.refresh-section {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 0;
    cursor: default;
    background: none;
    border: none;
}

.refresh-section:hover {
    transform: none;
    border-color: transparent;
}

.refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    color: var(--accent);
    cursor: pointer;
    transition: all 0.25s;
    font-size: 0.85rem;
    font-family: 'Noto Sans SC', sans-serif;
    white-space: nowrap;
}

.refresh-btn:hover {
    background: linear-gradient(135deg, var(--bg-card-hover), var(--bg-card));
    border-color: var(--accent-dim);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(200, 164, 92, 0.15);
}

.refresh-btn:active {
    transform: scale(0.97);
}

.refresh-btn.refreshing {
    border-color: var(--accent);
    pointer-events: none;
    opacity: 0.8;
}

.refresh-btn-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
}

.refresh-btn.refreshing .refresh-btn-icon {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.refresh-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 80px;
}

.refresh-status.refreshing {
    color: var(--accent);
}

.refresh-status.done {
    color: var(--online);
}

.throttle-banner {
    background: linear-gradient(90deg, rgba(255, 152, 0, 0.15), rgba(255, 193, 7, 0.15));
    border-left: 3px solid var(--warning, #ff9800);
    color: var(--warning, #ff9800);
    padding: 10px 16px;
    margin: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    animation: throttleFade 0.3s ease-in-out;
}

@keyframes throttleFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.refresh-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.refresh-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: refresh-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes refresh-spin {
    to { transform: rotate(360deg); }
}

.controls-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    margin: 10px 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-top: 2px solid var(--accent-dim);
}

.controls-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Noto Sans SC', sans-serif;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
    background: var(--bg-card);
}

.search-box input::placeholder {
    color: var(--text-secondary);
    font-weight: 300;
}

.search-box::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238a8a9a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0.5;
}

.controls-body {
    padding: 10px 18px 12px;
}

.filter-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 7px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.filter-tab:hover {
    color: var(--text-primary);
    background: rgba(200, 164, 92, 0.06);
    border-color: rgba(200, 164, 92, 0.15);
}

.filter-tab.active {
    background: var(--accent-glow);
    border-color: rgba(200, 164, 92, 0.3);
    color: var(--accent);
    box-shadow: 0 0 8px rgba(200, 164, 92, 0.1);
}

.filter-tab.favorite-filter {
    color: var(--favorite);
}

.filter-tab.favorite-filter.active {
    background: var(--favorite-glow);
    border-color: rgba(251, 191, 36, 0.25);
    color: var(--favorite);
}

.filter-tab svg {
    width: 12px;
    height: 12px;
}

.filter-separator {
    display: inline-block;
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
    flex-shrink: 0;
}

.filter-select {
    padding: 7px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 90px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a8a9a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.filter-select:hover {
    border-color: var(--accent-dim);
    color: var(--text-primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    color: var(--text-primary);
}

.filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

.scan-result-toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--online);
    animation: toastIn 0.3s ease-out;
}

.scan-result-toast.scan-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--full);
}

.scan-result-toast button {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.6;
}

.scan-result-toast button:hover { opacity: 1; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.scan-result-text {
    display: flex;
    gap: 4px;
    align-items: center;
}

.server-list {
    display: grid;
    gap: 10px;
    padding: 10px 0;
}

.server-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    align-items: center;
}

.server-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s;
}

.server-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-dim);
}

.server-card:hover::before {
    opacity: 1;
}

.server-card.favorited::before {
    background: var(--favorite);
    opacity: 1;
}

.server-card.card-refreshing {
    border-color: var(--accent-dim);
    background: linear-gradient(135deg, var(--bg-card), #1e1e2e);
}

.server-card.card-refreshing::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(200, 164, 92, 0.05), transparent);
    animation: card-refresh-pulse 1.2s ease-in-out infinite;
    pointer-events: none;
}

.server-card.card-status-changed {
    animation: card-flash 0.6s ease-out;
}

@keyframes card-refresh-pulse {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes card-flash {
    0% { border-color: var(--accent); box-shadow: 0 0 15px rgba(200, 164, 92, 0.2); }
    100% { border-color: var(--border-color); box-shadow: none; }
}

.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn:hover {
    color: var(--favorite);
    transform: scale(1.1);
}

.favorite-btn.favorited {
    color: var(--favorite);
    animation: favoritePulse 0.3s ease;
}

.favorite-btn svg {
    width: 22px;
    height: 22px;
}

@keyframes favoritePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    align-self: center;
    margin-top: -2px;
    transition: all 0.3s;
}

.status-dot.online {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
    animation: dotPulse 2s ease-in-out infinite;
}

.status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.status-dot.checking {
    background: var(--accent);
    opacity: 0.5;
    animation: dotBlink 1s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(74, 222, 128, 0.4), 0 0 8px rgba(74, 222, 128, 0.2); }
    50% { box-shadow: 0 0 8px rgba(74, 222, 128, 0.8), 0 0 16px rgba(74, 222, 128, 0.4); }
}

@keyframes dotBlink {
    0%, 100% { opacity: 0.3; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

.server-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.server-name {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.server-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    font-weight: 400;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
}

.meta-item .icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.geo-location {
    color: var(--accent-dim);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.flag-icon {
    width: 18px;
    height: 13px;
    border-radius: 2px;
    object-fit: cover;
    vertical-align: middle;
    display: inline-block;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.server-right {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.server-status-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.players-count {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--online);
    white-space: nowrap;
}

.players-count.full {
    color: var(--full);
}

.players-count.online {
    color: var(--online);
}

.players-count.offline {
    color: var(--text-secondary);
}

.server-type {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.badge {
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Rajdhani', sans-serif;
}

.badge.private {
    background: rgba(167, 139, 250, 0.15);
    color: var(--private);
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.badge.dedicated {
    background: rgba(200, 164, 92, 0.15);
    color: var(--accent);
    border: 1px solid rgba(200, 164, 92, 0.3);
}

.badge.community {
    background: rgba(74, 222, 128, 0.15);
    color: var(--online);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge.official {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge.pvp {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.mod {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge.pve {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.online {
    background: rgba(74, 222, 128, 0.15);
    color: var(--online);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge.offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--full);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.server-card.offline-server {
    opacity: 0.5;
    filter: grayscale(40%);
}

.action-buttons {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.btn {
    padding: 7px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(200, 164, 92, 0.2);
}

.btn-query {
    border-color: var(--accent-dim);
    color: var(--accent);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 25px 0 15px;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0 12px;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent-dim);
    color: var(--text-primary);
    background: var(--bg-card);
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(200, 164, 92, 0.3);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-ellipsis {
    color: var(--text-secondary);
    padding: 0 5px;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
}

.player-table {
    width: 100%;
    border-collapse: collapse;
}

.player-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
}

.player-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(42, 42, 56, 0.5);
    font-size: 0.85rem;
}

.player-table tr:hover td {
    background: var(--bg-secondary);
}

.player-id {
    color: var(--accent);
    font-weight: 600;
    font-family: 'Cinzel', serif;
}

.player-score {
    color: var(--online);
}

.player-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.modal-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.modal-error {
    text-align: center;
    padding: 20px;
    color: var(--full);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 15, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.5s;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(200, 164, 92, 0.3);
}

.scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.server-card {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.refresh-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 8px 0;
}

@media (max-width: 768px) {
    .header { flex-direction: column; gap: 20px; text-align: center; }
    .header::after { width: 120px; }
    .header-left h1 { font-size: 1.8rem; }
    .search-box { max-width: none; }
    .controls-header { flex-wrap: wrap; }
    .filter-tabs { justify-content: center; }
    .server-card { grid-template-columns: 1fr; }
    .action-buttons { flex-direction: row; justify-content: flex-start; }
}

.footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.icp-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* ==================== 置顶服务器区域 ==================== */
.pinned-section {
    margin: 0 16px 20px;
    background: linear-gradient(135deg, rgba(200,164,92,0.10), rgba(200,164,92,0.02));
    border: 1px solid rgba(200,164,92,0.30);
    border-radius: 14px;
    padding: 18px 22px;
    animation: pinnedGlow 3s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
}
.pinned-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(200,164,92,0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(200,164,92,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}
@keyframes pinnedGlow {
    0% { border-color: rgba(200,164,92,0.30); box-shadow: 0 0 12px rgba(200,164,92,0.05); }
    100% { border-color: rgba(200,164,92,0.50); box-shadow: 0 0 24px rgba(200,164,92,0.12); }
}

.pinned-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.pinned-title {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f0c060, #e8a840, #f7d774, #e8a840);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(232,168,64,0.5));
}
.pinned-stars {
    -webkit-text-fill-color: initial;
    color: #fbbf24;
    font-size: 0.85rem;
    letter-spacing: 2px;
    filter: drop-shadow(0 0 4px rgba(251,191,36,0.7));
    animation: starShine 2s ease-in-out infinite;
}
@keyframes starShine {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(251,191,36,0.7)); }
    50% { filter: drop-shadow(0 0 10px rgba(251,191,36,1)); transform: scale(1.05); }
}
.pinned-title::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pinPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px var(--accent), 0 0 20px rgba(200,164,92,0.5);
    flex-shrink: 0;
}
@keyframes pinPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.8); }
}

.pinned-toggle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 14px;
    border: 1px solid rgba(200,164,92,0.3);
    border-radius: 20px;
    background: rgba(200,164,92,0.05);
    transition: all 0.3s;
    z-index: 1;
}
.pinned-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(200,164,92,0.12);
}

/* 自适应网格：1个=full, 2个=各半, 3+=最多2列 */
.pinned-grid {
    display: grid;
    gap: 14px;
    position: relative;
    z-index: 1;
}
.pinned-grid.count-1 {
    grid-template-columns: 1fr;
}
.pinned-grid.count-2 {
    grid-template-columns: 1fr 1fr;
}
.pinned-grid.count-3,
.pinned-grid.count-more {
    grid-template-columns: repeat(2, 1fr);
}

.pinned-card {
    background: linear-gradient(135deg, rgba(200,164,92,0.08), rgba(26,26,37,0.95));
    border: 1px solid rgba(200,164,92,0.22);
    border-radius: 12px;
    padding: 16px 20px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}
.pinned-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 60px; height: 60px;
    background: radial-gradient(circle, rgba(200,164,92,0.15) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 0 0 0 60px;
}
.pinned-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(200,164,92,0.15), 0 0 0 1px rgba(200,164,92,0.1);
    background: linear-gradient(135deg, rgba(200,164,92,0.14), rgba(26,26,37,0.98));
}
.pinned-card.pinned-offline {
    opacity: 0.65;
    filter: grayscale(30%);
}
.pinned-card.pinned-offline:hover {
    opacity: 0.85;
}

.pinned-card-actions {
    position: absolute;
    top: -1px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.pinned-card-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 14px;
    border-radius: 0 0 8px 8px;
    letter-spacing: 1px;
    box-shadow: 0 2px 10px rgba(200,164,92,0.3);
    cursor: default;
}
.pinned-connect-badge {
    background: linear-gradient(135deg, var(--accent), #e8c97a);
    color: #1a1a12;
}

.pinned-copy-badge {
    background: linear-gradient(135deg, #4a90d9, #67b8e0);
    color: #fff;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.pinned-copy-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(74,144,217,0.45);
}
.pinned-copy-badge:active {
    transform: scale(0.95);
}
.pinned-copy-badge.copied {
    background: linear-gradient(135deg, #22c55e, #4ade80);
    color: #fff;
    box-shadow: 0 2px 12px rgba(34,197,94,0.4);
}

.pinned-card-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    z-index: 1;
}

.pinned-card-name {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 70px;
    text-shadow: 0 0 12px rgba(200,164,92,0.15);
}

/* 单个置顶时卡片更大 */
.pinned-grid.count-1 .pinned-card {
    padding: 22px 28px;
}
.pinned-grid.count-1 .pinned-card-name {
    font-size: 1.25rem;
}

.pinned-card-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pinned-status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pinned-status-dot.online {
    background: var(--online);
    box-shadow: 0 0 6px var(--online);
    animation: dotPulse 2s ease-in-out infinite;
}
.pinned-status-dot.offline {
    background: #666;
}
@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 4px var(--online); }
    50% { box-shadow: 0 0 12px var(--online), 0 0 20px rgba(74,222,128,0.4); }
}

.pinned-ip {
    color: var(--text-secondary);
    font-family: 'Consolas', 'Menlo', monospace;
    font-size: 0.78rem;
    font-weight: 500;
}

.pinned-card-desc {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-style: italic;
    opacity: 0.9;
    margin-top: 2px;
    line-height: 1.5;
    padding: 8px 12px;
    background: rgba(200,164,92,0.06);
    border-left: 2px solid rgba(200,164,92,0.3);
    border-radius: 0 6px 6px 0;
}

.pinned-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.pinned-players {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.pinned-players.on {
    color: var(--online);
    background: rgba(74,222,128,0.10);
    border: 1px solid rgba(74,222,128,0.25);
}
.pinned-players.off {
    color: var(--text-secondary);
    background: rgba(136,136,136,0.08);
    border: 1px solid rgba(136,136,136,0.15);
}

.pinned-tag {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pinned-tag.pvp { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.pinned-tag.pve { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.pinned-tag.official { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }

.pinned-expiry {
    font-size: 0.68rem;
    color: var(--text-secondary);
    opacity: 0.75;
}

.pinned-card-players-bar {
    margin-top: 8px;
    height: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
}
.pinned-card-players-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    border-radius: 2px;
    transition: width 0.6s ease;
}

@media (max-width: 768px) {
    .pinned-grid,
    .pinned-grid.count-2,
    .pinned-grid.count-3,
    .pinned-grid.count-more {
        grid-template-columns: 1fr;
    }
    .pinned-grid.count-1 .pinned-card {
        padding: 16px 20px;
    }
    .pinned-grid.count-1 .pinned-card-name {
        font-size: 1rem;
    }
    .pinned-section {
        padding: 14px 16px;
    }
}

/* ==================== 语言切换器 ==================== */
.lang-switcher {
    position: relative;
    z-index: 100;
}
.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.lang-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-dim);
}
.lang-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    min-width: 190px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    padding: 6px 0;
    max-height: 340px;
    overflow-y: auto;
}
.lang-option {
    padding: 8px 16px;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lang-option:hover {
    background: var(--accent-dim);
    color: var(--bg-primary);
}
.lang-option.active {
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 600;
}
@media (max-width: 480px) {
    .lang-btn span {
        display: none;
    }
    .lang-btn {
        padding: 6px 10px;
    }
}