* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #0c0c1d;
    background-image: linear-gradient(135deg, #0c0c1d 0%, #1a1a3e 50%, #0c0c1d 100%);
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    color: #e0e0e0;
    overflow-x: hidden;
    position: relative;
}

body[style*="background-image"] {
    background-color: #0c0c1d;
    background-size: cover !important;
    background-position: center center !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
}

body[style*="background-image"]::before {
    display: none;
}

.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: -1;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
}

body.has-bg::before {
    display: none;
}

body.has-bg {
    background-image: none !important;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 20% 50%, rgba(72, 0, 255, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 50%, rgba(255, 0, 128, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px;
    position: relative;
    z-index: 1;
}

.gate-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.gate-box {
    background: rgba(20, 20, 50, 0.9);
    border: 1px solid rgba(100, 100, 255, 0.2);
    border-radius: 20px;
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 40px rgba(72, 0, 255, 0.15), inset 0 0 40px rgba(72, 0, 255, 0.05);
    animation: gateFloat 3s ease-in-out infinite;
}

@keyframes gateFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.gate-box h2 {
    font-size: 22px;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.gate-box .lock-icon {
    font-size: 50px;
    margin-bottom: 15px;
    animation: lockPulse 2s ease-in-out infinite;
}

@keyframes lockPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.buy-btn {
    display: inline-block;
    padding: 10px 28px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 20px;
    transition: all 0.3s;
    letter-spacing: 1px;
}

.buy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.gate-input {
    width: 100%;
    padding: 14px 20px;
    background: rgba(30, 30, 70, 0.8);
    border: 1px solid rgba(100, 100, 255, 0.3);
    border-radius: 30px;
    color: #fff;
    font-size: 15px;
    text-align: center;
    outline: none;
    transition: all 0.3s;
    margin-bottom: 12px;
}

.gate-input:focus {
    border-color: #a855f7;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.gate-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 2px;
}

.gate-submit:hover {
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.5);
}

.remaining-info {
    margin-top: 15px;
    font-size: 13px;
    color: #a0a0c0;
}

.remaining-info span {
    color: #a855f7;
    font-weight: 700;
    font-size: 16px;
}

.gate-error {
    color: #ef4444;
    font-size: 13px;
    margin-top: 10px;
    min-height: 20px;
}

.announcement {
    background: rgba(20, 20, 50, 0.85);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

.announcement-text {
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-line;
    color: #f0f0f0;
}

.announcement-img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    border-radius: 10px;
    margin-top: 12px;
    object-fit: contain;
    -webkit-object-fit: contain;
}

.announcement-img-wrap {
    width: 100%;
    text-align: center;
    margin-top: 12px;
    overflow: hidden;
}

.announcement-img-wrap .announcement-img {
    display: inline-block;
    max-width: 100%;
    max-height: 300px;
}

.mode-section {
    margin-bottom: 24px;
}

.mode-section h3 {
    font-size: 15px;
    color: #a0a0c0;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 1px;
}

.mode-list {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.mode-item {
    flex: 1;
    padding: 14px 8px;
    background: rgba(30, 30, 70, 0.7);
    border: 2px solid rgba(100, 100, 255, 0.2);
    border-radius: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 600;
    user-select: none;
}

.mode-item:hover {
    border-color: rgba(168, 85, 247, 0.5);
    background: rgba(50, 30, 100, 0.7);
}

.mode-item.active-slow {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
}

.mode-item.active-fast {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.mode-item.active-crazy {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.mode-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 6px;
}

.input-section {
    margin-bottom: 20px;
}

.input-with-hint {
    position: relative;
    margin-bottom: 12px;
}

.input-with-hint .capsule-input {
    margin-bottom: 0;
}

.domain-hint {
    display: none;
    padding: 6px 22px 2px;
    font-size: 11px;
    color: #22c55e;
    letter-spacing: 0.5px;
    word-break: break-all;
    line-height: 1.4;
}

.capsule-input {
    width: 100%;
    padding: 14px 22px;
    background: rgba(30, 30, 70, 0.7);
    border: 1px solid rgba(100, 100, 255, 0.25);
    border-radius: 30px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    margin-bottom: 12px;
}

.capsule-input:focus {
    border-color: #a855f7;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

.capsule-input::placeholder {
    color: rgba(160, 160, 192, 0.6);
}

.link-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 24px;
}

.link-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.link-btn:nth-child(1) {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border-color: rgba(168, 85, 247, 0.4);
}

.link-btn:nth-child(2) {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    border-color: rgba(236, 72, 153, 0.4);
}

.link-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.launch-area {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 0;
}

.remaining-badge {
    background: rgba(20, 20, 50, 0.85);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    color: #a0a0c0;
    white-space: nowrap;
    flex-shrink: 0;
}

.remaining-badge span {
    color: #a855f7;
    font-weight: 700;
    font-size: 16px;
}

.launch-btn {
    flex: 1;
    padding: 16px;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 3px;
    position: relative;
    overflow: hidden;
}

.launch-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: btnShine 3s infinite;
}

@keyframes btnShine {
    0% { left: -50%; }
    100% { left: 150%; }
}

.launch-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.5);
}

.launch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.result-box {
    margin-top: 20px;
    background: rgba(20, 20, 50, 0.85);
    border: 1px solid rgba(100, 100, 255, 0.2);
    border-radius: 14px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.8;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    word-break: break-all;
}

.result-box.show {
    display: block;
}

.result-box .success {
    color: #22c55e;
}

.result-box .error {
    color: #ef4444;
}

.result-box .info {
    color: #a855f7;
}

.result-box .skip {
    color: #f59e0b;
}

.progress-section {
    margin-top: 16px;
    display: none;
}

.progress-section.show {
    display: block;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.progress-label {
    font-size: 13px;
    color: #a0a0c0;
}

.progress-percent {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(30, 30, 70, 0.7);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #a855f7, #ec4899);
    border-radius: 5px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: progressShine 1.5s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: #a0a0c0;
}

.stat-ok {
    color: #22c55e;
}

.stat-fail {
    color: #ef4444;
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(20, 20, 50, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 9999;
    transition: transform 0.4s;
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.blocked-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    flex-direction: column;
    gap: 20px;
}

.blocked-overlay h1 {
    color: #ef4444;
    font-size: 48px;
}

.blocked-overlay p {
    color: #a0a0c0;
    font-size: 16px;
}

@media (max-width: 500px) {
    .container {
        padding: 16px 12px;
    }
    .mode-item {
        padding: 10px 4px;
        font-size: 12px;
    }
    .mode-icon {
        font-size: 20px;
    }
    .auth-modal-box {
        width: 92%;
        padding: 28px 20px;
    }
    .launch-area {
        flex-direction: column;
    }
    .remaining-badge {
        align-self: center;
    }
}

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.auth-modal.show {
    display: flex;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.auth-modal-box {
    position: relative;
    background: rgba(20, 20, 50, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 20px;
    padding: 36px 28px;
    width: 90%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.2);
    animation: modalIn 0.3s ease;
    -webkit-animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.auth-modal-box h3 {
    font-size: 20px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.auth-modal-desc {
    font-size: 13px;
    color: #a0a0c0;
    margin-bottom: 20px;
    line-height: 1.6;
}

.auth-modal-cancel {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #a0a0c0;
    border: 1px solid rgba(100, 100, 255, 0.3);
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
}

.auth-modal-cancel:hover {
    border-color: #a855f7;
    color: #a855f7;
}
