/* ============================================================
   DeepSeek Code Assistant 中文版 — 登录页样式
   Copyright 2026 辉夜(Huiye) 项目组Apache License 2.0
   ============================================================ */
/* 颜色令牌统一由 assets/css/tokens.css 提供（改配色只改那一处）。 */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", "Noto Sans SC", sans-serif;
    background: radial-gradient(1200px 600px at 80% -10%, var(--ds-brand-800) 0%, var(--bg) 55%),
                var(--bg);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
}

.login-wrap { width: 100%; padding: 20px; display: flex; justify-content: center; }

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 34px 30px 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,.45);
}

.brand { text-align: center; margin-bottom: 26px; }

.logo-mark {
    width: 54px; height: 54px; margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 13px;
}

.brand h1 { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { margin-top: 8px; color: var(--muted); font-size: 13px; }

.field { margin-bottom: 16px; }
.field-label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }

.field input {
    width: 100%; padding: 11px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}
.field input:focus { border-color: var(--accent); }

.pwd-row { position: relative; }
.pwd-row input { padding-right: 42px; }
.eye {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px;
}

.msg { min-height: 20px; margin: 4px 0 12px; font-size: 13px; }
.msg.error { color: var(--danger); }
.msg.warn { color: #fbbf24; }
.msg.okmsg { color: #34d399; }

/* 登录 / 注册 Tab */
.tabs { display: flex; gap: 6px; margin-bottom: 20px; background: var(--bg-2);
        border: 1px solid var(--border); border-radius: 9px; padding: 4px; }
.tab { flex: 1; padding: 9px 0; border: none; border-radius: 7px; background: none;
       color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.tab.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.tab:hover:not(.active) { color: var(--text); }

/* 记住我 */
.check-row { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px;
             font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.check-row span { line-height: 1.3; }

.submit-btn {
    width: 100%; padding: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none; border-radius: 8px;
    color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.submit-btn:hover { filter: brightness(1.08); }
.submit-btn:disabled { opacity: .65; cursor: not-allowed; }

.footnote, .copyright { text-align: center; margin-top: 16px; font-size: 12px; color: var(--muted); }
.footnote code { background: var(--bg-2); padding: 2px 6px; border-radius: 5px; color: var(--accent-2); }

/* 找回密码 */
.forgot-link { display: block; margin: 14px auto 0; background: none; border: none;
               color: var(--muted); font-size: 13px; cursor: pointer; text-align: center; }
.forgot-link:hover { color: var(--accent); }
.reg-head { display: flex; align-items: center; justify-content: space-between;
            font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.reg-head .forgot-link { margin: 0; font-weight: 400; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.code-btn { flex-shrink: 0; padding: 0 16px; background: var(--bg-2); border: 1px solid var(--border);
            border-radius: 8px; color: var(--accent); font-size: 13px; cursor: pointer; }
.code-btn:disabled { opacity: .6; cursor: not-allowed; }

/* 移动端：更大的触控目标 + 安全区，避免小屏误触 */
@media (max-width: 480px) {
    body { padding: 0; }
    .login-wrap { padding: max(16px, env(safe-area-inset-top)) 16px; min-height: 100dvh; }
    .login-card { padding: 24px 20px 22px; border-radius: 16px; }
    .field input, .submit-btn { min-height: 46px; font-size: 16px; }
    .code-btn { min-height: 46px; }
    .tab { min-height: 44px; }
}

/* ============================================================
   可访问性 / 界面体验增强（与 style.css / base.css 一致）
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}