:root {
  --dst-green: #10b981;
  --dst-green-dark: #08a36f;
  --dst-green-soft: #e9fbf5;
  --text: #303133;
  --muted: #8d929b;
  --line: #ebeef5;
  --bg: #f3f3f3;
  --panel: #ffffff;
  --danger: #f56c6c;
  --warning: #e6a23c;
  --blue: #409eff;
  --rail: 90px;
  --topbar: 90px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--rail) 1fr;
}

.rail {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100dvh;
  background: #fff;
  border-right: 1px solid #edf0f2;
}

.brand {
  height: 90px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(180deg, #20c997, #06aa72);
}

.rail-btn {
  width: 90px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 4px solid transparent;
  background: #fff;
}

.rail-btn:hover,
.rail-btn.active {
  background: #f7fffb;
  border-left-color: var(--dst-green);
}

.home-icon {
  width: 28px;
  height: 25px;
  border: 2px solid #606266;
  border-top: 0;
  border-radius: 4px;
  position: relative;
}

.home-icon::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: -11px;
  border-left: 2px solid #606266;
  border-top: 2px solid #606266;
  transform: rotate(45deg);
  background: #fff;
}

.grid-icon,
.grid-icon::before,
.grid-icon::after {
  width: 23px;
  height: 3px;
  display: block;
  background: #303133;
  border-radius: 2px;
}

.grid-icon {
  position: relative;
}

.grid-icon::before,
.grid-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.grid-icon::before {
  top: -9px;
}

.grid-icon::after {
  top: 9px;
}

.workspace {
  min-width: 0;
}

.topbar {
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 34px;
  background: #fff;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.hamburger {
  width: 44px;
  height: 44px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 0;
  background: transparent;
}

.hamburger span {
  width: 28px;
  height: 4px;
  display: block;
  background: #111;
  border-radius: 3px;
}

.top-title {
  display: grid;
  gap: 6px;
}

.top-title strong {
  font-size: 18px;
  font-weight: 600;
}

.top-title span {
  color: var(--muted);
  font-size: 12px;
}

.user {
  margin-left: auto;
  color: #606266;
}

.main {
  padding: 18px 16px 28px;
}

.tabs {
  height: 60px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding-left: 0;
}

.tab {
  min-width: 168px;
  max-width: 255px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px 10px 0 0;
  color: #606266;
  background: #f4f4f4;
  font-size: 17px;
}

.tab.active {
  color: #222;
  background: #fff;
}

.tab .x {
  color: #666;
  font-size: 18px;
}

.page-host {
  min-height: calc(100dvh - 168px);
  background: transparent;
}

.content-card {
  background: #fff;
  box-shadow: 0 6px 16px rgba(31, 45, 61, 0.06);
}

.filter-card {
  padding: 36px 32px 30px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 22px 38px;
  align-items: center;
}

.field {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 10px;
}

.field label {
  color: #767b83;
  font-size: 16px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #dcdfe6;
  border-radius: 2px;
  padding: 0 16px;
  color: #303133;
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 90px;
  padding-top: 12px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--dst-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  justify-content: flex-end;
}

.table-card {
  margin-top: 22px;
  padding: 30px 24px 20px;
  overflow: hidden;
}

.toolbar {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-pill {
  padding: 8px 12px;
  color: #606266;
  background: #f5f7fa;
  border: 1px solid #ebeef5;
  border-radius: 3px;
}

.btn {
  min-width: 88px;
  height: 40px;
  border: 1px solid var(--dst-green);
  border-radius: 4px;
  color: var(--dst-green-dark);
  background: #fff;
  padding: 0 18px;
  transition: 0.15s ease;
}

.btn:hover {
  background: var(--dst-green-soft);
}

.btn.primary {
  color: #fff;
  background: var(--dst-green);
}

.btn.primary:hover {
  background: var(--dst-green-dark);
}

.btn.text {
  min-width: 0;
  height: auto;
  border: 0;
  padding: 0 5px;
  color: var(--dst-green-dark);
  background: transparent;
}

.btn.danger {
  color: var(--danger);
  border-color: var(--danger);
}

.btn.small {
  min-width: 58px;
  height: 28px;
  padding: 0 8px;
}

.btn.ghost {
  border-color: #dcdfe6;
  color: #606266;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  height: 58px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  text-align: left;
  white-space: nowrap;
  color: #565b63;
}

th {
  height: 62px;
  color: #6c7078;
  font-size: 16px;
  font-weight: 400;
  background: #fafafa;
}

td.index,
th.index {
  min-width: 82px;
  text-align: center;
}

.fixed-action {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 210px;
  background: #fff;
  box-shadow: -6px 0 10px rgba(0, 0, 0, 0.04);
}

th.fixed-action {
  background: #fafafa;
}

.link {
  color: var(--dst-green-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  color: #0f8f65;
  background: #e8fbf4;
}

.status.warn {
  color: #ad6d00;
  background: #fff4dd;
}

.status.blue {
  color: #2162a8;
  background: #eaf3ff;
}

.pager {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: #606266;
}

.page-no {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
}

.page-no.active {
  color: #fff;
  background: var(--dst-green);
  border-color: var(--dst-green);
}

.detail-page {
  background: #fff;
  min-height: calc(100dvh - 168px);
  padding-bottom: 86px;
}

.section-title {
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 28px;
  padding: 30px 40px;
}

.read-field {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  min-height: 46px;
}

.read-field label {
  color: #7d828a;
  font-size: 16px;
}

.read-field .value {
  color: #252a31;
  font-size: 16px;
}

.required {
  color: var(--danger);
}

.detail-block {
  padding: 22px 32px 28px;
  border-top: 12px solid #f5f5f5;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  font-size: 17px;
}

.subtle {
  color: var(--muted);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.metric {
  padding: 16px;
  background: #fafafa;
  border: 1px solid var(--line);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.footer-bar {
  position: fixed;
  left: var(--rail);
  right: 0;
  bottom: 0;
  z-index: 8;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.05);
}

.priority-list {
  max-width: 860px;
}

.priority-list table {
  width: 100%;
}

.priority-input {
  width: 84px;
  height: 34px;
  border: 1px solid #dcdfe6;
  text-align: center;
}

.drawer-mask,
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  background: rgba(0, 0, 0, 0.22);
}

.drawer-mask.open,
.modal-layer.open {
  display: block;
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: -390px;
  z-index: 35;
  width: 390px;
  background: #fff;
  box-shadow: 12px 0 24px rgba(0, 0, 0, 0.12);
  transition: left 0.2s ease;
}

.drawer.open {
  left: 0;
}

.drawer-head {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.drawer-head strong,
.drawer-head span {
  display: block;
}

.drawer-head span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.icon-close {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  font-size: 28px;
  color: #606266;
}

.menu-tree {
  height: calc(100dvh - 82px);
  overflow: auto;
  padding: 14px;
}

.menu-group-title {
  margin: 16px 8px 8px;
  color: #909399;
  font-size: 12px;
}

.menu-item {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 4px;
  padding: 0 12px;
  color: #303133;
  background: #fff;
  text-align: left;
}

.menu-item:hover,
.menu-item.active {
  color: var(--dst-green-dark);
  background: #f1fbf7;
}

.modal {
  position: fixed;
  z-index: 45;
  left: 50%;
  top: 50%;
  width: min(980px, calc(100vw - 80px));
  max-height: calc(100dvh - 80px);
  overflow: hidden;
  display: grid;
  grid-template-rows: 62px 1fr 66px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -50%);
}

.modal.big {
  width: min(1240px, calc(100vw - 60px));
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
}

.modal-body {
  overflow: auto;
  padding: 22px;
  background: #fff;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  left: 50%;
  top: 22px;
  z-index: 60;
  min-width: 230px;
  padding: 12px 18px;
  color: #0f684e;
  background: #effdf7;
  border: 1px solid #b7efd9;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transform: translate(-50%, -80px);
  opacity: 0;
  transition: 0.2s ease;
  text-align: center;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.category-panel {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fafafa;
}

.category-chip {
  min-width: 88px;
  padding: 8px 12px;
  border: 1px solid #e1e4e8;
  border-radius: 2px;
  background: #fff;
}

.category-chip.active {
  color: var(--dst-green-dark);
  border-color: var(--dst-green);
  background: #effdf7;
}

.empty {
  height: 160px;
  display: grid;
  place-items: center;
  color: #909399;
}

@media (max-width: 980px) {
  :root {
    --rail: 68px;
    --topbar: 72px;
  }

  .brand,
  .rail-btn {
    width: 68px;
    height: 68px;
  }

  .filter-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .field,
  .read-field {
    grid-template-columns: 120px 1fr;
  }

  .footer-bar {
    left: var(--rail);
  }
}
