/* 海灵菇智能写作 - 登录页面样式 */

/* ===== 首页 Header 右侧魔力源泉按钮 ===== */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-magic-source {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    color: var(--primary-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-magic-source:hover {
    background: var(--primary-color);
    color: white;
}

.btn-magic-source svg {
    width: 16px;
    height: 16px;
}

/* ===== 基础重置与变量定义 ===== */
:root {
    /* 绿色系主色调 - 低饱和度舒适养眼 */
    --primary-color: #5b9a6f;
    --primary-light: #7fb895;
    --primary-dark: #3d7a52;
    --primary-gradient: linear-gradient(135deg, #5b9a6f 0%, #3d7a52 100%);
    --primary-gradient-hover: linear-gradient(135deg, #7fb895 0%, #5b9a6f 100%);

    /* 辅助色 */
    --accent-color: #4a8a5e;
    --text-color: #2d2d2d;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-color: #f0f2f5;
    --bg-light: #f7f8fa;
    --white: #ffffff;
    --border-color: #e2e5ea;
    --border-focus: #5b9a6f;
    --error-color: #d44a4a;
    --error-bg: #fdf2f2;
    --danger-bg: #fce8e8;
    --danger-color: #8b4040;

    /* 圆角与阴影 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 8px rgba(91, 154, 111, 0.1);
}

/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== 星星浮动装饰（3秒循环） ===== */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.star {
    position: absolute;
    color: var(--primary-color);
    font-size: 1.2rem;
    opacity: 0.5;
    animation: starFloat 3s ease-in-out infinite;
}

.star:nth-child(1) { top: 15%; left: 8%; animation-delay: 0s; }
.star:nth-child(2) { top: 10%; left: 20%; animation-delay: 0.8s; }
.star:nth-child(3) { top: 20%; left: 30%; animation-delay: 1.6s; }
.star:nth-child(4) { top: 12%; left: 40%; animation-delay: 2.2s; }

@keyframes starFloat {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-14px); opacity: 0.7; }
}

/* ===== 登录页面容器 - 左右分栏（55%/45%） ===== */
.login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-color);
}

/* 登录页面覆盖 style.css 中的 .login-container 蓝色窄宽 */
body.login-page .login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color) !important;
    border-radius: 0;
    box-shadow: none;
    background-clip: unset;
    background-image: none;
}

/* 左栏 55% */
.left-section {
    width: 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 5rem;
    background-color: var(--bg-color);
    position: relative;
    z-index: 2;
}

/* 右栏 45% */
.right-section {
    width: 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    background-color: var(--bg-color);
    position: relative;
    z-index: 2;
}

/* ===== 左栏内容 ===== */
.intro-content {
    max-width: 520px;
}

/* 标题区 - 居左 */
.intro-header {
    margin-bottom: 2.5rem;
    text-align: left;
}

.intro-title {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 1rem;
}

.title-line-1 {
    color: var(--text-color);
    display: block;
}

.title-line-2 {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    display: block;
}

.intro-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.7;
}

/* 核心功能模块 */
.features-container {
    margin-bottom: 2.5rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.2rem;
    padding: 1rem 1.2rem;
    background-color: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.feature-text h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-color);
}

.feature-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 底部数据区 */
.stats-container {
    display: flex;
    gap: 2rem;
}

.stat-item {
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    background-color: var(--white);
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* ===== 右栏表单容器 ===== */
.form-container {
    width: 100%;
    max-width: 420px;
    background-color: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2.5rem 2rem;
}

/* 顶部品牌区 */
.brand-area {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 0.8rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-icon svg {
    width: 52px;
    height: 52px;
}

.brand-icon .star-sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary-light);
    border-radius: 50%;
    animation: sparkle 2s ease-in-out infinite;
}

.brand-icon .star-sparkle:nth-child(1) { top: -2px; right: 2px; animation-delay: 0s; }
.brand-icon .star-sparkle:nth-child(2) { bottom: 4px; right: -4px; animation-delay: 0.6s; }
.brand-icon .star-sparkle:nth-child(3) { top: 8px; left: -4px; animation-delay: 1.2s; }

@keyframes sparkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.brand-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.4rem;
}

.brand-tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 标签页切换 */
.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.8rem;
}

.tab-btn {
    flex: 1;
    padding: 0.8rem 0;
    text-align: center;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn:hover {
    color: var(--primary-color);
    transition: color 0.25s ease;
}

/* 标签页内容 */
.auth-tab {
    display: none;
}

.auth-tab.active {
    display: block;
    animation: tabFadeIn 0.25s ease;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单组 */
.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

/* 输入框组 */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--bg-light);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.input-group:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(91, 154, 111, 0.12);
    background-color: var(--white);
}

.input-prefix {
    margin-right: 0.8rem;
    font-size: 1.1rem;
    color: var(--text-light);
    flex-shrink: 0;
}

.form-input {
    flex: 1;
    padding: 0.2rem;
    border: none;
    background: none;
    font-size: 0.95rem;
    color: var(--text-color);
    outline: none;
    min-width: 0;
}

.form-input::placeholder {
    color: var(--text-light);
}

/* 密码切换按钮 */
.password-toggle {
    position: absolute;
    right: 0.8rem;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.25s ease;
    padding: 0.2rem;
    line-height: 1;
}

.password-toggle:hover {
    color: var(--primary-color);
}

/* 带操作按钮的输入组（验证码） */
.input-group-with-action {
    gap: 0.5rem;
}

.input-group-with-action .form-input {
    flex: 1;
}

/* 获取验证码按钮 */
/* 登录页面覆盖 style.css 蓝色 */
body.login-page .btn.btn-secondary.btn-small {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.25s ease, transform 0.2s ease;
    box-shadow: none;
}

body.login-page .btn.btn-secondary.btn-small:hover:not(:disabled) {
    background: var(--primary-gradient-hover);
    transform: translateY(-1px);
}

body.login-page .btn.btn-secondary.btn-small:disabled {
    background-color: #b0b8c1;
    cursor: not-allowed;
    transform: none;
}

.btn-small {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.25s ease, transform 0.2s ease;
}

.btn-small:hover:not(:disabled) {
    background: var(--primary-gradient-hover);
    transform: translateY(-1px);
}

.btn-small:disabled {
    background-color: #b0b8c1;
    cursor: not-allowed;
    transform: none;
}

/* 注册须知模块 */
.terms-container {
    margin-bottom: 1.2rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid #f0d0d0;
}

.terms-header {
    background-color: var(--error-bg);
    border-left: 3px solid var(--error-color);
    padding: 0.8rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.25s ease;
}

.terms-header:hover {
    background-color: var(--danger-bg);
}

.terms-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--error-color);
    margin: 0;
}

.toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    color: var(--error-color);
}

.terms-content {
    max-height: 0;
    overflow: hidden;
    background-color: var(--error-bg);
    transition: max-height 0.35s ease, padding 0.35s ease;
    font-size: 0.85rem;
    color: var(--danger-color);
    padding: 0 1rem;
    line-height: 1.7;
}

.terms-container.active .terms-content {
    max-height: 300px;
    padding: 0.8rem 1rem;
}

.terms-container.active .toggle-icon {
    transform: rotate(180deg);
}

/* 协议勾选项 */
.agreement-container {
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
}

.agreement-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 0.6rem;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

.agreement-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* 提交按钮 */
.form-actions {
    margin-top: 0.8rem;
}

/* 登录页面按钮覆盖 style.css 蓝色 */
body.login-page .btn.btn-primary.btn-submit {
    width: 100%;
    padding: 0.85rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: none;
}

body.login-page .btn.btn-primary.btn-submit:hover:not(:disabled) {
    background: var(--primary-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(91, 154, 111, 0.3);
}

body.login-page .btn.btn-primary.btn-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(91, 154, 111, 0.2);
}

body.login-page .btn.btn-primary.btn-submit:disabled {
    background-color: #c0c6cc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

body.login-page .btn.btn-primary.btn-submit.loading {
    position: relative;
    pointer-events: none;
    color: transparent;
}

body.login-page .btn.btn-primary.btn-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top: 2.5px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

.btn-submit {
    width: 100%;
    padding: 0.85rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.btn-submit:hover:not(:disabled) {
    background: var(--primary-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(91, 154, 111, 0.3);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(91, 154, 111, 0.2);
}

.btn-submit:disabled {
    background-color: #c0c6cc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 表单链接 */
.form-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1.2rem;
    font-size: 0.88rem;
}

.form-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.25s ease;
    cursor: pointer;
}

.form-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== 加载状态 ===== */
.btn-submit.loading {
    position: relative;
    pointer-events: none;
    color: transparent;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top: 2.5px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== Toast 提示 ===== */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.toast {
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: #2d6b3f;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    max-width: 340px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.toast-error {
    background-color: var(--error-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.toast-info {
    background-color: #f0f9ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

/* ===== 响应式 ===== */
@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
    }

    .left-section {
        width: 100%;
        padding: 3rem 2rem 2rem;
    }

    .right-section {
        width: 100%;
        padding: 0 2rem 3rem;
    }

    .intro-title {
        font-size: 1.8rem;
    }

    .form-container {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .left-section {
        padding: 2rem 1.5rem 1.5rem;
    }

    .right-section {
        padding: 0 1rem 2rem;
    }

    .intro-title {
        font-size: 1.5rem;
    }

    .stats-container {
        flex-direction: column;
        gap: 0.8rem;
    }

    .form-links {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .form-container {
        padding: 2rem 1.5rem 1.5rem;
    }
}
