/* ==========================================================================
   网页邮箱（对标 Outlook 网页版）
   ========================================================================== */
.mail-app { flex: 1; display: flex; min-height: 0; }
.mail-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mail-panes { flex: 1; display: flex; min-height: 0; }

/* ---------- 文件夹窗格 ---------- */
.folder-pane { width: 236px; flex: none; display: flex; flex-direction: column; background: var(--surface-alt); border-right: var(--pane-border); }
.folder-pane-top { padding: 12px 12px 8px; }
.tree-section { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 14px 8px 4px 16px; font-size: 12px; font-weight: 600; color: var(--fg3); }
.tree-section-account { font-size: 13px; color: var(--fg1); }
.tree-item {
    height: 32px; display: flex; align-items: center; gap: 6px; padding-right: 4px; margin: 0 6px; border-radius: var(--radius);
    color: var(--fg1); cursor: pointer; position: relative; user-select: none;
}
.tree-item:hover { background: var(--hover); }
.tree-item.active { background: var(--selected); font-weight: 600; }
.tree-item.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--brand); }
.tree-item.drop { background: var(--brand-soft); outline: 1px dashed var(--brand); }
.tree-item.unread .tree-name { font-weight: 600; }
.tree-toggle { width: 16px; height: 16px; flex: none; border: 0; background: transparent; padding: 0; display: grid; place-items: center; color: var(--fg3); cursor: pointer; }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-count { color: var(--brand-fg); font-weight: 600; font-size: 12px; padding: 0 4px; }
.tree-more { opacity: 0; }
.tree-item:hover .tree-more { opacity: 1; }
.tree-edit { flex: 1; min-width: 0; height: 24px; border: 1px solid var(--brand); border-radius: var(--radius); padding: 0 6px; font: inherit; outline: none; }
.quota { padding: 10px 16px 14px; border-top: var(--pane-border); font-size: 12px; color: var(--fg3); }
.quota-text { display: flex; justify-content: space-between; margin-bottom: 6px; }
.quota-bar { height: 4px; border-radius: 2px; background: var(--colorNeutralStroke2, #e0e0e0); overflow: hidden; }
.quota-bar div { height: 100%; background: var(--brand); }
.quota-bar div.danger { background: #d13438; }

/* ---------- 邮件列表 ---------- */
.list-pane { width: 400px; flex: none; display: flex; flex-direction: column; border-right: var(--pane-border); background: var(--surface); min-height: 0; }
.list-head { height: 44px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px; border-bottom: var(--pane-border); }
.list-title { font-size: 16px; font-weight: 600; }
.fl-check { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; margin: 0; }
.list-scroll { background: var(--surface); }
.list-group { position: sticky; top: 0; z-index: 1; padding: 10px 16px 4px; font-size: 12px; font-weight: 600; color: var(--fg2); background: var(--surface); }
.msg {
    position: relative; display: flex; gap: 10px; padding: 8px 12px 9px 14px; cursor: pointer;
    border-bottom: 1px solid var(--colorNeutralStroke3, #f0f0f0); border-left: 3px solid transparent;
}
.msg:hover { background: var(--hover); }
.msg.unread { border-left-color: var(--brand); }
.msg.open, .msg.selected { background: var(--brand-soft); }
.msg.flagged { background: #fdf6f6; }
.msg.flagged.open, .msg.flagged.selected { background: var(--brand-soft); }
.msg-lead { position: relative; width: 32px; flex: none; padding-top: 2px; }
.msg-check { position: absolute; left: 8px; top: 10px; display: none; }
.msg:hover .msg-check, .msg.selected .msg-check, .list-pane:has(.msg.selected) .msg-check { display: block; }
.msg:hover .msg-avatar, .msg.selected .msg-avatar, .list-pane:has(.msg.selected) .msg-avatar { visibility: hidden; }
.msg-body { flex: 1; min-width: 0; }
.msg-row { display: flex; align-items: center; gap: 6px; height: 20px; }
.msg-from { font-size: 14px; color: var(--fg1); }
.msg.unread .msg-from { font-weight: 600; }
.msg-thread { font-size: 11px; color: var(--fg3); border: 1px solid var(--colorNeutralStroke1, #d1d1d1); border-radius: 8px; padding: 0 5px; line-height: 15px; }
.msg-icons { display: flex; gap: 2px; color: var(--fg3); }
.msg-date { font-size: 12px; color: var(--fg3); flex: none; }
.msg.unread .msg-date { color: var(--brand-fg); font-weight: 600; }
.msg-subject { font-size: 13px; color: var(--fg1); line-height: 20px; }
.msg.unread .msg-subject { color: var(--brand-fg); font-weight: 600; }
.msg-preview { font-size: 13px; color: var(--fg3); line-height: 20px; }
.msg-actions { position: absolute; right: 8px; bottom: 6px; display: none; gap: 2px; background: inherit; }
.msg:hover .msg-actions { display: flex; }
.msg:hover .msg-preview { padding-right: 84px; }
.msg-actions button { width: 26px; height: 26px; border: 0; border-radius: var(--radius); background: transparent; color: var(--fg2); cursor: pointer; display: grid; place-items: center; }
.msg-actions button:hover { background: rgba(0,0,0,.06); color: var(--brand-fg); }
.msg-actions button.on { color: #d13438; }
.msg-skeleton { display: flex; gap: 12px; padding: 12px 16px; }
.list-more { padding: 12px; display: flex; justify-content: center; }

/* ---------- 阅读窗格 ---------- */
.reading-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--canvas); }
.reading-empty img { opacity: .9; margin-bottom: 8px; }
/* 主题固定在顶部；正文区单独滚动，展开邮件的发件人和答复按钮滚动时贴在顶部 */
.reading-pane .reading { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.reading-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 32px; }
.reading-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 18px 24px 12px; }
.reading-subject { font-size: 20px; line-height: 28px; font-weight: 600; margin: 0; word-break: break-word; }
.mail-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); margin-bottom: 10px; overflow: clip; }
.mail-card.expanded .mail-card-head { position: sticky; top: 0; z-index: 2; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 1px solid var(--colorNeutralStroke3, #f0f0f0); box-shadow: 0 4px 6px -4px rgba(0,0,0,.12); margin-bottom: 8px; }
.mail-card-head { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; cursor: pointer; }
.mail-card.collapsed .mail-card-head { align-items: center; padding: 10px 16px; }
.mail-card-who { flex: 1; min-width: 0; }
.mail-card-from { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.mail-card-to { margin-top: 2px; }
.mail-card-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.mail-card-actions { display: flex; gap: 0; }
.mail-card-body { padding: 4px 20px 20px 68px; }
.mail-card-body iframe { width: 100%; min-height: 60px; border: 0; display: block; background: #fff; }
.mail-text { white-space: pre-wrap; font-family: inherit; margin: 0; line-height: 1.6; word-break: break-word; }
.reading-foot { display: flex; gap: 8px; padding: 6px 4px; }

/* ---------- 附件卡片 ---------- */
.attach-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 20px 12px 68px; }
.attach-card {
    width: 232px; display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 8px; border: 1px solid var(--colorNeutralStroke2, #e0e0e0);
    border-radius: var(--radius-lg); background: var(--surface); transition: box-shadow .1s;
}
.attach-card:hover { box-shadow: var(--shadow-card); }
.attach-card.error { border-color: #d13438; }
.attach-icon { width: 36px; height: 36px; flex: none; border-radius: var(--radius); background: var(--brand-soft); color: var(--brand-fg); font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.attach-info { flex: 1; min-width: 0; cursor: pointer; }
.attach-name { font-size: 13px; }
.attach-total { margin-left: 4px; }

/* ---------- 撰写 ---------- */
.compose-pane { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--surface); margin: 12px; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.compose-bar { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.compose-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; padding: 4px 20px 16px; min-height: 0; }
.compose-msg { margin: 10px 0 4px; }
.compose-row { display: flex; align-items: center; gap: 10px; min-height: 42px; border-bottom: var(--pane-border); }
.compose-label { width: 52px; flex: none; color: var(--fg3); }
.compose-from { color: var(--fg2); }
.compose-subject { flex: 1; border: 0; outline: 0; font: inherit; font-size: 15px; padding: 10px 0; background: transparent; color: var(--fg1); }
.compose-links { display: flex; gap: 8px; }
.link-button { border: 0; background: transparent; color: var(--brand-fg); cursor: pointer; font: inherit; padding: 2px 4px; }
.link-button:hover { text-decoration: underline; }
.file-button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--radius); cursor: pointer; color: var(--fg1); }
.file-button:hover { background: var(--hover); }
.compose-attachments { padding: 12px 0 0; }
.editor-host { flex: 1; display: flex; flex-direction: column; min-height: 320px; padding-top: 8px; }
.editor-host .ql-toolbar.ql-snow { border: 0; border-bottom: var(--pane-border); padding: 6px 0; font-family: var(--font); }
.editor-host .ql-container.ql-snow { border: 0; font-family: var(--font); font-size: 14px; flex: 1; }
.editor-host .ql-editor { padding: 14px 2px; line-height: 1.6; min-height: 280px; }
.editor-host .ql-editor blockquote { border-left: 3px solid #e0e0e0; color: var(--fg3); padding-left: 12px; }
.text-danger { color: var(--danger); }

/* ---------- 收件人 ---------- */
.recipients { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 0; min-width: 0; cursor: text; }
.recipient-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 3px; border-radius: 13px;
    background: var(--colorNeutralBackground3, #f5f5f5); border: 1px solid var(--colorNeutralStroke2, #e0e0e0); font-size: 13px;
}
.recipient-chip.invalid { background: #fdf3f4; border-color: #d13438; color: #a4262c; }
.recipient-chip button { width: 18px; height: 18px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--fg3); }
.recipient-chip button:hover { background: rgba(0,0,0,.08); }
.recipient-input-wrap { position: relative; flex: 1; min-width: 160px; }
.recipient-input-wrap input { width: 100%; border: 0; outline: 0; font: inherit; padding: 4px 0; background: transparent; }
.suggest-list {
    position: absolute; top: calc(100% + 4px); left: 0; width: 380px; max-height: 340px; overflow-y: auto; z-index: 30; list-style: none; margin: 0; padding: 4px;
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-flyout);
}
.suggest-list li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius); cursor: pointer; }
.suggest-list li.active, .suggest-list li:hover { background: var(--hover); }
.suggest-text { display: flex; flex-direction: column; min-width: 0; }
.suggest-group { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-fg); }

/* ---------- 编辑器工具栏中文化 ---------- */
.editor-host .ql-snow .ql-picker.ql-size .ql-picker-label::before, .editor-host .ql-snow .ql-picker.ql-size .ql-picker-item::before { content: '正文'; }
.editor-host .ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before, .editor-host .ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before { content: '小'; }
.editor-host .ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before, .editor-host .ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before { content: '大'; }
.editor-host .ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before, .editor-host .ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { content: '特大'; }
.ql-snow .ql-picker.ql-size { width: 72px; }
.ql-snow .ql-tooltip[data-mode=link]::before { content: '链接地址：'; }
.ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: '保存'; }
.ql-snow .ql-tooltip a.ql-action::after { content: '编辑'; }
.ql-snow .ql-tooltip a.ql-remove::before { content: '移除'; }
.ql-snow .ql-tooltip::before { content: '访问链接：'; }
.account-item { width: calc(100% - 12px); border: 0; background: transparent; text-align: left; font: inherit; color: var(--fg1); cursor: pointer; padding-left: 8px; }
.compose-from-select { border: 0; background: transparent; color: var(--fg1); font: inherit; padding: 4px 24px 4px 0; cursor: pointer; max-width: 100%; }
.compose-from-select:hover, .compose-from-select:focus { background-color: var(--hover); outline: none; border-radius: var(--radius); }
/* 附件类型图标（文档页面 + 类型标志） */
.file-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; }
.file-icon svg { display: block; }
