:root {
  --ink: #1c2738; --muted: #647184; --line: #e2e7ee; --paper: #fff; --canvas: #f5f7fa;
  --nav: #172332; --nav-text: #cad3dd; --blue: #415fda; --blue-dark: #334dc0;
  --green: #238263; --warn: #a4681b; --red: #b73d43;
  font: 14px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--canvas);
}
* { box-sizing: border-box }
body { margin: 0 }
button, input, select, textarea { font: inherit }
button { cursor: pointer; color: inherit }
button:disabled { cursor: default; opacity: .52 }
button, input, select, textarea { -webkit-tap-highlight-color: transparent }
button:focus-visible, summary:focus-visible { outline: 3px solid #91a5ff; outline-offset: 3px }
input:focus, select:focus, textarea:focus { outline: 2px solid #8da1f5; outline-offset: 1px }
[hidden] { display: none !important }
h1, h2, h3, p { margin: 0 }
h1 { font-size: clamp(24px, 2.2vw, 34px); font-weight: 690; letter-spacing: -.055em; line-height: 1.24 }
h2 { font-size: 19px; font-weight: 650; letter-spacing: -.03em }
h3 { font-size: 16px; font-weight: 640 }
svg.icon { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto }
.brand { display: flex; align-items: center; gap: 11px; font-size: 23px; font-weight: 680; letter-spacing: -.065em; white-space: nowrap; line-height: 1 }
.brand b { font-weight: 410 }
.brand-mark { height: 34px; width: 34px; border-radius: 10px; color: #fff; background: var(--blue); box-shadow: inset 0 1px 0 #ffffff35 }
.brand-mark svg.icon { width: 22px; height: 22px }
.button, .compose-button { border: 1px solid #d5dce6; background: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: 7px; font-weight: 550; min-height: 36px; white-space: nowrap }
.button:hover:enabled { background: #f2f4f9 }
.primary, .compose-button { color: #fff; border-color: var(--blue); background: var(--blue) }
.primary:hover:enabled, .compose-button:hover:enabled { background: var(--blue-dark) }
.danger { color: #fff; background: var(--red); border-color: var(--red) }
.danger:hover:enabled { background: #98333b }
.icon-button, .small-icon { display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); width: 34px; height: 34px; flex: 0 0 auto }
.icon-button:hover:enabled { background: #edf0f5; color: var(--ink) }
.link-button { padding: 4px 0; background: none; border: 0; font-size: 13px; font-weight: 550; color: var(--blue) }
.muted { color: var(--muted) }
.startup { min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 15px; color: var(--muted) }
.startup .brand { color: var(--ink) }
.workspace { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 220px minmax(0,1fr); overflow: hidden }
.sidebar { min-height: 0; display: flex; flex-direction: column; padding: 28px 15px 16px; background: var(--nav); color: #fff }
.sidebar .brand { padding: 0 10px }
.compose-button { width: 100%; margin: 32px 0 29px; min-height: 42px; gap: 9px; font-size: 15px }
.nav-title { color: #96a5b7; font-size: 11px; font-weight: 620; letter-spacing: .14em; margin: 0 9px 10px; min-height: 20px; display: flex; align-items: center; justify-content: space-between }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--nav-text); text-align: left; min-height: 40px; font-size: 14px; font-weight: 490 }
.nav-item:hover { background: #ffffff0f; color: #fff }
.nav-item.active { background: #334158; color: #fff; font-weight: 610 }
.nav-item.active > [data-icon] { color: #c3ccff }
.nav-item .nav-count { margin-left: auto; font-size: 11px; border-radius: 4px; background: #53647b; padding: 1px 6px; color: #fff }
.nav-item .account-name { white-space: nowrap; text-overflow: ellipsis; overflow: hidden }
.nav-group + .nav-group { margin-top: 25px; padding-top: 23px; border-top: 1px solid #ffffff1a }
.account-group { min-height: 0; overflow-y: auto }
.small-icon { color: #adbacb; width: 23px; height: 22px }
.small-icon:hover { background: #ffffff1a; color: #fff }
.small-icon svg { width: 14px; height: 14px }
.dot { height: 7px; width: 7px; background: #99a6b7; display: inline-block; flex: 0 0 auto; border-radius: 50% }
.dot.ok { background: #56bc96 }
.dot.error { background: #e48075 }
.dot.pending { background: #dbb26e }
.nav-item .dot { margin-left: 5px; margin-right: 6px }
.nav-empty { color: #9dacbe; font-size: 12px; margin: 2px 12px 12px }
.side-footer { padding-top: 16px; border-top: 1px solid #ffffff1a; margin-top: auto }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0 }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 30px; min-height: 56px }
.breadcrumb, .sync-label { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; min-width: 0 }
.breadcrumb strong { font-weight: 540; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; overflow: hidden }
.breadcrumb i { font-style: normal; color: #bcc4d0 }
.breadcrumb .icon { width: 15px; height: 15px }
.sync-label { margin-left: auto; gap: 7px; white-space: nowrap; font-size: 12px }
.mobile-nav, .reader-back, .overlay { display: none }
.mail-view, .settings-view { display: flex; flex: 1; min-height: 0; flex-direction: column; padding: 0 28px 24px }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 112px; padding: 23px 0 }
.page-heading { min-width: 0 }
.page-heading h1 { overflow-wrap: anywhere }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 13px }
.mail-columns { display: grid; grid-template-columns: minmax(250px, 37%) minmax(0,1fr); min-height: 0; flex: 1; border: 1px solid #dae1e9; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 5px #17253604 }
.list-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line) }
.search { margin: 17px 17px 0; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #f6f8fa; color: #808d9e }
.search:focus-within { outline: 2px solid #aebafa }
.search input { width: 100%; border: 0; background: transparent; outline: none; color: var(--ink); font-size: 13px }
.search input:focus { outline: none }
.search svg { width: 16px; height: 16px }
.list-top, .pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px }
.list-top { min-height: 51px; padding: 6px 19px; border-bottom: 1px solid var(--line) }
.list-top strong { font-weight: 600; font-size: 13px }
.list-top > span, .pagination { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums }
.message-list { min-height: 0; overflow-y: auto; flex: 1 }
.msg-row { display: block; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #edf0f3; padding: 14px 18px; min-height: 94px }
.msg-row:hover { background: #f6f8fb }
.msg-row.selected { background: #edf1ff; box-shadow: inset 3px 0 var(--blue) }
.row-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px }
.person, .row-subject, .preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.person { color: #4b5a6e; font-size: 13px; font-weight: 560 }
.row-top time { flex: 0 0 auto; font-size: 11px; color: var(--muted); margin-left: auto }
.msg-row.unread .person, .msg-row.unread .row-subject { color: #172332; font-weight: 660 }
.unread-dot { width: 6px; height: 6px; border-radius: 100%; background: var(--blue); flex: 0 0 auto }
.row-subject { display: block; font-size: 14px; font-weight: 530; margin-bottom: 3px }
.preview { display: block; font-size: 12px; color: var(--muted) }
.pagination { border-top: 1px solid var(--line); justify-content: center; padding: 6px 8px }
.pagination .icon-button { height: 27px; width: 29px }
.reader { min-height: 0; min-width: 0; overflow: auto; background: #fff }
.reader-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; border-bottom: 1px solid var(--line); min-height: 57px; padding: 8px 20px }
.reader-toolbar .button { font-size: 12px; min-height: 31px; padding: 5px 10px }
.reader-content { padding: clamp(19px,2.4vw,36px) }
.reader-content h2 { font-size: clamp(19px,1.8vw,26px); line-height: 1.4; overflow-wrap: anywhere }
.read-meta { margin: 17px 0 21px; padding-bottom: 18px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; display: grid; gap: 4px }
.read-meta strong { color: var(--ink); font-weight: 570 }
.read-body { line-height: 1.85; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 19px; gap: 9px; color: var(--muted) }
.reader > .empty { min-height: 100% }
.message-list > .empty { padding: 44px 18px }
.empty h2, .empty h3 { color: var(--ink) }
.empty h2 { margin-top: 4px }
.empty p { max-width: 330px; line-height: 1.7; font-size: 13px }
.empty .button { margin-top: 8px }
.empty-icon { width: 53px; height: 53px; border: 1px solid #dce3f7; border-radius: 15px; color: #647bc8; background: #f1f4fe; display: grid; place-items: center; margin-bottom: 4px }
.empty-icon svg.icon { width: 26px; height: 26px }
.message-list .empty-icon { width: 36px; height: 36px; border-radius: 10px; background: #f7f8fa; color: #8696a9; border-color: var(--line) }
.message-list .empty-icon svg { width: 18px; height: 18px }
.settings-view { overflow: auto }
.account-list { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; flex: 0 0 auto }
.account-list > .empty { min-height: 300px }
.account-card { padding: 21px; display: grid; grid-template-columns: minmax(160px,1fr) minmax(120px,1fr) auto; gap: 13px 20px; align-items: center; border-bottom: 1px solid var(--line) }
.account-card:last-child { border-bottom: 0 }
.account-id { display: flex; align-items: center; gap: 12px; min-width: 0 }
.account-id > div { min-width: 0 }
.account-id h3, .account-id p { overflow-wrap: anywhere }
.account-id p, .health-detail { font-size: 12px; color: var(--muted) }
.account-avatar { background: #ecf0ff; color: var(--blue); border-radius: 11px; width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto }
.health-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550 }
.account-actions { display: flex; align-items: center; gap: 5px }
.account-actions .button { font-size: 12px; min-height: 32px }
.account-error { grid-column: 1 / -1; color: var(--red); font-size: 13px; overflow-wrap: anywhere }
.account-technical { grid-column: 1 / -1; color: var(--muted); font-size: 12px; overflow-wrap: anywhere }
.login-screen { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; background: #f3f5fa }
.login-header { padding: 25px clamp(20px,4vw,64px) }
.login-card { width: min(394px,calc(100% - 34px)); align-self: center; justify-self: center; padding: 0 0 clamp(35px,8vh,100px) }
.login-card h1 { font-size: 29px; margin-top: 30px }
.login-card p.muted { margin-top: 9px; font-size: 14px }
.login-card form { margin-top: 23px }
.login-card .wide { margin-top: 17px; width: 100%; min-height: 43px }
.login-art { height: 120px; position: relative; border-radius: 14px; background: #dee5fa; overflow: hidden; border: 1px solid #ccd5f0 }
.airpost { width: 62%; height: 6px; position: absolute; transform: rotate(-15deg); left: -9%; top: 62%; border-block: 1px solid #91a4d5 }
.airpost::after { content: ''; display: block; margin-top: 7px; border-top: 1px solid #91a4d5 }
.letter { position: absolute; top: 22px; left: 42%; transform: rotate(-11deg); width: 145px; height: 96px; border-radius: 4px; border: 1px solid #9faecf; box-shadow: 3px 6px 0 #b5c3e45e; background: #fbfcff }
.stamp { display: grid; place-items: center; position: absolute; top: 9px; right: 9px; width: 29px; height: 32px; border: 2px dotted #fff; outline: 1px solid #929fcb; background: #6a80c1; color: white }
.stamp svg.icon { width: 14px; height: 14px }
.post-lines, .letter-lines { position: absolute; height: 11px; border-block: 1px solid #b0bcd5 }
.post-lines { width: 37px; right: 24px; top: 27px; transform: rotate(-6deg) }
.letter-lines { width: 57px; left: 12px; bottom: 20px }
dialog { border: 1px solid var(--line); border-radius: 13px; padding: 0; color: var(--ink); width: min(460px,calc(100% - 24px)); max-height: min(85dvh,780px); box-shadow: 0 18px 90px #14213835; background: #fff }
dialog[open] { display: flex; flex-direction: column }
dialog::backdrop { background: #13203170 }
.compose-dialog { width: min(620px,calc(100% - 24px)) }
.dialog-head, .dialog-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; padding: 16px 21px }
.dialog-head { justify-content: space-between; border-bottom: 1px solid var(--line) }
.dialog-actions { justify-content: flex-end; border-top: 1px solid var(--line) }
.dialog-form { display: flex; flex-direction: column; overflow: hidden; min-height: 0 }
.form-body { padding: 20px 21px; overflow-y: auto; min-height: 0 }
label { display: block; font-weight: 560; font-size: 13px }
.form-body label + label, .form-body details, .form-body fieldset, .form-body .recipient-row, .form-body .recipient-row + div:not([hidden]), .form-body div + label, .login-card .error, .form-body .error { margin-top: 13px }
label input, label select, label textarea { display: block; margin-top: 5px; width: 100%; border: 1px solid #cdd5e0; border-radius: 6px; padding: 8px 10px; color: var(--ink); background: #fff; font-weight: normal }
label input, label select { min-height: 39px }
label textarea { resize: vertical; min-height: 110px }
.optional { color: var(--muted); font-size: 11px; font-weight: normal; margin-left: 7px }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 7px }
fieldset { padding: 12px; border: 1px solid var(--line); border-radius: 7px; margin: 0 }
legend { font-size: 12px; color: var(--muted); padding: 0 5px }
.host-pair { display: grid; grid-template-columns: minmax(0,1fr) 100px; gap: 12px; align-items: end }
.host-pair > label + label { margin: 0 }
label + .host-pair { margin-top: 13px }
summary { color: var(--blue); font-size: 12px; cursor: pointer }
details[open] summary { margin-bottom: 10px }
.recipient-row { display: flex; align-items: end; gap: 12px }
.recipient-row label { flex: 1 }
.recipient-row .link-button { margin-bottom: 6px }
.error { border-radius: 6px; background: #fff2f1; color: #a6353b; padding: 8px 10px; font-size: 13px; overflow-wrap: anywhere }
.remove-text { padding: 20px; overflow-wrap: anywhere }
#remove-error { margin: 0 20px 16px }
.toast { z-index: 20; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: min(90vw,540px); color: #fff; background: #263346; border-radius: 8px; padding: 10px 16px; box-shadow: 0 3px 16px #131c3224; font-size: 13px }
@media (min-width: 1600px) {
  .workspace { grid-template-columns: 235px minmax(0,1fr) }
  .mail-columns { grid-template-columns: minmax(300px,38%) minmax(0,1fr) }
}
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 185px minmax(0,1fr) }
  .mail-view, .settings-view { padding: 0 16px 16px }
  .topbar { padding-inline: 16px }
  .account-card { grid-template-columns: minmax(0,1fr) auto }
  .account-health { grid-column: 1 / -1; grid-row: 2 }
}
@media (max-width: 840px) {
  .workspace { grid-template-columns: 1fr }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(260px,80vw); z-index: 11; transform: translateX(-100%); visibility: hidden }
  .workspace.nav-open .sidebar { transform: none; visibility: visible }
  .overlay { display: block; position: fixed; inset: 0; z-index: 10; width: 100%; height: 100%; background: #131e3266; border: 0 }
  .mobile-nav { display: inline-flex }
  .topbar { min-height: 49px; padding-inline: 10px 16px }
  .page-head { min-height: 93px }
}
@media (max-width: 660px) {
  .mail-view, .settings-view { padding: 0 12px 12px }
  .mail-columns { display: flex }
  .list-pane, .reader { width: 100%; border: none }
  .reader { display: none }
  .mail-columns.reading .list-pane { display: none }
  .mail-columns.reading .reader { display: block }
  .reader-back { display: inline-flex; margin-right: auto }
  .reader-content { padding: 19px 16px }
  .reader-toolbar { padding-inline: 10px; gap: 5px }
  .page-head { min-height: 85px }
  .breadcrumb [data-icon], .breadcrumb > span:nth-child(2), .breadcrumb i { display: none }
  .settings-view .page-heading p { max-width: 18em }
  .account-card { padding: 14px; gap: 10px }
  .account-id { gap: 8px }
  .account-actions { gap: 2px }
  .account-actions .button { padding: 4px 7px }
  dialog { max-height: 90dvh }
}
.attachments { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 14px; display: flex; flex-wrap: wrap; gap: 7px }
.attachments h3 { width: 100%; font-size: 13px; margin-bottom: 3px }
.attachment { display: inline-flex; gap: 8px; align-items: baseline; border: 1px solid #d6def3; background: #f5f7ff; border-radius: 6px; padding: 6px 9px; color: var(--blue); text-decoration: none; max-width: 100%; font-size: 12px }
.attachment:hover { text-decoration: underline }
.attachment strong { overflow-wrap: anywhere }
.attachment span { color: var(--muted); white-space: nowrap }
input[type="file"] { font-size: 12px; padding: 6px }
input::file-selector-button { border: 0; border-radius: 4px; background: #e8edf8; color: var(--ink); margin-right: 8px; padding: 4px 8px; cursor: pointer }
#file-summary { overflow-wrap: anywhere }
.add-mobile { display: none }
@media (max-width: 660px) { .add-mobile { display: inline-flex } }
#list-account { max-width: 72%; padding: 3px 4px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 580; border: 0 }
form[aria-busy="true"] button[type="submit"]::before { content: ''; width: 12px; height: 12px; border: 2px solid #ffffff66; border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite }
@keyframes spin { to { transform: rotate(360deg) } }
@media (prefers-reduced-motion: reduce) { form[aria-busy="true"] button[type="submit"]::before { animation-duration: 2s } }
