:root {
  color-scheme: light;
  font: 13px/1.45 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --ink: #283348;
  --dim: #526079;
  --navy: #202d43;
  --rule: #cbd2db;
  --soft-rule: #e4e8ee;
  --caption: #e9edf3;
  --paper: #fffdf7;
  --blue: #284d7e;
  --active: #dbe8f9;
  --amber: #b96b29;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  background: #f5f7fb;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible, input:focus-visible, button:focus-visible {
  outline: 2px solid #376ea8;
  outline-offset: -2px;
}
.skip { position: absolute; top: -100px; left: 12px; z-index: 5; background: white; padding: 8px; }
.skip:focus { top: 8px; }
.masthead {
  min-height: 60px;
  border-top: 3px solid #d4995a;
  background: var(--navy);
  color: #eef2f8;
  padding: 0 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { font-size: 21px; letter-spacing: -.045em; line-height: 1; }
.brand-label { color: #b9c4d6; border-left: 1px solid #57647a; padding-left: 11px; margin-left: 3px; }
.brand-icon {
  display: block;
  width: 52px;
  height: auto;
  flex: none;
}
.endpoint { font: 12px var(--mono); text-align: right; overflow-wrap: anywhere; }
.endpoint span { color: #c0cada; margin-right: 7px; }

.layout {
  display: grid;
  grid-template-columns: clamp(214px, 23vw, 305px) minmax(0, 1fr);
  height: calc(100dvh - 91px);
  min-height: 530px;
}
.directory, .messages, .reader, .workspace { min-width: 0; min-height: 0; }
.directory, .messages, .reader { display: flex; flex-direction: column; }
.directory { border-right: 1px solid var(--rule); background: #f3f5f8; }
.workspace { display: grid; grid-template-rows: minmax(235px, 48%) minmax(0, 1fr); }
.messages { border-bottom: 5px solid #dce2eb; background: #fff; }
.reader { background: var(--paper); }

.pane-caption {
  min-height: 39px;
  padding: 5px 13px;
  border-bottom: 1px solid var(--rule);
  background: var(--caption);
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: space-between;
}
.pane-caption h1, .pane-caption h2 { margin: 0; font-size: 13px; font-weight: 730; }
.list-caption > div { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; }
.list-caption h1 { font: 700 14px var(--mono); overflow-wrap: anywhere; }
.caption-count { color: var(--dim); font-size: 11px; }
.catalog-tabs { display: flex; gap: 1px; padding: 8px 9px 0; border-bottom: 1px solid var(--rule); }
.catalog-tabs a, .reader-tabs a { padding: 5px 8px; color: var(--dim); white-space: nowrap; }
.catalog-tabs a:hover, .reader-tabs a:hover { color: var(--blue); background: #e0e8f3; }
.catalog-tabs a[aria-current], .reader-tabs a[aria-current] {
  background: #fff;
  color: var(--blue);
  box-shadow: inset 0 -2px var(--blue);
  font-weight: 700;
}
.search {
  display: flex;
  min-width: 0;
  margin: 8px 9px;
}
.search input, .search button {
  border: 1px solid #bfc9d8;
  min-height: 28px;
  font: inherit;
  background: white;
  color: var(--ink);
}
.search input { flex: 1; width: 100%; min-width: 0; padding: 3px 8px; border-radius: 4px 0 0 4px; }
.search input::placeholder { color: var(--dim); }
.search button { padding: 0; border-left: 0; width: 31px; flex: none; border-radius: 0 4px 4px 0; cursor: pointer; }
.search button:hover { background: var(--active); }
.search-icon { display: inline-block; width: 9px; height: 9px; border: 1.5px solid var(--blue); border-radius: 50%; position: relative; }
.search-icon::after { content: ""; width: 5px; height: 1.5px; background: var(--blue); position: absolute; top: 6px; left: 6px; transform: rotate(48deg); transform-origin: left; }
.directory-scroll, .message-scroll, .body-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-color: #bdc9d8 transparent; }
.group-list { list-style: none; margin: 0; padding: 0 5px 6px; }
.group-list a {
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 27px;
  padding: 3px 7px;
  border-radius: 3px;
}
.group-list a:hover { background: #e8eef6; }
.group-list a[aria-current] { color: #203f68; background: var(--active); box-shadow: inset 2px 0 var(--blue); font-weight: 700; }
.group-name, .group-count { font-family: var(--mono); font-size: 11px; }
.group-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-count { color: var(--dim); }
.group-icon { width: 12px; height: 8px; border: 1px solid #9d703d; background: #efd7b3; border-radius: 2px; position: relative; }
.group-icon::before { content: ""; position: absolute; top: -3px; left: -1px; width: 6px; height: 3px; border-radius: 2px 2px 0 0; background: #9d703d; }

.list-toolbar { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 6px; background: #f6f8fb; border-bottom: 1px solid var(--rule); padding: 3px 10px; }
.list-toolbar .search { margin: 0; width: min(245px, 50%); }
.row-controls { display: flex; gap: 4px; }
.tool { display: inline-block; color: var(--blue); border: 1px solid #c6d1df; background: #fbfcfe; border-radius: 4px; padding: 3px 8px; white-space: nowrap; font-size: 12px; }
a.tool:hover { background: var(--active); border-color: #a5b9d6; }
.tool.disabled { color: #748094; background: transparent; border-color: transparent; }
.thread-filter { padding: 5px 13px; display: flex; justify-content: space-between; gap: 12px; color: #435777; background: #edf3ff; }
.thread-filter strong { overflow-wrap: anywhere; }
.thread-filter a { flex: none; text-decoration: underline; }
.message-table { width: 100%; table-layout: fixed; border-spacing: 0; text-align: left; }
.message-table th { position: sticky; top: 0; z-index: 1; background: #edf1f6; border-bottom: 1px solid var(--rule); border-right: 1px solid #d8dfe9; color: #414f67; padding: 0; font-size: 11px; }
.message-table th a { display: block; padding: 4px 8px; }
.message-table th a:hover { background: #dbe7f8; }
.message-table th[aria-sort="ascending"], .message-table th[aria-sort="descending"] { color: #254871; background: #e1eaf7; }
.message-table th:first-child a { padding-left: 18px; }
.col-author { width: 27%; }
.col-date { width: 115px; }
.col-number { width: 64px; }
.message-table td { padding: 3px 8px; border-bottom: 1px solid var(--soft-rule); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-table td:first-child { padding: 0; }
.message-row:nth-child(even) { background: #f8faff; }
.message-row:hover { background: #eef4fe; }
.message-row.selected { background: var(--active); }
.message-row.selected td:first-child { box-shadow: inset 3px 0 var(--blue); }
.message-link { display: flex; align-items: center; gap: 7px; padding: 4px 7px 4px 12px; min-height: 25px; }
.message-link .subject { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.message-link.unread .subject, .message-row.selected .subject { font-weight: 670; }
.read-dot { width: 6px; height: 6px; border-radius: 50%; border: 1px solid #8796a9; flex: none; }
.unread .read-dot { background: var(--amber); border-color: var(--amber); }
.reply-arrow { color: var(--blue); }
.message-row .author { font-size: 12px; color: #445670; }
.message-row .date, .message-row .number { font: 11px var(--mono); color: var(--dim); }
.pager { display: flex; justify-content: space-between; padding: 4px 12px; border-top: 1px solid var(--rule); color: var(--blue); background: #f0f3f8; }
.pager a:hover { text-decoration: underline; }

.reader-caption { justify-content: flex-start; padding-block: 3px; }
.reader-tabs { display: flex; gap: 2px; }
.message-id { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font: 11px var(--mono); }
.message-heading { padding: 16px clamp(16px, 3vw, 40px) 11px; border-bottom: 1px solid #ebe4d7; }
.message-heading h2 { font-size: clamp(17px, 2.1vw, 26px); line-height: 1.3; margin: 0 0 8px; overflow-wrap: anywhere; }
.message-heading dl { display: flex; flex-wrap: wrap; gap: 3px 18px; margin: 0; font-size: 12px; }
.message-heading dl div { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.message-heading dt { color: var(--dim); }
.message-heading dd { margin: 0; }
.article-body { padding: 14px clamp(16px, 3vw, 40px) 30px; margin: 0; font: 13px/1.65 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.quote { color: #4d6a74; }
.raw-body { tab-size: 4; }
.empty { padding: 10px 14px; margin: 0; color: var(--dim); }
.statusbar { display: flex; align-items: center; gap: 15px; min-height: 31px; padding: 4px 13px; border-top: 1px solid var(--rule); color: var(--dim); background: #edf0f5; font-size: 11px; }
.read-only { color: #435777; }
.read-only i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #506e87; }
.status-sync { margin-left: auto; }
.status-sync time { font-family: var(--mono); }
.mobile { display: none; }
.error { margin: 22px auto; max-width: 640px; padding: 22px; background: white; border: 1px solid var(--rule); }
.error a { color: var(--blue); text-decoration: underline; }

@media (max-width: 800px) {
  .masthead { min-height: 51px; padding: 0 11px; }
  .brand-icon { width: 42px; }
  .brand strong { font-size: 18px; }
  .brand-label { display: none; }
  .layout { display: flex; flex-direction: column; height: auto; min-height: calc(100dvh - 84px); }
  .workspace { display: contents; }
  .messages { order: -1; border-bottom-width: 1px; }
  .reader { display: none; }
  .reading .reader { display: flex; order: -2; }
  .message-scroll, .directory-scroll, .body-scroll { flex: auto; max-height: none; }
  .directory { border-right: 0; margin-top: 10px; border-top: 1px solid var(--rule); }
  .mobile { display: inline-block; color: var(--blue); font-weight: 650; }
  .col-author, .message-row .author { display: none; }
  .col-date { width: 81px; }
  .col-number { width: 47px; }
  .reader-caption { flex-wrap: wrap; }
  .message-id { display: none; }
}
