body.user-entry-active { overflow: hidden; }
body.user-entry-active .sidebar, body.user-entry-active .topbar { display: none; }
body.user-entry-active .main-wrap { margin-left: 0; min-width: 0; }
body.user-entry-active #appMain { min-height: 100vh; padding: 0; background: var(--entry-surface, #f6f8f7); }
body.auth-view-active { overflow: hidden; }
body.auth-view-active .sidebar, body.auth-view-active .topbar { display: none; }
body.auth-view-active .main-wrap { margin-left: 0; min-width: 0; }
body.auth-view-active #appMain { min-height: 100vh; padding: 0; }

.admin-auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .95fr) minmax(480px, 1.05fr); background: #fff; }
.admin-auth-brand { padding: clamp(48px, 7vw, 96px); display: flex; flex-direction: column; justify-content: center; color: #f3f8f5; background: #10241b; box-shadow: inset -1px 0 rgba(255,255,255,.06); }
.admin-auth-brand .brand-mark { width: 34px; height: 34px; margin-bottom: 52px; }
.admin-auth-brand .eyebrow { color: #79c69e; }
.admin-auth-brand h1 { margin: 14px 0 10px; color: #fff; font-size: 44px; line-height: 1.15; }
.admin-auth-brand p { max-width: 430px; margin: 0; color: #aebbb4; font-size: 13px; line-height: 1.8; }
.admin-auth-form { --entry-primary: #0f7653; --entry-soft: #e1f2e9; width: min(420px, calc(100% - 48px)); margin: auto; }
.admin-auth-form h2 { margin: 12px 0 8px; font-size: 28px; line-height: 1.25; }
.admin-auth-form > p { margin: 0 0 30px; color: var(--muted); font-size: 12px; }
#adminLoginForm > label { display: block; margin-bottom: 18px; color: #536159; font-size: 10.5px; font-weight: 650; }
#adminLoginForm input { width: 100%; height: 48px; margin-top: 8px; padding: 0 14px; border: 1px solid #d6dfda; border-radius: 7px; outline: 0; background: #fbfcfb; font-size: 13px; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
#adminLoginForm input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.admin-auth-form .entry-submit { margin-top: 10px; border-color: #0a5b40; background: #0f7653; box-shadow: 0 10px 24px rgba(14,112,79,.22); }
.admin-auth-form .entry-submit:hover { background: #09543c; box-shadow: 0 12px 26px rgba(14,112,79,.3); }
.auth-error { margin-bottom: 16px; padding: 10px 12px; border-left: 3px solid var(--coral); color: #8d4039; background: var(--coral-soft); font-size: 9px; }
.auth-note { display: block; margin-top: 18px; color: var(--muted); font-size: 9.5px; line-height: 1.65; }
.backend-error-shell { min-height: 100vh; padding: 30px; display: grid; place-content: center; justify-items: center; text-align: center; background: #f4f7f5; }
.backend-error-shell > span { width: 52px; height: 52px; border-radius: 7px; display: grid; place-items: center; color: var(--coral); background: var(--coral-soft); }
.backend-error-shell > span svg { width: 23px; }
.backend-error-shell h1 { margin: 17px 0 6px; font-size: 20px; }
.backend-error-shell p { max-width: 520px; margin: 0 0 18px; color: var(--muted); font-size: 10px; line-height: 1.7; }

.user-login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 1.25fr) minmax(420px, .75fr); color: #17231d; background: var(--entry-surface); }
.entry-brand-panel { min-height: 100vh; padding: 34px clamp(38px, 5vw, 76px) 28px; display: flex; flex-direction: column; color: #fff; background: var(--entry-primary); }
.entry-back { width: max-content; height: 36px; padding: 0; border: 0; display: inline-flex; align-items: center; gap: 8px; color: currentColor; background: transparent; font-size: 10px; cursor: pointer; }
.entry-back svg { width: 15px; }
.entry-brand-content { width: min(620px, 100%); margin: auto 0; }
.entry-brand-line { display: flex; align-items: center; gap: 12px; }
.entry-brand-line strong, .entry-brand-line small { display: block; }
.entry-brand-line strong { font-size: 13px; }
.entry-brand-line small { margin-top: 3px; color: rgba(255,255,255,.68); font-size: 9px; }
.entry-logo { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 6px; display: grid; place-items: center; color: var(--entry-primary); background: #fff; }
.entry-logo svg { width: 20px; }
.entry-copy { margin: clamp(50px, 9vh, 100px) 0 40px; }
.entry-kicker { color: rgba(255,255,255,.7); font: 500 9px "DM Mono", monospace; text-transform: uppercase; }
.entry-copy h1 { max-width: 650px; margin: 13px 0 17px; color: inherit; font-size: clamp(32px, 4.2vw, 58px); line-height: 1.14; font-weight: 600; letter-spacing: 0; }
.entry-copy p { max-width: 530px; margin: 0; color: rgba(255,255,255,.74); font-size: 12px; line-height: 1.8; }
.entry-capabilities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid rgba(255,255,255,.22); border-bottom: 1px solid rgba(255,255,255,.22); }
.entry-capabilities > div { min-height: 82px; padding: 16px 13px; border-right: 1px solid rgba(255,255,255,.22); display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 7px; }
.entry-capabilities > div:last-child { border-right: 0; }
.entry-capabilities span { grid-column: 1 / -1; color: rgba(255,255,255,.55); font: 8px "DM Mono", monospace; }
.entry-capabilities strong { font-size: 10px; }
.entry-capabilities svg { width: 13px; color: rgba(255,255,255,.68); }
.entry-brand-panel > footer { display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.58); font-size: 8px; }
.entry-brand-panel > footer span { display: inline-flex; align-items: center; gap: 6px; }
.entry-brand-panel > footer svg { width: 12px; }
.entry-form-panel { min-height: 100vh; padding: 40px clamp(34px, 5vw, 72px); display: grid; place-items: center; background: #fff; }
.entry-form-wrap { width: min(420px, 100%); }
.entry-mobile-brand { display: none; }
.entry-form-label { color: var(--entry-primary); font: 500 8px "DM Mono", monospace; }
.entry-form-wrap h2 { margin: 11px 0 7px; font-size: 25px; letter-spacing: 0; }
.entry-form-wrap > p { margin: 0 0 30px; color: var(--muted); font-size: 10px; }
#portalLoginForm > label:not(.entry-consent) { display: block; margin-bottom: 17px; color: #536159; font-size: 10px; font-weight: 650; }
#portalLoginForm input:not([type="checkbox"]) { width: 100%; height: 46px; margin-top: 8px; padding: 0 13px; border: 1px solid #d6dfda; border-radius: 7px; outline: 0; color: #17231d; background: #fff; font-size: 12px; }
#portalLoginForm input:focus { border-color: var(--entry-primary); box-shadow: 0 0 0 3px var(--entry-soft); }
.verify-field, .password-field { position: relative; }
.verify-field { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.verify-field button { height: 44px; margin-top: 7px; padding: 0 13px; border: 1px solid var(--entry-primary); border-radius: 5px; color: var(--entry-primary); background: #fff; font-size: 9px; font-weight: 600; cursor: pointer; }
.verify-field button:disabled { opacity: .58; cursor: default; }
.password-field button { position: absolute; right: 5px; bottom: 4px; width: 36px; height: 36px; border: 0; display: grid; place-items: center; color: var(--muted); background: transparent; cursor: pointer; }
.password-field button svg { width: 15px; }
.entry-consent { margin: 4px 0 20px; display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 9px; line-height: 1.5; cursor: pointer; }
.entry-consent input { margin-top: 1px; accent-color: var(--entry-primary); }
.entry-submit { width: 100%; min-height: 52px; margin-top: 4px; padding: 0 17px; border: 1px solid rgba(23,35,29,.16); border-radius: 6px; display: flex; align-items: center; justify-content: space-between; color: #fff; background: var(--entry-primary); box-shadow: 0 8px 18px rgba(23,35,29,.16); font-size: 12px; font-weight: 700; cursor: pointer; transition: background .16s ease, box-shadow .16s ease, transform .16s ease; }
.entry-submit:hover { background: color-mix(in srgb, var(--entry-primary) 86%, #111 14%); box-shadow: 0 10px 22px rgba(23,35,29,.22); transform: translateY(-1px); }
.entry-submit:active { box-shadow: 0 4px 10px rgba(23,35,29,.16); transform: translateY(0); }
.entry-submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--entry-primary) 28%, transparent); outline-offset: 3px; }
.entry-submit:disabled { opacity: .72; cursor: wait; transform: none; }
.entry-submit svg { width: 18px; height: 18px; }
.third-party-divider { margin: 20px 0 13px; display: flex; align-items: center; gap: 10px; color: #98a19c; font-size: 8px; }
.third-party-divider::before, .third-party-divider::after { content: ""; height: 1px; flex: 1; background: #e4e8e6; }
.third-party-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.third-party-button { min-height: 44px; padding: 0 11px; border: 1px solid #dce2df; border-radius: 7px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #354139; background: #fff; font-size: 10px; cursor: pointer; }
.third-party-button:hover { border-color: #aeb9b3; background: #fafbfa; }
.third-party-button:disabled { opacity: .65; cursor: wait; }
.third-party-button > span { width: 23px; height: 23px; border-radius: 4px; display: grid; place-items: center; color: #fff; font-size: 9px; font-weight: 700; }
.third-party-button strong { font-size: 9px; }
.third-party-button.wechat > span, .third-party-button.wecom > span { background: #178b4e; }
.third-party-button.alipay > span { background: #1677ff; }
.third-party-button.dingtalk > span { background: #1677ff; }
.third-party-button.feishu > span { background: #3370ff; }
.entry-support { margin-top: 18px; display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.entry-support span { display: flex; align-items: center; gap: 5px; }
.entry-support svg { width: 13px; }
.entry-support button { padding: 0; border: 0; color: var(--entry-primary); background: transparent; font-size: 9px; cursor: pointer; }

.layout-retail .entry-brand-panel { color: #30291e; background: var(--entry-soft); }
.layout-retail .entry-brand-line small, .layout-retail .entry-kicker, .layout-retail .entry-copy p, .layout-retail .entry-brand-panel > footer { color: #75664f; }
.layout-retail .entry-logo { color: #fff; background: var(--entry-primary); }
.layout-retail .entry-capabilities { border-color: #d9c9af; }
.layout-retail .entry-capabilities > div { border-color: #d9c9af; }
.layout-retail .entry-capabilities span, .layout-retail .entry-capabilities svg { color: #8f7855; }
.layout-learning .entry-brand-panel { order: 2; color: #372424; background: var(--entry-soft); }
.layout-learning .entry-form-panel { order: 1; }
.layout-learning .entry-brand-line small, .layout-learning .entry-kicker, .layout-learning .entry-copy p, .layout-learning .entry-brand-panel > footer { color: #806061; }
.layout-learning .entry-logo { color: #fff; background: var(--entry-primary); }
.layout-learning .entry-capabilities, .layout-learning .entry-capabilities > div { border-color: #e4c8c6; }
.layout-learning .entry-capabilities span, .layout-learning .entry-capabilities svg { color: #9e7474; }
.layout-travel { grid-template-columns: minmax(420px, .9fr) minmax(440px, 1.1fr); }
.layout-travel .entry-brand-panel { background: #174e60; }
.layout-legal { grid-template-columns: minmax(400px, .78fr) minmax(460px, 1.22fr); }
.layout-legal .entry-brand-panel { background: #39352d; }
.layout-corporate .entry-brand-panel { background: #184d3e; }

.portal-shell { min-height: 100vh; display: grid; grid-template-rows: 66px minmax(0, 1fr) auto 24px; color: #17231d; background: var(--entry-surface); }
.portal-header { padding: 0 clamp(18px, 4vw, 52px); border-bottom: 1px solid #dfe5e2; display: flex; align-items: center; justify-content: space-between; background: #fff; }
.portal-brand { display: flex; align-items: center; gap: 10px; }
.portal-brand .entry-logo { width: 36px; height: 36px; color: #fff; background: var(--entry-primary); }
.portal-brand .entry-logo svg { width: 17px; }
.portal-brand strong, .portal-brand small { display: block; }
.portal-brand strong { font-size: 11px; }
.portal-brand small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.portal-header-actions { display: flex; align-items: center; gap: 6px; }
.portal-main { width: min(820px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 18px; overflow-y: auto; }
.portal-intro { padding-bottom: 28px; text-align: center; }
.portal-intro > span { width: 48px; height: 48px; margin: auto; border-radius: 7px; display: grid; place-items: center; color: #fff; background: var(--entry-primary); }
.portal-intro > span svg { width: 22px; }
.portal-intro h1 { margin: 14px 0 6px; font-size: 20px; }
.portal-intro p { max-width: 540px; margin: auto; color: var(--muted); font-size: 10px; line-height: 1.7; }
.portal-prompts { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.portal-prompts button { min-height: 54px; padding: 10px 12px; border: 1px solid #dbe2de; border-radius: 5px; display: flex; align-items: center; justify-content: space-between; color: #445149; background: #fff; font-size: 9px; text-align: left; cursor: pointer; }
.portal-prompts button:hover { border-color: var(--entry-primary); color: var(--entry-primary); }
.portal-prompts svg { width: 13px; }
.portal-messages { padding: 10px 0 80px; }
.portal-message { max-width: 76%; margin-bottom: 15px; display: flex; align-items: flex-start; gap: 9px; }
.portal-message > span { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--entry-primary); font-size: 8px; }
.portal-message > div { padding: 11px 13px; border: 1px solid #dce3df; border-radius: 3px 7px 7px 7px; background: #fff; font-size: 10px; line-height: 1.7; }
.portal-message.user { margin-left: auto; flex-direction: row-reverse; }
.portal-message.user > span { background: #4e5a54; }
.portal-message.user > div { color: #fff; background: var(--entry-primary); border-color: var(--entry-primary); border-radius: 7px 3px 7px 7px; }
.portal-compose { width: min(820px, calc(100% - 32px)); min-height: 58px; margin: 0 auto 10px; padding: 7px; border: 1px solid #d6ded9; border-radius: 7px; display: grid; grid-template-columns: 38px 1fr 40px; align-items: end; background: #fff; box-shadow: 0 8px 28px rgba(25,45,34,.08); }
.portal-compose textarea { min-height: 40px; max-height: 120px; padding: 11px 8px; border: 0; outline: 0; resize: none; font-size: 10px; }
.portal-send { width: 38px; height: 38px; border: 0; border-radius: 5px; display: grid; place-items: center; color: #fff; background: var(--entry-primary); cursor: pointer; }
.portal-send svg { width: 16px; }
.portal-footer { color: var(--muted); font-size: 8px; text-align: center; }

@media (max-width: 900px) {
  body.user-entry-active { overflow: auto; }
  .user-login-shell, .layout-travel, .layout-legal { grid-template-columns: 1fr; }
  .entry-brand-panel, .entry-form-panel { min-height: auto; }
  .entry-brand-panel { order: 1 !important; padding: 28px 34px 32px; }
  .entry-form-panel { order: 2 !important; min-height: 520px; padding: 42px 34px; }
  .entry-brand-content { margin: 34px 0 6px; }
  .entry-copy { margin: 32px 0 24px; }
  .entry-copy h1 { max-width: 620px; font-size: 36px; }
  .entry-brand-panel > footer { display: none; }
  .admin-auth-shell { grid-template-columns: 1fr; }
  .admin-auth-brand { min-height: 230px; padding: 34px; }
  .admin-auth-brand .brand-mark { margin-bottom: 24px; }
  .admin-auth-brand h1 { font-size: 30px; }
  .admin-auth-form { padding: 48px 0; }
}
