/* * {
  box-sizing: border-box;
} */

html {
  height: 100%;
  width: 100%;
  padding: 0px;
  margin: 0px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}
body {
  height: 100%;
  width: 100%;
  padding: 0px;
  margin: 0px;
}

header {
  box-sizing: border-box;
  display: block;
  height: 30px;
  border-bottom: #81c5ba solid 1px;
  font-size: 16px;
  width: 100%;
  padding: 5px;
}

header nav {
  display: inline-block;
  margin: auto;
}

header nav a {
  display: inline-block;
  margin: 0px 5px;
}

header right {
  display: block;
  float: right;
}

/* tab栏切换容器 */

right {
  display: block;
  float: right;
}

right a {
  padding-left: 5px;
  padding-right: 5px;
}

.click {
  cursor: pointer;
}
.click:hover {
  color: blue;
  text-decoration: underline;
}

tab {
  padding-top: 10px;
  margin-bottom: 5px;
  border-bottom: 1px solid #81c5ba;
  display: block;
  padding-left: 40px;
}

/* tab切换按钮 */
tab a,
tab-nav {
  height: 21px;
  /* width: 85px; */
  line-height: 21px;
  /* text-align: center; */
  font-size: 14px;
  border: 1px solid #ccc;
  border-bottom: 0px solid #81c5ba;
  border-radius: 6px 6px 0px 0px;
  padding: 3px 15px 0px 15px;
  margin: 0px 1px 0px 0px;
  display: inline-block;
}

tab a.active,
tab-nav.active {
  background-color: #81c5ba;
  color: #fff;
  border: 1px solid #81c5ba;
}

/**/

aside {
  position: sticky;
  width: 200px;
  left: 0;
  top: 0;
  float: left;
  clear: both;
}

aside menu a {
  display: block;
}

main {
  margin-left: 210px;
  display: block;
  width: calc(100% - 210px);
  /* position: fixed; */
}

/* 弹出窗体 */

popheader {
  display: block;
  background-color: #81c5ba;
  color: #fff;
  padding: 3px 10px;
  position: relative;
  /* height: 30px; */
  /* line-height: 30px; */
  /* vertical-align: middle; */
  font-size: 14px;
  font-weight: bold;
}

dialog {
  box-shadow: 1px 1px 5px 5px rgba(0, 0, 0, 0.1);
}

popdialog {
  display: block;
  position: absolute;
  border-radius: 4px;
  background: #fff;
  box-shadow: 1px 1px 5px 5px rgba(0, 0, 0, 0.1);
  max-height: calc(100% - 10px);
  max-width: calc(100% - 10px);
  overflow: hidden;
}

closeicon {
  position: absolute;
  right: 10px;
  top: 0;
  cursor: pointer;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  filter: alpha(opacity=50);
  opacity: 0.5;
}

popmask {
  display: grid;
  place-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

popbody {
  display: block;
  padding: 5px 10px;
  position: relative;
  height: calc(100% - 30px);
}

/* popbody div {
  margin: 15px 0;
} */

/* popbody label {
    display: inline-block;
    width: 100px;
    text-align: right;
} */

/* popbody span {
  display: none;
  color: red;
  font-size: 12px;
  margin-left: 15px;
} */

th {
  border-bottom: solid 1px;
}

lazyload > tr:hover,
lazyload > tr:nth-child(odd):hover,
tbody > tr:nth-child(odd):hover,
tbody > tr:hover {
  background-color: #ccc;
}

lazyload > tr:nth-child(even),
tbody > tr:nth-child(even) {
  background-color: antiquewhite;
  /* background-color: #f0f0f0; */
  /* background-color: beige; */
}

tbody a {
  display: inline-block;
}

label {
  box-sizing: border-box;
  display: inline-block;
  width: 90px;
  color: #81c5ba;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

button {
  height: 26px;
  border: solid 1px #81c5ba;
  border-radius: 13px;
  margin: 3px;
  outline: none;
  padding: 0px 13px 0px 13px;
  vertical-align: middle;
  white-space: nowrap;
}

button:hover {
  background-color: #81c5ba;
  color: #fff;
}

block {
  display: block;
}

formview {
  display: block;
}

f1,
f2,
f3 {
  box-sizing: border-box;
  display: inline-block;
  padding: 0px 3px;
  height: 22px;
}

f1 {
  width: 280px;
}

f2 {
  width: 560px;
}

f3 {
  width: 840px;
}

field {
  display: inline-block;
  width: calc(280px * var(--colspan));
}

f1 > input,
f2 > input,
f3 > input,
field > input {
  width: calc(100% - 96px);
  border: none;
  border-bottom: solid 1px #ccc;
  outline: none;
  margin: 0px;
}

f1 > select,
f2 > select,
f3 > select,
field > select {
  width: calc(100% - 90px);
}

fieldset {
  box-sizing: border-box;
  border: solid 1px #ccc;
  border-radius: 5px;
  margin-bottom: 3px;
  max-width: 100%;
  overflow: auto;
}

td {
  padding: 4px 5px;
}

input:not([type="checkbox"]),
select,
textarea {
  border: #ccc 1px solid;
  font-family: Consolas, "Courier New", monospace;
}

td > input:not([type="checkbox"]),
td > select {
  width: calc(100% - 8px);
}
td > textarea {
  width: calc(100% - 4px);
}

td button {
  height: 16px;
  border: solid 1px #81c5ba;
  font-size: 12px;
  border-radius: 8px;
  margin: 0px;
  outline: none;
  padding: 0px 11px 0px 11px;
  vertical-align: middle;
}

td.right {
  text-align: right;
}

.footer {
  position: fixed;
  /* border-top: solid 1px; */
  bottom: 0px;
  /* width: calc(100% - 30px); */
}

textarea {
  width: calc(100% - 8px);
}

a {
  cursor: pointer;
}

tag {
  display: inline-block;
  font-size: 12px;
  border: orange solid 1px;
  border-radius: 5px;
  padding: 3px;
  margin: 0px 2px;
  background-color: white;
  color: black;
}

lazyloadlist,
gridview {
  /* position: relative; */
  display: block;
  /* overflow: scroll; */
  overflow: auto;
  width: 100%;
}

lazyloadlist {
  position: fixed;
}

/* gridview td {
  white-space: pre-line;
} */

lazyloadlist.excel,
gridview.excel {
  box-sizing: border-box;
  display: block;
  width: 100%;
  font-size: 12px;
}

lazyloadlist table,
gridview.excel table {
  table-layout: fixed;
  width: max-content;
  border-spacing: 0px;
}

lazyloadlist thead,
gridview.excel thead {
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 2;
}

/* gridview.excel td:hover {
  border: solid 1px red;
} */

lazyloadlist.excel th,
lazyloadlist.excel td,
gridview.excel th,
gridview.excel td {
  margin: 1px;
  padding: 4px;
  /* border: solid 1px #ccc;
  border-collapse: collapse; */
}

lazyloadlist.excel th.fixed,
lazyloadlist.excel td.fixed,
gridview.excel th.fixed,
gridview.excel td.fixed,
gridview.excel col.fixed {
  position: sticky;
  left: 0;
  background-color: #fff;
  opacity: 0.9;
  z-index: 1;
}

/* gridview.excel th.fixed:hover,
gridview.excel td.fixed:hover {
  background-color: #ccc;
} */
lazyloadlist.excel th.fixright,
lazyloadlist.excel td.fixright,
gridview.excel th.fixright,
gridview.excel td.fixright {
  position: sticky;
  right: 0;
  background-color: #fff;
  z-index: 1;
}

lazyloadlist.excel input,
gridview.excel input {
  /* border: none; */
  border: 1px solid #ccc;
  background-color: transparent;
}

lazyloadlist.excel input:hover,
gridview.excel input:hover {
  background-color: white;
}

lazyloadlist.excel td.warning,
gridview.excel td.warning {
  background-color: red;
  color: white;
}

lazyloadlist.excel td.updated,
gridview.excel td.updated {
  background-color: yellow;
  /* color: white; */
}
td.editable:hover {
  background-color: white;
  /* border: solid 1px gainsboro; */
}

td.editable span {
  display: block;
  width: 100%;
  min-height: 16px;
}

gridview tr.unmatched {
  background-color: yellow;
}

gridview tr.unmatched:nth-child(odd) {
  background-color: yellowgreen;
}
gridview tr.unmatched:hover {
  background-color: #ccc;
}

lazyloadlist td,
lazyloadlist th,
gridview td,
gridview th {
  word-break: break-word;
  white-space: pre-wrap;
}
lazyloadlist.excel th,
gridview.excel th {
  position: sticky;
  top: 0;
}

lazyloadlist tfoot,
gridview tfoot {
  position: sticky;
  background-color: white;
  bottom: 0;
  z-index: 2;
}

lazyloadlist tfoot tr:first-child td,
gridview tfoot tr:first-child td {
  border-top: black 1px solid;
}

worksheet textarea {
  height: 17px;
  padding: 1px;
  resize: none;
}

input:invalid {
  border-color: red;
}

underline {
  display: block;
  width: calc(100% - 4px);
  margin: auto;
  min-height: 15px;
  border-bottom: #ccc 1px solid;
}

table lazyload {
  display: table-row-group;
}
table lazyloadtriger {
  display: table-row;
}

table lazyloadtriger > message {
  display: table-cell;
  position: absolute;
}

menu {
  padding-inline-start: 10px;
}

menu li:hover {
  background-color: antiquewhite;
}

menu li.active {
  background-color: #ccc;
}

tr.sum td {
  border-top: #ccc 1px solid;
  background-color: white;
}

tr.category td {
  border-top: #ccc 1px solid;
  background-color: white;
}

warning {
  display: block;
  color: red;
}

breadcrumb {
  display: block;
  /* margin-bottom: 10px; */
  margin: 5px;
}

breadcrumb a {
  margin-right: 5px;
  position: relative;
  text-decoration: none;
}
breadcrumb a::before {
  content: ">";
  margin-right: 3px;
  color: #888;
  text-decoration: none;
  /* 固定颜色，不要下划线 */
}

wizard {
  display: block;
  width: 100%;
  height: calc(100% - 26px);
  box-sizing: border-box;
  padding: 10px;
}

wizard steps {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  width: 100%;
  box-sizing: border-box;
}

wizard step {
  display: inline-block;
  position: relative;
  padding: 10px 20px;
  background: #f5f5f5;
  border-radius: 4px;
  min-width: 150px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

wizard step.clickable {
  cursor: pointer;
}

wizard step.clickable:hover {
  background: #e0e0e0;
}

wizard step.active {
  background: #81c5ba;
  color: white;
}

wizard step.active h4,
wizard step.active p {
  color: white;
}

wizard step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -15px;
  top: 50%;
  transform: translateY(-50%);
  color: #81c5ba;
  font-size: 20px;
  font-weight: bold;
}

wizard step h4 {
  margin: 0;
  color: #333;
}

wizard step p {
  margin: 5px 0 0;
  font-size: 12px;
  color: #666;
}

wizard content {
  display: block;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 4px;
  margin: 20px 0;
  min-height: 200px;
  width: 100%;
  height: calc(100% - 160px);
  box-sizing: border-box;
}

wizard pager {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 0;
  width: 100%;
  box-sizing: border-box;
}

wizard pager button {
  min-width: 80px;
  margin: 0;
  box-sizing: border-box;
}

wizard pager button.primary {
  background-color: #81c5ba;
  color: white;
}

wizard pager button.primary:hover {
  background-color: #6ba89e;
}

wizard pager button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

wizard pager button:disabled:hover {
  background-color: white;
  color: inherit;
}

/* JSON Schema 编辑器样式 */
jsonschema {
  display: block;
  padding: 10px;
}

json_object {
  display: block;
  margin: 5px 0;
  padding: 5px;
  border: 1px solid #eee;
  border-radius: 4px;
}

/* 普通的 json_property（非表格内） */
json_property {
  display: block;
  margin: 1px 0;
  padding: 1px 2px;
}

/* 普通的 json_property 内的输入控件 */
json_property:not(json_array_item > json_property)
  > input:not([type="checkbox"]),
json_property:not(json_array_item > json_property) > select,
json_property:not(json_array_item > json_property) > textarea {
  width: calc(100% - 422px);
  padding: 4px;
  border-radius: 3px;
}

json_property > textarea {
  vertical-align: top;
  min-height: 60px;
  resize: vertical;
}

/* 表格内的 json_property */
json_array_item > json_property {
  display: table-cell;
  padding: 0; /* 移除内边距，让输入控件填充整个单元格 */
  border: 1px solid #ddd;
  vertical-align: middle;
  height: 28px; /* 设置固定高度 */
}

/* 表格内的输入控件 */
json_array_item > json_property > input:not([type="checkbox"]),
json_array_item > json_property > select,
json_array_item > json_property > textarea {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  outline: none;
  padding: 2px;
  margin: 0;
}

property_label {
  display: inline-block;
  width: 400px;
  color: #333;
  margin-right: 10px;
  vertical-align: top;
}

.property-name {
  color: #666;
  font-size: 0.9em;
  font-style: italic;
}

json_array {
  display: table;
  max-width: 100%;
  border-collapse: collapse;
  border-left: 2px solid #81c5ba;
  padding-left: 10px;
  margin: 5px 0;
}

/* 表头行 */
json_array > json_array_header {
  display: table-header-group;
  background: #f5f5f5;
}

/* 表头单元格样式 */
json_array > json_array_header > property_label {
  display: table-cell;
  padding: 6px;
  font-weight: bold;
  text-align: left;
  border: 1px solid #ddd;
  width: auto;
  box-sizing: border-box;
  white-space: nowrap;
  cursor: help; /* 显示帮助光标 */
}

/* 设置第一列宽度较小 */
json_array > json_array_header > property_label:first-child,
json_array_item > json_property:first-child {
  width: 120px;
}

/* 设置最后一列宽度较小（仅在编辑模式下） */
jsonschema[data-mode="edit"]
  json_array
  > json_array_header
  > property_label.delete-column,
jsonschema[data-mode="edit"] json_array_item > json_property.delete-column {
  width: 30px;
}

/* 删除按钮列样式 */
.delete-column {
  padding: 0 !important;
  text-align: center;
  border-left: 2px solid #ddd !important;
}

/* 只读模式下最后一列自适应宽度 */
jsonschema[data-mode="read"]
  json_array
  > json_array_header
  > property_label:last-child,
jsonschema[data-mode="read"] json_array_item > json_property:last-child {
  width: auto;
}

/* 中间列自适应 */
json_array
  > json_array_header
  > property_label:not(:first-child):not(.delete-column),
json_array_item > json_property:not(:first-child):not(.delete-column) {
  width: auto;
}

/* textarea 列的特殊处理 */
json_array_item > json_property > textarea {
  width: 100%; /* 默认填充整个单元格 */
  min-width: 200px;
  box-sizing: border-box;
  resize: both;
  overflow: auto;
}

/* 支持自定义宽度的单元格 */
json_array_item > json_property[data-width] {
  box-sizing: border-box;
}

/* 隐藏数组项内的标签 */
json_array_item property_label {
  display: none;
}

/* 添加按钮 */
json_array + button {
  margin-top: 5px;
}

/* 标题和描述样式 */
json_object > h2 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.2em;
}

json_object > .description {
  color: #666;
  margin-bottom: 15px;
  font-size: 0.9em;
}

/* 数据行容器 */
json_array > json_array_body {
  display: table-row-group;
}

/* 数据行 */
json_array_item {
  display: table-row;
}

/* 删除按钮样式 */
.delete-item {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  background: transparent;
  color: #ff4444;
  border: none;
  cursor: pointer;
  font-size: 12px;
}

.delete-item:hover {
  color: #ff6666;
  background: rgba(255, 68, 68, 0.1);
}

/* 只读模式的值显示样式 */
.readonly-value {
  display: inline-block;
  padding: 4px 6px;
  color: #666;
}

/* 只读模式隐藏编辑相关元素 */
jsonschema[data-mode="read"] .delete-item,
jsonschema[data-mode="read"] button,
jsonschema[data-mode="read"] input,
jsonschema[data-mode="read"] select,
jsonschema[data-mode="read"] textarea {
  display: none;
}

/* 只读模式下的数组表格样式 */
jsonschema[data-mode="read"] json_array_item > json_property {
  padding: 4px 6px;
}

stickybottom {
  display: block;
  position: sticky;
  bottom: 0;
  background-color: white;
  /* opacity: 0.5; */
  width: 100%;
  border-top: 1px solid #ccc;
}

scrollbox {
  display: block;
  overflow: auto;
}
