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

:root {
    --auth-primary: #667eea;
    --auth-primary-dark: #5a67d8;
    --auth-secondary: #764ba2;
    --auth-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --auth-bg: linear-gradient(180deg, #ffffff 0%, #f5f5f5 50%, #e8e8e8 100%);
    --auth-card-bg: rgba(255, 255, 255, 0.85);
    --auth-card-border: rgba(0, 0, 0, 0.12);
    --auth-card-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
    --auth-card-hover-shadow: 0 25px 35px rgba(0, 0, 0, 0.18);
    --auth-text-primary: #1a202c;
    --auth-text-secondary: #718096;
    --auth-text-tertiary: #9ca3af;
    --auth-input-bg: #ffffff;
    --auth-input-border: #e5e7eb;
    --auth-input-hover-bg: #fafafa;
    --auth-input-hover-border: #d1d5db;
    --auth-input-focus-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12), 0 4px 12px rgba(102, 126, 234, 0.08);
    --auth-divider-bg: #e5e7eb;
    --auth-footer-border: #e5e7eb;
    --auth-social-bg: #ffffff;
    --auth-social-border: #e5e7eb;
    --auth-check-bg: #ffffff;
    --auth-check-border: #d1d5db;
    --auth-circle-bg: rgba(102, 126, 234, 0.08);
    --auth-terms-text: #666;
    --auth-terms-link: #059669;
    --auth-terms-link-hover: #047857;
    --auth-terms-content-heading: #333;
    --auth-terms-content-text: #666;
    --auth-success-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.06));
    --auth-success-border: rgba(16, 185, 129, 0.25);
    --auth-success-text: #059669;
    --auth-error-bg: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.06));
    --auth-error-border: rgba(239, 68, 68, 0.25);
    --auth-error-text: #dc2626;
}

[data-theme="dark"] {
    --auth-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    --auth-card-bg: rgba(30, 41, 59, 0.9);
    --auth-card-border: rgba(255, 255, 255, 0.08);
    --auth-card-shadow: 0 20px 25px rgba(0, 0, 0, 0.4);
    --auth-card-hover-shadow: 0 25px 35px rgba(0, 0, 0, 0.5);
    --auth-text-primary: #f1f5f9;
    --auth-text-secondary: #94a3b8;
    --auth-text-tertiary: #64748b;
    --auth-input-bg: rgba(15, 23, 42, 0.6);
    --auth-input-border: rgba(255, 255, 255, 0.1);
    --auth-input-hover-bg: rgba(15, 23, 42, 0.8);
    --auth-input-hover-border: rgba(255, 255, 255, 0.15);
    --auth-input-focus-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2), 0 4px 12px rgba(102, 126, 234, 0.15);
    --auth-divider-bg: rgba(255, 255, 255, 0.08);
    --auth-footer-border: rgba(255, 255, 255, 0.08);
    --auth-social-bg: rgba(15, 23, 42, 0.6);
    --auth-social-border: rgba(255, 255, 255, 0.1);
    --auth-check-bg: rgba(15, 23, 42, 0.6);
    --auth-check-border: rgba(255, 255, 255, 0.15);
    --auth-circle-bg: rgba(102, 126, 234, 0.06);
    --auth-terms-text: #94a3b8;
    --auth-terms-link: #34d399;
    --auth-terms-link-hover: #6ee7b7;
    --auth-terms-content-heading: #e2e8f0;
    --auth-terms-content-text: #94a3b8;
    --auth-success-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
    --auth-success-border: rgba(16, 185, 129, 0.3);
    --auth-success-text: #34d399;
    --auth-error-bg: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.08));
    --auth-error-border: rgba(239, 68, 68, 0.3);
    --auth-error-text: #f87171;
}

body.auth-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-bg);
    position: relative;
    overflow-y: auto;
    padding: 20px;
}

.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: var(--auth-circle-bg);
    animation: float 6s ease-in-out infinite;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -50px;
    animation-delay: 2s;
}

.circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    right: 10%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(10deg); }
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    padding: 20px;
}

.auth-card {
    background: var(--auth-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--auth-card-border);
    box-shadow: var(--auth-card-shadow);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--auth-card-hover-shadow);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-card-inner {
    padding: 20px 24px;
}

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

.auth-logo {
    width: 90px;
    height: 90px;
    margin: 0 auto 16px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-logo:hover {
    transform: scale(1.08);
}

.auth-logo svg {
    width: 90px;
    height: 90px;
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.2));
}

.auth-brand {
    font-size: 22px;
    font-weight: 800;
    color: var(--auth-text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 2px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--auth-text-secondary);
    font-weight: 500;
}

.auth-body {
    position: relative;
}

.auth-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--auth-text-primary);
    text-align: center;
    margin-bottom: 2px;
    animation: fadeInDown 0.5s ease-out 0.2s both;
}

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

.auth-description {
    font-size: 13px;
    color: var(--auth-text-secondary);
    text-align: center;
    margin-bottom: 12px;
    animation: fadeInDown 0.5s ease-out 0.3s both;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-field {
    position: relative;
    animation: fadeInUp 0.5s ease-out both;
}

.form-field:nth-child(1) { animation-delay: 0.1s; }
.form-field:nth-child(2) { animation-delay: 0.2s; }
.form-field:nth-child(3) { animation-delay: 0.3s; }
.form-field:nth-child(4) { animation-delay: 0.4s; }
.form-field:nth-child(5) { animation-delay: 0.5s; }
.form-field:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: var(--auth-text-tertiary);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 46px;
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-input-border);
    border-radius: 13px;
    font-size: 14px;
    color: var(--auth-text-primary);
    outline: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.form-input::placeholder {
    color: var(--auth-text-tertiary);
    transition: opacity 0.3s ease;
}

.form-input:hover {
    background: var(--auth-input-hover-bg);
    border-color: var(--auth-input-hover-border);
}

.form-input:hover::placeholder {
    opacity: 0.7;
}

.form-input:focus {
    background: var(--auth-input-bg);
    border-color: var(--auth-primary);
    box-shadow: var(--auth-input-focus-shadow);
}

.input-wrapper:focus-within .input-icon {
    color: var(--auth-primary);
    transform: scale(1.15);
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.form-row .form-field {
    flex: 1;
}

.captcha-box {
    flex-shrink: 0;
    width: 120px;
    height: 48px;
    background: var(--auth-input-bg);
    border: 1.5px solid var(--auth-input-border);
    border-radius: 13px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.captcha-box:hover {
    border-color: var(--auth-primary);
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.captcha-box img,
.captcha-box canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.send-code-btn {
    flex-shrink: 0;
    height: 48px;
    padding: 0 18px;
    background: var(--auth-gradient);
    border: none;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.send-code-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.35);
}

.send-code-btn:active:not(:disabled) {
    transform: translateY(0);
}

.send-code-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -4px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    width: 20px;
    height: 20px;
    background: var(--auth-check-bg);
    border: 2px solid var(--auth-check-border);
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"]:checked ~ .checkmark {
    background: var(--auth-gradient);
    border-color: transparent;
    transform: scale(1.05);
}

.checkmark:after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-wrapper input[type="checkbox"]:checked ~ .checkmark:after {
    display: block;
    animation: checkBounce 0.3s ease;
}

@keyframes checkBounce {
    0% { transform: rotate(45deg) scale(0); }
    50% { transform: rotate(45deg) scale(1.2); }
    100% { transform: rotate(45deg) scale(1); }
}

.checkbox-wrapper span {
    font-size: 14px;
    color: var(--auth-text-secondary);
}

.form-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.form-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--auth-gradient);
    transition: width 0.3s ease;
}

.form-link:hover {
    color: var(--auth-primary-dark);
}

.form-link:hover::after {
    width: 100%;
}

.submit-btn {
    width: 100%;
    height: 50px;
    background: var(--auth-gradient);
    border: none;
    border-radius: 13px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.45);
}

.submit-btn:active {
    transform: translateY(-1px);
}

.btn-text {
    letter-spacing: 2px;
}

.btn-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.submit-btn:hover .btn-arrow {
    transform: translateX(5px);
}

.form-message {
    margin-top: 2px;
    min-height: 5px;
}

.message-success,
.message-error {
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    animation: messageSlideIn 0.4s ease;
}

.message-success {
    background: var(--auth-success-bg);
    border: 1px solid var(--auth-success-border);
    color: var(--auth-success-text);
}

.message-error {
    background: var(--auth-error-bg);
    border: 1px solid var(--auth-error-border);
    color: var(--auth-error-text);
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 16px 0 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--auth-divider-bg), transparent);
}

.auth-divider span {
    font-size: 13px;
    color: var(--auth-text-tertiary);
    font-weight: 500;
}

.auth-social {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.auth-social-btn {
    width: 52px;
    height: 52px;
    background: var(--auth-social-bg);
    border: 1.5px solid var(--auth-social-border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--auth-text-tertiary);
    position: relative;
    overflow: hidden;
}

.auth-social-btn svg {
    width: 26px;
    height: 26px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.auth-social-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.auth-social-btn:hover svg {
    transform: scale(1.1);
}

.auth-social-btn.qq {
    color: #12B7F5;
    border-color: rgba(18, 183, 245, 0.3);
}

.auth-social-btn.qq:hover {
    background: #12B7F5;
    border-color: #12B7F5;
    color: #fff;
    box-shadow: 0 8px 25px rgba(18, 183, 245, 0.3);
}

.auth-social-btn.qq:hover svg {
    color: #fff;
}

.auth-social-btn.wechat {
    color: #07C160;
    border-color: rgba(7, 193, 96, 0.3);
}

.auth-social-btn.wechat:hover {
    background: #07C160;
    border-color: #07C160;
    color: #fff;
    box-shadow: 0 8px 25px rgba(7, 193, 96, 0.3);
}

.auth-social-btn.wechat:hover svg {
    color: #fff;
}

.auth-social-btn.alipay {
    color: #1677FF;
    border-color: rgba(22, 119, 255, 0.3);
}

.auth-social-btn.alipay:hover {
    background: #1677FF;
    border-color: #1677FF;
    color: #fff;
    box-shadow: 0 8px 25px rgba(22, 119, 255, 0.3);
}

.auth-social-btn.alipay:hover svg {
    color: #fff;
}

[data-theme="dark"] .auth-social-btn.qq {
    color: #12B7F5;
    border-color: rgba(18, 183, 245, 0.25);
}

[data-theme="dark"] .auth-social-btn.qq:hover {
    background: #12B7F5;
    color: #fff;
}

[data-theme="dark"] .auth-social-btn.alipay {
    color: #1677FF;
    border-color: rgba(22, 119, 255, 0.25);
}

[data-theme="dark"] .auth-social-btn.alipay:hover {
    background: #1677FF;
    color: #fff;
}

[data-theme="dark"] .auth-social-btn.wechat {
    color: #07C160;
    border-color: rgba(7, 193, 96, 0.25);
}

[data-theme="dark"] .auth-social-btn.wechat:hover {
    background: #07C160;
    color: #fff;
}

[data-theme="dark"] .auth-social-btn.wechat:hover svg {
    color: #fff;
}

.auth-footer {
    text-align: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--auth-footer-border);
}

.auth-footer-text {
    font-size: 14px;
    color: var(--auth-text-secondary);
}

.auth-footer-text a {
    color: var(--auth-primary);
    font-weight: 700;
    text-decoration: none;
    margin-left: 4px;
    transition: all 0.3s ease;
}

.auth-footer-text a:hover {
    color: var(--auth-primary-dark);
}

.form-input.error {
    border-color: #f87171;
    animation: shake 0.4s ease-in-out;
}

[data-theme="dark"] .form-input.error {
    background: rgba(239, 68, 68, 0.08);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

.terms-field {
    margin-top: 10px;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--auth-terms-text);
    line-height: 1.5;
}

.terms-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 13px;
    color: var(--auth-terms-text);
    line-height: 1.5;
}

.terms-checkbox input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.terms-text {
    white-space: nowrap;
}

.terms-and {
    margin: 0 3px;
    color: var(--auth-terms-text);
    font-size: 13px;
    line-height: 1.5;
}

.terms-link {
    color: var(--auth-terms-link);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.terms-link:hover {
    color: var(--auth-terms-link-hover);
    text-decoration: underline;
}

.terms-body {
    max-height: 400px;
    overflow-y: auto;
}

.terms-content {
    text-align: left;
    line-height: 1.6;
}

.terms-content h4 {
    color: var(--auth-terms-content-heading);
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 15px;
}

.terms-content p {
    color: var(--auth-terms-content-text);
    margin-bottom: 10px;
    font-size: 13px;
}

.terms-content ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.terms-content li {
    color: var(--auth-terms-content-text);
    font-size: 13px;
    margin-bottom: 5px;
}

@media (max-width: 520px) {
    .auth-container {
        padding: 16px;
    }

    .auth-card-inner {
        padding: 28px 22px;
    }

    .auth-brand {
        font-size: 22px;
    }

    .auth-title {
        font-size: 19px;
    }

    .form-input {
        height: 50px;
        font-size: 16px;
    }

    .captcha-box {
        width: 110px;
        height: 50px;
    }

    .send-code-btn {
        height: 50px;
    }

    .submit-btn {
        height: 52px;
    }

    .auth-social-btn {
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 380px) {
    .auth-card-inner {
        padding: 24px 18px;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .captcha-box,
    .send-code-btn {
        width: 100%;
    }
}
