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

html, body {
    height: 100%;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

body {
    background: #0a0e1a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

@media (min-width: 768px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        background: linear-gradient(135deg, #0a0e1a 0%, #0f1322 100%);
    }
    
    .phone-frame {
        width: 480px !important;
        max-width: 480px !important;
        height: auto !important;
        max-height: 90vh;
        margin: 0 auto;
        border-radius: 32px;
        overflow: hidden;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        border-left: 1px solid rgba(255, 255, 255, 0.08);
        border-right: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    .auth-wrap {
        overflow-y: auto;
        max-height: calc(90vh - 52px);
    }
    
    .auth-wrap::-webkit-scrollbar {
        width: 4px;
    }
    
    .auth-wrap::-webkit-scrollbar-track {
        background: #1e293b;
        border-radius: 4px;
    }
    
    .auth-wrap::-webkit-scrollbar-thumb {
        background: #3b82f6;
        border-radius: 4px;
    }
}

@media (max-width: 767px) {
    .phone-frame {
        width: 100%;
        max-width: 480px;
        height: 100vh;
        margin: 0 auto;
        border-left: 1px solid rgba(255, 255, 255, 0.08);
        border-right: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    .auth-wrap {
        height: calc(100vh - 52px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ========== 以下保持原有样式不变 ========== */
.crypto-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.crypto-bg .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: floatAmbient 25s infinite ease-in-out;
}

.crypto-bg .orb:nth-child(1) {
    width: 400px;
    height: 400px;
    background: #3b82f6;
    top: -10%;
    left: -10%;
}

.crypto-bg .orb:nth-child(2) {
    width: 350px;
    height: 350px;
    background: #8b5cf6;
    top: 60%;
    left: 75%;
    animation-delay: -8s;
}

.crypto-bg .orb:nth-child(3) {
    width: 280px;
    height: 280px;
    background: #06b6d4;
    top: 20%;
    left: 45%;
    animation-delay: -16s;
}

.crypto-bg .orb:nth-child(4) {
    width: 300px;
    height: 300px;
    background: #f59e0b;
    top: 70%;
    left: 10%;
    animation-delay: -24s;
}

.crypto-icons {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.crypto-icon {
    position: absolute;
    font-size: 24px;
    opacity: 0.08;
    animation: floatIcon 20s infinite linear;
    color: #fff;
}

.crypto-icon:nth-child(1) { top: 15%; left: 5%; font-size: 32px; animation-duration: 25s; }
.crypto-icon:nth-child(2) { top: 25%; right: 8%; font-size: 28px; animation-duration: 30s; animation-delay: -5s; }
.crypto-icon:nth-child(3) { bottom: 20%; left: 10%; font-size: 40px; animation-duration: 35s; animation-delay: -10s; }
.crypto-icon:nth-child(4) { bottom: 35%; right: 15%; font-size: 22px; animation-duration: 28s; animation-delay: -15s; }
.crypto-icon:nth-child(5) { top: 50%; left: 20%; font-size: 18px; animation-duration: 32s; animation-delay: -3s; }
.crypto-icon:nth-child(6) { top: 70%; right: 25%; font-size: 26px; animation-duration: 26s; animation-delay: -20s; }
.crypto-icon:nth-child(7) { top: 35%; left: 30%; font-size: 20px; animation-duration: 38s; animation-delay: -8s; }
.crypto-icon:nth-child(8) { bottom: 50%; right: 40%; font-size: 30px; animation-duration: 22s; animation-delay: -12s; }

.kline-decor {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    opacity: 0.04;
    pointer-events: none;
}

.kline-decor svg {
    width: 100%;
    height: 100%;
}

@keyframes floatAmbient {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -40px) scale(1.08); }
    66% { transform: translate(-25px, 25px) scale(0.92); }
}

@keyframes floatIcon {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(15px, -15px) rotate(5deg); }
    50% { transform: translate(-10px, 10px) rotate(-5deg); }
    75% { transform: translate(20px, -8px) rotate(3deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.phone-frame {
    width: 100%;
    max-width: 480px;
    backdrop-filter: blur(2px);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #111827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    min-height: 52px;
}

.top-bar .cs-btn {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #9ca3af;
    text-decoration: none;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.top-bar .cs-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.top-bar .cs-btn i {
    font-size: 16px;
}

.lang-selector-wrap {
    position: relative;
}

.lang-selector-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 24px;
    color: #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-selector-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lang-selector-btn i {
    font-size: 10px;
    color: #9ca3af;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 50;
    display: none;
    min-width: 130px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.lang-dropdown.show {
    display: block;
}

.lang-dropdown div {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    color: #e5e7eb;
    transition: background 0.15s;
}

.lang-dropdown div:hover {
    background: #374151;
}

.lang-dropdown div.active {
    background: #3b82f6;
    color: #fff;
    font-weight: 600;
}

.auth-wrap {
    position: relative;
    z-index: 2;
    padding: 40px 24px 28px;
    flex: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .icon-circle {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.auth-header .icon-circle img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.auth-header .icon-circle i {
    font-size: 32px;
    color: #fff;
}

.auth-header h4 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.auth-header p {
    font-size: 13px;
    color: #9ca3af;
}

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

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 6px;
    display: block;
}

.form-group .input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: all 0.2s;
}

.form-group .input-wrap:focus-within {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.form-group .input-wrap.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.form-group .input-wrap i.icon-left {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 0 14px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.form-group .input-wrap input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 15px;
    color: #fff;
    background: transparent;
    padding: 12px 10px;
}

.form-group .input-wrap input::placeholder {
    color: #4b5563;
}

.form-group .input-wrap .toggle-pwd {
    border: none;
    background: none;
    padding: 10px 14px;
    cursor: pointer;
    color: #6b7280;
    font-size: 14px;
    flex-shrink: 0;
}

.form-group .input-wrap .toggle-pwd:hover {
    color: #9ca3af;
}

.form-group .error-msg {
    font-size: 11px;
    color: #ef4444;
    margin-top: 6px;
    display: none;
}

.form-group .error-msg.show {
    display: block;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.btn-submit:active {
    transform: scale(0.98);
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.remember-row input {
    accent-color: #3b82f6;
    width: 16px;
    height: 16px;
    margin: 0;
}

.remember-row label {
    font-size: 12px;
    color: #9ca3af;
    cursor: pointer;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: #9ca3af;
}

.auth-footer a {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
    margin-left: 6px;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.alert {
    margin-bottom: 16px;
    border-radius: 12px;
    font-size: 13px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.alert .btn-close {
    filter: invert(1);
    opacity: 0.6;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 16px;
}

.toast-custom {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    background: #1f2937;
    color: #fff;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: fadeInOut 2s ease;
    max-width: 85%;
    text-align: center;
}

.toast-custom.error {
    background: #ef4444;
}

.toast-custom.success {
    background: #22c55e;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0e1a;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    transition: opacity 0.3s ease;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.page-loader .loader-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    animation: spin 0.8s linear infinite;
}

.page-loader .loader-text {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 500;
}

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

.trans-ready {
    opacity: 0;
    transition: opacity 0.15s;
}

.trans-ready.done {
    opacity: 1;
}