/* 增鑫AI工作站 · visual layer. Loaded after the application's stylesheet.
 * Theme and palette preferences remain functional; navigation dimensions and
 * open/collapsed states continue to be owned by the application.
 */

:root,
html[data-theme="light"] {
  --zx-ink: #16352f;
  --zx-canvas: #f4f7f6;
  --zx-sidebar: #102e2b;
  --zx-sidebar-secondary: #173a35;
  --fn-bg-primary: #ffffff;
  --fn-bg-secondary: #f4f7f6;
  --fn-bg-tertiary: #edf2f0;
  --fn-bg-layout: #f4f7f6;
  --fn-bg-page: #f4f7f6;
  --fn-bg-container: #ffffff;
  --fn-bg-elevated: #ffffff;
  --fn-bg-code: #f0f5f3;
  --fn-bg-toolbar: #f8faf9;
  --fn-bg-toolbar-hover: #edf3f0;
  --fn-bg-input-label: #f4f7f6;
  --fn-bg-subtle: #f0f5f3;
  --fn-bg-secondary-hover: #eaf1ed;
  --fn-bg-secondary-active: #e1ebe5;
  --fn-surface: #ffffff;
  --fn-surface-sunken: #f4f7f6;
  --fn-text-primary: #16352f;
  --fn-text-secondary: #526960;
  --fn-text-tertiary: #667b72;
  --fn-text-quaternary: #798c83;
  --fn-text-placeholder: #7e9187;
  --fn-border-primary: #dce6e0;
  --fn-border-secondary: #e8eee9;
  --fn-border-tertiary: #eef3f0;
  --fn-border-input: #c5d5ca;
  --fn-border-input-alt: #dce6e0;
  --fn-border: #dce6e0;
  --fn-border-color: #dce6e0;
  --fn-border-strong: #bacdc0;
  --fn-card-border-normal: #dce6e0;
  --fn-card-shadow-normal: 0 2px 8px rgb(18 51 38 / 3%);
  --fn-card-radius: 14px;
  --fn-header-bg: #ffffff;
  --fn-shadow-sm: 0 2px 6px rgb(18 51 38 / 4%);
  --fn-shadow-md: 0 6px 18px rgb(18 51 38 / 6%);
  --fn-shadow-lg: 0 12px 32px rgb(18 51 38 / 9%);
  --fn-radius-md: 9px;
  --fn-radius-lg: 13px;
  --fn-radius-xl: 18px;
}

html[data-theme="dark"] {
  --zx-ink: #e7f2eb;
  --zx-canvas: #0b1b1b;
  --zx-sidebar: #092421;
  --zx-sidebar-secondary: #102e2b;
  --fn-bg-primary: #102322;
  --fn-bg-secondary: #152d2a;
  --fn-bg-tertiary: #1b3531;
  --fn-bg-elevated: #142a27;
  --fn-bg-layout: #0b1b1b;
  --fn-bg-container: #102322;
  --fn-bg-base: #102322;
  --fn-bg-page: #0b1b1b;
  --fn-bg-code: #102420;
  --fn-bg-toolbar: #102420;
  --fn-bg-toolbar-hover: #203c35;
  --fn-bg-input-label: #152d2a;
  --fn-bg-subtle: #152d2a;
  --fn-bg-secondary-hover: #203c35;
  --fn-bg-secondary-active: #284a40;
  --fn-bg-glass: rgb(16 35 34 / 92%);
  --fn-surface: #142a27;
  --fn-surface-sunken: #102322;
  --fn-text-primary: #e7f2eb;
  --fn-text-secondary: #b9cec0;
  --fn-text-tertiary: #91afa0;
  --fn-text-quaternary: #82a392;
  --fn-text-placeholder: #85a393;
  --fn-border-primary: #2c493d;
  --fn-border-secondary: #223e34;
  --fn-border-tertiary: #1d372e;
  --fn-border-input: #426553;
  --fn-border-input-alt: #2c493d;
  --fn-border: #2c493d;
  --fn-border-color: #2c493d;
  --fn-border-strong: #4d705d;
  --fn-card-border-normal: #2c493d;
  --fn-card-shadow-normal: 0 2px 8px rgb(0 0 0 / 12%);
  --fn-header-bg: #102322;
}

/* The teal option is the workstation default. Other palette choices continue
 * to use their original accent tokens, including custom colors. */
html:not([data-palette]):not([data-theme="dark"]),
html[data-palette="teal"]:not([data-theme="dark"]) {
  --fn-color-brand: #0f766e;
  --fn-color-brand-hover: #115e59;
  --fn-color-brand-soft: #115e59;
  --fn-color-brand-bg: #eaf5ef;
  --fn-color-brand-light: #e0f0e7;
  --fn-color-brand-shadow: rgb(15 118 110 / 16%);
  --fn-color-brand-glow: rgb(15 118 110 / 7%);
  --fn-color-on-brand: #ffffff;
  --fn-text-brand: #0f766e;
  --fn-logo-color: #0f766e;
  --fn-border-focus: #0f766e;
  --fn-bg-hover: rgb(15 118 110 / 5%);
  --fn-bg-active: rgb(15 118 110 / 10%);
  --fn-bg-selected: rgb(15 118 110 / 7%);
  --fn-assistant-bubble-bg-gradient: linear-gradient(135deg, #f4f9f6, #ffffff);
  --fn-assistant-bubble-border: rgb(15 118 110 / 13%);
  --fn-assistant-glow-color: 15, 118, 110;
  --fn-shadow-brand: 0 4px 14px rgb(15 118 110 / 16%);
  --fn-shadow-brand-lg: 0 8px 24px rgb(15 118 110 / 20%);
}

html:not([data-palette])[data-theme="dark"],
html[data-palette="teal"][data-theme="dark"] {
  --fn-text-brand: #68d5bc;
  --fn-logo-color: #68d5bc;
  --fn-border-focus: #68d5bc;
  --fn-color-brand-bg: rgb(104 213 188 / 12%);
  --fn-color-brand-light: rgb(104 213 188 / 16%);
  --fn-color-brand-shadow: rgb(15 118 110 / 20%);
  --fn-color-brand-glow: rgb(104 213 188 / 8%);
  --fn-assistant-bubble-bg-gradient: linear-gradient(135deg, #1a3830, #142a27);
  --fn-assistant-bubble-border: rgb(104 213 188 / 16%);
  --fn-assistant-glow-color: 104, 213, 188;
}

body {
  background: var(--zx-canvas);
  color: var(--fn-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Scoped tokens are essential: menus rendered in portals keep the content
 * surface theme, while every control inside the navigation stays legible. */
.zx-sidebar,
.index-module__sidebarWrapper__4lXPW,
.index-module__sidebar__CKXDV {
  --fn-bg-sidebar: var(--zx-sidebar-secondary);
  --fn-sidebar-bg: var(--zx-sidebar);
  --fn-sidebar-border: #284b41;
  --fn-sidebar-item-hover: rgb(213 246 225 / 9%);
  --fn-sidebar-item-active-bg: #2a5548;
  --fn-sidebar-item-active: #2a5548;
  --fn-sidebar-item-active-text: #f1fff5;
  --fn-sidebar-group-text: #9cbeae;
  --fn-text-primary: #edf8f1;
  --fn-text-secondary: #c7ded0;
  --fn-text-tertiary: #aac9b8;
  --fn-text-quaternary: #96b5a4;
  --fn-text-placeholder: #9bbca9;
  --fn-text-brand: #8de0be;
  --fn-color-brand: #8de0be;
  --fn-border-focus: #a8edce;
  --fn-bg-hover: rgb(213 246 225 / 9%);
  --fn-bg-secondary: #21453c;
  --fn-bg-tertiary: #284c40;
  --fn-border-primary: #365c4b;
  --fn-border-secondary: #2b5144;
  --fn-border-input: #4f7863;
  --fn-border-input-alt: #365c4b;
  --fn-bg-elevated: #173a35;
  --fn-bg-input-label: #21453c;
  color: var(--fn-text-primary);
}

.zx-sidebar {
  background: var(--zx-sidebar) !important;
  box-shadow: inset -1px 0 rgb(176 220 195 / 10%);
}

.zx-sidebar > div:first-child {
  border-bottom: 1px solid rgb(176 220 195 / 12%);
}

.zx-sidebar img[src*="wordmark"] {
  filter: none;
}

.zx-sidebar .Sidebar-module__navItemRow__ur8SY {
  border-radius: 10px;
  margin-bottom: 4px;
}

.zx-sidebar .Sidebar-module__navGroupHeader__MGs0j {
  padding-top: 14px;
  padding-bottom: 9px;
}

.zx-sidebar .Sidebar-module__navGroupLabel__y63e1 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
}

.zx-sidebar .Sidebar-module__navGroupChevron__H5aAX {
  opacity: 0.75;
}

.zx-sidebar :is(button, a, input):focus-visible,
.index-module__sidebar__CKXDV :is(button, a, input):focus-visible {
  outline: 2px solid #a8edce;
  outline-offset: -2px;
}

.index-module__sidebarWrapper__4lXPW {
  background: var(--zx-sidebar-secondary);
}

.index-module__sidebar__CKXDV {
  background: var(--zx-sidebar-secondary);
  box-shadow: inset -1px 0 rgb(176 220 195 / 10%);
}

.index-module__sessionSearchInput__nImlW::placeholder {
  color: var(--fn-text-placeholder);
  opacity: 1;
}

.index-module__sidebarResizeHandle__jCfS3:hover::after,
.index-module__sidebarResizeHandle__jCfS3.index-module__sidebarResizeHandleActive__-mUDh::after {
  background: #8de0be;
}

/* Content hierarchy: quiet canvas, crisp working surfaces and fewer shadows. */
.index-module__chatTitleBar__Ygg3u {
  background: var(--fn-bg-elevated);
  border-bottom-color: var(--fn-border-primary);
}

.index-module__welcome__kaS6Y {
  background-image: radial-gradient(ellipse at 50% 20%, rgb(15 118 110 / 6%), transparent 62%);
}

.index-module__welcomeHeading__eG7WC {
  gap: 10px;
}

.index-module__welcomeTitle__kQtU3 {
  font-weight: 650;
  letter-spacing: -0.025em;
}

.index-module__welcomeSubtitle__LncFU {
  line-height: 1.8;
  color: var(--fn-text-secondary);
}

.index-module__welcomeMascot__7azUS {
  width: 150px;
  margin-bottom: -4px;
}

.index-module__quickCard__FxldL {
  border-color: var(--fn-border-primary);
  border-radius: 13px;
  box-shadow: 0 2px 6px rgb(18 51 38 / 2%);
}

.index-module__quickCard__FxldL:hover {
  border-color: var(--fn-color-brand);
  box-shadow: 0 5px 18px rgb(18 51 38 / 7%);
}

.ant-table-wrapper .ant-table-thead > tr > th {
  background: var(--fn-bg-secondary);
  color: var(--fn-text-secondary);
  font-weight: 600;
}

.ant-card {
  border-color: var(--fn-border-primary);
  box-shadow: var(--fn-card-shadow-normal);
}

.ant-input,
.ant-input-affix-wrapper,
.ant-select-selector,
.ant-input-number {
  border-color: var(--fn-border-input);
}

/* Dedicated hooks added only to the login shell; no behavior is altered. */
.zx-auth-page,
.setup-module__wizardShell__Uv7kJ {
  background:
    radial-gradient(ellipse at 16% 8%, rgb(112 184 147 / 17%), transparent 40%),
    radial-gradient(ellipse at 92% 92%, rgb(15 118 110 / 11%), transparent 45%),
    var(--zx-canvas) !important;
}

.zx-auth-card {
  max-width: 404px !important;
  padding: 40px 36px 36px !important;
  border-top: 3px solid #0f766e !important;
  box-shadow: 0 22px 64px rgb(18 51 38 / 10%) !important;
  box-sizing: border-box;
}

.zx-auth-card > img {
  width: 280px !important;
  max-width: 100% !important;
  height: auto !important;
}

.zx-auth-card h2 {
  letter-spacing: 0.02em;
}

.setup-module__wizardCard__rz91H {
  border-top: 3px solid #0f766e;
  box-shadow: 0 22px 64px rgb(18 51 38 / 10%);
}

.setup-module__wizardHeader__lXhwz {
  padding-top: 22px;
  background: var(--fn-bg-elevated);
  border-radius: 14px 14px 0 0;
}

.setup-module__wizardHeaderLogo__dKLn9 {
  max-width: 205px;
  height: 38px;
}

@media (max-width: 767px) {
  .zx-auth-card {
    margin: 0 !important;
    padding: 32px 24px 28px !important;
  }

  .zx-sidebar .Sidebar-module__navItemMain__d0App {
    min-height: 44px;
  }

  .index-module__welcomeMascot__7azUS {
    width: 116px;
  }

  .index-module__welcomeTitle__kQtU3 {
    font-size: 23px;
  }

  .setup-module__wizardHeaderLogo__dKLn9 {
    max-width: min(180px, 44vw);
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zx-sidebar,
  .index-module__sidebar__CKXDV,
  .index-module__welcomeMascot__7azUS,
  .index-module__quickCard__FxldL {
    transition: none !important;
  }
}

/* Long Chinese wordmark keeps its own row; release badge remains visible. */
.zx-sidebar > div:first-child { flex-wrap: wrap; row-gap: 8px !important; }
.zx-sidebar img[src*="wordmark"] { width: 166px !important; max-width: 100% !important; height: auto !important; }

/* Remote phone only: fit the actual stage content box, not an auto-height frame.
 * Keep the canvas element proportional so pointer coordinates remain accurate.
 * The frame consumes 18px; the separate device rail consumes another 52px.
 */
.index-module__stage__9A7fI {
  container-type: size;
}
.index-module__stage__9A7fI .index-module__phoneCluster__XWRL0 {
  --phone-width-cap: 420px;
  min-width: 0;
  min-height: 0;
  max-width: 100cqw;
  max-height: 100cqh;
}
.index-module__stage__9A7fI .index-module__phoneClusterLandscape__RuV6r {
  --phone-width-cap: 780px;
}
.index-module__stage__9A7fI .index-module__phoneCluster__XWRL0 .index-module__canvas__oQwzq {
  width: auto;
  height: auto;
  max-width: min(var(--phone-width-cap), calc(100cqw - 70px));
  max-height: calc(100cqh - 18px);
}
.index-module__stage__9A7fI .index-module__deviceRail__P92tn {
  box-sizing: border-box;
  flex: 0 0 52px;
  min-height: 0;
  max-height: 100cqh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-inline: 0;
}
.index-module__deviceRail__P92tn .index-module__railBtn__T0e8Y {
  flex: 0 0 36px;
}
.index-module__deviceRail__P92tn .index-module__railDivider__6jwGo {
  flex-shrink: 0;
}
