:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
  background: #f4f6f8;
  color: #172033;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
main { max-width: 1180px; margin: auto; padding: 28px; }
h1, h2 { margin: 0; }
h1 { font-size: 28px; letter-spacing: -.04em; }
h2 { font-size: 18px; }
p { margin: 8px 0; }
.hidden { display: none !important; }
.muted { color: #697386; font-size: 13px; }
.eyebrow { color: #3478f6; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.card, dialog { background: #fff; border: 1px solid #e4e8ef; border-radius: 8px; box-shadow: 0 10px 28px rgba(31, 45, 61, .06); }
form { display: grid; gap: 10px; }
label { font-size: 13px; font-weight: 700; margin-top: 12px; }
input, textarea, select { width: 100%; border: 1px solid #d7dde7; border-radius: 10px; padding: 11px 12px; background: #fff; color: #172033; font: inherit; }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: #3478f6; cursor: pointer; }
textarea { resize: vertical; min-height: 190px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
button { border: 0; border-radius: 9px; padding: 10px 14px; background: #3478f6; color: #fff; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; }
button:hover { filter: brightness(.96); }
button:disabled { cursor: wait; opacity: .6; }
.secondary { background: #edf3ff; color: #285dac; }
.danger { background: #fff0f0; color: #bd3232; }
.icon-button { background: transparent; color: #697386; font-size: 25px; line-height: 1; padding: 4px 8px; }
header, .section-title, .summary, .toolbar, .dialog-actions, .mail-toolbar, .panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
header { margin-bottom: 22px; }
.summary { margin-bottom: 16px; align-items: stretch; }
.stat { min-width: 170px; padding: 18px; display: grid; gap: 7px; color: #697386; font-size: 13px; }
.stat strong { color: #172033; font-size: 28px; }
.toolbar { flex: 1; padding: 14px; flex-wrap: wrap; }
.toolbar input { flex: 1 1 360px; min-width: 220px; }
.accounts-panel { padding: 18px; }
.table-wrap { overflow: visible; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 10px; border-top: 1px solid #eef1f5; font-size: 13px; }
th { color: #697386; font-size: 12px; }
th:last-child, td:last-child { text-align: right; }
.select-col { width: 34px; text-align: center; }
.selected-row { background: #f7faff; }
.actions { min-width: 190px; position: relative; }
.action-menu { display: inline-flex; justify-content: flex-end; gap: 7px; position: relative; }
.more-menu { position: relative; }
.more-trigger::after { content: "▾"; margin-left: 6px; font-size: 10px; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; display: none; min-width: 150px; padding: 6px; border: 1px solid #e4e8ef; border-radius: 8px; background: #fff; box-shadow: 0 12px 30px rgba(31, 45, 61, .14); text-align: left; }
.more-menu.open .menu-panel { display: grid; gap: 2px; }
.menu-item { width: 100%; padding: 9px 10px; border-radius: 6px; background: transparent; color: #172033; text-align: left; font-size: 13px; font-weight: 650; }
.menu-item:hover { background: #f4f7fb; filter: none; }
.menu-item.danger { color: #bd3232; }
.menu-item.danger:hover { background: #fff0f0; }
.menu-separator { height: 1px; margin: 5px 4px; background: #eef1f5; }
.empty { padding: 40px; text-align: center; color: #697386; }
.error { min-height: 18px; color: #c23934; font-size: 13px; }
dialog { width: min(860px, calc(100% - 32px)); padding: 0; }
dialog::backdrop { background: rgba(15, 24, 38, .36); }
.dialog-card { padding: 20px; }
.dialog-actions { justify-content: flex-end; margin-top: 8px; }
.mail-dialog-card { max-height: min(780px, calc(100vh - 44px)); display: grid; grid-template-rows: auto auto 1fr; padding: 22px 24px; }
.mail-toolbar { justify-content: flex-start; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 10px 0 12px; border-top: 1px solid #eef1f5; border-bottom: 1px solid #eef1f5; }
.mail-content { min-height: 0; overflow: auto; margin-top: 14px; padding-right: 8px; }
.mail-item { margin-bottom: 14px; padding: 16px; border: 1px solid #e4e8ef; border-radius: 8px; background: #fff; }
.mail-item pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.mail-summary { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px 12px; margin: 0 0 14px; font-size: 13px; }
.mail-summary dt { color: #697386; }
.mail-summary dd { margin: 0; overflow-wrap: anywhere; }
.mail-html { overflow-x: auto; border-top: 1px solid #eef1f5; padding-top: 12px; color: #172033; }
.mail-html img { max-width: 100%; height: auto; }
.mail-html table { max-width: 100%; }
.code-label { color: #697386; font-size: 12px; font-weight: 800; }
.code { display: inline-flex; align-items: center; min-width: 72px; justify-content: center; padding: 6px 10px; border-radius: 8px; background: #fff5d8; color: #7a5200; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 12px 16px; border-radius: 10px; background: #172033; color: #fff; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
@media (max-width: 680px) {
  main { padding: 16px; }
  .summary { display: grid; }
  .toolbar { display: grid; }
  .table-wrap { overflow-x: auto; }
  th:nth-child(2), td:nth-child(2) { display: none; }
}
