/* 核心修复：强制清除外部 CSS 干扰，确保背景统一，不遮挡内容 */
body, html, .login_page, .form, .login, .login_center {
    background: #f8f6f1 !important;
    background-image: none !important;
    background-color: #f8f6f1 !important;
}

:root {
    --song-paper: #f8f6f1;
    --song-card-bg: #fffdf9;
    --song-ink: #2b2b2b;
    --song-ink-light: #6b6b6b;
    --song-bamboo: #7d9082;
    --song-seal: #c23a2a; /* 宋红/印泥红 */
    --song-border: #d4cfc5;
    --font-serif: "Noto Serif SC", "STSong", "SimSun", serif;
}

* { box-sizing: border-box; outline: none; }

body {
    font-family: var(--font-serif);
    color: var(--song-ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* 宣纸肌理 */
    background-image: 
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E") !important;
}

.lang-switch {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 1000;
    background: rgba(248,246,241,0.92);
    border: 1px solid var(--song-border);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    cursor: pointer;
    color: var(--song-ink-light);
    transition: all 0.3s;
    font-family: var(--font-serif);
    box-shadow: 0 2px 8px rgba(43,43,43,0.05);
}
.lang-switch:hover { color: var(--song-bamboo); border-color: var(--song-bamboo); }

.song-container {
    display: flex;
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 24px;
    gap: 60px;
    align-items: stretch; /* 改为 stretch，让子元素填满高度 */
    justify-content: center;
}

/* 左侧诗词区 */
.song-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.poem {
    font-size: 28px;
    line-height: 1.6;
    color: var(--song-ink);
    letter-spacing: 4px;
    margin-bottom: 20px;
    font-weight: 400;
    white-space: nowrap;
}
.poem-en {
    font-size: 14px;
    color: var(--song-ink-light);
    letter-spacing: 1px;
    font-style: italic;
    margin-top: 15px;
    opacity: 0.75;
    line-height: 1.6;
    max-width: 300px;
}

.seal {
    width: 56px;
    height: 56px;
    border: 2.5px solid var(--song-seal);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--song-seal);
    font-size: 17px;
    font-weight: bold;
    margin-top: 40px;
    transform: rotate(-6deg);
    opacity: 0.85;
    letter-spacing: 1px;
}

/* 右侧登录框容器 - 拉伸填满高度 */
.song-right {
    flex: 0 0 440px;
    position: relative;
    background: transparent !important;
    align-self: stretch; /* 关键：让右侧容器拉伸填满父容器高度 */
    display: flex;
    flex-direction: column;
}

/* 登录卡片 - 拉伸并垂直分布内容 */
.login {
    background: var(--song-card-bg) !important;
    border: 1px solid var(--song-border);
    border-radius: 6px;
    padding: 0 !important; /* 移除固定 padding，改用 flex 布局控制间距 */
    box-shadow: 0 10px 30px rgba(43,43,43,0.06);
    position: relative;
    overflow: visible !important;
    flex: 1; /* 关键：让登录卡片填满右侧容器 */
    display: flex;
    flex-direction: column;
}

/* 顶部竹节装饰线 */
.login::after {
    content: "";
    position: absolute;
    top: 0; left: 45px; right: 45px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--song-bamboo), transparent);
}

.login_center { 
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 45px; /* 内部间距 */
}

.login_top { 
    margin-bottom: 40px;
    flex-shrink: 0; /* 防止顶部被压缩 */
}
.login_top .left {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: var(--song-ink);
}
.login_top .right {
    font-size: 13px;
    color: var(--song-ink-light);
}
.login_top .right a {
    color: var(--song-seal);
    border-bottom: 1px dashed var(--song-seal);
    margin-left: 4px;
}
.login_top .right a:hover { color: var(--song-ink); border-color: var(--song-ink); }

.xian {
    width: 30px; height: 2px;
    background: var(--song-bamboo);
    margin: 15px 0;
    opacity: 0.6;
}

.login_main { 
    flex: 1; /* 关键：让表单区域占据剩余空间 */
    display: flex;
    flex-direction: column;
    justify-content: center; /* 垂直居中表单内容 */
    gap: 28px; /* 增加表单项之间的间距 */
}

.username {
    display: flex;
    align-items: center;
    gap: 12px;
}
.username .left {
    width: 60px;
    text-align: right;
    font-size: 14px;
    color: var(--song-ink-light);
    flex-shrink: 0;
    letter-spacing: 1px;
}

.shurukuang, .yanzhengma {
    flex: 1;
    height: 48px; /* 稍微增加输入框高度 */
    padding: 0 14px;
    border: 1px solid #ddd8ce;
    background: #faf8f4;
    border-radius: 4px;
    font-family: var(--font-serif);
    font-size: 14px;
    transition: all 0.3s;
    color: var(--song-ink);
}
.shurukuang:focus, .yanzhengma:focus {
    border-color: var(--song-bamboo);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(125,144,130,0.12);
}

.yzm-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.yzm-container input { flex: 1; min-width: 0; }
#captchaImg {
    height: 48px; /* 与输入框高度一致 */
    border: 1px solid #ddd8ce;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    transition: transform 0.2s;
}
#captchaImg:hover { transform: scale(1.02); }

.error {
    height: 18px;
    color: var(--song-seal);
    font-size: 12px;
    text-align: center;
    margin: 15px 0;
    visibility: hidden; /* 默认隐藏，JS 控制显示 */
    flex-shrink: 0;
}

/* 
 * 登录按钮样式：
 * 使用 ID 选择器提高优先级，确保覆盖 pass.css
 * 确保按钮可见、可点击、颜色正确
 */
.login_submit {
    position: relative !important;
    margin-top: auto !important; /* 关键：推到底部 */
    padding-top: 20px !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    z-index: 20 !important;
    flex-shrink: 0; /* 防止被压缩 */
}

input#doLogin {
    display: block !important;
    width: 100% !important;
    height: 52px !important; /* 增加按钮高度 */
    background: var(--song-seal) !important; /* 宋红 */
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    font-family: var(--font-serif) !important;
    font-size: 18px !important; /* 稍微增大字体 */
    letter-spacing: 4px !important;
    cursor: pointer !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-shadow: 0 4px 12px rgba(194, 58, 42, 0.25) !important;
    line-height: 52px !important;
    text-align: center !important;
    padding: 0 !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: all 0.3s ease !important;
}

input#doLogin:hover {
    background: #a83022 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(194, 58, 42, 0.3) !important;
}

input#doLogin:active {
    transform: translateY(0);
}

footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: #999;
    letter-spacing: 1px;
    background: transparent !important;
    flex-shrink: 0;
}

.center { margin: 0 auto; }
.clear { clear: both; }
.fl { float: left; }
.fr { float: right; }

/* 响应式 */
@media (max-width: 900px) {
    .song-container { 
        flex-direction: column; 
        gap: 30px; 
        padding: 40px 16px;
        align-items: center; /* 移动端恢复居中 */
    }
    .song-left { padding: 20px 0; }
    .poem { font-size: 22px; white-space: normal; }
    .song-right { 
        flex: 0 0 auto; 
        width: 100%; 
        max-width: 440px;
        align-self: center;
        min-height: auto;
    }
    .login { 
        padding: 0 !important;
        min-height: auto;
    }
    .login_center {
        padding: 30px 24px;
    }
    .login_main {
        gap: 20px;
    }
}
