/* GMI · 航天指挥中心 + 清晰工作区 */

/* 登录：左侧企业叙事，右侧可读、稳定的认证表单。 */
.login-page { position: fixed; inset: 0; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 48px 32px; isolation: isolate; background: var(--bg-deep); }
.login-scene { position: absolute; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 20% 20%, var(--neon-cyan-faint), transparent 62%), linear-gradient(145deg, var(--bg-deep), var(--bg-base)); }
.login-scene::before { content: ""; position: absolute; inset: 0; opacity: .28; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 96px 96px; mask-image: linear-gradient(90deg, transparent, var(--text-hi), transparent); }
.login-scene::after { content: ""; position: absolute; width: 65vw; aspect-ratio: 1; left: -25vw; top: -40vw; border-radius: 50%; border: 1px solid var(--line-strong); box-shadow: 0 0 0 80px var(--neon-cyan-faint), 0 0 0 160px var(--neon-cyan-faint); opacity: .45; }
#login-particles { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .25; }
.login-layout { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .85fr); gap: clamp(40px, 6vw, 96px); align-items: center; width: min(1120px, 100%); margin: auto; }
.login-story { min-width: 0; padding: 16px 0; }
.login-eyebrow { display: block; font-family: var(--font-num); font-size: 12px; letter-spacing: .18em; line-height: 1.8; color: var(--accent); text-transform: uppercase; margin-bottom: 20px; }
.login-heading, .login-story h1 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 650; letter-spacing: -.025em; line-height: 1.35; max-width: 560px; overflow-wrap: anywhere; }
.login-description { font-size: 16px; color: var(--text-mid); line-height: 1.9; margin-top: 22px; max-width: 440px; }
.login-orbit { width: min(340px, 90%); aspect-ratio: 1.6; position: relative; margin: 36px 0 12px; border: 1px solid var(--line-strong); border-radius: 50%; transform: rotate(-18deg); color: var(--accent); background: radial-gradient(ellipse, var(--neon-cyan-faint), transparent 64%); }
.login-orbit::before { content: ""; position: absolute; inset: 22%; border: 1px solid var(--line); border-radius: 50%; box-shadow: 0 0 0 24px var(--neon-cyan-faint); }
.login-orbit::after { content: ""; position: absolute; top: 13%; left: 15%; width: 12px; height: 12px; background: var(--accent); border: 3px solid var(--bg-base); border-radius: 50%; box-shadow: 0 0 0 5px var(--neon-cyan-faint); }
.login-security { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 24px; color: var(--text-dim); font-size: 12px; line-height: 1.7; }
.login-security svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--accent); }
.login-box { position: relative; z-index: 1; width: 100%; max-width: 460px; padding: 36px; text-align: left; background: var(--bg-panel-solid); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-overlay); }
.login-page > .login-box { width: min(440px, 100%); }
.login-box header { margin-bottom: 24px; }
.login-logo, .login-box .logo { width: 52px; height: 52px; margin: 0 0 20px; border-radius: 12px; background: var(--grad-main); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: var(--on-accent); overflow: hidden; }
.login-logo img, .login-box .logo img { width: 100%; height: 100%; object-fit: contain; }
.login-title { font-size: 24px; font-weight: 650; letter-spacing: -.02em; line-height: 1.4; }
.login-sub { margin: 8px 0 26px; font-size: 14px; color: var(--text-mid); line-height: 1.7; }
.login-sub .cursor { display: inline-block; width: 8px; color: var(--accent); }
.login-field { position: relative; margin-bottom: 20px; text-align: left; min-width: 0; }
.login-field label, .login-box form > label { display: block; position: static; transform: none; color: var(--text-mid); font-size: 14px; font-weight: 500; margin-bottom: 8px; line-height: 20px; }
.login-field input, .login-field select { display: block; width: 100%; height: 44px; padding: 0 14px; background: var(--bg-input); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); transition: border-color .18s, box-shadow .18s; }
.login-field:has(.field-icon) input, .login-field:has(.field-icon) select { padding-left: 42px; }
.login-field input:focus, .login-field select:focus { border-color: var(--accent); box-shadow: var(--glow-cyan); }
.login-field .field-icon { position: absolute; left: 14px; bottom: 13px; width: 18px; height: 18px; color: var(--text-dim); pointer-events: none; }
.login-btn { width: 100%; min-height: 44px; padding: 10px 16px; margin-top: 4px; border-radius: var(--radius-sm); background: var(--grad-main); color: var(--on-accent); font-size: 15px; font-weight: 650; letter-spacing: .08em; transition: filter .18s; }
.login-btn { display: flex; align-items: center; justify-content: center; gap: 12px; }
.login-btn svg { width: 20px; height: 20px; }
.login-orbit b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; letter-spacing: .12em; transform: rotate(18deg); }
.login-box form { margin-top: 24px; }
.login-links { justify-content: space-between; }
#login-theme { margin-top: 20px; }
.user-chip .u-name, .user-chip .u-role { display: block; }
.dashboard-company-cover { width: 100%; max-height: 240px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: 24px; }
.login-btn:hover { filter: brightness(1.08); }
.login-btn:disabled { opacity: .6; }
.login-error { min-height: 20px; margin-top: 12px; font-size: 13px; color: var(--danger); }
.login-mode-note { padding: 12px 14px; margin-top: 20px; font-size: 12px; line-height: 1.7; color: var(--text-mid); border-left: 2px solid var(--line-strong); background: var(--bg-raised); border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }
.login-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-size: 13px; }
.login-link { color: var(--accent); cursor: pointer; padding: 4px 0; }
.login-link:hover { text-decoration: underline; }
.login-sep { color: var(--line-strong); }
.login-demo { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-dim); }
.login-demo .demo-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.login-demo .chip { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--text-mid); cursor: pointer; }
.login-demo .chip:hover { color: var(--accent); border-color: var(--accent); background: var(--bg-hover); }

/* 工作区框架 */
.app-shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; display: flex; flex-direction: column; background: var(--bg-sidebar); border-right: 1px solid var(--line); transition: width .2s ease; position: relative; z-index: 20; }
.sidebar.folded { width: var(--sidebar-w-fold); }
.brand { min-height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); overflow: hidden; }
.brand-logo { width: 36px; height: 36px; flex-shrink: 0; border-radius: 9px; background: var(--grad-main); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; color: var(--on-accent); overflow: hidden; }
.brand-branding { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-branding img, .brand-logo img { width: 36px; height: 36px; max-width: 100%; object-fit: contain; flex-shrink: 0; }
.brand-logo:has(img:not([hidden])) { background: var(--bg-panel-solid); padding: 3px; }
.brand-name { min-width: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.brand-name small { display: block; margin-top: 3px; font-size: 10px; font-weight: 500; color: var(--text-dim); letter-spacing: .16em; }
.sidebar.folded .brand-name { display: none; }
.sidebar.folded .brand { justify-content: center; padding-inline: 12px; }
.nav-menu { flex: 1; padding: 20px 12px; overflow-y: auto; overflow-x: hidden; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; margin-bottom: 5px; border-radius: var(--radius-sm); color: var(--text-mid); cursor: pointer; white-space: nowrap; overflow: hidden; position: relative; transition: background .18s, color .18s; }
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { color: var(--text-hi); background: var(--bg-hover); text-decoration: none; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-lock { margin-left: auto; flex-shrink: 0; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 10px; font-weight: 500; color: var(--text-dim); letter-spacing: .02em; }
.nav-item.locked { opacity: .55; cursor: not-allowed; }
.nav-item.locked:hover { color: var(--text-mid); background: transparent; }
.nav-item.active { color: var(--accent); background: var(--neon-cyan-faint); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 25%; height: 50%; width: 2px; border-radius: 2px; background: var(--accent); }
.sidebar.folded .nav-item { justify-content: center; padding-inline: 0; }
.sidebar.folded .nav-item span { display: none; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); }
.fold-btn { width: 100%; height: 40px; border-radius: var(--radius-sm); color: var(--text-dim); display: flex; align-items: center; justify-content: center; }
.fold-btn:hover { color: var(--accent); background: var(--bg-hover); }
.fold-btn svg { width: 18px; height: 18px; transition: transform .2s; }
.sidebar.folded .fold-btn svg { transform: rotate(180deg); }
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { min-height: var(--topbar-h); flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--bg-topbar); border-bottom: 1px solid var(--line); z-index: 15; }
.page-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.company-context { min-width: 0; max-width: 260px; color: var(--text-mid); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-context strong, .company-context b { color: var(--text-hi); font-weight: 600; }
.company-context small { display: block; font-size: 11px; color: var(--text-dim); }
.topbar-spacer { flex: 1; min-width: 0; }
.global-search { position: relative; width: 240px; min-width: 120px; flex-shrink: 1; }
.global-search input { width: 100%; height: 40px; padding: 0 12px 0 36px; background: var(--bg-input); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; }
.global-search input:focus { border-color: var(--accent); box-shadow: var(--glow-cyan); }
.global-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-dim); pointer-events: none; }
.topbar-btn { position: relative; flex-shrink: 0; width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-mid); transition: background .18s; }
.topbar-btn:hover { color: var(--accent); background: var(--bg-hover); }
.topbar-btn svg { width: 19px; height: 19px; }
.badge-dot { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: var(--on-danger); font-size: 10px; line-height: 17px; text-align: center; font-family: var(--font-num); }
.user-chip { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 10px 4px 5px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; flex-shrink: 0; max-width: 210px; }
.user-chip:hover { border-color: var(--line-strong); background: var(--bg-hover); }
.avatar { width: 30px; height: 30px; flex-shrink: 0; border-radius: 7px; background: var(--neon-cyan-faint); border: 1px solid var(--neon-cyan-dim); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--accent); }
.user-chip .u-info { min-width: 0; }
.user-chip .u-name { font-size: 13px; line-height: 1.4; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .u-role { font-size: 11px; line-height: 1.4; color: var(--text-dim); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip > svg { flex-shrink: 0; width: 16px; height: 16px; color: var(--text-dim); }
.sync-chip { display: flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 28px; padding: 3px 9px; border-radius: 6px; font-size: 11px; white-space: nowrap; cursor: default; border: 1px solid var(--line); }
.sync-chip i { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sync-chip.online { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.sync-chip.online i { background: var(--ok); }
.sync-chip.offline { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.sync-chip.offline i { background: var(--danger); }
.sync-chip.local { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.sync-chip.local i { background: var(--warn); }
.license-upload { display: flex; align-items: center; justify-content: center; min-height: 130px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--bg-input); cursor: pointer; padding: 16px; }
.license-upload:hover { border-color: var(--accent); background: var(--bg-hover); }
.lu-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.content { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 24px; position: relative; background: var(--bg-base); }
.view-page { min-width: 0; animation: page-in .24s ease both; }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.view-head h2, .workspace-heading h1, .workspace-heading h2 { font-size: 26px; line-height: 1.35; letter-spacing: -.025em; font-weight: 650; }
.view-head .sub { font-size: 14px; color: var(--text-dim); margin-top: 6px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.workspace-heading p { color: var(--text-mid); margin-top: 6px; font-size: 14px; }
.placeholder-view { padding: 64px 24px; text-align: center; color: var(--text-dim); }
.placeholder-view .ph-icon { width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 16px; background: var(--neon-cyan-faint); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.placeholder-view .ph-icon svg { width: 28px; height: 28px; }
.placeholder-view h3 { color: var(--text-hi); font-size: 20px; margin-bottom: 8px; }
.menu-btn, .sidebar-mask { display: none; }

@media (max-width: 1180px) {
  .global-search { width: 180px; }
  .company-context { max-width: 180px; }
}
@media (max-width: 1024px) {
  .sidebar { width: var(--sidebar-w-fold); }
  .sidebar .brand-name, .sidebar .nav-item span { display: none; }
  .sidebar .nav-item { justify-content: center; padding-inline: 0; }
  .sidebar .brand { justify-content: center; padding-inline: 12px; }
  .sidebar-foot { display: none; }
  .topbar { gap: 8px; padding-inline: 16px; }
  .sync-chip span { display: none; }
  .sync-chip { padding-inline: 8px; }
  .content { padding: 20px; }
  .login-layout { gap: 40px; grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); }
  .login-box { padding: 28px; }
}
@media (max-width: 860px) {
  .global-search { display: none; }
  .login-page { padding: 32px 24px; align-items: flex-start; }
  .login-layout { grid-template-columns: 1fr; width: min(520px, 100%); gap: 28px; }
  .login-story { padding: 0; }
  .login-eyebrow { margin-bottom: 12px; }
  .login-heading, .login-story h1 { font-size: 28px; }
  .login-description { font-size: 14px; margin-top: 12px; }
  .login-orbit { display: none; }
  .login-story .login-security { margin-top: 16px; }
  .login-box { max-width: none; }
}
@media (max-width: 760px) {
  .menu-btn { display: flex; }
  .sidebar, .sidebar.folded { position: fixed; inset: 0 auto 0 0; width: 248px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-overlay); z-index: 60; }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .sidebar .brand-name, .sidebar .nav-item span { display: block; }
  .sidebar .brand { justify-content: flex-start; padding-inline: 20px; }
  .sidebar .nav-item { justify-content: flex-start; padding-inline: 12px; min-height: 44px; }
  .sidebar-mask { display: block; position: fixed; inset: 0; z-index: 55; background: var(--overlay); opacity: 0; pointer-events: none; transition: opacity .22s; }
  .app-shell.nav-open .sidebar-mask { opacity: 1; pointer-events: auto; }
  .topbar { min-height: 60px; gap: 6px; padding: 8px 12px; }
  .page-title { font-size: 14px; }
  .company-context { flex: 1; max-width: 180px; font-size: 13px; }
  .user-chip .u-info { display: none; }
  .user-chip { padding: 4px; gap: 4px; }
  .user-chip > svg { width: 12px; }
  .content { padding: 16px; }
  .view-head h2, .workspace-heading h1, .workspace-heading h2 { font-size: 24px; }
  .login-page { padding: 24px 16px; }
  .login-box { padding: 24px; }
}
@media (max-width: 420px) {
  .topbar { gap: 4px; padding-inline: 8px; }
  .page-title { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-spacer { flex-grow: .1; }
  .company-context { max-width: 120px; }
  .user-chip > svg { display: none; }
  .login-security { font-size: 11px; }
  .login-box { padding: 24px 20px; }
}
@supports (padding: env(safe-area-inset-left)) {
  @media (max-width: 760px) {
    .topbar { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
    .content { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
    .sidebar { padding-bottom: env(safe-area-inset-bottom); }
    .login-page { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  }
}
