:root{--bg:#0b1020;--bg2:#0e1530;--card:#0f1a33;--stroke:rgba(255,255,255,.10);--stroke2:rgba(255,255,255,.16);--text:#eaf0ff;--muted:#a8b7de;--accent:#6aa2ff;--accent2:#3a7bff;--danger:#ff4f6d;--ok:#36d399;--shadow:0 10px 30px rgba(0,0,0,.25);--radius:14px}
@media (prefers-color-scheme: light){:root{--bg:#f6f7fb;--bg2:#eef1ff;--card:#fff;--stroke:rgba(15,23,42,.10);--stroke2:rgba(15,23,42,.16);--text:#0f172a;--muted:#475569;--accent:#2563eb;--accent2:#1d4ed8;--danger:#e11d48;--ok:#059669;--shadow:0 10px 22px rgba(2,6,23,.08)}}
*{box-sizing:border-box}html,body{height:100%}
body{margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;background:radial-gradient(1200px 600px at 20% -10%,var(--bg2),transparent 70%),var(--bg);color:var(--text)}
a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}
.container{max-width:1360px;margin:0 auto;padding:18px}
.shell{display:grid;grid-template-columns:260px 1fr;gap:16px}
@media (max-width:980px){.shell{grid-template-columns:1fr}}
.sidebar{position:sticky;top:16px;align-self:start}@media (max-width:980px){.sidebar{position:static}}
.card{background:var(--card);border:1px solid var(--stroke);border-radius:var(--radius);box-shadow:var(--shadow)}
.card.pad{padding:14px}
.brand{display:flex;align-items:center;gap:10px;font-weight:750;letter-spacing:.2px}
.logo{width:32px;height:32px;border-radius:10px;background:linear-gradient(135deg,var(--accent),#8b5cf6);box-shadow:0 8px 18px rgba(37,99,235,.25)}
.nav{display:flex;flex-direction:column;gap:6px;margin-top:12px}
.nav a{display:flex;align-items:center;gap:10px;padding:10px 10px;border-radius:12px;color:var(--text);opacity:.9;border:1px solid transparent}
.nav a.active{opacity:1;background:rgba(106,162,255,.12);border-color:var(--stroke)}
.nav a:hover{background:rgba(106,162,255,.08)}
.badge{display:inline-flex;align-items:center;gap:6px;padding:2px 10px;border-radius:999px;background:rgba(106,162,255,.14);color:var(--text);font-size:12px;border:1px solid var(--stroke)}
.badge.count{min-width:28px;justify-content:center}
.muted{color:var(--muted)}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.input,textarea,select{width:100%;background:transparent;border:1px solid var(--stroke2);color:var(--text);padding:10px 12px;border-radius:12px;outline:none}
.input:focus,textarea:focus,select:focus{border-color:rgba(106,162,255,.55);box-shadow:0 0 0 4px rgba(106,162,255,.15)}
textarea{min-height:170px;resize:vertical}
.btn{display:inline-flex;gap:8px;align-items:center;justify-content:center;padding:10px 12px;border-radius:12px;border:1px solid var(--stroke2);background:rgba(106,162,255,.10);color:var(--text);cursor:pointer;text-decoration:none}
.btn:hover{border-color:rgba(106,162,255,.55)}
.btn.primary{background:linear-gradient(135deg,var(--accent),var(--accent2));border-color:transparent;color:white}
.btn.danger{background:rgba(255,79,109,.12);color:var(--text)}
.btn.ghost{background:transparent}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:10px 10px;border-bottom:1px solid var(--stroke);text-align:left;vertical-align:top}
.table th{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.msg-subject{font-weight:650}
.flash{padding:10px 12px;border-radius:12px;margin:10px 0;border:1px solid var(--stroke)}
.flash.ok{background:rgba(54,211,153,.10)}
.flash.err{background:rgba(255,79,109,.12)}
.toolbar{display:flex;gap:8px;flex-wrap:wrap}
pre.quote{white-space:pre-wrap;word-break:break-word;background:rgba(255,255,255,.05);border:1px solid var(--stroke);border-radius:12px;padding:12px}
.kbd{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono";font-size:12px;padding:2px 6px;border:1px solid var(--stroke);border-radius:8px;background:rgba(255,255,255,.06)}

.folder-title{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin:14px 0 6px}
.folder-list{display:flex;flex-direction:column;gap:4px;max-height:42vh;overflow:auto;padding-right:4px}
.folder-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border-radius:12px;color:var(--text);border:1px solid transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.folder-item:hover{background:rgba(106,162,255,.08)}
.folder-item.active{background:rgba(106,162,255,.12);border-color:var(--stroke)}
.folder-item span{overflow:hidden;text-overflow:ellipsis}

/* list + reader columns */
.mail-split{display:grid;grid-template-columns:360px minmax(0,1fr);gap:16px;align-items:stretch}
@media (max-width:1100px){.mail-split{grid-template-columns:1fr}}
.mail-list{border:1px solid var(--stroke);border-radius:14px;overflow:hidden;min-height:520px}
.mail-list .table th,.mail-list .table td{padding:9px 10px}
.mail-list .table tr:hover{background:rgba(106,162,255,.06)}
.mail-list a{color:inherit;text-decoration:none;display:block}
.mail-list .selected{background:rgba(106,162,255,.10)}
.mail-view{border:1px solid var(--stroke);border-radius:14px;overflow:hidden;min-height:520px}
.mail-view .head{padding:12px 12px;border-bottom:1px solid var(--stroke)}
.mail-view .body{padding:12px 12px;max-height:65vh;overflow:auto}

.wysiwyg-bar{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-bottom:8px}
.wysiwyg-bar button{border:1px solid var(--stroke2);background:rgba(255,255,255,.04);color:var(--text);padding:6px 10px;border-radius:10px;cursor:pointer}
.wysiwyg-bar button:hover{border-color:rgba(106,162,255,.55)}
.wysiwyg-bar .sep{width:1px;height:22px;background:var(--stroke);display:inline-block;margin:0 4px}
.wysiwyg-editor{min-height:170px;padding:10px 12px;border:1px solid var(--stroke2);border-radius:12px;background:transparent;outline:none}
.wysiwyg-editor:focus{border-color:rgba(106,162,255,.55);box-shadow:0 0 0 4px rgba(106,162,255,.15)}
.wysiwyg-wrapper .wysiwyg-html{display:none;min-height:170px}
.wysiwyg-wrapper.html-mode .wysiwyg-editor{display:none}
.wysiwyg-wrapper.html-mode .wysiwyg-html{display:block}
.blockquote{border-left:3px solid rgba(106,162,255,.6);margin:10px 0;padding:8px 12px;background:rgba(255,255,255,.03);border-radius:12px}

.ccbcc{display:none}
.ccbcc.show{display:block}
