* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    color: #fff;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 先显示渐变背景作为后备 */
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    background-image: url('mc.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(8px);
    z-index: -2;
    /* 添加过渡效果，图片加载后平滑显示 */
    transition: opacity 0.5s ease-in;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

/* 星空背景 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    box-shadow: 
        100px 200px #fff, 200px 100px #fff, 300px 300px #fff,
        400px 150px #fff, 150px 400px #fff, 500px 250px #fff,
        250px 500px #fff, 350px 450px #fff, 450px 350px #fff,
        550px 150px #fff, 150px 550px #fff, 600px 400px #fff,
        50px 50px #fff, 650px 50px #fff, 50px 650px #fff,
        700px 200px #fff, 200px 700px #fff, 750px 500px #fff,
        800px 100px #fff, 100px 800px #fff, 850px 350px #fff,
        900px 600px #fff, 600px 900px #fff, 950px 150px #fff,
        1000px 450px #fff, 450px 1000px #fff, 1100px 250px #fff,
        1200px 550px #fff, 550px 1200px #fff, 1300px 100px #fff;
    animation: stars 3s ease-in-out infinite alternate;
}

.stars::after {
    animation-delay: 1.5s;
}

@keyframes stars {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.header-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.server-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5),
                 0 0 40px rgba(147, 51, 234, 0.3);
    background: linear-gradient(45deg, #fff, #a78bfa, #fff);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fbbf24;
    animation: pulse 2s ease-in-out infinite;
}

.status-badge.online .status-dot {
    background: #10b981;
}

.status-badge.offline .status-dot {
    background: #ef4444;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.refresh-btn:active {
    transform: translateY(0) scale(0.95);
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.refresh-btn.refreshing svg {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

main {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card h2::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: linear-gradient(180deg, #a78bfa, #7c3aed);
    border-radius: 2px;
}

.server-info {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.value {
    font-weight: 700;
    font-size: 1rem;
    color: #a78bfa;
}

.value.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    position: relative;
}

.value.clickable:hover {
    background: rgba(167, 139, 250, 0.2);
    color: #fff;
    transform: translateX(2px);
}

.value.clickable:active {
    transform: scale(0.95);
}

.player-count {
    font-size: 1.5rem;
    background: linear-gradient(45deg, #10b981, #34d399);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
}

.players-card {
    grid-column: 1 / -1;
}

.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.player-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
}

.player-name {
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    opacity: 0.5;
    font-style: italic;
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cms-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: #a78bfa;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.cms-link:hover {
    color: #fff;
}

footer p {
    opacity: 0.6;
    font-size: 0.9rem;
}

/* 复制通知 */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.copy-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.copy-notification::before {
    content: '✓';
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* CMS样式 */
.info-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.info-box strong {
    display: block;
    margin-bottom: 0.75rem;
    color: #34d399;
    font-size: 1rem;
}

.info-box p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.6;
}

.info-box code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #a78bfa;
}

.back-link {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-weight: 600;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

.cms-container {
    max-width: 800px;
}

.cms-card {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #fff;
}

.form-group input {
    width: 100%;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #a78bfa;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.6;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.save-btn,
.reset-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.save-btn {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.reset-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 10px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert.success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #34d399;
}

.preview-card {
    background: rgba(255, 255, 255, 0.05);
}

.preview-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.preview-item strong {
    color: #a78bfa;
    font-size: 0.9rem;
}

.preview-item span {
    color: white;
    word-break: break-all;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .server-title {
        font-size: 2rem;
    }

    .header-controls {
        flex-direction: column;
        gap: 0.75rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .players-list {
        grid-template-columns: 1fr;
    }

    .back-link {
        position: static;
        display: inline-block;
        margin-bottom: 1rem;
    }

    header {
        text-align: center;
    }

    .button-group {
        flex-direction: column;
    }
}

