
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f6f8fb;
  color: #1f2328;
  --treeselectjs-border-color: #d0d7de;
  --treeselectjs-border-focus: #0969da;
  --treeselectjs-bg: #ffffff;
  --treeselectjs-tag-bg: #eef5ff;
  --treeselectjs-tag-bg-hover: #e2eeff;
  --treeselectjs-item-focus-bg: #f5f9ff;
  --treeselectjs-item-selected-bg: #eef5ff;
  --treeselectjs-checkbox-checked-bg: #0969da;
}
.wrap { max-width: 1680px; margin: 28px auto; padding: 0 16px; }
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px 24px;
  margin-bottom: 12px;
}
.topbar > div:first-child { min-width: 0; }
h1 { margin: 0 0 8px; font-size: 30px; }
.sub { color: #57606a; margin-bottom: 18px; line-height: 1.75; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #d8dee4;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 6px 18px rgba(15,23,42,.04);
  justify-self: end;
  align-self: start;
  flex-shrink: 0;
}
.lang-switch label {
  font-size: 13px;
  color: #57606a;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.2;
}
.lang-switch select { min-width: 140px; padding: 8px 10px; border-radius: 10px; }

.panel {
  background: #fff;
  border: 1px solid #d8dee4;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 26px rgba(15,23,42,.05);
  margin-bottom: 16px;
}
.filter-shell {
  position: relative;
  min-height: 540px;
  border-radius: 16px;
  overflow: visible;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  z-index: 1;
}

.filter-shell.panel-open {
  overflow: hidden;
}
.filter-view {
  position: absolute;
  inset: 0;
  padding: 20px 22px;
  transition: transform .28s ease, opacity .2s ease;
  background: #f8fafc;
}
.filter-main { transform: translateX(0); opacity: 1; z-index: 1; }
.filter-panel {
  transform: none;
  opacity: 1;
  z-index: 2;
  background: #f8fafc;
  display: none;
  flex-direction: column;
}
.filter-shell.panel-open .filter-main {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}


.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 3.4fr) minmax(300px, 1.1fr);
  gap: 18px;
  align-items: start;
}
.main-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.main-right { min-width: 0; }
.entry-rail {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.entry-wrap { padding: 12px 0; }
.entry-wrap + .entry-wrap { border-top: 1px solid #edf1f5; }
.field label, .entry-wrap label {
  display: block;
  font-size: 13px;
  color: #57606a;
  margin-bottom: 7px;
  font-weight: 600;
}
.base-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.section-subtitle {
  font-size: 13px;
  color: #57606a;
  font-weight: 700;
  padding-top: 2px;
}
.dimension-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
select, .entry-card {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  background: #fff;
}
select { padding: 10px 12px; outline: none; }
.entry-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(180deg,#fff 0%,#f8fbff 100%);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.entry-card:hover { border-color: #b9c6d8; box-shadow: 0 0 0 3px rgba(9,105,218,.06); }
.entry-title { font-size: 14px; font-weight: 600; color: #1f2328; }
.entry-meta { font-size: 12px; color: #57606a; white-space: nowrap; }
.main-foot-note { color: #6b7280; font-size: 13px; }

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
  flex: 0 0 auto;
}
.panel-head h3 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.panel-head p { margin: 0; font-size: 13px; color: #6b7280; line-height: 1.55; }
.panel-close {
  border: none;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0 2px;
  flex: 0 0 auto;
}
.panel-scroll { overflow: auto; flex: 1 1 auto; padding-top: 14px; }
.panel-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f4f7fb;
  color: #57606a;
  font-size: 12px;
  border: 1px solid #e5e7eb;
}
.role-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.panel-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.panel-grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.span-3 { grid-column: span 3; }
.panel-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(15,23,42,.03);
  min-height: 100%;
}
.panel-card h4 { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.panel-card p { margin: 0 0 10px; font-size: 12px; color: #6b7280; line-height: 1.5; }

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: #1f2328;
  user-select: none;
}
.check-label input[type="checkbox"] { width: 16px; height: 16px; margin: 0; }
.check-label:hover { border-color: #b9c6d8; box-shadow: 0 0 0 3px rgba(9,105,218,.06); }
.compact-bool-field { margin-top: 12px; }
.compact-bool-field > label:not(.check-label) { display: none !important; }

.meta { display: flex; justify-content: space-between; align-items: center; color: #57606a; font-size: 14px; margin-bottom: 10px; gap: 12px; flex-wrap: wrap; }
.hint { color: #57606a; font-size: 12px; }
table { width: 100%; border-collapse: collapse; background: #fff; overflow: hidden; border-radius: 12px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid #eaeef2; vertical-align: top; font-size: 14px; line-height: 1.6; }
th { background: #f6f8fa; font-weight: 700; white-space: nowrap; }
.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5ff;
  color: #0969da;
  font-size: 12px;
  margin-right: 6px;
  margin-bottom: 6px;
  border: 1px solid #dbe9ff;
}
.model-link { color: #0969da; text-decoration: none; font-weight: 700; }
.model-link:hover { text-decoration: underline; }
.note { color: #57606a; font-size: 13px; line-height: 1.7; }
.ts-wrapper.multi .ts-control > div {
  background: #eef5ff;
  color: #0969da;
  border: 1px solid #dbe9ff;
  border-radius: 999px;
  padding: 4px 8px;
}
.clickable-row { cursor: pointer; transition: background-color .15s ease; }
.clickable-row:hover { background: #f9fbff; }
.expand-cell { padding: 0 !important; background: #fcfcfd; }
.expand-wrap { padding: 18px; border-top: 1px dashed #d8dee4; background: #fafbfc; }
.expand-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.mini-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  min-height: 100%;
  box-shadow: 0 4px 12px rgba(15,23,42,.03);
}
.mini-title { font-size: 13px; color: #57606a; margin-bottom: 8px; font-weight: 700; }
.summary-line { color: #24292f; margin-bottom: 8px; font-size: 14px; }

@media (max-width: 1500px) {
  .main-layout { grid-template-columns: minmax(0, 2.5fr) minmax(260px, 1fr); }
  .base-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dimension-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panel-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .expand-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .main-layout { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr; }
  .lang-switch { justify-self: start; }
}
@media (max-width: 820px) {
  .base-grid,
  .dimension-grid,
  .role-grid,
  .panel-grid-4,
  .panel-grid-5,
  .expand-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  table { display: block; overflow-x: auto; }
}


.filter-main,
.main-layout,
.main-left,
.dimension-grid,
.field,
#chargingProtocolTreeContainer {
  overflow: visible;
}

#chargingProtocolTreeContainer {
  position: relative;
  z-index: 40;
}

#chargingProtocolTreeContainer .treeselect {
  position: relative;
  z-index: 40;
}

#chargingProtocolTreeContainer .treeselect-list,
#chargingProtocolTreeContainer .treeselect-input__tags,
#chargingProtocolTreeContainer .treeselect-input__dropdown {
  z-index: 50;
}

.filter-shell.panel-open .filter-main {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}


/* v11: stronger panel hiding fix */



/* v12: strongest panel hide/show fix */
.filter-shell:not(.panel-open) .filter-main {
  display: block;
}

.filter-shell:not(.panel-open) .filter-panel {
  display: none;
  pointer-events: none;
}

.filter-shell.panel-open .filter-main {
  display: none !important;
}

.filter-shell.panel-open .filter-panel {
  display: flex !important;
  pointer-events: auto;
  opacity: 1;
}


/* v3: fix dropdown overlap near right rail / neighboring columns */
.main-layout,
.main-left,
.main-right,
.base-grid,
.dimension-grid,
.role-grid,
.panel-grid-4,
.panel-grid-5 {
  overflow: visible;
}

.main-left,
.main-right {
  position: relative;
}

.main-left {
  z-index: 2;
}

.main-right {
  z-index: 1;
}

.field,
.ts-wrapper,
.treeselect {
  position: relative;
}

.field:focus-within,
.field.open,
.ts-wrapper.focus,
.ts-wrapper.dropdown-active,
.treeselect--open,
.treeselect:focus-within {
  z-index: 120;
}

.ts-dropdown,
.treeselect-list,
.treeselect-input__dropdown {
  z-index: 130 !important;
}
