:root{--bg0: #0f1c24;--bg1: #162a35;--bg2: #1d3745;--panel: rgba(20, 40, 52, .88);--line: rgba(180, 210, 220, .16);--text: #e8f1f4;--muted: #93aab4;--accent: #2bb8a7;--accent-2: #f0a35e;--danger: #e07a6a;--ok: #7dcf9a;--shadow: 0 18px 50px rgba(0, 0, 0, .35);--font-display: "Noto Sans TC", "IBM Plex Sans", sans-serif;--font-body: "IBM Plex Sans", "Noto Sans TC", sans-serif}*{box-sizing:border-box}html,body,#root{min-height:100%}body{margin:0;color:var(--text);font-family:var(--font-body);background:radial-gradient(1200px 600px at 10% -10%,rgba(43,184,167,.18),transparent 55%),radial-gradient(900px 500px at 90% 0%,rgba(240,163,94,.14),transparent 50%),linear-gradient(160deg,var(--bg0),var(--bg1) 45%,#122029)}button,input,select,textarea{font:inherit;color:inherit}.app{width:min(1120px,calc(100% - 2rem));margin:0 auto;padding:1.5rem 0 3.5rem;display:flex;flex-direction:column;gap:1.25rem}.topbar{display:flex;flex-direction:column;align-items:stretch;gap:.55rem}.brand-row{display:flex;align-items:center;justify-content:space-between;gap:1rem}.brand{display:flex;flex-direction:column;gap:.35rem;flex:0 0 auto;min-width:0}.brand h1{margin:0;font-family:var(--font-display);font-size:clamp(1.6rem,2.6vw,2.2rem);letter-spacing:.02em;font-weight:700;white-space:nowrap}.status-panel{flex:1 1 auto;min-width:0;width:auto;max-width:min(720px,100%);margin-left:auto;padding:.55rem .8rem}.status-bar{display:flex;align-items:center;justify-content:space-between;gap:.85rem;flex-wrap:wrap}.status-email{min-width:0;flex:1;font-size:.95rem;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-actions{display:flex;align-items:center;gap:.45rem;flex-shrink:0;flex-wrap:wrap}.status-chip{display:inline-flex;align-items:center;max-width:9rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:999px;border:1px solid var(--line);background:#08121859;padding:.35rem .65rem;font-size:.75rem;color:var(--muted)}.conn-indicator{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;gap:.4rem;border-radius:999px;border:1px solid var(--line);background:#08121873;padding:.4rem .75rem;font-size:.82rem;font-weight:600;cursor:pointer;color:var(--muted)}.conn-indicator .conn-dot{width:.55rem;height:.55rem;border-radius:50%;background:var(--muted)}.conn-indicator.on{color:var(--ok);border-color:#7dcf9a66;background:#7dcf9a1a}.conn-indicator.on .conn-dot{background:var(--ok);box-shadow:0 0 0 3px #7dcf9a33}.conn-indicator.off{color:var(--danger);border-color:#e07a6a66;background:#e07a6a1a}.conn-indicator.off .conn-dot{background:var(--danger);box-shadow:0 0 0 3px #e07a6a2e}.btn-compact{padding:.45rem .7rem;font-size:.82rem}.timeline-panel{width:100%}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.9rem}.panel-head h2{margin:0}.panel-head-actions{display:flex;align-items:center;gap:.45rem}.latest-email{margin-bottom:1rem;padding:.85rem .95rem;border:1px solid rgba(43,184,167,.28);border-radius:12px;background:#2bb8a714}.latest-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.55rem}.latest-meta{display:flex;flex-wrap:wrap;gap:.45rem .85rem;color:var(--muted);font-size:.82rem;margin-bottom:.35rem}.latest-subject{font-weight:600;margin-bottom:.55rem}.latest-summary{margin:0 0 .55rem;line-height:1.55}.latest-points{margin:0;padding-left:1.15rem;color:#c5d6dd;line-height:1.55}.latest-points li+li{margin-top:.25rem}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;background:#040a0eb8;display:flex;align-items:center;justify-content:center;padding:1.25rem}.modal{width:min(520px,100%);max-height:min(90vh,720px);overflow:auto}.markdown-modal{width:min(920px,100%);max-height:min(88vh,820px);display:flex;flex-direction:column}.markdown-layout{display:grid;grid-template-columns:minmax(200px,260px) 1fr;gap:.85rem;min-height:420px;flex:1}.markdown-sidebar{display:grid;grid-template-rows:1fr auto;gap:.75rem;max-height:min(60vh,560px);min-height:0}.markdown-saves-pane{display:flex;flex-direction:column;gap:.35rem;min-height:0;overflow:hidden}.markdown-pane-label{font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}.markdown-pane-empty{margin:0;font-size:.78rem;color:var(--muted);padding:.4rem .1rem}.markdown-list{display:flex;flex-direction:column;gap:.4rem;overflow:auto;min-height:0;flex:1}.markdown-history-pane{display:flex;flex-direction:column;gap:.4rem;padding-top:.55rem;border-top:1px solid var(--line);position:relative}.markdown-history-trigger{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;min-height:3.1rem;padding:.65rem .75rem;border-radius:10px;border:1px solid rgba(43,184,167,.4);background:#081218bf;color:#e8f4f2;font:inherit;font-size:.95rem;font-weight:600;cursor:pointer;text-align:left}.markdown-history-trigger:focus{outline:none;border-color:#2bb8a7b3;box-shadow:0 0 0 3px #2bb8a726}.markdown-history-trigger-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.markdown-history-chevron{flex-shrink:0;opacity:.75}.markdown-history-menu{position:absolute;left:0;right:0;bottom:calc(100% + .35rem);z-index:5;display:flex;flex-direction:column;gap:.35rem;max-height:min(40vh,320px);overflow:auto;padding:.4rem;border-radius:10px;border:1px solid var(--line);background:#060e14f7;box-shadow:0 10px 28px #00000073}.markdown-history-option{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:flex;flex-direction:column;align-items:flex-start;gap:.15rem;width:100%;padding:.55rem .65rem;border-radius:8px;border:1px solid var(--line);background:#0812188c;color:inherit;font:inherit;text-align:left;cursor:pointer}.markdown-history-option span{font-size:.72rem;color:var(--muted)}.markdown-history-option.is-green{border-color:#7dcf9a8c;background:#7dcf9a24}.markdown-history-option.is-red{border-color:#e07a6a8c;background:#e07a6a24}.markdown-history-option.active{outline:2px solid rgba(43,184,167,.55);outline-offset:1px}.markdown-history-option:hover{filter:brightness(1.08)}.markdown-item{-webkit-appearance:none;-moz-appearance:none;appearance:none;text-align:left;border:1px solid var(--line);background:#08121866;border-radius:10px;padding:.55rem .65rem;cursor:pointer;color:var(--text);display:flex;flex-direction:column;gap:.2rem}.markdown-item span{color:var(--muted);font-size:.75rem}.markdown-item.active{border-color:#2bb8a773;background:#2bb8a71f}.markdown-view{margin:0;white-space:pre-wrap;word-break:break-word;font-size:.86rem;line-height:1.55;color:#c5d6dd;background:#00000040;border-radius:10px;padding:.85rem;overflow:auto;max-height:min(60vh,560px);border:1px solid var(--line)}@media(max-width:720px){.markdown-layout{grid-template-columns:1fr}.markdown-sidebar{max-height:260px}}.modal-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.35rem;flex:0 0 auto}.modal-head-actions{display:flex;align-items:center;gap:.4rem;flex-shrink:0}.modal-head h2{margin:0}.setup-form .field{margin-bottom:.75rem}.model-row{display:flex;gap:.55rem;align-items:stretch}.model-row select{flex:1;min-width:0}.modal-actions{display:flex;justify-content:flex-end;gap:.6rem;margin-top:.5rem}.modal code{font-size:.78rem;color:var(--accent-2)}@media(max-width:900px){.brand-row{flex-direction:column;align-items:stretch}.status-panel{max-width:none;margin-left:0}.status-bar,.status-actions{flex-wrap:wrap}}.panel{background:var(--panel);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:1.15rem 1.2rem 1.3rem}.panel h2{margin:0 0 .9rem;font-size:.95rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--accent)}.field{display:flex;flex-direction:column;gap:.35rem;margin-bottom:.85rem}.field label{font-size:.82rem;color:var(--muted)}.field input,.field select,.field textarea{width:100%;border:1px solid var(--line);background:#0812188c;border-radius:10px;padding:.65rem .75rem;outline:none}.field input:focus,.field select:focus,.field textarea:focus{border-color:#2bb8a78c;box-shadow:0 0 0 3px #2bb8a726}.row{display:flex;gap:.6rem;flex-wrap:wrap}.btn{border:none;border-radius:10px;padding:.7rem 1rem;cursor:pointer;font-weight:600;transition:transform .15s ease,opacity .15s ease,background .15s ease}.btn:hover:not(:disabled){transform:translateY(-1px)}.btn:disabled{opacity:.55;cursor:not-allowed}.btn-primary{background:linear-gradient(135deg,#2bb8a7,#1f9a8c);color:#06201c}.btn-ghost{background:transparent;border:1px solid var(--line);color:var(--text)}.btn-stop{background:linear-gradient(135deg,#e07a6a,#c45d4f);color:#2a0f0c;min-width:5.5rem}.hint{font-size:.78rem;color:var(--muted);line-height:1.45;margin:.2rem 0 .8rem}.status{margin-top:.75rem;font-size:.86rem;color:var(--muted)}.status.error{color:var(--danger)}.status.ok{color:var(--ok)}.search-form{display:flex;flex-direction:column;gap:.7rem;margin-bottom:1rem}.search-bar{display:flex;gap:.65rem}.search-bar input{flex:1;border:1px solid var(--line);background:#0812188c;border-radius:10px;padding:.75rem .85rem;outline:none}.search-bar input:focus{border-color:#2bb8a78c}.date-range{display:flex;flex-wrap:wrap;align-items:center;gap:.65rem .85rem}.date-field{display:flex;align-items:center;gap:.45rem;color:var(--muted);font-size:.85rem}.date-field input[type=date]{border:1px solid var(--line);background:#0812188c;border-radius:10px;padding:.45rem .6rem;outline:none;color:var(--text);color-scheme:dark}.date-field input[type=date]:focus{border-color:#2bb8a78c}.date-hint{color:var(--muted);font-size:.78rem}.meta{display:flex;justify-content:space-between;align-items:center;gap:1rem;color:var(--muted);font-size:.85rem;margin-bottom:1rem;flex-wrap:wrap}.meta-actions{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap}.ref-toggle{display:inline-flex;align-items:center;gap:.4rem;color:var(--muted);font-size:.82rem;cursor:pointer;-webkit-user-select:none;user-select:none}.ref-toggle input{accent-color:var(--accent)}.related-saves{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem;margin:-.35rem 0 .9rem;color:var(--muted);font-size:.8rem}.related-chip{display:inline-flex;padding:.2rem .55rem;border-radius:999px;border:1px solid rgba(43,184,167,.3);background:#2bb8a71a;color:#b7ebe3}.timeline{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.75rem}.item{position:relative;width:100%;padding:1rem 1rem 1rem 1.15rem;border:1px solid var(--line);border-radius:14px;background:#0a161e73;color:inherit;font:inherit;text-align:left;cursor:pointer;transition:border-color .15s ease,background .15s ease}.item:hover,.item:focus-visible{border-color:#2bb8a773;background:#0e202ab8;outline:none}.item:before{content:"";position:absolute;left:0;top:.9rem;bottom:.9rem;width:3px;border-radius:999px;background:linear-gradient(180deg,var(--accent),var(--accent-2))}.item-split{display:grid;grid-template-columns:minmax(180px,.9fr) minmax(220px,1.3fr);gap:1rem 1.25rem;align-items:start}.item-meta{display:flex;flex-direction:column;gap:.35rem;min-width:0}.item-ai{min-width:0;padding-left:1.1rem;border-left:1px solid var(--line)}.when{font-variant-numeric:tabular-nums;color:var(--accent-2);font-size:.86rem;font-weight:600}.who{font-weight:600;line-height:1.35}.from{color:var(--muted);font-size:.8rem;word-break:break-all}.subject{color:#c5d6dd;font-size:.88rem;line-height:1.4;word-break:break-word}.summary{margin:0;line-height:1.55;font-size:.94rem}.hl{margin:0;padding:.05em .12em;border-radius:3px;background:#e8b84a73;color:#fff6d6;box-decoration-break:clone;-webkit-box-decoration-break:clone}.summary-pending{color:var(--muted)}.pending-label{display:inline-block;margin-right:.45rem;padding:.1rem .4rem;border-radius:6px;border:1px solid rgba(43,184,167,.28);background:#2bb8a714;color:var(--accent-2);font-size:.72rem;font-weight:600;vertical-align:middle}.ai-pending-bar{margin:0 0 .75rem;padding:.55rem .75rem;border-radius:10px;border:1px solid rgba(43,184,167,.28);background:#2bb8a714;color:#b7ebe3;font-size:.86rem}.timeline-pending .item{opacity:.92}.action{margin:.55rem 0 0;padding:.55rem .7rem;border-radius:10px;background:#2bb8a71a;border:1px solid rgba(43,184,167,.22);color:#b7ebe3;font-size:.9rem;line-height:1.45}.email-detail-modal{width:min(720px,100%);max-height:min(82vh,820px);display:flex;flex-direction:column}.email-detail-meta{display:flex;flex-direction:column;gap:.45rem;margin-bottom:.9rem;padding-bottom:.85rem;border-bottom:1px solid var(--line);font-size:.9rem}.email-detail-meta>div{display:grid;grid-template-columns:4.5rem 1fr;gap:.5rem;align-items:baseline}.email-detail-meta .label{color:var(--muted);font-size:.8rem}.email-detail-body{margin:0;flex:1;min-height:0;white-space:pre-wrap;word-break:break-word;font-size:.88rem;line-height:1.55;color:#c5d6dd;background:#00000040;border-radius:10px;padding:.9rem;overflow:auto;border:1px solid var(--line)}@media(max-width:720px){.item-split{grid-template-columns:1fr;gap:.75rem}.item-ai{padding-left:0;border-left:none;padding-top:.75rem;border-top:1px solid var(--line)}}.empty{color:var(--muted);padding:1.5rem .25rem;line-height:1.5}.history-sync-status{font-size:.82rem;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-modal{width:min(1100px,100%);max-height:min(86vh,900px);display:flex;flex-direction:column;overflow:hidden;min-height:min(70vh,720px)}.history-sync-hint{margin:0 0 .85rem;color:var(--muted);font-size:.85rem;line-height:1.45}.history-layout{display:grid;grid-template-columns:minmax(200px,240px) minmax(0,1fr);gap:.85rem;min-height:0;flex:1;overflow:hidden}.history-month-grid{display:flex;flex-direction:column;gap:.55rem;margin-bottom:0;max-height:none;height:100%;overflow:auto;padding-right:.2rem;flex:none;align-items:stretch;min-height:0}.history-month-btn{display:flex;flex-direction:column;width:100%;min-height:0;height:auto;flex:0 0 auto;align-self:stretch;padding:0;border-radius:10px;border:1px solid var(--line);background:#0812188c;color:inherit;overflow:hidden;transition:border-color .15s ease,background .15s ease}.history-month-btn:hover{border-color:#2bb8a773}.history-month-btn.is-working,.history-month-btn.is-paused{height:auto}.history-month-btn.is-green{border-color:#7dcf9a8c;background:#7dcf9a1f}.history-month-btn.is-red{border-color:#e07a6a8c;background:#e07a6a1f}.history-month-btn.active{outline:2px solid rgba(43,184,167,.55);outline-offset:1px}.history-month-top{display:flex;flex-direction:column;align-items:stretch;gap:.15rem;padding:.45rem .55rem .4rem;min-height:0;flex:0 0 auto}.history-month-row{display:flex;align-items:center;justify-content:space-between;gap:.4rem;min-width:0}.history-month-main{display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;min-width:0;flex:1 1 auto}.history-month-main:disabled{cursor:wait}.history-month-meta-btn{display:block;width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;min-width:0}.history-month-ym{font-weight:700;font-size:.9rem;color:#e8f4f2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;line-height:1.25}.history-month-meta{display:block;font-size:.68rem;color:var(--muted);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.history-month-controls{display:flex;flex-shrink:0;gap:.3rem;margin-top:0}.history-ctrl-btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid rgba(255,255,255,.18);background:#00000059;color:#d7ebe7;font:inherit;font-size:.68rem;line-height:1;padding:.28rem .45rem;border-radius:6px;cursor:pointer}.history-ctrl-btn:hover{background:#00000080}.history-ctrl-stop{border-color:#e07a6a73;color:#f0c4bc}.history-ctrl-sync{border-color:#2bb8a773;color:#b7ebe3;font-weight:700}.history-month-btn.is-working{opacity:.98}.history-month-btn.is-paused{border-style:dashed}.history-month-bar{flex:0 0 auto;margin-top:auto;position:relative;display:flex;align-items:center;justify-content:center;height:15px;min-height:15px;flex-shrink:0;background:#00000059;overflow:hidden}.history-month-bar-fill{position:absolute;inset:0 auto 0 0;width:0;background:linear-gradient(90deg,var(--accent),var(--accent-2));transition:width .35s ease}.history-month-btn.is-red .history-month-bar-fill{background:linear-gradient(90deg,#e07a6a,#f0a090)}.history-month-btn.is-green .history-month-bar-fill{background:linear-gradient(90deg,#5bbf82,#7dcf9a)}.history-month-bar-label{position:relative;z-index:1;font-size:.62rem;font-weight:700;color:#f2faf8;text-shadow:0 1px 2px rgba(0,0,0,.55)}.history-months{display:flex;flex-direction:column;gap:.4rem;overflow:auto;min-height:0}.history-month-item{display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;padding:.55rem .65rem;border-radius:10px;border:1px solid var(--line);background:#08121873;color:inherit;font:inherit;text-align:left;cursor:pointer}.history-month-item.active,.history-month-item:hover{border-color:#2bb8a773;background:#0e202ab8}.history-month-item span{color:var(--muted);font-size:.78rem}.hist-green{color:#7dcf9a}.hist-red{color:#e07a6a}.history-main{min-height:0;overflow:auto;display:flex;flex-direction:column;gap:.75rem;max-height:none;height:100%;flex:1 1 auto;padding-right:.15rem}@media(max-width:720px){.history-modal{min-height:0;max-height:min(92vh,900px);overflow:auto}.history-layout{grid-template-columns:1fr;grid-template-rows:minmax(180px,32vh) minmax(240px,1fr);overflow:visible}.history-month-grid{height:auto;max-height:32vh}.history-main{height:auto;max-height:none}}.history-overall{padding:.75rem .85rem;border-radius:12px;border:1px solid var(--line);background:#0a161e80}.history-overall h3{margin:0 0 .4rem;font-size:.9rem}.history-overall p{margin:0;line-height:1.5;color:#c5d6dd;font-size:.9rem;white-space:pre-wrap}.history-followups{margin-top:.75rem;padding-top:.65rem;border-top:1px solid rgba(255,255,255,.08)}.history-followups h4{margin:0 0 .4rem;font-size:.82rem;color:#b7ebe3;font-weight:700}.history-followups ul{margin:0;padding-left:1.15rem;display:flex;flex-direction:column;gap:.35rem}.history-followups li{line-height:1.45;color:#d5e4ea;font-size:.86rem}.history-emails{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.55rem}.history-email-item{width:100%;text-align:left;padding:.75rem .85rem;border-radius:12px;border:1px solid var(--line);background:#0a161e73;color:inherit;font:inherit;cursor:pointer}.history-email-item.is-done{border-color:#7dcf9a59}.history-email-item.is-pending{border-color:#e07a6a59}.history-email-item:hover{background:#0e202ab8}.history-email-head{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem .65rem;margin-bottom:.3rem}.history-dot{width:.55rem;height:.55rem;border-radius:999px}.history-dot.green{background:#7dcf9a;box-shadow:0 0 0 3px #7dcf9a33}.history-dot.red{background:#e07a6a;box-shadow:0 0 0 3px #e07a6a2e}.folder-tag{font-size:.72rem;color:var(--muted);border:1px solid var(--line);border-radius:6px;padding:.05rem .35rem}.progress-box{display:flex;flex-direction:column;gap:.65rem}.progress-title{color:var(--accent);font-weight:600}.progress-list{margin:0;padding-left:1.1rem;color:var(--muted);font-size:.88rem;line-height:1.5;max-height:10rem;overflow:auto}.progress-list li+li{margin-top:.2rem}
