:root {
  --mainBg: #f7f6ef;
  --mainBlack: #363531;
  --mainGrey: #ccc7c0;
  --mainWhite: #ffffff;
  --lineLight: rgb(223, 223, 223);
  --muted: rgb(117, 117, 117);
  --placeholder: rgb(201, 201, 201);
  --hoverFade: rgb(152, 152, 152);
  --caret: rgb(128, 217, 237);

  --fontMain: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --fontSerif: ui-serif, Georgia, "Songti SC", "STSong", "Times New Roman", serif;
  --fontSize: 1.2rem;
}

@media (min-width: 1920px) {
  :root {
    --fontSize: 1.5rem;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
}

html {
  font-size: 10px;
  scroll-padding-top: 12rem;
}

body {
  margin: 0;
  background: var(--mainBg);
  color: var(--mainBlack);
  font-family: var(--fontMain);
  font-size: var(--fontSize);
  line-height: 17px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

button {
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 1px dotted var(--mainBlack);
  outline-offset: 2px;
}

.frame {
  position: fixed;
  inset: 0;
  border: 6px solid var(--mainBlack);
  pointer-events: none;
  z-index: 999;
}

@media (max-width: 768px) {
  .frame {
    display: none;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 98;
  background: var(--mainBg);
  border-bottom: 1px solid var(--mainBlack);
}

.headerGrid {
  display: grid;
  grid-template-columns: 33.3333% auto 33.3333%;
  gap: 2rem;
  padding: 2rem 3rem 1.4rem;
  min-height: 28.2rem;
  align-items: start;
}

.enable-scrolled-header .headerGrid {
  min-height: 5.1rem;
  padding: 1.9rem 3rem 1.5rem;
  align-items: center;
}

.enable-scrolled-header .brandSub {
  display: none;
}

.headerCenter {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.2rem;
}

.headerCenter h1 {
  font-size: 1.4rem;
  font-family: var(--fontSerif);
  font-feature-settings: "smcp";
  font-variant: small-caps;
  font-weight: 400;
  margin: 0;
  text-align: center;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
}

.logo {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--mainBlack);
  font-family: var(--fontSerif);
  font-feature-settings: "smcp";
  font-variant: small-caps;
  font-size: 1.4rem;
}

.brandName {
  font-family: var(--fontSerif);
  font-feature-settings: "smcp";
  font-variant: small-caps;
  font-size: 1.4rem;
  font-weight: 400;
}

.brandSub {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 1.1rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
}

.topActions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: flex-end;
}

.btn,
.btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.2rem 0;
  font-family: var(--fontMain);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 17px;
  border-bottom: 1px solid transparent;
  color: var(--mainBlack);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.6;
  text-decoration: none;
  border-bottom-color: currentColor;
}

.btnPrimary {
  font-weight: 500;
}

.btnDanger {
  color: #7a2b2b;
}

.btnGhost {
  opacity: 0.9;
}

.mePill {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--lineLight);
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 17px;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 3rem 10rem;
}

.split {
  display: grid;
  grid-template-columns: 0.95fr 2.05fr;
  gap: 3rem;
}

.sidebar {
  border: 1px solid var(--lineLight);
  padding: 2rem 2rem 1.8rem;
  background: transparent;
}

.sideHeader {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--lineLight);
}

.sideTitle {
  font-family: var(--fontSerif);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 17px;
}

.tableList {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.2rem;
}

.tableItem {
  padding: 1rem 1.2rem;
  border: 1px solid var(--lineLight);
  background: transparent;
  cursor: pointer;
}

.tableItem:hover {
  color: var(--hoverFade);
}

.tableItem.active {
  border-color: var(--mainBlack);
}

.tableItem .tname {
  font-family: var(--fontSerif);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 17px;
}

.tableItem .tsub {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 17px;
}

.content {
  min-width: 0;
}

.empty {
  border: 1px solid var(--lineLight);
  padding: 2rem 2rem 1.8rem;
}

.emptyTitle {
  font-family: var(--fontSerif);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 17px;
}

.emptySub {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 17px;
}

.panelTop {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.2rem;
  padding: 0 0 1.2rem;
  border-bottom: 1px solid var(--mainBlack);
  margin-bottom: 2rem;
}

.tableName {
  font-family: var(--fontSerif);
  font-feature-settings: "smcp";
  font-variant: small-caps;
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 17px;
}

.tableMeta {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 17px;
}

.panelActions {
  display: flex;
  gap: 1rem;
}

.card {
  border: 1px solid var(--lineLight);
  padding: 2rem 2rem 1.8rem;
  background: transparent;
}

.card + .card {
  margin-top: 2rem;
}

.cardNarrow {
  max-width: 52rem;
  margin: 0 auto;
}

.cardTitle {
  font-family: var(--fontSerif);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 17px;
}

.cardSub {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 17px;
}

.divider {
  height: 1px;
  background: var(--lineLight);
  margin: 1.4rem 0;
}

.cardRow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.rowTitle {
  font-family: var(--fontSerif);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 17px;
  white-space: nowrap;
}

.cardFooter {
  display: flex;
  gap: 1.2rem;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--lineLight);
}

.hint {
  font-size: 1.1rem;
  color: var(--muted);
}

.form {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.field .label {
  color: var(--muted);
  font-size: 1.1rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.input,
.textarea {
  width: 100%;
  padding: 1rem 1.2rem;
  border: 1px solid var(--lineLight);
  background: transparent;
  outline: none;
  caret-color: var(--caret);
  border-radius: 0;
}

.textarea {
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--placeholder);
}

.input:focus,
.textarea:focus {
  border-color: var(--mainBlack);
}

.inputSm {
  padding: 0.8rem 1rem;
  font-size: 1.1rem;
}

.toast {
  position: fixed;
  right: 1.6rem;
  top: 30rem;
  background: var(--mainBg);
  border: 1px solid var(--mainBlack);
  padding: 1rem 1.2rem;
  min-width: 22rem;
  z-index: 30;
  font-size: 1.1rem;
}

.enable-scrolled-header .toast {
  top: 7.6rem;
}

.toast.err {
  border-color: #7a2b2b;
  color: #7a2b2b;
}

.login {
  min-height: calc(100vh - 28.2rem);
}

.center {
  min-height: calc(100vh - 28.2rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.2rem 0;
}

.err {
  color: #7a2b2b;
  border: 1px solid #7a2b2b;
  padding: 1rem 1.2rem;
  background: transparent;
  white-space: pre-wrap;
}

.tips {
  margin-top: 1.2rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 17px;
}

.table {
  border: 1px solid var(--lineLight);
  overflow: hidden;
}

.thead,
.trow {
  display: grid;
  grid-template-columns: 170px 180px 72px 1fr 88px;
  gap: 1rem;
  padding: 1rem 1.2rem;
}

.thead {
  border-bottom: 1px solid var(--lineLight);
  font-size: 1.1rem;
  color: var(--muted);
  letter-spacing: 0.08rem;
  text-transform: uppercase;
}

.tbody {
  display: flex;
  flex-direction: column;
}

.trow {
  border-bottom: 1px solid var(--lineLight);
}

.trow:last-child {
  border-bottom: none;
}

.cellTitle {
  font-family: var(--fontSerif);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 17px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--lineLight);
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 17px;
  width: max-content;
}

.toggle {
  display: flex;
  align-items: center;
  height: 100%;
}

.toggle input {
  width: 1.8rem;
  height: 1.8rem;
}

.saveBtn {
  justify-content: flex-end;
}

.footerSpace {
  height: 3rem;
}

@media (max-width: 1100px) {
  .split {
    grid-template-columns: 1fr;
  }

  .thead,
  .trow {
    grid-template-columns: 1fr 1fr 72px 1.2fr 88px;
  }
}

@media (max-width: 768px) {
  .headerGrid {
    min-height: 5.1rem;
    padding: 1.9rem 2rem 1.5rem;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .headerCenter {
    display: none;
  }

  .page {
    padding: 1rem 2rem 6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
