/* ========== 登录页 · 方案 2 ========== */
.login-wrapper {
    -webkit-app-region: no-drag;
    min-height: 100vh;
    display: flex;
    background: var(--color-background, #ffffff);
    color: var(--color-text);
    overflow: auto;
}

.login-wrapper input,
.login-wrapper button,
.login-wrapper a,
.login-wrapper form,
.login-card,
.login-card *,
.window-controls,
.window-controls * {
    -webkit-app-region: no-drag !important;
}

.login-shell {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(440px, 48%) minmax(0, 1fr);
    background:
        linear-gradient(180deg, #eef2f7 0%, #f4f6f9 100%);
}

/* 仅顶栏可拖拽移动窗口；右侧留给关闭按钮 */
.login-drag-strip {
    position: fixed;
    top: 0;
    left: 0;
    right: 96px;
    height: 44px;
    z-index: 20;
    -webkit-app-region: drag;
}

html[data-platform="darwin"] .login-drag-strip {
    left: 78px;
    right: 0;
}

html[data-platform="darwin"] .window-controls,
html[data-platform="darwin"] #global-window-controls {
    display: none !important;
}

.login-brand {
    -webkit-app-region: drag;
    position: relative;
    display: flex;
    flex-direction: column;
    /* 固定从顶部排布，避免右侧表单高度变化（授权→登录）把文案顶上/压下 */
    justify-content: flex-start;
    align-items: flex-start;
    gap: clamp(40px, 6vh, 72px);
    padding: 96px 52px 64px 68px;
    color: #eef3ff;
    overflow: hidden;
    min-height: 100%;
    background-color: #061e3d;
    background-image: none;
}

.login-brand-voxel {
    position: absolute;
    /* 外扩保证边缘/右下角裁切后仍有体素，无留空 */
    inset: -48px -64px -72px -48px;
    z-index: 0;
    pointer-events: none;
}

.login-brand-voxel canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* 仅压暗左侧文字区，右下角完全露出动态体素 */
.login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        100deg,
        rgba(2, 6, 23, 0.58) 0%,
        rgba(2, 6, 23, 0.28) 32%,
        rgba(2, 6, 23, 0.06) 58%,
        transparent 78%
    );
}

.login-brand::after {
    content: none;
}

/* 左侧品牌区也可拖，但不要挡住右侧登录表单 */
.login-brand * {
    -webkit-app-region: drag;
}

.login-brand-lockup,
.login-brand-copy {
    position: relative;
    z-index: 2;
}

.login-brand-lockup {
    display: flex;
    align-items: center;
    gap: 24px;
}

.login-logo {
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.88);
    border-radius: 18px;
    color: #ffffff;
    font-size: 46px;
    font-weight: 800;
    line-height: 1;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 40px rgba(3, 18, 48, 0.28);
    backdrop-filter: blur(8px);
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.login-kicker {
    color: #ffffff;
    font-size: clamp(22px, 2vw, 32px);
    font-weight: 800;
    letter-spacing: 0.06em;
    white-space: nowrap;
    text-shadow: 0 10px 28px rgba(3, 18, 48, 0.35);
}

.login-brand-copy {
    position: relative;
    z-index: 2;
    max-width: 540px;
    /* 相对顶部锁定，不随容器高度把整块推到底 */
    margin-top: 0;
    flex: 0 0 auto;
}

.login-brand-divider {
    display: block;
    width: 56px;
    height: 3px;
    margin-bottom: 24px;
    border-radius: 999px;
    background: linear-gradient(90deg, #67e8f9, rgba(103, 232, 249, 0.15));
}

.login-title {
    margin: 0;
    color: #ffffff;
    font-size: clamp(34px, 3.4vw, 52px);
    font-weight: 850;
    line-height: 1.12;
    letter-spacing: 0.01em;
    white-space: normal;
    text-wrap: balance;
    text-shadow: 0 16px 40px rgba(3, 18, 48, 0.28);
}

.login-subtitle {
    margin-top: 18px;
    color: #7dd3fc;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: none;
}

.login-lead {
    margin: 18px 0 0;
    max-width: 28em;
    color: rgba(238, 243, 255, 0.86);
    font-size: 15px;
    line-height: 1.65;
    font-weight: 500;
}

.login-feature-list {
    list-style: none;
    margin: 34px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
    max-width: 460px;
}

.login-feature-list li {
    position: relative;
    padding: 12px 14px 12px 34px;
    color: rgba(255, 255, 255, 0.94);
    font-size: 14px;
    line-height: 1.45;
    font-weight: 550;
    letter-spacing: 0.01em;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
}

.login-feature-list li::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 1.05em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #67e8f9;
    box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.2);
}

.login-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(40px, 5vw, 72px) clamp(32px, 4vw, 64px);
    background: transparent;
}

.login-card-inner {
    width: min(100%, 440px);
    padding: 36px 34px 32px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow:
        0 30px 70px rgba(15, 23, 42, 0.08),
        0 2px 0 rgba(255, 255, 255, 0.8) inset;
    backdrop-filter: blur(10px);
    transform: none;
}

.login-header {
    margin-bottom: 32px;
}

.login-header h2 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(28px, 2.6vw, 34px);
    font-weight: 850;
    line-height: 1.15;
    letter-spacing: 0.01em;
}

.login-header p {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.login-form {
    display: grid;
    gap: 22px;
}

.login-form .input-group[hidden] {
    display: none !important;
}

.login-form .input-group {
    position: relative;
    display: grid;
    gap: 10px;
}

.input-label {
    color: var(--color-text, #e8eaed);
    font-size: 16px;
    font-weight: 700;
}

.login-form .input-icon {
    position: absolute;
    left: 16px;
    bottom: 18px;
    width: 20px;
    height: 20px;
    color: #7b8796;
    pointer-events: none;
}

.login-form .input-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-form input,
.login-form select {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 48px;
    border: 1px solid var(--color-border, rgba(212, 184, 150, 0.14));
    border-radius: 8px;
    outline: none;
    background: var(--color-input-bg, #ffffff);
    color: var(--color-text, #1e293b);
    font-family: var(--font-family);
    font-size: 16px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.login-form input::placeholder {
    color: #9aa5b4;
}

.login-form input:focus,
.login-form select:focus {
    border-color: #1168e8;
    box-shadow: 0 0 0 3px rgba(17, 104, 232, 0.14);
}

.login-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 18px;
    -webkit-app-region: no-drag;
}

.login-tab {
    height: 40px;
    border: 1px solid #d5dce7;
    border-radius: 10px;
    background: #f7f9fc;
    color: #5b677a;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.login-tab.active {
    border-color: #1261e8;
    background: #eef5ff;
    color: #1261e8;
}

.login-qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    -webkit-app-region: no-drag;
}

.login-qr-panel[hidden],
.login-form[hidden] {
    display: none !important;
}

.login-qr-box {
    width: 232px;
    height: 232px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border, rgba(212, 184, 150, 0.14));
    border-radius: 8px;
    background: #ffffff; /* 二维码需保持高对比浅底 */
}

.login-qr-box img {
    width: 210px;
    height: 210px;
    display: block;
}

.login-qr-placeholder {
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
    padding: 16px;
}

.login-qr-status {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.login-btn-secondary {
    background: #eef2f7;
    color: #1e293b;
    box-shadow: none;
}

.login-btn-secondary:hover {
    background: #e2e8f0;
    box-shadow: none;
}

.remember-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #6b7789;
    font-size: 13px;
    line-height: 1.5;
    user-select: none;
}

.remember-login-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    cursor: pointer;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 500;
}

.remember-login-check input {
    margin: 2px 0 0;
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    accent-color: #1261e8;
    cursor: pointer;
}

.remember-login-check span {
    min-width: 0;
}

.login-forgot-link {
    border: 0;
    background: transparent;
    color: #1261e8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.login-forgot-link:hover {
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    height: 52px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: #1261e8;
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(18, 97, 232, 0.18);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast), background var(--transition-fast);
}

.login-btn:hover {
    background: #0c54d4;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(18, 97, 232, 0.24);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:focus-visible {
    outline: 3px solid rgba(18, 97, 232, 0.28);
    outline-offset: 3px;
}

.login-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 980px) {
    .login-shell {
        grid-template-columns: 1fr;
        align-content: start;
    }

    .login-brand {
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 28px;
        padding: 38px 44px;
        background-position: center 72%;
    }

    .login-brand-divider {
        margin-bottom: 22px;
    }

    .login-feature-list {
        margin-top: 22px;
        gap: 10px;
    }

    .login-feature-list li {
        font-size: 13px;
        padding: 10px 12px 10px 30px;
    }

    .login-card {
        padding: 40px 40px 56px;
    }

    .login-card-inner {
        width: min(100%, 400px);
        padding: 28px 24px;
        transform: none;
    }

    .login-title {
        white-space: normal;
        font-size: clamp(30px, 7vw, 40px);
    }

    .login-lead {
        font-size: 14px;
    }
}

@media (max-width: 640px) {
    .login-brand {
        min-height: 220px;
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 30px 24px;
    }

    .login-logo {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        border-width: 3px;
        font-size: 34px;
    }

    .login-kicker {
        font-size: 24px;
    }

    .login-brand-divider {
        display: none;
    }

    .login-title {
        font-size: 27px;
    }

    .login-subtitle {
        margin-top: 10px;
        font-size: 15px;
    }

    .login-card {
        align-items: flex-start;
        padding: 40px 24px 56px;
    }

    .login-header {
        margin-bottom: 36px;
    }

    .login-form {
        gap: 26px;
    }

    .login-header h2 {
        font-size: 34px;
    }

    .login-header p {
        font-size: 16px;
    }

    .login-form input,
    .login-btn {
        height: 54px;
    }

    .login-form .input-icon {
        bottom: 15px;
    }
}

/* ========== 登录页授权面板（独立样式，不复用登录表单 input-group） ========== */
.login-card-inner:has(.login-license-panel:not([hidden])) {
    width: min(100%, 520px);
}
.login-account-panel {
    display: grid;
    gap: 10px;
}
.login-account-panel[hidden] {
    display: none !important;
}
.login-license-summary {
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f0fdf4;
    color: #166534;
    font-size: 12px;
    line-height: 1.5;
}
.login-license-manage-link {
    justify-self: start;
    border: none;
    background: none;
    color: #0f766e;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.login-license-manage-link[hidden] {
    display: none !important;
}
.login-license-panel {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 16px;
    border: 1px solid #d7e3ef;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
}
.login-license-panel[hidden] { display: none !important; }
.login-license-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.login-license-head strong {
    font-size: 15px;
    color: #0f172a;
}
.login-license-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #e8eef8;
    color: #334155;
    flex-shrink: 0;
}
.login-license-badge[data-state="active"] { background: #dcfce7; color: #166534; }
.login-license-badge[data-state="expired"],
.login-license-badge[data-state="revoked"],
.login-license-badge[data-state="invalid"],
.login-license-badge[data-state="error"] { background: #fee2e2; color: #991b1b; }
.login-license-badge[data-state="offline-expired"],
.login-license-badge[data-state="online-required"],
.login-license-badge[data-state="missing"],
.login-license-badge[data-state="pending"] { background: #ffedd5; color: #9a3412; }
.login-license-message,
.login-license-meta {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}
.login-license-message.is-warn,
.login-license-summary.is-warn {
    color: #b42318;
    background: #fef3f2;
    border: 1px solid #fecdca;
    border-radius: 10px;
    padding: 10px 12px;
}
.login-license-online-hint,
.login-online-actions-tip {
    margin: 6px 0 0;
    font-size: 12px;
    color: #0f766e;
    line-height: 1.45;
}
.login-license-online-hint.is-error,
.login-online-actions-tip.is-error { color: #b42318; }
.login-online-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 8px 0 4px;
}
.login-online-actions[hidden] { display: none !important; }
.login-license-block {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}
.login-license-block[hidden] { display: none !important; }
.login-license-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f766e;
}
.login-license-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}
.login-license-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.02em;
}
.login-license-input {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d5dce7;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: #0f172a;
    font-size: 14px;
    box-sizing: border-box;
}
.login-license-input.is-mono {
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    letter-spacing: 0.03em;
}
.login-license-input[readonly] {
    background: #f1f5f9;
}
.login-license-input:focus {
    border-color: #1168e8;
    box-shadow: 0 0 0 3px rgba(17, 104, 232, 0.12);
}
.login-license-btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.login-license-btn {
    width: 100%;
    height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.login-license-btn:hover { background: #f8fafc; }
.login-license-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.login-license-btn.primary {
    border-color: transparent;
    background: linear-gradient(135deg, #1168e8, #0b4fbe);
    color: #fff;
}
.login-license-btn.primary:hover { filter: brightness(1.03); }
.login-license-onboard-tip {
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    line-height: 1.5;
}
.login-form.is-license-locked {
    opacity: 0.55;
    pointer-events: none;
}
.login-form.is-license-locked .login-btn {
    background: #94a3b8;
}
#license-goto-login {
    width: 100%;
    height: 44px;
}
#license-goto-login[hidden] {
    display: none !important;
}
