* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  font:
    15px/1.55 Inter,
    "Microsoft YaHei",
    sans-serif;
  color: #233748;
  background: #f2f5f6;
}
#layout {
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  min-height: 100vh;
}
aside {
  background: #153a4d;
  color: #e6edf5;
}
.brand {
  font-size: 20px;
  color: #fff;
  font-weight: 650;
  padding: 22px 16px;
  background: #113346;
}
nav {
  padding: 18px 8px;
}
nav small {
  display: block;
  color: #c1cfdd;
  margin: 16px 12px 6px;
}
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid #ccd7e1;
  background: white;
  color: #24435a;
  border-radius: 6px;
  padding: 6px 13px;
}
button:hover {
  background: #edf5ff;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button.primary {
  background: #15635f;
  color: white;
  border-color: #15635f;
}
button.link {
  border: 0;
  background: none;
  color: #116864;
  padding: 4px 6px;
}
nav button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #e6edf5;
  border: 0;
  border-radius: 6px;
  margin: 2px 0;
  padding: 9px 16px;
}
nav button.active,
nav button:hover {
  background: #285569;
  color: #fff;
}
header {
  background: white;
  border-bottom: 1px solid #d9e1e7;
  padding: 12px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 55px;
}
#view {
  padding: 0 clamp(14px, 3vw, 46px) 30px;
}
.card {
  padding: 18px;
  background: white;
  border: 1px solid #dde4eb;
  border-radius: 11px;
  margin-bottom: 15px;
}
h1 {
  font-size: 22px;
  margin: 0 0 14px;
}
h2 {
  font-size: 18px;
  margin: 0 0 12px;
}
h3 {
  font-size: 16px;
  margin: 14px 0 7px;
}
.filters,
.actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.filters label {
  max-width: 190px;
}
.filters input,
.filters select {
  width: 100%;
}
input,
select,
textarea {
  font: inherit;
  border: 1px solid #becad5;
  border-radius: 6px;
  padding: 7px 9px;
  background: white;
  color: #182b39;
  width: 100%;
  min-width: 0;
}
textarea {
  resize: vertical;
  min-height: 90px;
}
input[type="checkbox"] {
  width: auto;
}
label {
  display: block;
  font-size: 14px;
}
label > span {
  display: block;
  margin-bottom: 4px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(215px, 100%), 1fr));
  gap: 12px 16px;
}
.wide {
  grid-column: 1/-1;
}
.muted {
  color: #526574;
  font-size: 13px;
}
.table {
  overflow-x: auto;
  margin-top: 12px;
}
.activity-photo {
  display: block;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}
.design-table {
  table-layout: fixed;
  white-space: normal;
}
.design-table td {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  vertical-align: top;
}
.design-table col:first-child:empty:not([style]) {
  width: 56px;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid #e0e7e8;
  text-align: left;
}
th {
  background: #edf3f3;
  color: #354d5e;
}
tr:nth-child(even) {
  background: #fafbfd;
}
.tag {
  background: #e9f3fb;
  color: #245981;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
}
dialog {
  border: 1px solid #bfcbd5;
  border-radius: 7px;
  padding: 0;
  width: min(1200px, 95vw);
  max-height: 90vh;
  color: inherit;
}
dialog::backdrop {
  background: #0a2238a8;
}
.dlghead,
.dlgfoot {
  background: white;
  position: sticky;
  z-index: 2;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dlghead {
  top: 0;
  background: #15635f;
  color: white;
}
.dlghead h2 {
  margin: 0;
}
.dlghead button {
  border: 0;
  background: transparent;
  color: white;
}
.dlgfoot {
  bottom: 0;
  border-top: 1px solid #dbe2e8;
  justify-content: flex-end;
}
.inner {
  padding: 18px;
}
.steps {
  color: #42647c;
  margin: 0 0 20px;
}
.section {
  scroll-margin-top: 64px;
  margin: 0 0 20px;
}
.section h3 {
  border-bottom: 1px solid #dce5eb;
  padding-bottom: 6px;
}
.sectionlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  margin-bottom: 15px;
}
.sectionlinks a {
  color: #116864;
}
.subrow {
  border-left: 3px solid #d6e2ec;
  background: #f6f8fa;
  padding: 12px;
  margin: 10px 0;
}
.subrow > .actions {
  margin-top: 8px;
}
.upload {
  margin: 12px 0;
}
.upload input {
  max-width: 330px;
  display: block;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 20px;
}
.preview {
  overflow-wrap: anywhere;
}
.preview dt {
  font-weight: 600;
}
.preview dd {
  margin: 0 0 6px;
  white-space: pre-wrap;
}
.preview .pair {
  padding: 7px;
  border-bottom: 1px solid #e7edf1;
}
.login {
  width: min(100%, 370px);
  margin: 0;
}
.login label {
  margin-bottom: 12px;
}
.captcha {
  display: flex;
  align-items: center;
  gap: 10px;
}
.captcha img {
  max-width: 135px;
  display: block;
}
.err {
  color: #a82a20;
}
#notice {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 22px;
  border-radius: 6px;
  background: #253b4b;
  color: white;
  z-index: 10;
  max-width: 92vw;
}
.dlgmsg {
  color: #a82a20;
  margin: 6px 16px;
}
.expert-choices {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.section details {
  margin: 12px 0;
}
.section summary {
  color: #116864;
  cursor: pointer;
}
.empty {
  color: #607381;
  padding: 28px;
  text-align: center;
}
@media (max-width: 760px) {
  #layout {
    display: block;
  }
  .brand {
    padding: 10px 15px;
    font-size: 17px;
  }
  nav {
    padding: 0 6px;
    display: flex;
    flex-wrap: wrap;
  }
  nav small {
    display: none;
  }
  nav button {
    width: auto;
  }
  header {
    padding: 10px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  #view,
  .inner {
    padding: 10px;
  }
}
main { min-width: 0; }
#menu-toggle { display: none; }
#identity { margin-left: auto; display: flex; align-items: center; gap: 12px; }
#crumb { color: #496272; font-size: 14px; }
.brand { padding: 28px 23px; border-bottom: 1px solid #ffffff25; }
.brand strong, .school-name { font: 600 28px/1.3 "STSong","SimSun",serif; letter-spacing: .15em; }
.brand span { display: block; margin-top: 7px; color: #b9cdd5; font-size: 13px; letter-spacing: .12em; }
nav button.active { box-shadow: inset 3px 0 #e8b877; }
#page-heading { padding: 26px clamp(14px, 3vw, 46px) 16px; display: flex; align-items: baseline; gap: 14px; }
#page-heading h1 { margin: 0; font-size: clamp(23px, 2.1vw, 32px); letter-spacing: .02em; }
#page-heading span { font-size: 13px; color: #576c77; }
.card, dialog { box-shadow: 0 3px 16px #16384608; }
.filters { background: #fafcfc; gap: 10px 13px; }
.filters label { flex: 1 1 112px; }
.filters label > span, th { font-weight: 600; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #719eac; outline-offset: 2px; }
.table { font-size: 14px; }
#view .table tbody tr:hover { background-color: #edf6f4; }
.tag { display: inline-block; border-radius: 20px; white-space: nowrap; }
.tag[data-tone=done] { background: #e2f2e8; color: #235e47; }
.tag[data-tone=warn] { background: #fff0d9; color: #835018; }
.dlghead { background: #173e50; padding: 14px 22px; }
.section { border: 1px solid #dbe5e6; border-radius: 9px; padding: 0 16px 15px; background: white; }
.section h3 { color: #204a57; line-height: 1.45; padding-bottom: 9px; }
.inner { background: #f7f9fa; padding: 20px 24px; }
.dlgfoot:empty, .dlgmsg:empty, .err:empty { display: none; }
.split > * { min-width: 0; }
.preview dt { color: #325466; }
.preview dd { line-height: 1.65; }
.upload input[type=file] { padding: 8px; background: #f5faf9; border-style: dashed; }
::file-selector-button { padding: 5px 10px; color: #125c57; background: #e1eeeb; border: 0; border-radius: 4px; margin-right: 9px; cursor: pointer; }
.chapter-select { display: flex; align-items: center; gap: 8px; width: min(300px,42%); margin-left: auto; }
.chapter-select select { color: #203d4c; }
.field-count { font-size: 12px; color: #546a76; text-align: right; }
.draft-status { margin-right: auto; font-size: 13px; color: #496573; }
#dialog-body { min-height: 0; }
.login-mode #layout { display: block; }
.login-mode aside, .login-mode header { display: none; }
.login-mode #view { padding: 0; }
.login-shell { display: grid; grid-template-columns: minmax(280px, 1.1fr) minmax(320px,.9fr); min-height: 100vh; }
.login-cover { display: flex; flex-direction: column; justify-content: space-between; color: white; padding: clamp(36px,5vw,85px); min-height: 100%; background: linear-gradient(180deg,#0d30474d,transparent 36%,#062338d9), url("./mountain.webp") center / cover, #24495e; }
.school-name { text-shadow: 0 1px 8px #163447; }
.cover-caption { border-left: 4px solid #e0b878; padding-left: 20px; }
.cover-caption h1 { font: 600 clamp(30px,4vw,62px)/1.3 "STSong","SimSun",serif; letter-spacing: .08em; margin: 0; }
.cover-caption p { font-size: 16px; margin: 10px 0 0; color: #e6f0ef; }
.login-panel { background: #f9fbfa; display: grid; place-items: center; padding: clamp(28px,5vw,80px); }
.login { background: transparent; box-shadow: none; border: 0; padding: 0; }
.login h2 { font-size: 30px; margin: 0 0 30px; }
.login input { padding: 12px; }
.login label { margin-bottom: 19px; }
.login .primary { width: 100%; padding: 12px; margin-top: 10px; }
.login .captcha { flex-wrap: wrap; }
.login .captcha label { flex: 1 1 100px; margin: 0; }
@media (max-width:760px) {
  #menu-toggle { display: inline-block; }
  header { gap: 8px; }
  nav:not(.expanded) { display: none; }
  nav.expanded { padding: 8px; }
  .brand { padding: 11px 16px; display: flex; align-items: baseline; gap: 12px; }
  .brand strong { font-size: 20px; }
  .brand span { margin: 0; }
  #identity { gap: 0; font-size: 13px; }
  #page-heading { padding-top: 16px; }
  .login-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-cover { min-height: 190px; padding: 22px; background-position: 50% 60%; }
  .login-panel { align-items: start; padding: 30px 24px; }
  .dlghead,.inner,.dlgfoot { padding: 11px; }
  .dlghead { flex-wrap: wrap; }
  .dlghead h2 { font-size: 16px; }
  .chapter-select { width: 44%; }
  .section { padding-inline: 9px; }
}
#view .table .wrap-cell { white-space: normal; overflow-wrap: anywhere; min-width: 6em; max-width: 17em; }
#view .operation-cell .actions { row-gap: 1px; column-gap: 4px; }
#view .operation-cell { min-width: 95px; }
#view .table .link { font-size: 14px; }
.rich-control { min-width: 0; }
.rich-control > span { display: block; margin-bottom: 6px; }
.rich-field { min-width: 0; }
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border: 1px solid #b8c7d6;
  border-radius: 5px 5px 0 0;
  background: #f5f8fa;
}
.rich-toolbar button, .rich-toolbar select { padding: 4px 7px; font-size: 13px; margin: 0; }
.rich-toolbar select { width: auto; max-width: 100%; }
td .rich-toolbar select { font-size: 12px; }
.rich-toolbar .ql-active { color: #fff; background: #154f63; }
.rich-toolbar .ql-bold { font-weight: bold; }
.rich-toolbar .ql-italic { font-style: italic; }
.rich-toolbar .ql-underline { text-decoration: underline; }
.rich-field > .ql-container { height: auto; font: inherit; }
.rich-field .ql-editor {
  height: auto;
  min-height: 240px;
  overflow-y: visible;
  padding: 10px 12px;
  border: 1px solid #b8c7d6;
  border-top: 0;
  border-radius: 0 0 5px 5px;
  background: #fff;
}
.rich-body > .rich-toolbar, .rich-design > .rich-toolbar {
  position: sticky;
  top: var(--dialog-header-height, 60px);
  z-index: 1;
}
.rich-cell .ql-editor { min-height: 120px; }
.rich-design > .ql-container > .ql-editor { min-height: 240px; }
.design-embed { margin: 8px 0; }
.rich-field .ql-editor, .rich-preview { line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.rich-field .ql-editor p, .rich-preview p { margin: 0 0 8px; }
.rich-field .ql-editor .rt-firstIndent-2, .rich-preview .rt-firstIndent-2 { text-indent: 2em; }
.rich-field .ql-editor .rt-lineSpacing-1, .rich-preview .rt-lineSpacing-1 { line-height: 1; }
.rich-field .ql-editor .rt-lineSpacing-2, .rich-preview .rt-lineSpacing-2 { line-height: 2; }
.rich-field .ql-editor .rt-afterSpacing-0, .rich-preview .rt-afterSpacing-0 { margin-bottom: 0; }
.rich-field .ql-editor .rt-afterSpacing-12, .rich-preview .rt-afterSpacing-12 { margin-bottom: 16px; }
.rt-align-left { text-align: left; }
.rt-align-center { text-align: center; }
.rt-align-right { text-align: right; }
.rt-align-justify { text-align: justify; }
.formula-block img { max-width: 100%; height: auto; vertical-align: middle; }
.ql-code-block-container, .rich-preview .code-line {
  font-family: Consolas, ui-monospace, monospace;
  background: #f1f5f9;
  white-space: pre-wrap;
}
.design-requirements.over-limit { color: #a42620; }
.rich-photo { margin: 0 0 8px; }
.rich-photo img { display: block; max-width: 100%; height: auto; }
.rich-field .ql-editor:focus-visible { outline: 3px solid #719eac; outline-offset: 1px; }
.rich-image-list { padding: 7px 12px; border: 1px solid #b8c7d6; }
.rich-field .over-limit { color: #a42620; }
