:root {
    --ink: #25233b;
    --muted: #68657d;
    --line: #dedbf1;
    --paper: #ffffff;
    --canvas: #667eea;
    --brand: #5365dd;
    --brand-soft: #6958bf;
    --primary: #667eea;
    --primary-dark: #5b55c5;
    --accent: #764ba2;
    --contact-bg: #f3f0ff;
    --contact-ink: #56398a;
    --danger: #b42318;
    --success: #067647;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--ink);
    background: linear-gradient(135deg, var(--canvas) 0%, var(--accent) 100%);
    font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
a {
    font: inherit;
}

.auth-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 34px 24px 40px;
}

.brand-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(820px, 100%);
    padding: 0 20px 24px;
    color: #ffffff;
    text-align: center;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #f0edff;
    font-size: 24px;
    font-weight: 800;
}

.brand-mark-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.brand-copy {
    margin: 16px 0 0;
    padding: 0;
}

.brand-kicker,
.section-kicker {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 800;
}

.brand-kicker {
    color: #e7e2ff;
}

.section-kicker {
    color: var(--accent);
}

.brand-copy h1 {
    margin: 0;
    max-width: none;
    font-size: 34px;
    line-height: 1.25;
}

.brand-copy p {
    margin: 8px auto 0;
    max-width: 520px;
    color: #e5e1fa;
    font-size: 15px;
    line-height: 1.9;
}

.brand-meta {
    display: none;
    align-items: center;
    gap: 10px;
    color: #ded9f5;
    font-size: 12px;
}

.brand-meta-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b9c2ff;
    box-shadow: 0 0 0 4px rgba(185, 194, 255, 0.2);
}

.auth-workspace {
    width: 100%;
    min-width: 0;
    padding: 0;
}

.workspace-inner {
    width: min(820px, 100%);
    margin: 0 auto;
}

.notice-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    margin-bottom: 14px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    color: #4f3f8d;
    background: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.login-surface,
.error-surface {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 24px 60px rgba(48, 31, 102, 0.28);
}

.surface-header {
    padding: 0 0 24px;
}

.surface-header h2,
.error-main h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.35;
}

.surface-header p,
.error-main > p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
}

.login-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
}

.login-form-section {
    padding: 36px 38px 32px;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    color: #344350;
    font-size: 15px;
    font-weight: 700;
}

.input-shell {
    position: relative;
}

.input-shell i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #6a7a83;
    transform: translateY(-50%);
    pointer-events: none;
}

.activation-input {
    width: 100%;
    height: 54px;
    padding: 0 48px 0 42px;
    border: 1px solid #cbd6d8;
    border-radius: 6px;
    outline: none;
    color: var(--ink);
    background: #fbfcfc;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

.activation-input::placeholder {
    color: #9aa6ad;
    font-weight: 400;
}

.activation-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: #ffffff;
}

.input-tag {
    position: absolute;
    top: 50%;
    right: 12px;
    color: #7c898f;
    font-size: 12px;
    font-weight: 800;
    transform: translateY(-50%);
}

.primary-button,
.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 50px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.primary-button {
    margin-top: 16px;
    border: 1px solid var(--primary);
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 8px 20px rgba(94, 78, 186, 0.22);
}

.primary-button:hover {
    border-color: var(--primary-dark);
    background: linear-gradient(135deg, var(--primary-dark) 0%, #68418f 100%);
}

.primary-button:active,
.secondary-link:active {
    transform: translateY(1px);
}

.primary-button:focus-visible,
.secondary-link:focus-visible,
.text-link:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.28);
    outline-offset: 2px;
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.secondary-link {
    margin-top: 10px;
    border: 1px solid #d6dfe0;
    color: #3c4a54;
    background: #f7f9f9;
}

.secondary-link:hover {
    border-color: #b9c6c8;
    background: #edf2f2;
}

.login-footer-links {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 16px;
}

.text-link {
    color: #50616c;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.text-link:hover {
    color: var(--primary);
}

.form-message {
    display: none;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
}

.form-message.is-visible {
    display: block;
}

.form-message.is-error {
    color: var(--danger);
    background: #fff1f0;
}

.form-message.is-success {
    color: var(--success);
    background: #ecfdf3;
}

.contact-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    border-left: 1px solid #dcd5f5;
    color: var(--contact-ink);
    background: var(--contact-bg);
    text-align: center;
}

.contact-qr {
    display: block;
    width: 164px;
    height: 170px;
    padding: 6px;
    border: 1px solid #cfc7ec;
    border-radius: 6px;
    background: #ffffff;
    object-fit: contain;
}

.contact-title {
    margin: 14px 0 0;
    font-size: 16px;
    font-weight: 800;
}

.contact-copy {
    margin: 6px 0 0;
    color: #654a96;
    font-size: 13px;
    line-height: 1.65;
}

.error-surface {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
}

.error-main {
    padding: 42px 38px;
}

.error-code {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 58px;
    font-weight: 900;
    line-height: 1;
}

.error-actions {
    display: flex;
    gap: 10px;
    margin-top: 28px;
}

.error-actions .primary-button,
.error-actions .secondary-link {
    width: auto;
    min-width: 140px;
    margin-top: 0;
    padding: 0 18px;
}

@media (max-width: 860px) {
    .auth-shell {
        justify-content: flex-start;
        padding: 28px 20px 36px;
    }

    .brand-panel {
        padding: 0 16px 22px;
    }

    .brand-copy {
        padding: 0;
    }

    .brand-copy h1 {
        max-width: none;
        font-size: 30px;
    }

    .brand-copy p {
        max-width: 520px;
        margin-top: 12px;
    }

    .auth-workspace {
        padding: 0;
    }
}

@media (max-width: 620px) {
    .auth-shell {
        padding: 20px 10px 24px;
    }

    .brand-panel {
        padding: 0 12px 18px;
    }

    .brand-mark-icon {
        width: 32px;
        height: 32px;
    }

    .brand-mark {
        font-size: 21px;
    }

    .brand-copy {
        margin-top: 12px;
        padding: 0;
    }

    .brand-copy h1 {
        font-size: 24px;
    }

    .brand-kicker {
        margin-bottom: 6px;
    }

    .auth-workspace {
        padding: 0;
    }

    .notice-strip {
        align-items: flex-start;
        min-height: 0;
        margin-bottom: 10px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .login-form-section {
        padding: 24px 18px 20px;
    }

    .surface-header {
        padding: 0 0 22px;
    }

    .surface-header h2,
    .error-main h2 {
        font-size: 28px;
    }

    .login-body,
    .error-surface {
        grid-template-columns: 1fr;
    }

    .contact-section {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        column-gap: 14px;
        padding: 16px;
        border-top: 1px solid #dcd5f5;
        border-left: 0;
        text-align: left;
    }

    .contact-qr {
        grid-row: 1 / span 2;
        width: 96px;
        height: 100px;
    }

    .contact-title {
        align-self: end;
        margin-top: 0;
    }

    .contact-copy {
        align-self: start;
    }

    .login-footer-links {
        flex-direction: column;
        gap: 10px;
    }

    .error-main {
        padding: 32px 24px;
    }

    .error-code {
        font-size: 48px;
    }

    .error-actions {
        flex-direction: column;
    }

    .error-actions .primary-button,
    .error-actions .secondary-link {
        width: 100%;
    }
}
