:root {
  --ink: #20342e;
  --muted: #70817b;
  --green: #267859;
  --pale: #dcece5;
  --paper: #f5f3ed;
  --line: #dce2de;
  --red: #bd4a46;
  --gold: #d8a949;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 85% 12%, #e7f0eb 0, transparent 32%),
    var(--paper);
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}
.protected,
.question-card,
.options {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button,
a,
input,
textarea,
select {
  font: inherit;
}
button,
a {
  cursor: pointer;
}
header {
  min-height: 82px;
  padding: 10px clamp(18px, 3vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #d8ded9;
  background: #fafaf7ed;
  position: sticky;
  top: 0;
  z-index: 9;
}
header a,
header button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 13px;
  text-decoration: none;
  border-radius: 10px;
  font-size: 15px;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
header nav,
.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}
.main-nav {
  flex: 1;
  justify-content: center;
}
.utility-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
header nav .active {
  background: var(--pale);
  color: var(--green);
  font-weight: 700;
}
header nav #nav-search,
header nav #nav-favorites {
  border: 1px solid #c9ded4;
  color: var(--green);
}
header nav #nav-search:hover,
header nav #nav-favorites:hover {
  background: var(--green);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: none;
}
.brand-home {
  padding: 0;
  border-radius: 16px;
}
.brand-home:hover b,
.brand-home:focus-visible b {
  color: var(--green);
}
.brand > span,
.logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.brand div {
  display: flex;
  flex-direction: column;
}
.brand b {
  font-size: 18px;
  line-height: 1.18;
}
.brand small {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.brand > span {
  width: auto;
  min-width: 64px;
  padding: 0 12px;
  font-size: 14px;
  letter-spacing: .04em;
}
main {
  max-width: 1160px;
  margin: auto;
  padding: 38px 24px 70px;
}
.progress-head {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  margin-bottom: 24px;
  color: var(--muted);
}
.progress-head > div {
  grid-column: 2;
  text-align: center;
}
.progress {
  height: 5px;
  background: #dfe7e2;
  border-radius: 9px;
  margin-top: 12px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--green);
}
#favorite {
  grid-column: 3;
  justify-self: end;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  padding: 11px 18px;
  border-radius: 99px;
  font-weight: 700;
  box-shadow: 0 8px 20px #26785924;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
#favorite:hover,
#favorite:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 11px 24px #26785938;
}
#favorite.is-favorite {
  border-color: var(--gold);
  background: var(--gold);
}
#favorite:disabled {
  opacity: .6;
}
.question-card,
.panel {
  background: linear-gradient(155deg, #fff 0%, #fdfdf9 100%);
  border: 1px solid #e2e4df;
  border-radius: 26px;
  padding: 48px 54px;
  box-shadow: 0 22px 65px #35534714;
}
.meta {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.meta > span {
  background: var(--pale);
  color: var(--green);
  padding: 7px 12px;
  border-radius: 99px;
}
.meta code {
  background: #edf3ef;
  padding: 6px 9px;
  border-radius: 6px;
  color: var(--green);
}
.question-card h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1.45;
  font-weight: 500;
  margin: 28px 0 36px;
}
.options {
  display: grid;
  gap: 14px;
}
.options button {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfbf8;
  display: grid;
  grid-template-columns: 55px 1fr 35px;
  align-items: center;
  text-align: left;
  padding: 0 18px 0 0;
  color: var(--ink);
}
.options button b {
  height: 100%;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
}
.options button span {
  padding: 16px 20px;
  font-size: 17px;
}
.options button.correct {
  border-color: var(--green);
  background: #edf8f2;
}
.options button.correct b {
  background: var(--green);
  color: #fff;
}
.options button.wrong {
  border-color: var(--red);
  background: #fff1f0;
}
.options button.wrong b {
  background: var(--red);
  color: #fff;
}
.options em {
  font-size: 25px;
  color: var(--green);
}
.options .wrong em {
  color: var(--red);
}
.explanation {
  margin-top: 28px;
  padding: 26px 30px;
  border-left: 4px solid var(--gold);
  background: #fff8e7;
  border-radius: 0 16px 16px 0;
}
.explanation > div {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid #eadcb5;
  padding-bottom: 15px;
}
.explanation strong {
  font-size: 22px;
  color: var(--green);
}
.explanation span {
  margin-left: auto;
}
.explanation h3 {
  color: var(--green);
  font-size: 15px;
  margin: 20px 0 6px;
}
.explanation p {
  white-space: pre-wrap;
  line-height: 1.7;
}
.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-top: 26px;
}
.pager > #prev {
  margin-right: auto;
}
.pager > #next {
  margin-left: 0;
}
.pager button,
.login-card button,
.import-card button {
  border: 1px solid #9eb2a8;
  background: #fff;
  padding: 13px 22px;
  border-radius: 12px;
  color: var(--green);
}
.pager button:last-child,
.login-card button,
.import-card button {
  background: var(--green);
  color: #fff;
}
.hidden {
  display: none !important;
}
.question-search {
  margin-bottom: 22px;
  padding: 20px 22px;
  border-color: #d5e4dc;
}
.question-search form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
}
.question-search input {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 1px 2px #20342e0a;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.question-search input:focus {
  outline: 0;
  border-color: var(--green);
  box-shadow: 0 0 0 4px #2678591c;
}
.question-search form button {
  border: 1px solid var(--green);
  border-radius: 12px;
  padding: 12px 20px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 20px #26785920;
  transition: transform .18s ease, box-shadow .18s ease;
}
.question-search form button:last-child {
  background: #fff;
  color: var(--green);
  box-shadow: none;
}
.question-search form button:hover,
.admin-question-actions a:hover,
.admin-question-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 24px #26785932;
}
.question-search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}
.question-search-footer small {
  color: var(--muted);
}
#question-search-message {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--green);
}
#question-search-message.error {
  color: var(--red);
}
.question-search-results {
  display: grid;
  gap: 8px;
  max-height: 420px;
  margin-top: 10px;
  padding-right: 4px;
  overflow-y: auto;
}
.question-search-results button {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 5px 16px #3553470c;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.question-search-results button:hover {
  border-color: var(--green);
  background: #f3faf6;
  transform: translateY(-1px);
  box-shadow: 0 9px 22px #35534718;
}
.question-search-results b {
  color: var(--green);
}
.question-search-results small {
  color: var(--muted);
}
.admin-question-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}
.admin-question-actions a,
.admin-question-actions button {
  padding: 12px 20px;
  border: 1px solid var(--green);
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 8px 20px #26785920;
  transition: transform .18s ease, box-shadow .18s ease;
}
.admin-question-actions button {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}
.admin-question-actions button:disabled {
  opacity: .5;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 25px;
}
.stats article {
  background: #f4f7f5;
  padding: 22px;
  border-radius: 16px;
}
.stats b {
  display: block;
  font-size: 28px;
  color: var(--green);
}
.stats span {
  color: var(--muted);
}
.stat-wrong {
  background: #fff3f1 !important;
}
.stat-wrong b {
  color: var(--red);
}
.wrong-stats-heading,
.wrong-review-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.wrong-stats-heading h1,
.wrong-review-title h2 {
  margin: 0;
}
.wrong-stats-heading p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}
#wrong-question-total {
  min-width: 64px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff1ef;
  color: var(--red);
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}
.wrong-review {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.wrong-review-title {
  align-items: center;
  margin-bottom: 16px;
}
.wrong-review-title span {
  color: var(--muted);
}
.wrong-review-title span b {
  color: var(--red);
}
.wrong-list {
  display: grid;
  gap: 10px;
}
.wrong-question-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 6px 18px #3553470b;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.wrong-question-row:hover,
.wrong-question-row:focus-visible {
  border-color: #e1aaa5;
  background: #fffafa;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px #663b3514;
  outline: 0;
}
.wrong-question-row > b {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff1ef;
  color: var(--red);
  font-size: 15px;
}
.wrong-question-content {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.wrong-question-content strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wrong-question-content small {
  color: var(--red);
}
.wrong-question-row em {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--pale);
  color: var(--green);
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}
.wrong-empty,
.wrong-loading {
  margin: 0;
  padding: 30px 20px;
  border-radius: 14px;
  background: #f6f8f6;
  color: var(--muted);
  text-align: center;
}
.wrong-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 22px;
}
.wrong-pagination button {
  min-width: 94px;
  padding: 10px 16px;
  border: 1px solid #b8cec3;
  border-radius: 11px;
  background: #fff;
  color: var(--green);
  font-weight: 700;
}
.wrong-pagination button:not(:disabled):hover {
  border-color: var(--green);
  background: var(--pale);
}
.wrong-pagination button:disabled {
  cursor: default;
  opacity: .45;
}
.wrong-pagination span {
  color: var(--muted);
  font-size: 14px;
}
.login-page {
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card,
.import-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 42px;
  box-shadow: 0 30px 90px #264b3c20;
}
.login-card .logo {
  width: auto;
  min-width: 64px;
  padding: 0 14px;
  font-size: 14px;
  letter-spacing: .04em;
}
.login-card small {
  display: block;
  color: var(--green);
  letter-spacing: 0.18em;
  margin-top: 22px;
}
.login-card h1 {
  font-family: Georgia, serif;
  font-size: 36px;
  margin-bottom: 8px;
}
.login-card p,
.login-card footer {
  color: var(--muted);
}
.login-card form {
  display: grid;
  gap: 9px;
  margin: 26px 0;
}
.social-login {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.social-login a {
  display: block;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}
.social-login .social-google:hover {
  border-color: #4285f4;
}
.social-login .social-facebook {
  color: #1877f2;
}
.social-login .social-wechat {
  color: #07a95b;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 -8px;
  color: var(--muted);
  font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.login-card input,
.import-card input {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.error {
  color: var(--red);
}
.import-page main {
  max-width: 800px;
}
.import-card {
  width: 100%;
}
.import-card textarea {
  width: 100%;
  min-height: 130px;
}
.report {
  padding: 15px;
  background: #edf8f2;
  color: var(--green);
  border-radius: 12px;
  margin: 15px 0;
}
.reset-mail-status {
  margin: 20px 0 24px;
  padding: 18px;
  border: 1px solid #b8ddcb;
  border-radius: 16px;
  background: #edf8f2;
  color: var(--ink);
  box-shadow: 0 10px 28px #26785914;
}
.reset-mail-status__title {
  color: var(--green);
  font-size: 18px;
  font-weight: 800;
}
.reset-mail-status > p {
  margin: 8px 0 14px;
  color: var(--ink);
  line-height: 1.65;
}
.reset-mail-warning {
  display: grid;
  gap: 7px;
  padding: 15px 16px;
  border: 2px solid #e1a928;
  border-radius: 12px;
  background: #fff4cc;
  color: #563b00;
  line-height: 1.65;
}
.reset-mail-warning strong {
  color: #9b5700;
  font-size: 17px;
}
.reset-mail-warning span {
  font-weight: 600;
}
.muted {
  color: var(--muted);
}
.admin-editor,
.admin-editor .panel,
.admin-editor input,
.admin-editor textarea {
  -webkit-user-select: text;
  user-select: text;
}
.admin-site-header {
  justify-content: flex-start;
}
.admin-main-nav {
  flex: 1;
  justify-content: flex-end;
}
.admin-main-nav .active {
  background: var(--pale);
  color: var(--green);
  font-weight: 700;
}
.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.admin-table-wrap table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
}
.admin-table-wrap th,
.admin-table-wrap td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.admin-table-wrap th {
  background: #f2f6f3;
  color: var(--green);
}
.registration-ip code {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 7px;
  background: #f5f7f6;
  color: #355c4d;
  font-size: 13px;
  white-space: nowrap;
}
.inline-admin-form {
  display: inline-block;
  margin: 2px;
}
.inline-admin-form button {
  padding: 7px 10px;
  border: 1px solid #b7c9c0;
  border-radius: 8px;
  background: #fff;
  color: var(--green);
}
.editor-main {
  max-width: 1320px;
}
.editor-toolbar {
  padding: 24px 30px;
  margin-bottom: 20px;
}
.editor-toolbar form > div {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.editor-toolbar input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.editor-toolbar button,
.question-edit-form button {
  border: 0;
  border-radius: 10px;
  padding: 12px 20px;
  background: var(--green);
  color: #fff;
}
.editor-message {
  margin: 14px 0;
  padding: 14px 18px;
  border-radius: 10px;
  background: #edf8f2;
  color: var(--green);
}
.editor-message.error {
  background: #fff1f0;
  color: var(--red);
}
.search-results {
  padding: 28px;
  margin-bottom: 20px;
}
.search-results a {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 16px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.search-results a:hover {
  color: var(--green);
}
.editor-card {
  padding: 30px 36px;
}
.editor-pager {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 25px;
}
.editor-pager strong {
  text-align: center;
}
.editor-pager a {
  color: var(--green);
  text-decoration: none;
}
.editor-pager a:last-child {
  text-align: right;
}
.editor-pager .disabled {
  pointer-events: none;
  color: #aaa;
}
.question-edit-form,
.question-edit-form label {
  display: grid;
  gap: 8px;
}
.question-edit-form {
  gap: 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.option-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.question-edit-form input,
.question-edit-form textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.question-edit-form textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.55;
}
.question-edit-form > label > textarea {
  min-height: 130px;
}
.question-edit-form textarea.large {
  min-height: 210px;
}
.save-row {
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffffff2;
}
.save-row span {
  color: var(--muted);
}
@media print {
  body {
    display: none !important;
  }
}
@media (max-width: 1040px) {
  header {
    flex-wrap: wrap;
  }
  .main-nav {
    order: 3;
    width: 100%;
    flex-basis: 100%;
    justify-content: flex-start;
    padding: 2px 0 4px;
  }
  .utility-nav {
    margin-left: auto;
  }
}
@media (max-width: 760px) {
  .question-search form {
    grid-template-columns: 1fr 1fr;
  }
  .question-search input {
    grid-column: 1 / -1;
  }
  .question-search-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .question-search-results button {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  #favorite {
    grid-column: 2;
    grid-row: 1;
  }
  .admin-question-actions {
    order: 3;
    width: 100%;
    justify-content: stretch;
  }
  .admin-question-actions a,
  .admin-question-actions button {
    flex: 1;
    text-align: center;
  }
  header {
    height: auto;
    min-height: 76px;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 12px 7px;
  }
  header nav {
    order: 3;
    width: 100%;
    padding-bottom: 8px;
  }
  .brand small {
    display: none;
  }
  .brand > span {
    min-width: 56px;
    height: 44px;
    padding: 0 10px;
    font-size: 12px;
  }
  .brand b {
    font-size: 16px;
  }
  .utility-nav {
    gap: 0;
  }
  .utility-nav a,
  .utility-nav button {
    padding: 8px 7px;
    font-size: 13px;
  }
  .main-nav {
    gap: 5px;
    scrollbar-width: thin;
  }
  .main-nav a,
  .main-nav button {
    min-height: 42px;
    padding: 9px 12px;
    font-size: 14px;
  }
  main {
    padding: 22px 13px;
  }
  .question-card,
  .panel {
    padding: 28px 20px;
  }
  .question-card h1 {
    font-size: 23px;
  }
  .progress-head {
    grid-template-columns: 1fr 1fr;
  }
  .progress-head > div {
    grid-column: 1/-1;
    grid-row: 2;
    margin-top: 15px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stats article {
    padding: 17px;
  }
  .stats b {
    font-size: 24px;
  }
  .wrong-stats-heading {
    align-items: center;
  }
  .wrong-stats-heading p {
    font-size: 14px;
  }
  #wrong-question-total {
    min-width: 52px;
    padding: 8px 12px;
    font-size: 18px;
  }
  .wrong-review-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
  .wrong-question-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 11px;
    padding: 13px;
  }
  .wrong-question-row > b {
    width: 42px;
    height: 42px;
  }
  .wrong-question-content strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .wrong-question-row em {
    grid-column: 2;
    justify-self: start;
    padding: 6px 10px;
    font-size: 13px;
  }
  .wrong-pagination {
    gap: 10px;
  }
  .wrong-pagination button {
    min-width: 78px;
    padding: 9px 11px;
  }
  .options button span {
    font-size: 15px;
  }
  .admin-editor header {
    height: auto;
    min-height: 76px;
    flex-wrap: wrap;
    padding: 10px 12px;
  }
  .admin-editor header nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }
  .admin-main-nav {
    justify-content: flex-start;
  }
  .editor-card,
  .editor-toolbar,
  .search-results {
    padding: 20px 16px;
  }
  .form-grid,
  .option-edit-grid {
    grid-template-columns: 1fr;
  }
  .editor-pager {
    grid-template-columns: 1fr 1fr;
  }
  .editor-pager strong {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .search-results a {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .save-row {
    align-items: stretch;
    flex-direction: column;
  }
}
a[href^="device.php"] {
  display: none !important;
}

/* Referral rewards */
.referral-main,
.referral-admin {
  max-width: 1240px;
}
.referral-hero {
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #fff 0%, #eef8f3 100%);
}
.referral-hero::after {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: #26785912;
  content: "";
  position: absolute;
  right: -70px;
  top: -90px;
}
.eyebrow {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 99px;
  background: var(--pale);
  color: var(--green);
  font-weight: 800;
  letter-spacing: .08em;
}
.referral-hero h1 {
  max-width: 800px;
  margin: 18px 0 12px;
  font: 500 clamp(34px,5vw,56px)/1.12 Georgia,"Microsoft YaHei",serif;
}
.referral-hero > p {
  max-width: 880px;
  color: #52665f;
  font-size: 18px;
  line-height: 1.75;
}
.referral-policy {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  margin-top: 24px;
  padding: 18px;
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  background: #fff9e9;
  line-height: 1.65;
}
.referral-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 22px;
  margin: 24px 0;
}
.referral-grid .panel,
.referral-list,
.partner-profile,
.referral-detail {
  padding: 30px;
}
.invite-card {
  display: grid;
  gap: 10px;
}
.invite-card h2,
.referral-summary h2,
.partner-profile h2,
.referral-list h2 {
  margin: 0 0 12px;
}
.invite-card input,
.referral-form input,
.referral-form textarea,
.admin-search input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.referral-code {
  color: var(--green);
  font: 700 30px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;
  letter-spacing: .06em;
}
.referral-notice {
  margin: 14px 0;
  padding: 12px;
  border-radius: 10px;
  background: #eaf7f1;
  color: var(--green);
}
.referral-stat-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
}
.referral-stat-grid div {
  min-height: 105px;
  padding: 17px;
  border-radius: 15px;
  background: #edf5f1;
}
.referral-stat-grid b {
  display: block;
  color: var(--green);
  font: 600 28px Georgia,serif;
}
.referral-stat-grid span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}
.referral-form {
  display: grid;
  gap: 9px;
}
.referral-form label {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.referral-form textarea {
  min-height: 90px;
  resize: vertical;
}
.referral-form button,
.admin-search button,
.admin-action-row button,
.table-action,
.action-link {
  display: inline-block;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}
.referral-form button {
  margin-top: 10px;
}
.referral-list td small,
.referral-admin td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.admin-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.admin-title-row h1,
.admin-title-row h2 {
  margin: 0 0 7px;
}
.admin-title-row p {
  margin: 0;
  color: var(--muted);
}
.admin-search {
  display: flex;
  gap: 8px;
  min-width: min(420px,100%);
}
.admin-action-row form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-action-row button:nth-of-type(3),
.danger-confirm {
  background: var(--red);
}
.referral-detail-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 24px;
  margin: 22px 0 34px;
}
.payout-form {
  align-content: start;
  padding: 22px;
  border: 1px solid #ecd6b1;
  border-radius: 16px;
  background: #fffaf0;
}
.referral-admin .panel + .panel {
  margin-top: 24px;
}
@media (max-width: 780px) {
  .referral-grid,
  .referral-detail-grid {
    grid-template-columns: 1fr;
  }
  .referral-stat-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .referral-policy {
    grid-template-columns: 1fr;
  }
  .admin-title-row {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-search {
    min-width: 0;
  }
  .referral-grid .panel,
  .referral-list,
  .partner-profile,
  .referral-detail {
    padding: 22px 17px;
  }
}
.refund-policy-note {
  margin: 18px 0;
  padding: 15px 17px;
  border: 1px solid #ead8b8;
  border-radius: 12px;
  background: #fff9ed;
  color: #5f5646;
  line-height: 1.65;
  text-align: left;
}
.refund-policy-note a {
  color: var(--green);
  font-weight: 700;
}
.policy-page {
  max-width: 820px;
  margin: auto;
}
.policy-page h1 {
  font: 500 42px Georgia,serif;
}
.policy-page h2 {
  margin-top: 28px;
  color: var(--green);
}
.policy-page p {
  color: #52635d;
  line-height: 1.8;
}
