:root {
  --wy-font-family: "Kaiti SC", "STKaiti", "KaiTi", "楷体", "楷体_GB2312", "STKaiTi", serif;
  --wy-header-height: 56px;
  --wy-breadcrumb-height: 40px;
  --wy-chrome-height: calc(var(--wy-header-height) + var(--wy-breadcrumb-height));
  --wy-body-size: 15px;
  --wy-nav-size: 15px;
  --wy-crumb-size: 14px;
  --wy-title-size: 20px;
}

html,
body,
#app,
.app-shell,
.app-shell *:not(script):not(style):not(code):not(pre),
button,
input,
select,
textarea,
.modal,
.leaflet-container,
.leaflet-container * {
  font-family: var(--wy-font-family);
}

body {
  min-width: 0;
  font-size: var(--wy-body-size);
  line-height: 1.55;
}

.app-shell {
  min-height: 100vh;
}

/* —— 顶栏 —— */
.app-shell .global-header {
  height: var(--wy-header-height);
  min-height: var(--wy-header-height);
  flex-wrap: nowrap;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  background: #1d1d1d;
}

.app-shell .brand {
  min-width: 0;
  gap: 8px;
}

.app-shell .brand strong {
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.app-shell .global-nav,
.app-shell .global-tools {
  height: var(--wy-header-height);
  order: unset;
  width: auto;
}

.app-shell .global-nav {
  flex: 1 1 auto;
  justify-content: flex-start;
  gap: 8px;
  overflow-x: auto;
}

.app-shell .global-nav .nav-item > a,
.app-shell .global-nav a {
  height: 32px;
  min-width: 76px;
  padding: 0 14px;
  font-size: var(--wy-nav-size);
  border-radius: 16px;
}

.app-shell .global-tools {
  gap: 16px;
  flex-shrink: 0;
}

.app-shell .tenant-selector select,
.app-shell .user-button {
  font-size: 14px;
  font-family: inherit;
}

/* —— 面包屑 —— */
.app-shell .breadcrumb {
  height: var(--wy-breadcrumb-height);
  padding: 0 24px;
  gap: 8px;
  font-size: var(--wy-crumb-size);
  background: #fff;
  color: #666;
}

.app-shell .breadcrumb a,
.app-shell .breadcrumb span {
  font-size: inherit;
  line-height: 1;
}

.app-shell .breadcrumb span:last-child {
  color: #333;
}

/* —— 管理区随顶栏/面包屑重算 —— */
.app-shell .workspace {
  min-height: calc(100vh - var(--wy-header-height));
}

.app-shell .management-workspace {
  min-height: calc(100vh - var(--wy-chrome-height));
  height: auto;
}

.app-shell .management-main,
.app-shell .data-panel,
.app-shell .prototype-page {
  min-height: calc(100vh - var(--wy-chrome-height));
}

.app-shell:has(.route-library-workspace) .management-workspace {
  height: calc(100vh - var(--wy-chrome-height));
  min-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
}

.app-shell:has(.route-library-workspace) .management-main {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app-shell:has(.route-library-workspace) .management-main > .route-library-workspace {
  flex: 1;
  min-height: 0;
}

.app-shell .management-sidebar {
  padding-top: 20px;
}

.app-shell .management-sidebar nav a {
  height: 36px;
  font-size: 15px;
}

.app-shell .management-page-heading h1,
.app-shell .prototype-page h1,
.app-shell .route-heading-title h1 {
  font-size: var(--wy-title-size);
  font-weight: 600;
  line-height: 1.35;
}

.app-shell table,
.app-shell th,
.app-shell td,
.app-shell .button,
.app-shell .planner-button,
.app-shell .route-title {
  font-family: inherit;
}

@media (max-width: 1100px) {
  .app-shell .global-header {
    padding: 0 16px;
    gap: 12px;
  }

  .app-shell .global-nav {
    gap: 4px;
  }

  .app-shell .global-nav .nav-item > a,
  .app-shell .global-nav a {
    min-width: 64px;
    padding: 0 10px;
  }

  .app-shell .breadcrumb {
    padding: 0 16px;
  }
}

@media (max-width: 860px) {
  .app-shell .brand strong {
    font-size: 15px;
  }

  .app-shell .global-nav .nav-item > a,
  .app-shell .global-nav a {
    font-size: 14px;
  }
}
