/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: linear-gradient(180deg, #f7f8fc 0%, #fafafa 30%, #f5f6fa 100%);
    color: #1a1a2e;
    line-height: 1.7;
    min-height: 100vh;
    position: relative;
    padding-top: 62px;
}

/* Subtle dot texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(200, 210, 230, 0.15) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Background decoration ===== */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bg-decoration::before {
    content: '';
    position: absolute;
    top: -15%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(160, 190, 230, 0.25) 0%, transparent 65%);
    border-radius: 50%;
}

.bg-decoration::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -8%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(190, 210, 240, 0.2) 0%, transparent 60%);
    border-radius: 50%;
}

.bg-blob-center {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(215, 225, 245, 0.12) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}



/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 60px 0 60px;
}

.server-badge {
    display: inline-block;
    background: #e8edf5;
    color: #4a5b7a;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.server-name {
    font-size: 52px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.server-subtitle {
    font-size: 18px;
    color: #666;
    font-weight: 400;
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-num {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e6b;
}

.stat-label {
    font-size: 13px;
    color: #888;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid #f0f0f0;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    color: #1a1a2e;
    text-decoration: none;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.nav-logo-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2px;
    align-items: center;
}

.nav-links a {
    display: block;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-links a:hover {
    background: #f0f2f5;
    color: #1a1a2e;
}

/* 登录后用户胶囊 */
#nav-user-capsule {
    display: inline-flex;
    align-items: center;
    gap: 0;
}
#nav-user-capsule a:first-child {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f0f2f5;
    border-radius: 16px 0 0 16px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    border: 1px solid #e4e7ed;
    border-right: none;
    margin-left: 4px;
    text-decoration: none;
}
#nav-user-capsule a:last-child {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #f0f2f5;
    border-radius: 0 16px 16px 0;
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    border: 1px solid #e4e7ed;
    border-left: none;
    text-decoration: none;
}
#nav-user-capsule a:last-child:hover {
    color: #c33;
    background: #fee;
}

.nav-role-tag {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 600;
}

/* Nav toggle (mobile) */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #1a1a2e;
    border-radius: 2px;
    transition: 0.3s;
}

/* ===== Sections ===== */
.section {
    padding: 56px 0;
    scroll-margin-top: 80px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    margin-bottom: 12px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: #2c3e6b;
    border-radius: 2px;
    margin: 12px auto 0;
}

.section-desc {
    text-align: center;
    color: #777;
    font-size: 15px;
    margin-bottom: 32px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Cards ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
}

.info-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.card-icon {
    color: #2c3e6b;
    margin-bottom: 16px;
}

.info-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a2e;
}

.info-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* ===== Server Status ===== */
.status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 32px;
}

.status-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px 20px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s;
}

.status-card:hover {
    transform: translateY(-2px);
}

.status-icon {
    color: #2c3e6b;
    margin-bottom: 12px;
    opacity: 0.7;
}

.status-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.status-card .status-label {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

.status-value {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.2;
    transition: color 0.3s;
}

.status-sub {
    font-size: 12px;
    color: #aaa;
}

/* RAM bar */
.ram-bar {
    width: 100%;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    margin: 6px 0 2px;
    overflow: hidden;
}

.ram-bar-fill {
    height: 100%;
    width: 0%;
    background: #2c3e6b;
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ===== Rules ===== */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.rule-num {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e6b;
    background: #e8edf5;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rule-content h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1a1a2e;
}

.rule-content p {
    font-size: 14px;
    color: #777;
}

/* ===== Join ===== */
.join-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* ===== Quick Actions ===== */
.quick-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 24px 0 36px;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    font-family: inherit;
    line-height: 1;
}

.btn-primary {
    background: #1a1a2e;
    color: #fff;
}

.btn-primary:hover {
    background: #2c3e6b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.2);
}

.btn-secondary {
    background: #f0f2f5;
    color: #1a1a2e;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e4e7ed;
    transform: translateY(-1px);
}

.btn-text {
    background: transparent;
    color: #888;
    padding: 12px 16px;
    font-weight: 400;
}

.btn-text:hover {
    color: #555;
}

/* ===== Apply Form ===== */
.apply-form {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    padding: 36px 32px;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.required {
    color: #d32f2f;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
    outline: none;
}

.form-group input:focus {
    border-color: #1a1a2e;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.08);
}

.form-group input::placeholder {
    color: #bbb;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

.submit-btn {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
}

/* ===== Flash Toast ===== */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 48px);
    max-width: 420px;
}

.toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    animation: slideDown 0.3s ease;
    transition: opacity 0.3s;
}

.toast-success {
    background: #1b5e20;
}

.toast-error {
    background: #b71c1c;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    cursor: pointer;
    padding: 0 0 0 12px;
    line-height: 1;
}

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

/* ===== Announcements ===== */
.announcement-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

.announcement-item {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.announcement-date {
    display: inline-block;
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.announcement-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.announcement-item p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* ===== FAQ ===== */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
}

.faq-item {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.faq-item h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.faq-item p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* ===== Changelog ===== */
.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
}

.changelog-item {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.changelog-version {
    font-size: 14px;
    font-weight: 700;
    color: #2c3e6b;
    background: #e8edf5;
    padding: 2px 10px;
    border-radius: 6px;
}

.changelog-date {
    font-size: 12px;
    color: #999;
}

.changelog-item p {
    font-size: 14px;
    color: #666;
    width: 100%;
    margin-top: 4px;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 40px 0;
    margin-top: 40px;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 13px;
}

.footer-motto {
    margin-top: 4px;
    color: #bbb;
    font-size: 13px;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
    .nav-links {
        position: fixed;
        top: 62px;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(8px);
        flex-direction: column;
        padding: 8px 16px 16px;
        gap: 0;
        border-bottom: 1px solid #f0f0f0;
        display: none;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 12px 16px;
        border-radius: 8px;
    }

    /* 移动端：QQ号和退出统一胶囊卡片 */
    #nav-user-capsule {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        width: 100%;
        background: #fff;
        border: 1px solid #e8eaed;
        border-radius: 10px;
        overflow: hidden;
        margin-top: 2px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    }
    #nav-user-capsule a {
        display: flex;
        align-items: center;
        padding: 10px 14px;
        font-size: 13px;
        text-decoration: none;
        white-space: nowrap;
        border-radius: 0;
        background: transparent;
        transition: background 0.2s;
    }
    #nav-user-capsule a:first-child {
        flex: 1;
        color: #1a1a2e;
        font-weight: 500;
        border-right: 1px solid #e8eaed;
        overflow: hidden;
        text-overflow: ellipsis;
        gap: 4px;
    }
    #nav-user-capsule a:last-child {
        flex-shrink: 0;
        color: #e53935;
        font-weight: 500;
        padding: 10px 16px;
    }
    #nav-user-capsule a:last-child:hover {
        background: #ffebee;
    }

    .nav-toggle {
        display: flex;
    }

    .server-name {
        font-size: 36px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-stats {
        gap: 32px;
    }

    .hero {
        padding: 48px 0 36px;
    }

    .join-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        justify-content: center;
    }

    .rule-item {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .nav-logo-img {
        width: 32px;
        height: 32px;
    }

    .nav-logo {
        font-size: 16px;
        gap: 8px;
    }

    .server-name {
        font-size: 28px;
    }

    .section {
        padding: 32px 0;
    }

    .hero {
        padding: 40px 0 40px;
    }

    body {
        padding-top: 54px;
    }

    .nav-container {
        height: 54px;
    }

    .nav-links {
        top: 54px;
    }

    .status-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .status-value {
        font-size: 22px;
    }

    .apply-form {
        padding: 24px 20px;
    }
}

/* ===== Modal 新增 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    width: calc(100% - 48px);
    max-width: 400px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.15);
    position: relative;
    animation: scaleIn 0.2s ease;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
.modal-close:hover { color: #333; }
.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 24px;
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
