/* ============================================================
   全局重置 & 暖炭灰底色
   背景使用微妙的径向噪点纹理，模拟亚麻布/手工纸质感
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* —— 暖北欧色板 —— */
    --bg-deep:      #1a1b1f;   /* 暖炭灰基色 */
    --bg-surface:   #23242a;   /* 稍亮的表面色 */
    --bg-elevated:  #2c2d34;   /* 悬浮元素 */
    --text-primary: #e8e4df;   /* 暖白，非纯白 */
    --text-secondary: #9d9892; /* 暖灰 */
    --text-muted:   #6b6560;   /* 更深暖灰 */
    --accent-copper: #c4815c;  /* 赤陶/铜主色调 */
    --accent-ember:  #d4946a;  /* 亮态赤陶 */
    --accent-deep:   #a05e3d;  /* 深态赤陶 */
    --moon-amber:    #f0d9b5;  /* 月亮琥珀 */
    --moon-cream:    #faf3e8;  /* 月亮奶油高光 */
    --error:         #d4735a;  /* 暖调错误红 */
    --success:       #7a9a7e;  /* 灰绿——北欧苔藓 */
    --radius-sm:     6px;
    --radius-md:     12px;
    --radius-lg:     24px;
    --font-serif:    "Noto Serif SC", "STSong", "SimSun", "Songti SC", "宋体", serif;
    --font-sans:     "PingFang SC", "Microsoft YaHei", "微软雅黑", "Hiragino Sans GB", "STHeiti", sans-serif;
    --transition:    220ms cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    height: 100%;
}

body {
    /* 暖炭灰底色，叠加手工纸纹理 */
    background-color: var(--bg-deep);
    background-image:
        /* 微弱的纤维纹理——模拟北欧手工纸 */
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.003) 2px,
            rgba(255, 255, 255, 0.003) 4px
        ),
        /* 极淡的径向渐变营造深度 */
        radial-gradient(
            ellipse at 50% 30%,
            rgba(196, 129, 92, 0.06) 0%,
            transparent 70%
        );
    font-family: var(--font-sans);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    /* 抗锯齿 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   哑光环境光 (Matte Ambient)
   大半径模糊 + 低透明度，无 glossy glow，如烛光漫反射
   ============================================================ */
.ambient {
    position: fixed;
    border-radius: 50%;
    filter: blur(180px);
    pointer-events: none;
    z-index: 0;
}

/* 顶部暖光——模拟天花板的间接照明 */
.ambient--top {
    width: 700px;
    height: 500px;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(
        ellipse at center,
        rgba(196, 129, 92, 0.10) 0%,
        rgba(196, 129, 92, 0.04) 40%,
        transparent 70%
    );
}

/* 右下角环境光——温暖基底 */
.ambient--low {
    width: 600px;
    height: 400px;
    bottom: -150px;
    right: -100px;
    background: radial-gradient(
        ellipse at center,
        rgba(196, 129, 92, 0.08) 0%,
        rgba(196, 129, 92, 0.03) 40%,
        transparent 70%
    );
}

/* 补充一个极淡的琥珀光斑在左中——平衡构图 */
.ambient--mid {
    width: 500px;
    height: 500px;
    top: 40%;
    left: -150px;
    filter: blur(200px);
    background: radial-gradient(
        ellipse at center,
        rgba(240, 217, 181, 0.05) 0%,
        transparent 70%
    );
}

/* ============================================================
   主布局 —— 双栏卡片
   不使用 rounded card + left-border accent 的套路
   改用微妙分割 + 材质层次区分左右
   ============================================================ */
.card {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    max-width: 880px;
    min-height: 560px;
    background: var(--bg-surface);
    /* 极淡的边框，不是 accent 彩条 */
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
    /* 微妙的投影——不发光，只下沉 */
    box-shadow:
        0 2px 40px rgba(0, 0, 0, 0.45),
        0 1px 4px rgba(0, 0, 0, 0.30);
}

/* ========== 左栏：品牌 + 月亮 + 诗意文案 ========== */
.card__left {
    flex: 0 0 48%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 36px;
    position: relative;
    /* 左侧微妙的暖色调叠加——像壁炉光映在墙上 */
    background:
        radial-gradient(
            ellipse at 50% 55%,
            rgba(196, 129, 92, 0.07) 0%,
            transparent 70%
        ),
        var(--bg-elevated);
    /* 右侧有一条极淡的分割线，不用 accent 色 */
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

/* 品牌 Logo */
.brand-logo {
    display: block;
    margin-bottom: 40px;
    text-decoration: none;
    /* Logo 本身是 light 版的，在暗背景上自然呈现 */
}
.brand-logo img {
    height: 36px;
    width: auto;
    display: block;
    opacity: 0.90;
    transition: opacity var(--transition);
}
.brand-logo:hover img {
    opacity: 1;
}

/* ========== 月亮 CSS 绘制 ========== */
.moon-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 40px;
}

/* 月亮光晕——哑光，大模糊，琥珀色 */
.moon-glow {
    position: absolute;
    inset: -30px;
    border-radius: 50%;
    background: radial-gradient(
        ellipse at 50% 50%,
        rgba(240, 217, 181, 0.18) 0%,
        rgba(240, 217, 181, 0.06) 50%,
        transparent 70%
    );
    filter: blur(20px);
    /* 微弱的脉动——模拟月光的呼吸感，非常慢，几乎不可察觉 */
    animation: moonBreathe 8s ease-in-out infinite;
}

@keyframes moonBreathe {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.06); }
}

/* 月亮本体——琥珀到奶油的渐变 */
.moon-body {
    position: absolute;
    width: 100px;
    height: 100px;
    top: 10px;
    left: 10px;
    border-radius: 50%;
    background: radial-gradient(
        ellipse at 35% 35%,
        var(--moon-cream) 0%,
        var(--moon-amber) 40%,
        #d4b896 70%,
        #b8956e 100%
    );
    /* 模拟月面细微纹理——极淡的同心噪点感 */
    box-shadow:
        inset 0 0 30px rgba(0, 0, 0, 0.15),
        0 0 60px rgba(240, 217, 181, 0.12);
}

/* 月面暗影——新月形状的剪影覆盖，做成弦月 */
.moon-shadow {
    position: absolute;
    width: 100px;
    height: 100px;
    top: 10px;
    left: 28px; /* 偏移制造弦月效果 */
    border-radius: 50%;
    background: var(--bg-elevated);
    /* 微妙的羽化边缘 */
    box-shadow: -8px 0 20px 8px var(--bg-elevated);
}

/* 诗意文案——衬线字体 */
.card__poem {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.7;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

.card__note {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.8;
    letter-spacing: 0.03em;
}

/* ========== 右栏：登录表单 ========== */
.card__right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 40px;
}

.form-head {
    margin-bottom: 32px;
}

.form-head h2 {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.form-head p {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* ========== 表单控件 ========== */
.form-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
}

.input-row {
    display: flex;
    align-items: center;
    background: var(--bg-deep);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition);
    /* 无 glow，使用朴素的 border 变化 */
}

.input-row:focus-within {
    border-color: rgba(196, 129, 92, 0.5);
}

/* +86 前缀 */
.input-row__affix {
    flex-shrink: 0;
    padding: 11px 0 11px 14px;
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    user-select: none;
    /* 右侧微弱分隔 */
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    margin-right: 10px;
}

.form-body input[type="tel"],
.form-body input[type="password"],
.form-body input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 11px 12px;
    font-size: 15px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    letter-spacing: 0.02em;
}

/* 移除浏览器自动填充的丑陋背景 */
.form-body input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-deep) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--text-primary);
}

.form-body input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* 密码显隐切换按钮 */
.input-row__action {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.input-row__action:hover {
    color: var(--accent-copper);
}

/* 校验提示 */
.input-group__tip {
    font-size: 12px;
    color: var(--error);
    min-height: 0;
    opacity: 0;
    transition: opacity var(--transition);
    letter-spacing: 0.02em;
}
.input-group__tip.visible {
    opacity: 1;
}

/* ========== 登录按钮 ========== */
.btn-go {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 24px;
    margin-top: 4px;
    background: var(--accent-copper);
    color: #1a1b1f;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: 0.12em;
    cursor: pointer;
    transition:
        background var(--transition),
        box-shadow var(--transition);
    /* 极微弱的投影，不发光 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-go:hover:not(:disabled) {
    background: var(--accent-ember);
    box-shadow: 0 2px 8px rgba(160, 94, 61, 0.25);
}

.btn-go:active:not(:disabled) {
    background: var(--accent-deep);
    transform: scale(0.985);
    transition: transform 80ms ease;
}

.btn-go:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ========== 全局消息 ========== */
.form-msg {
    font-size: 13px;
    text-align: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.02em;
    transition: opacity var(--transition);
}
.form-msg[hidden] {
    display: none;
}
.form-msg--error {
    background: rgba(212, 115, 90, 0.10);
    color: var(--error);
}
.form-msg--success {
    background: rgba(122, 154, 126, 0.10);
    color: var(--success);
}

/* ========== 底部链接 ========== */
.form-foot {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
}
.form-foot span {
    color: var(--text-muted);
}
.form-foot a {
    color: var(--accent-copper);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.03em;
    transition: color var(--transition);
    margin-left: 4px;
}
.form-foot a:hover {
    color: var(--accent-ember);
}

/* ============================================================
   响应式 —— 小屏幕时双栏变单栏
   ============================================================ */
@media (max-width: 720px) {
    .card {
        flex-direction: column;
        max-width: 420px;
    }
    .card__left {
        flex: auto;
        padding: 36px 28px 28px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }
    .card__right {
        padding: 32px 28px 40px;
    }
    .brand-logo {
        margin-bottom: 24px;
    }
    .moon-container {
        width: 80px;
        height: 80px;
        margin-bottom: 24px;
    }
    .moon-body,
    .moon-shadow {
        width: 64px;
        height: 64px;
        top: 8px;
    }
    .moon-body { left: 8px; }
    .moon-shadow { left: 22px; }
    .moon-glow { inset: -20px; }
    .card__poem {
        font-size: 18px;
    }
}
