/* ===== Console UX polish v25 ===== */

/* Compact sidebar list — no big blank gaps */
html.cyy-tech .semi-layout-sider,
html.cyy-tech .ant-layout-sider {
  width: 200px !important;
  min-width: 200px !important;
  max-width: 200px !important;
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
}

/* Allow the menu list to scroll (up/down) */
html.cyy-tech .semi-layout-sider .semi-layout-sider-children,
html.cyy-tech .ant-layout-sider .ant-layout-sider-children,
html.cyy-tech .semi-layout-sider .semi-navigation,
html.cyy-tech .ant-layout-sider .ant-menu {
  height: 100% !important;
  max-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

html.cyy-tech .semi-layout-sider .semi-navigation,
html.cyy-tech .semi-layout-sider .semi-navigation-list,
html.cyy-tech .semi-layout-sider .semi-navigation > ul,
html.cyy-tech .ant-layout-sider .ant-menu {
  padding: 4px 0 16px !important;
  margin: 0 !important;
  gap: 0 !important;
  row-gap: 0 !important;
}

html.cyy-tech .semi-navigation-item,
html.cyy-tech .ant-menu-item,
html.cyy-tech .semi-navigation-sub-title,
html.cyy-tech .semi-navigation-item-text {
  font-size: 13.5px !important;
}

html.cyy-tech .semi-layout-sider .semi-navigation-item,
html.cyy-tech .semi-layout-sider .ant-menu-item {
  height: 34px !important;
  min-height: 34px !important;
  line-height: 34px !important;
  margin: 0 6px 1px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  gap: 8px !important;
  max-height: none !important;
}

/* Submenu wrappers must not be height-locked */
html.cyy-tech .semi-layout-sider .semi-navigation-sub {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Section titles: tight, no forced item height */
html.cyy-tech .semi-layout-sider .semi-navigation-sub-title,
html.cyy-tech .semi-layout-sider .ant-menu-item-group-title,
html.cyy-tech .semi-layout-sider .semi-navigation-item-group-title {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  line-height: 1.25 !important;
  padding: 8px 14px 2px !important;
  margin: 2px 0 0 !important;
  font-size: 11px !important;
  letter-spacing: 0.06em;
  color: var(--cyy-muted) !important;
}

/* Nested lists: keep natural height so open menus & scrolling work */
html.cyy-tech .semi-layout-sider .semi-navigation-item-list,
html.cyy-tech .semi-layout-sider .semi-collapsible,
html.cyy-tech .semi-layout-sider .semi-collapsible-wrapper {
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Empty / spacer rows */
html.cyy-tech .semi-layout-sider .semi-navigation-item:empty,
html.cyy-tech .semi-layout-sider .semi-navigation-divider {
  margin: 2px 10px !important;
  padding: 0 !important;
  min-height: 0 !important;
  height: 1px !important;
  opacity: 0.35;
}

/* Main console content can also scroll freely */
html.cyy-tech.cyy-console .semi-layout-content,
html.cyy-tech.cyy-console .ant-layout-content,
html.cyy-tech.cyy-console main {
  overflow-x: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

html.cyy-tech .semi-icon,
html.cyy-tech .anticon {
  font-size: 16px !important;
}

/* Custom nav icons */
.cyy-nav-ico {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cyy-nav-ico svg {
  width: 18px;
  height: 18px;
  display: block;
}
.semi-navigation-item-selected .cyy-nav-ico svg,
.ant-menu-item-selected .cyy-nav-ico svg {
  stroke: #0e7490;
}

/* Header brand: clean logo + text (like ref image 3), NO blue pill box */
.cyy-brand-link {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  text-decoration: none !important;
  color: var(--cyy-text) !important;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}
.cyy-brand-link img {
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  object-fit: cover !important;
  background: transparent !important;
  box-shadow: none !important;
}
.cyy-brand-link span { color: var(--cyy-text) !important; }

/* Hide leftover nested logo frames / blue pill / duplicate marks in header */
html.cyy-tech header .cyy-brand-pill,
html.cyy-tech .cyy-brand-pill { display: none !important; }

/* Kill nested logo box (blue outer + white inner frame) from stock New API header */
html.cyy-tech header .semi-navigation-header > a:not(.cyy-brand-link),
html.cyy-tech header .semi-navigation-header > img,
html.cyy-tech header .semi-navigation-header > div:not(.cyy-page-title):has(> img:only-child) {
  display: none !important;
}

html.cyy-tech.cyy-console header .semi-navigation-horizontal > .semi-navigation-list,
html.cyy-tech.cyy-console header .semi-navigation-horizontal > ul,
html.cyy-tech.cyy-console header nav.cyy-top-nav-links,
html.cyy-tech.cyy-console .cyy-hide-on-console {
  display: none !important;
}

/* Console header: brand + page title left, utilities right — no top site nav */
html.cyy-tech.cyy-console .semi-layout-header,
html.cyy-tech.cyy-console header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
html.cyy-tech.cyy-console .cyy-page-title {
  border-left: none;
  margin-left: 10px;
  padding-left: 0;
}

/* Fill the whole header bar: brand left, account/actions far right */
html.cyy-tech .semi-layout-header,
html.cyy-tech header.semi-layout-header,
html.cyy-tech .ant-layout-header {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
}

html.cyy-tech .semi-layout-header > *,
html.cyy-tech header.semi-layout-header > *,
html.cyy-tech .semi-layout-header .semi-navigation,
html.cyy-tech .semi-layout-header .semi-navigation-horizontal,
html.cyy-tech .semi-layout-header > div {
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
}

html.cyy-tech .semi-navigation-header,
html.cyy-tech .cyy-brand-host,
html.cyy-tech .cyy-brand-link {
  flex: 0 0 auto !important;
  margin-right: 0 !important;
}

/* Push notice / theme / lang / user to the far right */
html.cyy-tech .cyy-top-actions,
html.cyy-tech .semi-layout-header .semi-navigation-footer,
html.cyy-tech .semi-layout-header > .semi-space,
html.cyy-tech .semi-navigation-horizontal > .semi-space,
html.cyy-tech .semi-layout-header .semi-space:last-of-type {
  margin-left: auto !important;
  margin-right: 0 !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Console sidebar site links at top: 首页/控制台/模型广场/文档/关于 */
.cyy-sider-extra--top {
  margin: 4px 0 8px !important;
  padding: 0 0 8px !important;
  border-top: none !important;
  border-bottom: 1px solid rgba(7, 17, 31, 0.08);
}
.cyy-sider-extra-sep {
  height: 0;
  margin: 0;
}
.cyy-sider-home,
.cyy-sider-link {
  display: flex !important;
  align-items: center;
  gap: 8px;
  height: 34px;
  margin: 1px 6px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  color: var(--cyy-text) !important;
  text-decoration: none !important;
  font-size: 13.5px;
  font-weight: 600;
}
.cyy-sider-home:hover,
.cyy-sider-link:hover {
  background: rgba(8, 145, 178, 0.1);
  color: #0e7490 !important;
}
.cyy-sider-link.is-active {
  background: rgba(8, 145, 178, 0.14) !important;
  color: #0e7490 !important;
  box-shadow: inset 3px 0 0 var(--cyy-accent, #0891b2);
}
.cyy-sider-home .cyy-nav-ico,
.cyy-sider-link .cyy-nav-ico {
  display: inline-flex !important;
}

.cyy-sider-extra {
  margin: 10px 8px 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(7, 17, 31, 0.08);
}
.cyy-sider-extra-title {
  padding: 4px 10px 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--cyy-muted);
  text-transform: uppercase;
}
.cyy-sider-extra a {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin: 1px 0;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--cyy-text) !important;
  text-decoration: none !important;
  font-size: 13.5px;
}
.cyy-sider-extra a:hover {
  background: rgba(8, 145, 178, 0.1);
  color: #0e7490 !important;
}

.cyy-page-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid rgba(7, 17, 31, 0.12);
  color: var(--cyy-text);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.cyy-page-title svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

html.cyy-tech .semi-layout-header,
html.cyy-tech header {
  background: var(--cyy-page-bg, #eef3f8) !important;
  min-height: 56px !important;
  border-bottom: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Kill white strips / tinted layers inside the header */
html.cyy-tech .semi-layout-header,
html.cyy-tech .semi-layout-header .semi-navigation,
html.cyy-tech .semi-layout-header .semi-navigation-horizontal,
html.cyy-tech .semi-layout-header .semi-navigation-header,
html.cyy-tech .semi-layout-header .semi-navigation-list,
html.cyy-tech .semi-layout-header .semi-navigation-footer,
html.cyy-tech .semi-layout-header .semi-space,
html.cyy-tech .semi-layout-header > div,
html.cyy-tech .semi-layout-header nav,
html.cyy-tech .semi-layout-header .cyy-top-actions {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

/* Header icon buttons: no gray discs that look like color bands */
html.cyy-tech .semi-layout-header .semi-button,
html.cyy-tech .semi-layout-header button.semi-button,
html.cyy-tech .semi-layout-header .semi-button-tertiary,
html.cyy-tech .semi-layout-header .semi-button-borderless {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

/* Non-console top header: brand | nav centered | actions */
html.cyy-tech:not(.cyy-console) .semi-layout-header,
html.cyy-tech:not(.cyy-console) header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}
html.cyy-tech:not(.cyy-console) .semi-navigation-list,
html.cyy-tech:not(.cyy-console) header .semi-navigation-list {
  flex: 1 1 auto !important;
  display: flex !important;
  justify-content: center !important;
  gap: clamp(12px, 2vw, 28px) !important;
}

/* One flat page color — no stacked washes */
html.cyy-tech,
html.cyy-tech body,
html.cyy-tech #root,
html.cyy-tech .semi-layout,
html.cyy-tech .ant-layout,
html.cyy-tech .semi-layout-content,
html.cyy-tech .ant-layout-content,
html.cyy-tech main,
html.cyy-tech .semi-layout-content > div {
  background: var(--cyy-page-bg, #eef3f8) !important;
}

html.cyy-tech body::before,
html.cyy-tech body::after {
  display: none !important;
  content: none !important;
}

/* Homepage: inherit the same flat page color */
html.cyy-tech .na-home {
  margin-top: 0 !important;
  background: transparent !important;
  isolation: auto !important;
}
html.cyy-tech .na-home::before,
html.cyy-tech .na-home::after {
  display: none !important;
  content: none !important;
  background: none !important;
}

/* Dashboard cards denser */
html.cyy-tech.cyy-console .semi-card-body,
html.cyy-tech.cyy-console .ant-card-body {
  padding: 14px 16px !important;
}

html.cyy-tech.cyy-console .semi-card,
html.cyy-tech.cyy-console .ant-card {
  margin-bottom: 12px !important;
}

/* Homepage logo: static (no spin / orbit) */
html.cyy-tech .na-logo-card,
html.cyy-tech [data-cyy-spin] {
  animation: none !important;
  transform: rotateY(0deg) !important;
}
html.cyy-tech .na-globe__ring,
html.cyy-tech .na-globe__ring2 {
  animation: none !important;
}

/* Unique dash / notice circle icons */
.cyy-dash-ico {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 36px !important;
  color: #fff !important;
}
.cyy-dash-ico svg {
  width: 18px !important;
  height: 18px !important;
  display: block;
  stroke: #fff !important;
}
.cyy-dash-ico--0 { background: #0ea5e9 !important; }
.cyy-dash-ico--1 { background: #6366f1 !important; }
.cyy-dash-ico--2 { background: #10b981 !important; }
.cyy-dash-ico--3 { background: #06b6d4 !important; }
.cyy-dash-ico--4 { background: #f59e0b !important; }

.cyy-empty-art {
  width: min(220px, 70vw);
  max-width: 100%;
  margin: 8px auto 4px;
  opacity: 0.98;
  pointer-events: none;
  position: static !important;
  inset: auto !important;
  transform: none !important;
  float: none !important;
  z-index: auto !important;
}
.cyy-empty-art svg {
  width: 100%;
  height: auto;
  display: block;
  position: static !important;
}

/* Hide ONLY stock art inside Semi/Ant empty-image slots — no absolute positioning */
html.cyy-tech .semi-empty-image > img,
html.cyy-tech .semi-empty-image > svg,
html.cyy-tech .semi-empty-image > canvas,
html.cyy-tech .semi-empty-image > object,
html.cyy-tech .ant-empty-image > img,
html.cyy-tech .ant-empty-image > svg {
  display: none !important;
  visibility: hidden !important;
}
html.cyy-tech .semi-empty-image,
html.cyy-tech .ant-empty-image {
  min-height: 140px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
html.cyy-tech .semi-empty-image > .cyy-empty-art,
html.cyy-tech .ant-empty-image > .cyy-empty-art {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
}

/* Sidebar: only keep our custom left icon — hide stock icons before the label */
html.cyy-tech .semi-layout-sider .semi-navigation-item .semi-icon,
html.cyy-tech .semi-layout-sider .semi-navigation-item .anticon,
html.cyy-tech .semi-layout-sider .semi-navigation-item > svg {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
/* Keep expand/collapse chevron that sits after the label text */
html.cyy-tech .semi-layout-sider .semi-navigation-item .semi-navigation-item-text ~ .semi-icon,
html.cyy-tech .semi-layout-sider .semi-navigation-item .semi-navigation-item-text ~ .anticon,
html.cyy-tech .semi-layout-sider .semi-navigation-item .semi-navigation-item-text ~ .semi-navigation-item-icon,
html.cyy-tech .semi-layout-sider .semi-navigation-item .semi-navigation-item-text ~ svg {
  display: inline-flex !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
}
html.cyy-tech .semi-layout-sider .cyy-nav-ico {
  display: inline-flex !important;
  width: 18px !important;
  height: 18px !important;
  margin-right: 2px !important;
  flex: 0 0 18px !important;
}
html.cyy-tech .semi-layout-sider .cyy-nav-ico svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
}
