/**
 * 长荡湖门户 —— 登录/注册页面专用样式
 * 暗色全屏背景 + 居中白色半透明卡片
 * Version: 1.0.0
 */

/* ========== 基础重置 ========== */
*, *::before, *::after { box-sizing: border-box; }
.cdh-login-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #26403A;
    overflow-x: hidden;
    position: relative;
}

/* ========== 全屏背景 ========== */
.cdh-login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.55);
    transition: filter 0.6s ease;
}

/* ========== 暗色遮罩层 ========== */
.cdh-login-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(10, 22, 30, 0.35);
    backdrop-filter: blur(2px);
}

/* ========== 居中卡片容器 ========== */
.cdh-login-wrap {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* ========== 登录卡片 ========== */
.cdh-login-card {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 40px 36px 32px;
    animation: cdh-cardIn 0.5s ease-out;
}

@keyframes cdh-cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========== 品牌 Logo ========== */
.cdh-login-brand {
    text-align: center;
    margin-bottom: 28px;
}
.cdh-login-brand svg {
    width: 64px;
    height: 64px;
    display: block;
    margin: 0 auto 10px;
}
.cdh-login-brand span {
    font-size: 22px;
    font-weight: 700;
    color: #26403A;
    letter-spacing: 2px;
}

/* ========== 错误/成功提示条 ========== */
.cdh-login-error,
.cdh-login-success {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    animation: cdh-shake 0.4s ease;
}
.cdh-login-error {
    background: #fff0f0;
    border: 1px solid #ffcdd2;
    color: #c62828;
}
.cdh-login-success {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #276749;
}
.cdh-login-error svg,
.cdh-login-success svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.cdh-login-error svg { stroke: #c62828; }
.cdh-login-success svg { stroke: #276749; }

@keyframes cdh-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ========== 输入框组 ========== */
.cdh-input-group {
    position: relative;
    margin-bottom: 16px;
}
.cdh-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #7a8699;
    pointer-events: none;
    transition: color 0.2s;
}
.cdh-input-group:focus-within .cdh-input-icon {
    color: #2FA893;
}
.cdh-input-group input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14.5px;
    color: #26403A;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.cdh-input-group input::placeholder {
    color: #a0aec0;
}
.cdh-input-group input:focus {
    border-color: #2FA893;
    box-shadow: 0 0 0 3px rgba(47, 168, 147, 0.12);
}

/* ========== 记住密码 + 忘记密码 ========== */
.cdh-login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 13px;
}
.cdh-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #4a5568;
    user-select: none;
}
.cdh-remember input[type="checkbox"] {
    display: none;
}
.cdh-checkmark {
    width: 16px;
    height: 16px;
    border: 1.5px solid #cbd5e0;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.cdh-checkmark::after {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) scale(0);
    transition: transform 0.15s ease;
    margin-top: -1px;
}
.cdh-remember input:checked + .cdh-checkmark {
    background: #2FA893;
    border-color: #2FA893;
}
.cdh-remember input:checked + .cdh-checkmark::after {
    transform: rotate(-45deg) scale(1);
}
.cdh-forgot {
    color: #2FA893;
    text-decoration: none;
    transition: opacity 0.2s;
}
.cdh-forgot:hover {
    opacity: 0.75;
    text-decoration: underline;
}

/* ========== 登录/注册按钮 ========== */
.cdh-login-btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2FA893 0%, #238b7a 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 4px 12px rgba(47, 168, 147, 0.35);
}
.cdh-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(47, 168, 147, 0.45);
}
.cdh-login-btn:active {
    transform: translateY(0);
}
.cdh-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== 底部链接 ========== */
.cdh-login-footer {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: #718096;
}
.cdh-login-footer a {
    color: #2FA893;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}
.cdh-login-footer a:hover {
    opacity: 0.75;
    text-decoration: underline;
}

/* ========== 第三方登录 ========== */
.cdh-social-login {
    margin-top: 24px;
}
.cdh-social-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.cdh-social-divider span:first-child,
.cdh-social-divider span:last-child {
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
.cdh-social-label {
    font-size: 12px;
    color: #a0aec0;
    white-space: nowrap;
}

/* 社交图标行 */
.cdh-social-icons {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}
.cdh-social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}
.cdh-social-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
.cdh-social-icon:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.cdh-social-icon.wechat  { background: #07C160; }
.cdh-social-icon.qq      { background: #12B7F5; }
.cdh-social-icon.weibo   { background: #E6162D; }
.cdh-social-icon.douyin  { background: #000000; }
.cdh-social-icon.taobao  { background: #FF5000; }
.cdh-social-icon.alipay  { background: #1677FF; }

/* ========== 已登录用户状态（次导航） ========== */
.cdh-user-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
.cdh-user-link::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-3 4-5 8-5s8 2 8 5'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: .85;
}
.cdh-logout-link {
    color: rgba(255,255,255,.7);
    font-size: 12px;
    margin-left: 8px;
    text-decoration: none;
    transition: color .2s;
}
.cdh-logout-link:hover { color: #fff; }

/* ========== 响应式 ========== */
@media (max-width: 480px) {
    .cdh-login-card {
        padding: 32px 24px 28px;
        border-radius: 12px;
    }
    .cdh-login-brand svg {
        width: 52px;
        height: 52px;
    }
    .cdh-login-brand span {
        font-size: 20px;
    }
    .cdh-social-icon {
        width: 36px;
        height: 36px;
    }
    .cdh-social-icon svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-height: 600px) {
    .cdh-login-wrap {
        padding: 16px;
    }
    .cdh-login-card {
        padding: 28px 24px 24px;
    }
}
