:root {
  --ui-canvas: #f7f7f9;
  --ui-surface: #ffffff;
  --ui-surface-muted: #f5f5f8;
  --ui-surface-strong: #ececf2;
  --ui-text: #24252b;
  --ui-text-secondary: #555567;
  --ui-text-tertiary: #747782;
  --ui-border: #dedee8;
  --ui-border-strong: #c9c8d6;
  --ui-accent: #5d4ced;
  --ui-accent-hover: #4a3aff;
  --ui-accent-soft: #f0edff;
  --ui-accent-border: #b8b0ff;
  --ui-warning: #b85f2f;
  --ui-warning-soft: #fff3ea;
  --ui-shadow-float: 0 18px 42px rgb(45 43 80 / 9%);
  --ui-shadow-dialog: 0 28px 72px rgb(45 43 80 / 18%);
  --ui-radius-lg: 8px;
  --ui-focus: 0 0 0 3px rgb(74 58 255 / 20%);
}

body {
  background: var(--ui-canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.login-screen {
  position: relative;
  overflow: hidden;
  padding: 40px 20px;
  background-color: #edf2f3;
  background-image: url("/assets/login-network-bg.webp");
  background-position: center;
  background-size: cover;
}

.login-card {
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(462px, 100%);
  padding: 36px 34px 30px;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgb(38 50 63 / 12%);
  animation: login-enter 420ms cubic-bezier(.2,.75,.25,1) both;
}

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

.login-brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border: 3px solid #5548ff;
  border-radius: 50%;
  background: #fff;
  color: #5548ff;
}

.login-brand-mark svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { color: var(--ui-text); font-size: 19px; line-height: 1.3; }
.login-brand small { margin-top: 2px; color: var(--ui-text-tertiary); font-size: 12px; }
.login-heading { display: grid; gap: 7px; margin-top: 4px; }
.login-heading > * { margin: 0; }
.login-heading .eyebrow { color: var(--ui-accent); font-weight: 800; letter-spacing: .12em; }
.login-heading h1 { font-size: clamp(30px, 6vw, 38px); line-height: 1.14; letter-spacing: -.035em; }
.login-heading .muted { line-height: 1.65; }
.login-fields { display: grid; gap: 16px; }
.login-fields label { margin: 0; color: var(--ui-text-secondary); font-weight: 700; }
.login-fields input { min-height: 44px; margin-top: 7px; border-color: #d8dce6; background: #fff; }
.login-fields input:focus { border-color: #5548ff; box-shadow: 0 0 0 3px rgb(85 72 255 / 12%); }
.login-submit { width: 100%; min-height: 44px; border-color: #f58a4b; background: #f58a4b; color: #161922; }
.login-submit:hover:not(:disabled) { border-color: #e87938; background: #e87938; }
.feishu-login {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #3370ff;
  border-radius: 6px;
  background: #3370ff;
  color: #fff;
  font-weight: 700;
}
.feishu-login:hover:not(:disabled) { border-color: #245bdb; background: #245bdb; }
.feishu-login:active:not(:disabled), .login-submit:active:not(:disabled) { transform: translateY(1px); }
.feishu-login span { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid rgb(255 255 255 / 72%); border-radius: 5px; color: #fff; font-size: 12px; font-weight: 850; }
.login-divider { display: flex; align-items: center; gap: 10px; color: var(--ui-text-tertiary); font-size: 11px; }
.login-divider::before, .login-divider::after { height: 1px; flex: 1; background: #e8e7ee; content: ""; }
.login-card .message { min-height: 0; margin: -10px 0 0; }
.login-card .message:empty { display: none; }
.login-footnote { margin: 4px 0 0; padding-top: 18px; border-top: 1px solid #e8e7ee; color: var(--ui-text-tertiary); font-size: 12px; line-height: 1.75; text-align: center; }
.login-footnote span { color: #9095a2; }

@keyframes login-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-shell { grid-template-columns: 176px minmax(0, 1fr); }
.app-shell::before { display: none; }

.sidebar {
  padding: 16px 12px;
  border-right: 0;
  background: #302e47;
  color: #f7fbfb;
}

.sidebar-brand-row { min-height: 48px; margin: 0 4px 20px; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.sidebar .brand::after { display: none; }
.brand-mark { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 8px; background: #f28c52; color: #302e47; font-size: 16px; font-weight: 850; }
.brand-copy { min-width: 0; }
.brand-copy strong, .brand-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy strong { color: #fff; font-size: 16px; line-height: 1.25; }
.brand-copy small { margin-top: 2px; color: #b8b6ca; font-size: 10px; font-weight: 500; }
.sidebar-group-label { color: #aaa8bb; }
.sidebar .nav { color: #d6d4e2; }
.sidebar .nav:hover { background: #3b3856; color: #fff; }
.sidebar .nav.active { background: #433f63; color: #fff; }
.sidebar .nav.active::before { left: -12px; background: #f28c52; }
.sidebar-foot { border-color: #48445f; color: #aaa8bb; }
.sidebar-foot strong { color: #fff; }
.sidebar-foot .link-button { color: #c8c5d6; }

main { padding-inline: 28px; }
.app-topbar { min-height: 56px; }
.page-header { padding: 24px 0 22px; }
.page-header::after { background: #f28c52; }

.model-panel, .panel, .summary-card, .task, .asset-library .asset-tile {
  border-color: #dfe0e7;
  border-radius: 8px;
  box-shadow: none;
}

.model-row:hover, .task:hover, .asset-library .asset-tile:hover {
  border-color: #b8b0ff;
  box-shadow: 0 10px 24px rgb(45 43 80 / 7%);
}

.primary { min-height: 40px; }
.status.running::before { background: #f28c52; }

@media (max-width: 1023px) {
  .app-shell { grid-template-columns: 164px minmax(0, 1fr); }
  main { padding-inline: 20px; }
}

@media (max-width: 767px) {
  .app-shell { display: block; }
  .sidebar { width: min(288px, calc(100vw - 56px)); }
  main { padding-inline: 16px; }
  .login-screen { align-items: start; padding: 24px 14px; background-position: center top; }
  .login-card { margin-top: max(18px, 5vh); padding: 28px 22px 24px; }
  .login-heading h1 { font-size: 31px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-card { animation: none; }
}
