@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  font-family: Inter, "Microsoft YaHei", sans-serif;
  color: #202b29;
  background: #f4f6f4;
  font-size: 14px;
  font-synthesis: none;
  --green: #18624d;
  --muted: #718078;
  --line: #e2e8e3;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid #d7e0d9;
  background: #fff;
  color: #35463e;
  padding: 9px 14px;
  border-radius: 7px;
  transition: background 0.15s;
}
button:hover {
  background: #eef3ef;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 600;
}
button.primary:hover {
  background: #124b3b;
}
button.text-button {
  border: 0;
  background: none;
  color: #68776e;
  padding: 8px;
}
.danger-text {
  color: #a74439;
  border: 0;
  background: transparent;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 27px;
  letter-spacing: -0.7px;
}
h2 {
  font-size: 15px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #dce3de;
  background: #fff;
  border-radius: 7px;
  color: #26382e;
  outline: none;
  margin-top: 8px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #3c8065;
  box-shadow: 0 0 0 3px #18624d14;
}
input::placeholder {
  color: #97a29b;
}
input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--green);
}
textarea {
  resize: vertical;
  word-break: break-all;
}
small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
[hidden] {
  display: none !important;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 9px;
  background: var(--green);
  color: white;
  font-size: 19px;
  font-weight: 600;
}
.topbar {
  height: 78px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 600;
}
.domain-label {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  padding-left: 16px;
  border-left: 1px solid var(--line);
  margin-left: 10px;
}
.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
main {
  max-width: 1460px;
  margin: auto;
  padding: 34px 4% 20px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}
.page-heading p {
  color: var(--muted);
  margin-top: 10px;
  font-size: 13px;
}
.notice {
  background: #fff8e7;
  border: 1px solid #eadab4;
  color: #8b692a;
  padding: 13px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  line-height: 1.7;
}
.inbox-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 20px;
  min-height: 570px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 19px 6px;
}
.search-label {
  padding: 0 16px 16px;
}
.search-label input {
  font-weight: 400;
  font-size: 12px;
  background: #f8faf8;
}
.mailbox-list {
  max-height: 650px;
  overflow: auto;
  padding: 0 8px 10px;
}
.mailbox-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  padding: 15px 12px;
  margin-bottom: 4px;
  background: transparent;
}
.mailbox-item.selected {
  background: #edf5ef;
  border-color: #d5e5da;
}
.mailbox-item .address {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
}
.mailbox-item .meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.status.closed,
.status.expired {
  color: #a08560;
}
.mail-panel {
  min-width: 0;
}
.empty-state {
  min-height: 410px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  text-align: center;
}
.empty-state h2 {
  font-size: 17px;
  margin-bottom: 10px;
  font-weight: 500;
}
.empty-state p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.empty-icon {
  font-size: 44px;
  color: #b6c9bd;
  margin-bottom: 17px;
}
.mailbox-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 25px 24px 20px;
}
.mailbox-heading h2 {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.mailbox-heading p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}
.mailbox-heading button {
  white-space: nowrap;
}
.mail-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}
.mail-toolbar > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mail-toolbar button {
  font-size: 12px;
  padding: 7px 10px;
}
.auto-refresh {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.message-list {
  padding: 0 20px;
}
.message-item {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 4px;
  border: 0;
  border-bottom: 1px solid #edf0ed;
  border-radius: 0;
  text-align: left;
}
.message-item.selected {
  background: #f1f7f3;
}
.message-item > div {
  min-width: 0;
}
.message-item .subject {
  font-weight: 500;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-item .message-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
  overflow-wrap: anywhere;
}
.code-chip {
  font-size: 14px;
  color: var(--green);
  font-weight: 600;
  letter-spacing: 1.5px;
  background: #edf5ef;
  padding: 7px 10px;
  border-radius: 5px;
  white-space: nowrap;
}
.list-empty {
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
  font-size: 13px;
  padding: 56px 22px;
}
.message-detail {
  padding: 24px;
  border-top: 1px solid var(--line);
  margin-top: 15px;
}
.detail-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.detail-top h3 {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.detail-top button {
  font-size: 12px;
  white-space: nowrap;
}
.detail-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
  margin-top: 12px;
  overflow-wrap: anywhere;
}
.verification-code {
  display: inline-block;
  background: #edf5ef;
  color: var(--green);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 5px;
  padding: 14px 20px;
  border-radius: 7px;
  margin-top: 22px;
}
#detail-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.9;
  font:
    13px/1.9 Inter,
    "Microsoft YaHei",
    sans-serif;
  margin-top: 24px;
  color: #48564e;
}
.load-more {
  display: block;
  margin: 14px auto;
  font-size: 12px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  color: #8c988f;
  font-size: 11px;
  line-height: 1.8;
  padding-top: 19px;
}
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 25px;
}
.login-card {
  width: 100%;
  max-width: 410px;
  padding: 35px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 15px 60px #163e2610;
}
.login-card h1 {
  font-size: 24px;
  margin-top: 22px;
}
.login-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 10px 0 24px;
}
.login-card label {
  margin-top: 20px;
}
.login-card button {
  width: 100%;
  margin-top: 25px;
}
.login-card p.error {
  color: #aa3e34;
  min-height: 0;
  margin: 12px 0;
}
.login-card small {
  display: block;
  margin-top: 16px;
}
dialog {
  width: min(470px, calc(100vw - 30px));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  box-shadow: 0 20px 90px #102e2a30;
}
dialog::backdrop {
  background: #1c32284f;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.dialog-heading h2 {
  font-size: 19px;
}
.dialog-close {
  border: 0;
  padding: 0 4px;
  font-size: 25px;
  color: #839087;
  background: transparent;
}
dialog label {
  margin-top: 20px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 27px;
}
.form-note {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
  margin-top: 17px;
}
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #263e32;
  color: white;
  border-radius: 8px;
  padding: 13px 20px;
  z-index: 10;
  max-width: min(90vw, 600px);
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 4px 20px #0002;
}
.toast.is-error {
  background: #8d3f35;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 900px) {
  .inbox-layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .mail-toolbar {
    flex-wrap: wrap;
  }
  .mailbox-heading {
    padding: 20px 16px;
  }
  .mailbox-heading h2 {
    font-size: 13px;
  }
  .domain-label {
    display: none;
  }
  .mailbox-heading button {
    font-size: 12px;
  }
}
@media (max-width: 650px) {
  .mailbox-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .detail-top {
    align-items: flex-start;
    flex-direction: column;
  }
  .detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  main {
    padding-top: 24px;
  }
  .topbar {
    height: 68px;
  }
  .brand {
    font-size: 15px;
  }
  .top-actions {
    gap: 3px;
  }
  .top-actions button {
    font-size: 12px;
    padding: 8px;
  }
  .inbox-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .mailbox-list {
    max-height: 220px;
  }
  .mailbox-panel .panel-heading {
    padding-top: 12px;
  }
  .search-label {
    padding-bottom: 8px;
  }
  .mailbox-item {
    padding: 10px;
  }
  .page-heading h1 {
    font-size: 24px;
  }
  .page-heading p {
    font-size: 11px;
  }
  .mail-panel {
    min-height: 350px;
  }
  .empty-state {
    min-height: 300px;
  }
  .mail-toolbar > div {
    gap: 7px;
  }
  .message-detail {
    padding: 20px;
  }
  .login-card {
    padding: 28px;
  }
  .domain-label {
    display: none;
  }
  footer {
    font-size: 10px;
  }
}
