:root {
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
  color: #26323e;
  background: #f4f6f9;
  font-size: 14px;
  line-height: 1.6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  border: 0;
  background: #4f63d8;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover {
  filter: brightness(0.96);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
.secondary {
  color: #42516a;
  background: #edf0f7;
}
.danger {
  background: #fff0ef;
  color: #ae3835;
}
input,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #dbe1e9;
  border-radius: 7px;
  background: white;
  color: #26323e;
}
input:focus,
select:focus {
  outline: 2px solid #bac6ff;
  border-color: #687ee6;
}
label {
  display: block;
  color: #5a6575;
}
label > input,
label > select {
  margin-top: 5px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 25px;
  letter-spacing: -0.5px;
}
h2 {
  font-size: 17px;
  font-weight: 650;
}
.brand {
  font-size: 12px;
  letter-spacing: 3px;
  font-weight: 750;
  color: #6d7ce0;
}
.login {
  width: min(440px, calc(100% - 32px));
  margin: 12vh auto;
  background: white;
  padding: 36px;
  border-radius: 16px;
  border: 1px solid #e0e6ef;
}
.login h1 {
  margin: 16px 0 8px;
}
.login p {
  color: #7a8797;
  margin-bottom: 24px;
}
.login button {
  width: 100%;
  margin-top: 20px;
}
#login-error {
  max-width: 700px;
  margin: 16px auto;
  color: #b52b32;
}
#workspace {
  display: flex;
  min-height: 100vh;
}
#workspace[hidden],
[hidden] {
  display: none !important;
}
aside {
  width: 215px;
  padding: 32px 22px;
  background: #fff;
  border-right: 1px solid #e3e8f1;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
}
aside h2 {
  margin: 8px 0 32px;
}
nav {
  display: grid;
  gap: 10px;
}
nav button {
  text-align: left;
  color: #657083;
  background: transparent;
}
nav button.active {
  background: #edf0ff;
  color: #4c60cd;
}
.aside-note {
  margin-top: auto;
  padding: 30px 0;
  color: #8b95a4;
  font-size: 12px;
}
main {
  margin-left: 215px;
  width: calc(100% - 215px);
  padding: 32px;
  max-width: 1800px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.eyebrow {
  color: #8a95a5;
  font-size: 12px;
  margin-bottom: 5px;
}
.pill {
  background: #e9edf5;
  color: #61708a;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
}
.card {
  background: #fff;
  border: 1px solid #e1e6ef;
  border-radius: 12px;
  padding: 22px;
  min-width: 0;
}
.search-form {
  display: flex;
  align-items: end;
  gap: 16px;
  margin-bottom: 20px;
}
.search-form > label:first-child {
  width: 150px;
}
.grow {
  flex: 1;
}
.search-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(360px, 1.8fr);
  gap: 20px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.section-title span,
.section-title p,
.hint {
  font-size: 12px;
  color: #8390a2;
}
.results,
.chapters {
  max-height: 62vh;
  min-height: 250px;
  overflow: auto;
}
.result {
  display: block;
  text-align: left;
  background: transparent;
  color: #31415a;
  width: 100%;
  white-space: normal;
  border-radius: 6px;
  border-bottom: 1px solid #edf0f5;
  padding: 14px 10px;
}
.result.selected {
  background: #f0f3ff;
  color: #4f63d8;
}
.empty {
  padding: 48px 12px;
  color: #98a1ad;
  text-align: center;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .check {
  margin-right: auto;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5d6877;
}
.check input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.chapter {
  padding: 12px;
  border-bottom: 1px solid #edf0f5;
}
.pager {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid #edf0f5;
}
.search-layout > .card {
  display: flex;
  flex-direction: column;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.metrics span {
  color: #8590a1;
  font-size: 12px;
}
.metrics strong {
  display: block;
  font-size: 25px;
  margin-top: 6px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  font-size: 12px;
  color: #8993a3;
  background: #f7f9fc;
  font-weight: 500;
}
td,
th {
  padding: 12px;
  border-bottom: 1px solid #edf0f5;
}
td:first-child input {
  width: 16px;
}
td:nth-child(2) {
  min-width: 180px;
}
td:last-child {
  max-width: 430px;
  word-break: break-word;
  font-size: 12px;
  color: #8190a0;
}
small {
  display: block;
  color: #8390a2;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 20px;
}
.settings-grid label {
  margin: 14px 0;
}
.settings-grid h2 {
  margin-bottom: 12px;
}
.hint {
  margin: 12px 0;
}
#notice,
#source-status:not(:empty) {
  background: #fff7e7;
  color: #806124;
  border: 1px solid #f4e3bd;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}
#notice.success {
  background: #ebf8f2;
  border-color: #ccebdd;
  color: #357958;
}
@media (max-width: 1000px) {
  aside {
    width: 175px;
    padding: 25px 16px;
  }
  main {
    margin-left: 175px;
    width: calc(100% - 175px);
    padding: 22px;
  }
  .search-layout {
    grid-template-columns: 1fr;
  }
  .results {
    max-height: 250px;
    min-height: 120px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 650px) {
  #workspace {
    display: block;
  }
  aside {
    position: static;
    width: 100%;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid #e3e8f1;
  }
  aside h2,
  .aside-note {
    display: none;
  }
  nav {
    display: flex;
    margin: 12px 0;
  }
  aside > #logout {
    position: absolute;
    right: 16px;
    top: 10px;
    padding: 5px 12px;
  }
  main {
    margin: 0;
    width: 100%;
    padding: 16px;
  }
  header {
    gap: 12px;
  }
  h1 {
    font-size: 21px;
  }
  .search-form {
    flex-wrap: wrap;
  }
  .search-form .grow {
    flex-basis: 50%;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .card {
    padding: 16px;
  }
  .toolbar button {
    padding: 8px 10px;
  }
  .search-form > label:first-child {
    width: 110px;
  }
}
