:root {
  color-scheme: light;
  --nav: #14233d;
  --ink: #111827;
  --muted: #536177;
  --line: #ccd4df;
  --wash: #eef1f5;
  --accent: #006bd6;
  --selected: #d8ebff;
  background: #fff;
  color: var(--ink);
  font: 16px/1.5 system-ui, 'Microsoft YaHei', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; margin: 0; }
button, input { font: inherit; }
button {
  padding: .55rem .92rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}
button:hover:enabled { background: var(--wash); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 650; }
.primary:hover:enabled { background: #005bb8; }
.topbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem clamp(1rem, 2.2vw, 2rem);
  background: var(--nav);
  color: #fff;
}
.wordmark { display: flex; gap: .85rem; align-items: center; font-size: 1.22rem; font-weight: 750; }
.envelope { position: relative; width: 30px; height: 22px; border: 2px solid currentColor; border-radius: 3px; overflow: hidden; }
.envelope::after { content: ''; display: block; width: 20px; height: 20px; transform: rotate(45deg); border: solid currentColor; border-width: 0 2px 2px 0; position: absolute; left: 3px; top: -13px; }
.logout { color: #fff; background: transparent; border-color: transparent; }
.logout:hover:enabled { background: #263858; }
main { max-width: 1560px; margin: 0 auto; padding: 0 clamp(1rem, 2vw, 2rem) 2rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 3vw, 2.35rem); line-height: 1.2; }
h2 { font-size: 1.32rem; line-height: 1.3; }
.page-heading, .inbox-heading, .heading-group, .controls, .message-meta { display: flex; align-items: center; }
.page-heading { justify-content: space-between; gap: 1rem; min-height: 112px; border-bottom: 1px solid var(--line); }
.heading-group { flex-wrap: wrap; gap: 1rem; min-width: 0; }
.heading-group span:not(:empty) { border-left: 1px solid var(--line); padding-left: 1rem; color: var(--muted); overflow-wrap: anywhere; }
.page-heading .heading-group span { font-size: 1.2rem; }
.workspace-grid { display: grid; grid-template-columns: minmax(220px, .93fr) minmax(0, 3fr); gap: 1rem; padding-top: 2rem; }
.mailbox-list { background: var(--wash); min-height: 64vh; border-radius: 5px; overflow: hidden; }
.mailbox-list h2 { padding: 1rem; }
.mailbox-list ul { list-style: none; padding: 0; margin: 0; }
.mailbox-list li + li { border-top: 1px solid var(--line); }
.mailbox-list button { display: block; width: 100%; border: 0; border-left: 4px solid transparent; border-radius: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; background: transparent; }
.mailbox-list button:focus-visible { outline-offset: -3px; }
.mailbox-list button[aria-current='true'], .mailbox-list button:hover { background: var(--selected); }
.mailbox-list button[aria-current='true'] { border-left-color: var(--accent); }
.mailbox-list button span { display: block; }
.mailbox-list .expiry { color: var(--muted); font-size: .85rem; margin-top: .16rem; }
.address { font-family: ui-monospace, Consolas, monospace; font-size: .875rem; }
.muted, .empty { color: var(--muted); padding: 1rem; }
.inbox-heading { flex-wrap: wrap; justify-content: space-between; gap: .85rem; padding: .5rem 0 1rem; }
.controls { gap: .55rem; }
.mail-table, .reader { border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { text-align: left; padding: .68rem .9rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { background: var(--wash); }
th:last-child { width: 10.5rem; }
td:last-child, .message-meta, .notice { color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.selected { background: var(--selected); }
.subject-button { padding: 0; border: 0; background: transparent; text-align: left; white-space: normal; overflow-wrap: anywhere; font-weight: 650; }
.subject-button:hover:enabled { background: transparent; text-decoration: underline; }
.reader { margin-top: 1.2rem; min-height: 310px; padding: 1.15rem 1.3rem; }
.reader h2 { overflow-wrap: anywhere; }
.message-meta { justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.message-body { padding: 1rem 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.login { max-width: 440px; margin: clamp(3rem, 12vh, 8rem) auto 0; border: 1px solid var(--line); border-radius: 7px; padding: 2rem; }
.login h1 { font-size: 1.65rem; margin-bottom: 1.4rem; }
.login form { display: grid; gap: .65rem; }
.login input { border: 1px solid var(--line); border-radius: 5px; padding: .65rem .8rem; width: 100%; }
.login button { margin-top: .55rem; }
.notice { margin-top: .75rem; min-height: 1.5rem; overflow-wrap: anywhere; }
.notice[data-error='true'] { color: #a92323; }
@media (max-width: 720px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr); padding-top: 1rem; }
  .mailbox-list { min-height: 0; max-height: 190px; overflow: auto; }
  .page-heading { min-height: 85px; }
  .page-heading .heading-group { gap: .28rem; display: grid; }
  .page-heading .heading-group span:not(:empty) { border: 0; padding: 0; font-size: .9rem; }
  .inbox-heading .heading-group { gap: .5rem; }
  th, td { padding: .55rem .48rem; font-size: .88rem; }
  th:last-child { width: 5.8rem; }
  .reader { padding: .95rem; }
}
