:root {
    --color-black: #091416;
}

.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-modal.show {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.login-modal-content {
    background: var(--color-black);
    border-radius: 24px;
    padding: 0;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateY(-50px) scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    -webkit-overflow-scrolling: touch;
}

.login-modal.show .login-modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-modal.hiding {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-modal.hiding .login-modal-content {
    transform: translateY(-30px) scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.login-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid rgba(180, 148, 86, 0.1);
    flex-shrink: 0;
}

.login-modal-title-section {
    flex: 1;
}

.login-modal-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-light-gold);
    margin: 0 0 0.5rem 0;
}

.login-modal-subtitle {
    font-size: 0.9rem;
    color: var(--color-light-gray);
    margin: 0;
}

.login-modal-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-modal-lang {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-light-gold);
    cursor: pointer;
    font-size: 0.9rem;
}

.login-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--color-light-gold);
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.login-modal-close:hover {
    background: rgba(180, 148, 86, 0.1);
}

.login-modal-body {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 2rem;
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.login-form-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-form-divider {
    width: 1px;
    background: rgba(180, 148, 86, 0.2);
    margin: 0;
}

.login-options-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(180, 148, 86, 0.3);
    border-radius: 12px;
    font-size: 0.95rem;
    color: #091416;
    background: white;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-light-gold);
    box-shadow: 0 0 0 3px rgba(180, 148, 86, 0.1);
}

.form-input::placeholder {
    color: #091416;
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 60px;
    border: 1px solid rgba(180, 148, 86, 0.3);
    border-radius: 12px;
    font-size: 0.95rem;
    color: #091416;
    background: white;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b49456' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-light-gold);
    box-shadow: 0 0 0 3px rgba(180, 148, 86, 0.1);
}

.country-select-wrapper {
    position: relative;
}

.country-flag-icon {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-light-gold);
    pointer-events: none;
    font-size: 1.2rem;
    z-index: 1;
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-light-gold);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background:#FCD535 !important;
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;

}

.btn-login-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 162, 87, 0.5);
}

.btn-login-primary:active {
    transform: translateY(0);
}

.terms-text {
    font-size: 0.75rem;
    color: var(--color-light-gray);
    text-align: center;
    margin-top: 0.5rem;
}

.terms-link {
    color: var(--color-light-gold);
    text-decoration: none;
    font-weight: 500;
}

.terms-link:hover {
    text-decoration: underline;
}

.btn-login-option {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--color-black);
    border: 1.5px solid var(--color-light-gold);
    border-radius: 12px;
    color: var(--color-ebony);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-login-option:hover {
    background: rgba(180, 148, 86, 0.05);
    border-color: var(--color-bronze);
}

.btn-login-option.active {
    background: linear-gradient(135deg, var(--color-light-gold) 0%, var(--color-green) 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(212, 162, 87, 0.3);
}

.btn-login-option.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 162, 87, 0.5);
}

.btn-connect-wallet {
    width: 100%;
    padding: 5px;
    background: var(--color-black);
    border: 1.5px solid var(--color-light-gold);
    border-radius: 12px;
    color: var(--color-ebony);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-connect-wallet .wallet-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallet-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: white;
}

.btn-connect-wallet .wallet-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.btn-connect-wallet:hover {
    background: rgba(180, 148, 86, 0.05);
    border-color: var(--color-bronze);
}

.btn-connect-wallet.active {
    background: linear-gradient(135deg, var(--color-light-gold) 0%, var(--color-green) 100%);
    border-color: transparent;
    color: white;
}

.btn-login-option.active {
    background: #FCD535 !important;
    color: black;
}

.wallet-connect-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.wallet-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


.btn-wallet-option {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--color-black);
    border: 1.5px solid rgba(180, 148, 86, 0.3);
    border-radius: 12px;
    color: var(--color-ebony);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-wallet-option:hover {
    border-color: var(--color-light-gold);
    background: rgba(180, 148, 86, 0.05);
}

.wallet-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.btn-wallet-option img {
    display: block;
}

.btn-wallet-option .wallet-logo-fallback {
    display: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.referral-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.referral-divider {
    position: relative;
    text-align: center;
}

.referral-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(180, 148, 86, 0.2);
}

.referral-divider-text {
    position: relative;
    background: var(--color-black);
    padding: 0 1rem;
    color: var(--color-light-gold);
    font-weight: 500;
    font-size: 0.9rem;
}

/* 注册模态框 */
.signup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.signup-modal.show {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

.signup-modal-content {
    background: var(--color-black);
    border-radius: 24px;
    padding: 0;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateY(-50px) scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    -webkit-overflow-scrolling: touch;
}

.signup-modal.show .signup-modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.signup-modal.hiding {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.signup-modal.hiding .signup-modal-content {
    transform: translateY(-30px) scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.signup-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid rgba(180, 148, 86, 0.1);
    flex-shrink: 0;
}

.signup-modal-title-section {
    flex: 1;
}

.signup-modal-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-light-gold);
    margin: 0 0 0.5rem 0;
}

.signup-modal-subtitle {
    font-size: 0.9rem;
    color: var(--color-light-gray);
    margin: 0;
}

.signup-modal-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.signup-modal-lang {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-light-gold);
    cursor: pointer;
    font-size: 0.9rem;
}

.signup-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--color-light-gold);
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.signup-modal-close:hover {
    background: rgba(180, 148, 86, 0.1);
}

.signup-modal-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.signup-form-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.signup-form-divider {
    width: 1px;
    background: rgba(180, 148, 86, 0.2);
    margin: 0;
}

.signup-options-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-get-code {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--color-light-gold) 0%, var(--color-green) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-get-code:hover {
    background: linear-gradient(135deg, var(--color-bronze) 0%, var(--color-light-gold) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(212, 162, 87, 0.3);
}

.btn-get-code:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-signup {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--color-black);
    border: 1.5px solid var(--color-light-gold);
    border-radius: 12px;
    color: var(--color-light-gold);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-signup:hover {
    background: rgba(180, 148, 86, 0.05);
    border-color: var(--color-bronze);
}

.forgot-password {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-ebony);
}

.forgot-password-link {
    color: var(--color-light-gold);
    text-decoration: none;
    font-weight: 500;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

.login-option-divider {
    height: 1px;
    background: rgba(180, 148, 86, 0.2);
    margin: 0.5rem 0;
}


.wallet-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.wallet-modal.show {
    display: flex;
}

.wallet-modal-content {
    background: var(--color-ebony);
    border: 2px solid var(--color-light-gold);
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.wallet-modal-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--color-light-gold);
    margin-bottom: 1.5rem;
}

.wallet-address {
    background: rgba(180, 148, 86, 0.1);
    border: 1px solid var(--color-light-gold);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    word-break: break-all;
    color: var(--color-cream);
}

.btn-disconnect {
    background: transparent;
    border: 2px solid var(--color-bronze);
    color: var(--color-bronze);
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.btn-disconnect:hover {
    background: var(--color-bronze);
    color: var(--color-ebony);
}

@media (max-width: 768px) {
    .login-modal {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 1rem;
    }

    .login-modal-content {
        max-height: calc(100vh - 2rem);
        width: calc(100% - 1rem);
        margin: 0 auto;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .login-modal-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .login-form-divider {
        display: none;
    }

    .login-modal-header {
        padding: 1.5rem 1.5rem 1rem;
        flex-shrink: 0;
    }

    .login-modal-title {
        font-size: 1.5rem;
    }

    .signup-modal {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 1rem;
    }

    .signup-modal-content {
        max-height: calc(100vh - 2rem);
        width: calc(100% - 1rem);
        margin: 0 auto;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .signup-modal-body {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .signup-form-divider {
        display: none;
    }

    .signup-modal-header {
        padding: 1.5rem 1.5rem 1rem;
        flex-shrink: 0;
    }

    .signup-modal-title {
        font-size: 1.5rem;
    }
}

/* 设置二级密码模态框样式 */
.security-password-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.security-password-modal.show {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

.security-password-modal-content {
    background: var(--color-black);
    border-radius: 24px;
    padding: 0;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateY(-50px) scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    -webkit-overflow-scrolling: touch;
}

.security-password-modal.show .security-password-modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.security-password-modal.hiding {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.security-password-modal.hiding .security-password-modal-content {
    transform: translateY(-30px) scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.security-password-modal-header {
    padding: 1.5rem 1.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(180, 148, 86, 0.2);
}

.security-password-modal-title-section {
    flex: 1;
}

.security-password-modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-light-gold);
    margin: 0 0 0.5rem 0;
}

.security-password-modal-subtitle {
    color: var(--color-light-gray);
    font-size: 0.9rem;
    margin: 0;
}

.security-password-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.security-password-modal-close {
    background: transparent;
    border: none;
    color: var(--color-light-gold);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.security-password-modal-close:hover {
    color: var(--color-bronze);
}

.security-password-modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .security-password-modal-content {
        max-width: 95%;
        margin: 1rem;
    }

    .security-password-modal-header {
        padding: 1.5rem 1.5rem 1rem;
        flex-shrink: 0;
    }

    .security-password-modal-title {
        font-size: 1.5rem;
    }
}

