:root {
  --ink: #183a31;
  --text: #202e29;
  --muted: #5c6963;
  --line: #dce3de;
  --paper: #fff;
  --wash: #f3f5f2;
  --accent: #266a50;
  --warn: #8d5117;
  --danger: #a02a2a;
  --radius: 8px;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--wash);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 40px;
  padding: 8px 15px;
  font-weight: 600;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
button:hover {
  filter: brightness(0.95);
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #aebcb3;
  background: #fff;
  border-radius: 5px;
  padding: 10px;
  color: var(--text);
  caret-color: var(--accent);
}
input[type="file"] {
  border: 0;
  padding: 5px;
  font-size: 12px;
}
textarea {
  resize: vertical;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 6px;
}
h1 {
  font-size: 27px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
h2 {
  font-size: 17px;
  margin: 26px 0 14px;
}
p {
  margin: 8px 0 14px;
}
small,
.hint,
.subtle {
  color: var(--muted);
  font-weight: 400;
}
.hint {
  font-size: 12px;
  line-height: 1.7;
  max-width: 80ch;
}
.subtle {
  font-size: 12px;
  margin-left: 10px;
}
.primary {
  background: var(--accent);
  color: #fff;
}
.secondary {
  border-color: #bccbc2;
  background: #f0f5f1;
  color: var(--ink);
}
.quiet {
  background: transparent;
  color: var(--muted);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid #cc9b37;
  outline-offset: 3px;
}
summary:focus-visible {
  outline: 3px solid #cc9b37;
  outline-offset: 3px;
}
::selection {
  background: #c8dfcf;
  color: #133526;
}
* {
  scrollbar-color: #a7b9ad var(--wash);
  scrollbar-width: thin;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
pre {
  white-space: pre-wrap;
  word-break: break-all;
  background: var(--wash);
  padding: 10px;
  font-size: 12px;
}
aside {
  width: 224px;
  background: var(--ink);
  color: #fff;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  padding: 26px 16px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 700;
  font-size: 17px;
  margin: 0 10px 30px;
}
.brand small {
  display: block;
  color: #b4c9be;
  font-size: 12px;
  font-weight: 400;
}
.brandmark {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  background: #d5e7cf;
  color: #214633;
  border-radius: 9px;
  font-weight: 800;
  font-size: 20px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
nav button {
  text-align: left;
  color: #d5e3db;
  background: transparent;
  font-weight: 400;
  padding: 11px 16px;
}
nav button:hover {
  background: #285045;
}
nav button.active {
  background: #e1edde;
  color: #1b4332;
  font-weight: 700;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 18px 12px 0;
  font-size: 12px;
  color: #d5e3db;
}
.sidebar-bottom small {
  color: #b4c9be;
  padding-left: 15px;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #b5d499;
  border-radius: 50%;
  margin-right: 7px;
}
.workspace {
  margin-left: 224px;
}
header {
  height: 70px;
  padding: 0 36px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
header > div {
  display: flex;
  gap: 10px;
  align-items: center;
}
.mode-banner {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 11px 36px;
  background: #eee9da;
  color: #684a1e;
  font-size: 12px;
}
.mode-banner strong {
  white-space: nowrap;
}
main {
  padding: 30px 36px;
  max-width: 1600px;
  min-height: calc(100vh - 165px);
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 26px;
}
.page-heading p {
  color: var(--muted);
  margin-bottom: 0;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
article {
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
article h2 {
  margin-top: 0;
}
.split article {
  border: 0;
  border-radius: 0;
}
.stock-summary {
  border-right: 1px solid var(--line) !important;
}
.stock-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.stock-line strong {
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1.2;
}
.stock-line > span {
  font-size: 14px;
  color: var(--muted);
}
.meter {
  height: 6px;
  border-radius: 4px;
  background: #e2e9e3;
  margin: 16px 0;
}
.meter > div {
  height: 100%;
  background: var(--accent);
  width: 0;
  max-width: 100%;
}
.notice-list {
  padding-left: 20px;
  color: var(--warn);
}
.notice-list li {
  margin: 10px 0;
}
.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 16px 0;
}
.mailbox-parent-picker {
  max-width: 560px;
}
.mailbox-list-controls {
  display: flex;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}
.mailbox-list-controls > div:first-child { flex: 1 1 240px; }
.mailbox-list-controls > div:last-child { flex: 0 0 110px; }
.mailbox-list-controls label { margin-top: 0; }
.mailbox-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.mailbox-pagination > span { flex: 1 1 180px; }
.mailbox-paged-table .table-wrap { max-height: 560px; }
.mailbox-paged-table th { position: sticky; top: 0; }
.mailbox-paged-table td { padding-top: 10px; padding-bottom: 10px; }
.mailbox-row-detail { white-space: normal; min-width: 140px; max-width: 320px; overflow-wrap: anywhere; }
.mailbox-row-detail summary { white-space: nowrap; cursor: pointer; color: var(--accent); }
.mailbox-diagnostics { margin: 12px 0; }
.mailbox-diagnostics > summary,
.mailbox-settings > summary { cursor: pointer; color: var(--ink); min-height: 40px; padding: 8px 0; }
.mailbox-settings { margin: 24px 0; border-top: 1px solid var(--line); padding-top: 12px; }
#alias-creation-status { font-weight: 600; font-variant-numeric: tabular-nums; }
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #f8faf7;
}
td,
th {
  padding: 14px 16px;
  border-bottom: 1px solid #e8eee8;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fbfcf9;
}
td small {
  display: block;
}
td button {
  font-size: 12px;
  padding: 6px 10px;
  min-height: 34px;
}
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  background: #edf1ed;
  color: #47584d;
  font-size: 12px;
  font-weight: 600;
}
.badge.good {
  background: #e3f0e5;
  color: #22613b;
}
.badge.warn {
  background: #fcf0dd;
  color: #825016;
}
.badge.bad {
  background: #f8e5e3;
  color: #962e27;
}
.workflow-note {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}
.two-col {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
}
.drop-zone {
  border: 1px dashed #8ca797;
  border-radius: 6px;
  background: #f8fbf7;
  padding: 22px;
  text-align: center;
  cursor: pointer;
}
.drop-zone strong,
.drop-zone span {
  display: block;
}
.drop-zone span {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0;
}
.drop-zone.drag {
  background: #e0eedf;
}
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.actions input {
  max-width: 260px;
}
.actions select {
  max-width: 220px;
}
.actions label {
  margin: 0;
}
.empty {
  text-align: center;
  padding: 34px;
  color: var(--muted);
  border: 1px dashed var(--line);
  background: #fff;
  border-radius: var(--radius);
  margin: 16px 0;
}
.message {
  padding: 12px 16px;
  border: 1px solid #bfd2c3;
  background: #eaf4e9;
  margin-bottom: 18px;
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.message.error {
  background: #fff0e9;
  border-color: #e3b99a;
  color: #8b3e16;
}
.form-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
.form-row > div {
  width: 200px;
}
.task-composer {
  margin-bottom: 24px;
}
#parent-maintenance-status {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
#parent-maintenance-feedback {
  margin: 14px 0 0;
}
.developer-self-test {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.developer-self-test summary {
  padding: 14px 18px;
  cursor: pointer;
  min-height: 44px;
  font-weight: 600;
}
.developer-self-test-body {
  padding: 0 18px 18px;
}
.task-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.task-head {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.task-head code {
  font-size: 12px;
  color: var(--muted);
}
.task-assets {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.asset-item {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #fff;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.asset-item img {
  width: 120px;
  height: 90px;
  object-fit: contain;
  background: #eff4ed;
}
.task-info {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}
.task-info b {
  color: var(--text);
}
footer {
  padding: 20px 36px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #eaf0e8;
  padding: 24px;
}
.login-inner {
  width: 440px;
  max-width: 100%;
  background: #fff;
  padding: 42px;
  border: 1px solid #cddace;
  border-radius: 12px;
}
.login-inner h1 {
  margin-top: 22px;
}
.login-inner button {
  margin-top: 14px;
  width: 100%;
}
.login-inner p {
  color: var(--muted);
}
#login-error {
  color: var(--danger);
}
[hidden] {
  display: none !important;
}
@media (max-width: 1000px) {
  aside {
    width: 185px;
    padding: 20px 10px;
  }
  .workspace {
    margin-left: 185px;
  }
  header {
    padding: 0 22px;
  }
  main {
    padding: 24px 22px;
  }
  .mode-banner {
    padding: 10px 22px;
  }
  .brand {
    font-size: 15px;
    margin-left: 4px;
  }
  .split,
  .two-col {
    grid-template-columns: 1fr;
  }
  .stock-summary {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }
  .form-row {
    flex-wrap: wrap;
  }
  .subtle {
    display: block;
    margin-left: 0;
  }
}
@media (max-width: 650px) {
  aside {
    position: static;
    width: 100%;
    padding: 16px;
  }
  .brand {
    margin: 0 0 14px;
  }
  .brand small {
    display: none;
  }
  nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 5px;
  }
  nav button {
    white-space: nowrap;
    padding: 8px 12px;
  }
  .sidebar-bottom {
    display: none;
  }
  .workspace {
    margin: 0;
  }
  header {
    height: auto;
    min-height: 58px;
    padding: 10px 16px;
    gap: 8px;
    flex-wrap: wrap;
  }
  header > div {
    gap: 4px;
  }
  #identity {
    display: none;
  }
  .mode-banner {
    align-items: flex-start;
    padding: 10px 16px;
    gap: 10px;
  }
  .mode-banner span {
    font-size: 12px;
  }
  main {
    padding: 24px 16px;
  }
  h1 {
    font-size: 24px;
  }
  .page-heading {
    gap: 12px;
  }
  .page-heading > .primary {
    font-size: 12px;
    white-space: nowrap;
    padding: 8px 12px;
  }
  .two-col {
    gap: 14px;
  }
  article {
    padding: 18px;
  }
  .form-row > div {
    width: calc(50% - 7px);
  }
  .form-row > .primary {
    width: 100%;
  }
  .task-head code {
    font-size: 12px;
    overflow-wrap: anywhere;
  }
  footer {
    padding: 20px 16px;
    display: block;
  }
  footer span {
    display: block;
  }
  .asset-item {
    width: 100%;
  }
  .actions input {
    max-width: 100%;
  }
  .login-inner {
    padding: 28px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .message {
    animation: appear 0.2s ease-out;
  }
  @keyframes appear {
    from {
      clip-path: inset(0 0 100% 0);
    }
    to {
      clip-path: inset(0);
    }
  }
}

.preview-slot {
  width: 120px;
  min-height: 90px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
}
.interactive-actions { flex-wrap: wrap; margin-block: 16px; }
.interactive-confirm { display: flex; align-items: center; gap: 10px; margin-block: 16px; }
.interactive-confirm input { width: 20px; min-height: 20px; }
.interactive-history, .interactive-message { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.interactive-history summary, .interactive-message summary { cursor: pointer; padding-block: 10px; }
.interactive-message pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
#gpt-bound-email { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  #mailboxes .form-row > div { flex-basis: 100%; min-width: 0; width: 100%; }
  #parent-job { overflow-wrap: anywhere; }
}
