/* ==========================================================================
   萌趣配色方案
   ========================================================================== */
:root {
    /* 主色调 */
    --primary-color: #FFB6C1;
    --primary-pink: var(--primary-color);
    --primary-600: #F28EA7;
    --secondary-color: #87CEEB;
    --secondary-blue: var(--secondary-color);
    --secondary-hover: #6BB6D6;
    --tertiary-color: #DDA0DD;
    --light-purple: var(--tertiary-color);
    --accent-color: #FFE4B5;
    --accent-yellow: var(--accent-color);
    --soft-green: #98FB98;
    --cream: #FFF8DC;
    --white: #FFFFFF;
    
    /* 文本颜色 */
    --text-primary: #1F2937;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --text-dark: #4A4A4A;
    --text-light: #8B8B8B;
    --text-contrast-strong: #111827;
    
    /* 背景与阴影 */
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    
    /* 文本在不同背景上的颜色 */
    --on-primary: #1F2937;
    --on-secondary: #1F2937;
    --on-tertiary: #FFFFFF;
    --on-accent: #1F2937;
}

/* ==========================================================================
   全局样式
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ==========================================================================
   主容器
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    min-height: 600px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    background: var(--white);
    border-radius: 30px;
    box-shadow: 0 20px 40px var(--shadow);
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
}

/* ==========================================================================
   左侧背景面板
   ========================================================================== */
.left-panel {
    -webkit-box-flex: 1;
        -ms-flex: 1;
            flex: 1;
    position: relative;
    background: linear-gradient(135deg, var(--light-purple) 0%, var(--soft-green) 100%);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
}

.background-image {
    width: 100%;
    height: 100%;
    position: relative;
    background-image: 
        radial-gradient(circle at 20% 20%, var(--primary-pink) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, var(--accent-yellow) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, var(--secondary-blue) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
}

.welcome-text {
    text-align: center;
    color: var(--white);
    animation: slideInLeft 1s ease-out;
}

.welcome-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.welcome-text p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* ==========================================================================
   右侧面板
   ========================================================================== */
.right-panel {
    -webkit-box-flex: 1;
        -ms-flex: 1;
            flex: 1;
    padding: 3rem;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    background: var(--cream);
}

.form-container {
    width: 100%;
    max-width: 400px;
    padding-top: 1rem;
    animation: slideInRight 1s ease-out;
}

/* ==========================================================================
   头部文字
   ========================================================================== */
.header-text {
    text-align: center;
    margin-bottom: 2rem;
}

.header-text h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.header-text p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ==========================================================================
   切换按钮
   ========================================================================== */
.tab-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    background: var(--white);
    border-radius: 25px;
    padding: 0.5rem;
    box-shadow: 0 4px 15px var(--shadow);
}

.tab-btn {
    flex: 1;
    padding: 0.8rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn .material-symbols-rounded {
    font-size: 1.2rem;
    line-height: 1;
}

.tab-btn:hover {
    color: var(--text-dark);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: var(--primary-color);
    color: var(--on-primary);
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.4);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--primary-pink);
    border-radius: 2px;
}

/* ==========================================================================
   表单内容
   ========================================================================== */
.form-content {
    display: none;
    animation: fadeIn 0.5s ease-out;
    position: relative;
}

.form-content::before {
    content: '🌸';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1.5rem;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
    z-index: -1;
}

.form-content.active::after {
    content: '🌟';
    position: absolute;
    bottom: -10px;
    left: -10px;
    font-size: 1.2rem;
    opacity: 0;
    animation: sparkle 2s ease-in-out 0.5s infinite, fadeIn 0.5s ease-in-out 0.3s forwards;
    z-index: 1;
}

.form-content.active {
    display: block;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon .icon {
    position: absolute;
    left: 1rem;
    font-size: 1rem;
    z-index: 1;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.15) 0%, rgba(221, 160, 221, 0.15) 100%);
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.input-icon:focus-within .icon {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--tertiary-color) 100%);
    color: white;
    transform: scale(1.1);
}

.input-icon input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid transparent;
    border-radius: 20px;
    font-size: 1rem;
    background: var(--white);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
}

.input-icon input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px var(--shadow-hover);
    transform: translateY(-2px);
}

/* 焦点可见样式 */
input:focus-visible,
.submit-btn:focus-visible,
.code-btn:focus-visible,
.tab-btn:focus-visible,
.link:focus-visible {
    outline: 3px solid #3a6ea5;
    outline-offset: 3px;
    border-radius: 6px;
    box-shadow: 0 0 0 3px rgba(58, 110, 165, 0.3);
    transition: all 0.2s ease;
}

/* 优化键盘导航的Tab顺序视觉反馈 */
input:focus,
.submit-btn:focus,
.code-btn:focus,
.tab-btn:focus,
.link:focus {
    outline: 3px solid #3a6ea5;
    outline-offset: 3px;
    border-radius: 6px;
    box-shadow: 0 0 0 3px rgba(58, 110, 165, 0.3);
    transition: all 0.2s ease;
}

/* 优化Tab键导航顺序 */
* {
    box-sizing: border-box;
}

/* 确保Tab键导航顺序符合用户预期 */
/* 提示：若需要调整键盘导航顺序，请在 HTML 上设置 tabindex 属性 */

.input-icon input::placeholder {
    color: var(--text-light);
}

/* ==========================================================================
   验证码按钮
   ========================================================================== */
.code-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.code-btn:hover {
    background: var(--secondary-hover);
    transform: translateY(-50%) scale(1.05);
}

/* ==========================================================================
   记住我选项
   ========================================================================== */
.form-options {
    margin-bottom: 1.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-light);
}

.remember-me input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-light);
    border-radius: 5px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.remember-me input:checked + .checkmark {
    background: var(--primary-pink);
    border-color: var(--primary-pink);
}

.remember-me input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-weight: bold;
}

/* ==========================================================================
   提交按钮
   ========================================================================== */
.submit-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--tertiary-color) 100%);
    color: var(--text-contrast-strong);
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.4);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '✨';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.submit-btn:hover::before {
    opacity: 1;
    visibility: visible;
    animation: sparkle 1s ease-in-out infinite;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 182, 193, 0.6);
}

.submit-btn:active {
    transform: translateY(-1px);
}

/* ==========================================================================
   底部链接
   ========================================================================== */
.footer-links {
    text-align: center;
    margin-top: 2rem;
}

.footer-links p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.link:hover {
    color: var(--tertiary-color);
    text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #F9FAFB;
        --text-secondary: #E5E7EB;
        --text-muted: #9CA3AF;
        --on-tertiary: #FFFFFF;
        --text-contrast-strong: #F9FAFB;
    }
    body {
        background: linear-gradient(135deg, #0f172a 0%, #1f2937 100%);
    }
    .header-text h2 { color: var(--text-primary); }
    .header-text p { color: var(--text-muted); }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.error-message {
    color: #b00020;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    animation: errorPulse 0.4s ease-out;
}

.has-error {
    border-color: #b00020 !important;
    box-shadow: 0 4px 15px rgba(176, 0, 32, 0.25) !important;
}

/* ==========================================================================
   密码强度指示器样式
   ========================================================================== */
.password-strength {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.strength-label {
    font-weight: 600;
    min-width: 70px;
}

.strength-bar {
    flex: 1;
    height: 6px;
    background: var(--white);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.strength-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
}

.strength-text {
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

@keyframes errorPulse {
    0% { transform: scale(0.98); opacity: 0.8; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.99); opacity: 0.9; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}



/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        max-width: 900px;
    }
    .right-panel {
        padding: 2.5rem;
    }
}
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: auto;
        max-width: 400px;
        margin: 2rem;
    }
    html { font-size: 16px; }
    body { overflow-x: hidden; }
    
    .left-panel {
        height: 200px;
        padding: 2rem;
    }
    
    .welcome-text h1 {
        font-size: 1.8rem;
    }
    
    .welcome-text p {
        font-size: 1rem;
    }
    
    .right-panel {
        padding: 2rem;
    }
    .tab-btn, .submit-btn, .code-btn, input { min-height: 48px; }
    
    .tab-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-btn {
        border-radius: 15px;
        justify-content: center;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .tab-btn.active::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 1rem;
        border-radius: 20px;
    }
    .tab-buttons { gap: 8px; }
    *:hover { transform: none !important; box-shadow: none !important; }
    
    .form-container {
        padding-top: 0.5rem;
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 0;
    }
    
    .input-icon input {
        padding: 0.8rem 0.8rem 0.8rem 2.5rem;
        font-size: 0.9rem;
    }
    
    .submit-btn {
        padding: 0.8rem;
        font-size: 1rem;
    }
}

@media print {
    body {
        background: #ffffff !important;
    }
    .container {
        box-shadow: none;
        max-width: 100%;
        border-radius: 0;
    }
    .left-panel {
        display: none;
    }
    .right-panel {
        padding: 1rem;
        background: #ffffff;
    }
    .submit-btn, .code-btn, .tab-buttons {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 10px;
    background: #000;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    z-index: 10000;
}
.skip-link:focus {
    top: 10px;
}
