:root {
    --auth-brand: #2563eb;
    --auth-brand-dark: #1d4ed8;
    --auth-brand-soft: #eff6ff;
    --auth-ink: #111827;
    --auth-muted: #64748b;
    --auth-faint: #94a3b8;
    --auth-line: #dbe3ee;
    --auth-line-strong: #c4cfdd;
    --auth-bg: #f6f8fb;
    --auth-surface: #ffffff;
    --auth-green: #16a34a;
    --auth-danger: #dc4c45;
    --auth-danger-bg: #fff2f1;
    --auth-success: #15803d;
    --auth-success-bg: #edf9f1;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; touch-action: manipulation; }
body, button, input { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
body { margin: 0; color: var(--auth-ink); letter-spacing: 0; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; }

.auth-body { min-height: 100vh; overflow-x: hidden; background: var(--auth-bg); }
.auth-header {
    height: 64px;
    position: relative;
    z-index: 20;
    border-bottom: 1px solid #e5eaf2;
    background: rgba(255, 255, 255, .98);
    backdrop-filter: blur(14px);
}
.auth-header-inner {
    width: calc(100% - 48px);
    max-width: 1240px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin: 0 auto;
}
.auth-brand { min-width: 0; display: inline-flex; align-items: center; gap: 10px; color: var(--auth-ink); text-decoration: none; }
.auth-brand > img { width: auto; height: 42px; max-width: 190px; display: block; object-fit: contain; }
.auth-brand-fallback { min-width: 0; display: inline-flex; align-items: center; gap: 10px; }
.auth-brand-fallback[hidden] { display: none; }
.auth-mark {
    width: 40px;
    height: 40px;
    display: grid;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 8px;
    background: var(--auth-brand);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 7px 16px rgba(37, 99, 235, .2);
}
.auth-brand > span:last-child { min-width: 0; }
.auth-brand strong,
.auth-brand small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-brand strong { max-width: 230px; font-size: 16px; }
.auth-brand small { margin-top: 2px; color: var(--auth-brand); font: 8px Consolas, monospace; }
.auth-header-actions { display: flex; align-items: center; gap: 22px; }
.auth-service-state { display: inline-flex; align-items: center; gap: 8px; color: #5d6d83; font-size: 11px; }
.auth-service-state i {
    width: 7px;
    height: 7px;
    display: inline-block;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--auth-green);
    box-shadow: 0 0 0 4px rgba(22, 163, 74, .11);
}
.back-link {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    border: 1px solid var(--auth-line);
    border-radius: 2px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    text-decoration: none;
    transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.back-link:hover { border-color: #a9b9cd; background: #f8fafc; color: var(--auth-brand); }

.auth-main {
    width: 100%;
    min-height: calc(100vh - 64px);
    min-height: calc(100dvh - 64px);
    display: grid;
    grid-template-columns: minmax(420px, 1.12fr) minmax(470px, .88fr);
}
.auth-context {
    min-width: 0;
    min-height: 650px;
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #edf4ff url("../../../template/studio/assets/images/home-hero-video-poster-2.jpg") 81% center / cover no-repeat;
}
.auth-context-media {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}
.auth-context-media video { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 81% center; }

.auth-workspace {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 46px;
    border-left: 1px solid #e3e9f2;
    background: #f8fafc;
}
.auth-card { width: 100%; max-width: 430px; }
.auth-page-register .auth-workspace { padding-top: 34px; padding-bottom: 34px; }
.auth-page-register .auth-card { max-width: 600px; }
.auth-title { margin-bottom: 27px; }
.auth-title > span { color: var(--auth-brand); font-size: 11px; font-weight: 750; }
.auth-title h2 { margin: 7px 0 7px; color: var(--auth-ink); font-size: 28px; line-height: 1.35; letter-spacing: 0; }
.auth-title p { margin: 0; color: var(--auth-muted); font-size: 12px; line-height: 1.7; }

.auth-message { margin-bottom: 16px; padding: 11px 13px; border: 1px solid; font-size: 12px; line-height: 1.6; }
.auth-message.error { border-color: #edb7b3; background: var(--auth-danger-bg); color: #b93831; }
.auth-message.success { border-color: #addabd; background: var(--auth-success-bg); color: var(--auth-success); }
.auth-message[hidden] { display: none; }

.auth-form { display: grid; gap: 15px; }
.auth-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 13px; }
.auth-form label { min-width: 0; display: block; }
.auth-form label > span:first-child,
.captcha-field > span { display: block; margin-bottom: 7px; color: #526174; font-size: 12px; font-weight: 600; }
.auth-form input {
    width: 100%;
    height: 48px;
    padding: 0 13px;
    border: 1px solid var(--auth-line-strong);
    border-radius: 2px;
    outline: none;
    background: #fff;
    color: var(--auth-ink);
    font-size: 14px;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.auth-form input::placeholder { color: #a0aec0; }
.auth-form input:hover { border-color: #a8b7ca; }
.auth-form input:focus { border-color: #7ca5f4; background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .09); }
.auth-password { position: relative; display: block; }
.auth-password input { padding-right: 48px; }
.auth-password button {
    width: 44px;
    height: 44px;
    position: absolute;
    top: 2px;
    right: 2px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #8998aa;
    cursor: pointer;
}
.auth-password button:hover,
.auth-password button[aria-pressed="true"] { color: var(--auth-brand); }
.auth-password button i { width: 18px; height: 12px; position: relative; display: block; border: 1.6px solid currentColor; border-radius: 50%; }
.auth-password button i::after { content: ""; width: 4px; height: 4px; position: absolute; top: 2px; left: 5px; border: 1.5px solid currentColor; border-radius: 50%; }
.auth-password button[aria-pressed="true"] i::before { content: ""; width: 22px; height: 1.5px; position: absolute; top: 4px; left: -3px; background: currentColor; transform: rotate(-35deg); }

.captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 10px; }
.captcha-image {
    width: 132px;
    height: 48px;
    position: relative;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--auth-line-strong);
    border-radius: 2px;
    background: #f4f7fb;
    cursor: pointer;
}
.captcha-image img { width: 100%; height: 100%; display: block; object-fit: fill; }
.captcha-image::before { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(15, 23, 42, .42); opacity: 0; transition: opacity .18s ease; }
.captcha-image::after {
    content: "";
    width: 13px;
    height: 13px;
    position: absolute;
    z-index: 2;
    top: 15px;
    left: 58px;
    border: 2px solid #fff;
    border-left-color: transparent;
    border-radius: 50%;
    opacity: 0;
    transition: opacity .18s ease, transform .28s ease;
}
.captcha-image:hover::before,
.captcha-image:hover::after,
.captcha-image:focus-visible::before,
.captcha-image:focus-visible::after { opacity: 1; }
.captcha-image:hover::after { transform: rotate(180deg); }

.code-row { display: grid; grid-template-columns: minmax(0, 1fr) 116px; gap: 10px; }
.code-button {
    width: 116px;
    height: 48px;
    padding: 0 8px;
    border: 1px solid #aab9cc;
    border-radius: 2px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    cursor: pointer;
    transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
.code-button:hover:not(:disabled) { border-color: var(--auth-brand); background: var(--auth-brand-soft); color: var(--auth-brand); }
.code-button:disabled { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }
.form-links { display: flex; justify-content: flex-end; margin-top: -5px; }
.form-links a { color: #5f6f83; font-size: 12px; text-decoration: none; }
.form-links a:hover { color: var(--auth-brand); }
.password-note { margin: -5px 0 0; color: #8795a7; font-size: 11px; }
.auth-submit {
    width: 100%;
    height: 50px;
    position: relative;
    overflow: hidden;
    padding: 0 18px;
    border: 1px solid var(--auth-brand);
    border-radius: 0;
    background: var(--auth-brand);
    color: #fff;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 9px 20px rgba(37, 99, 235, .2);
    transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.auth-submit::after { content: ""; width: 48%; height: 190%; position: absolute; top: -45%; left: -65%; background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .22), transparent); transform: skewX(-18deg); transition: left .48s ease; }
.auth-submit:hover { background: var(--auth-brand-dark); box-shadow: 0 13px 26px rgba(37, 99, 235, .28); transform: translateY(-1px); }
.auth-submit:hover::after { left: 120%; }
.auth-submit:active { transform: translateY(0); }
.auth-submit:disabled { background: #7095e8; border-color: #7095e8; box-shadow: none; cursor: wait; transform: none; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 23px 0 14px; color: #8b98a9; font-size: 11px; }
.auth-divider::before,
.auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--auth-line); }
.social-login { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.social-login a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid var(--auth-line);
    border-radius: 2px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.social-login a:hover { border-color: #aab9cc; background: #f8fafc; transform: translateY(-1px); }
.social-login span { width: 24px; height: 24px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; }
.social-login .wechat span { background: #16a34a; }
.social-login .qq span { background: #1597d3; }
.auth-switch { margin: 24px 0 0; color: var(--auth-muted); text-align: center; font-size: 12px; }
.auth-switch a { color: var(--auth-brand); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

button:focus-visible,
a:focus-visible { outline: 2px solid var(--auth-brand); outline-offset: 2px; }

@media (max-width: 1120px) {
    .auth-main { grid-template-columns: minmax(350px, .85fr) minmax(500px, 1.15fr); }
    .auth-workspace { padding-right: 34px; padding-left: 34px; }
}

@media (max-width: 860px) {
    .auth-main { display: block; }
    .auth-context { display: none; }
    .auth-workspace { min-height: 520px; padding: 44px 28px 60px; border-top: 1px solid #e3e9f2; border-left: 0; }
    .auth-page-register .auth-workspace { padding-top: 42px; padding-bottom: 60px; }
}

@media (max-width: 600px) {
    .auth-header { height: 60px; }
    .auth-header-inner { width: calc(100% - 28px); }
    .auth-brand > img { height: 38px; max-width: 155px; }
    .auth-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 7px; }
    .auth-brand strong { max-width: 170px; font-size: 14px; }
    .auth-service-state { display: none; }
    .auth-header-actions { gap: 0; }
    .back-link { min-height: 32px; padding: 0 10px; font-size: 11px; }
    .auth-workspace,
    .auth-page-register .auth-workspace { min-height: 0; align-items: flex-start; padding: 32px 18px 48px; }
    .auth-title { margin-bottom: 23px; }
    .auth-title h2 { font-size: 24px; }
    .auth-form-grid { grid-template-columns: 1fr; }
    .auth-form input { height: 48px; font-size: 16px; }
    .captcha-row { grid-template-columns: minmax(0, 1fr) 120px; gap: 8px; }
    .captcha-image { width: 120px; }
    .captcha-image::after { left: 52px; }
    .code-row { grid-template-columns: minmax(0, 1fr) 104px; gap: 8px; }
    .code-button { width: 104px; font-size: 11px; }
}

@media (max-width: 390px) {
    .auth-header-inner { width: calc(100% - 22px); }
    .auth-brand small { display: none; }
    .auth-brand strong { max-width: 135px; }
    .back-link { padding: 0 8px; }
    .auth-workspace,
    .auth-page-register .auth-workspace { padding-right: 14px; padding-left: 14px; }
    .captcha-row { grid-template-columns: minmax(0, 1fr) 112px; }
    .captcha-image { width: 112px; }
    .captcha-image::after { left: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .auth-context-media video { display: none; }
}
