/* ====== EasyMail 样式 ====== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --accent: #0ea5e9;
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --success: #10b981;
    --warning: #f59e0b;
    --bg: #f5f7fa;
    --card: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text: #1e293b;
    --text-secondary: #475569;
    --muted: #64748b;
    --muted-light: #94a3b8;
    --unseen: #fef3c7;
    --hover: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    --shadow-primary: 0 4px 16px rgba(37, 99, 235, 0.2);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 0.18s ease;
    --transition-fast: 0.12s ease;
}

/* 屏幕阅读器专用：视觉隐藏但仍可被辅助技术读取 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ 认证页 ============ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    padding: 20px;
}

.auth-card {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    padding: 52px 44px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 380px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: authCardEntrance 0.4s ease-out;
}

@keyframes authCardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-icon { font-size: 48px; margin-bottom: 16px; }

.auth-card h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--text);
}

.auth-subtitle {
    color: var(--muted);
    margin-bottom: 28px;
    font-size: 14px;
}

.auth-hint {
    margin-top: 24px;
    font-size: 12px;
    color: var(--muted);
}

/* ============ 通用组件 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.2;
    box-sizing: border-box;
    vertical-align: middle;
    position: relative;
    overflow: hidden;
}
.btn:hover {
    background: var(--hover);
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border-color: var(--primary-dark);
    box-shadow: var(--shadow-primary);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #ef4444 100%);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-dark) 0%, var(--danger) 100%);
    border-color: var(--danger-dark);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-block { display: flex; width: 100%; padding: 13px; font-size: 15px; font-weight: 600; }
.btn-small { padding: 7px 12px; font-size: 13px; }

.input {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition);
    background: var(--card);
    color: var(--text);
}
.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15), 0 0 20px rgba(37, 99, 235, 0.08);
    background: #fff;
}
.input::placeholder {
    color: var(--muted-light);
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}
.form-check label { display: inline-flex; align-items: center; gap: 6px; }

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}
.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}
.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* 登录失败提示中的剩余次数徽章 */
.attempt-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.08);
    font-weight: 600;
    margin: 0 2px;
}
.attempt-badge.low { background: #fee2e2; color: #991b1b; }

/* 锁定倒计时 */
.lock-countdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}
.lock-countdown-icon { font-size: 18px; }
.lock-countdown-time {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #b91c1c;
}

/* ============ 应用页 ============ */
.app-page { min-height: 100vh; }

.app-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    border-bottom: none;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-brand {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.app-nav { display: flex; align-items: center; gap: 8px; }
.nav-user {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    margin-right: 8px;
}

.app-header .btn {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}
.app-header .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.app-header .btn-danger {
    background: rgba(220, 38, 38, 0.9);
    border-color: rgba(220, 38, 38, 1);
}
.app-header .btn-danger:hover {
    background: rgba(185, 28, 28, 1);
    border-color: rgba(185, 28, 28, 1);
}
.app-header .account-switcher-btn {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.app-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0px;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
    max-width: 520px;
    margin: 0 auto;
}
.card h2 { font-size: 22px; margin-bottom: 4px; }
.card-subtitle { color: var(--muted); font-size: 13px; margin-bottom: 24px; }

.advanced { margin: 16px 0; }
.advanced summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    padding: 8px 0;
}
.advanced[open] .form-row { margin-top: 12px; }

.saved-accounts {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
}
.saved-accounts h3 {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.saved-account-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.saved-account-list li {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
    padding: 0;
    color: inherit;
    font-size: inherit;
    background: #fff;
}
.saved-account-list li:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, .12);
}
.saved-account-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text);
    min-width: 0;
    text-align: left;
}
.saved-account-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.saved-account-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.saved-account-email {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}
.saved-account-host {
    font-size: 11px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}
.saved-account-arrow {
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
    transition: transform .15s;
    align-self: center;
    padding-left: 4px;
}
.saved-account-list li:hover .saved-account-arrow { transform: translateX(3px); }
.saved-account-delete {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    color: var(--muted);
    text-decoration: none;
    border-left: 1px solid var(--border);
    transition: color .15s, background .15s;
    font-size: 14px;
    cursor: pointer;
    background: transparent;
}
.saved-account-delete:hover {
    color: var(--danger);
    background: #fef2f2;
}

/* ====== 顶部账号切换下拉菜单 ====== */
.account-switcher { position: relative; }
.account-switcher-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    max-width: 260px;
}
.account-icon { font-size: 14px; }
.account-email {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}
.account-arrow { font-size: 10px; opacity: .6; }

.account-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 280px;
    max-width: 360px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    z-index: 100;
    padding: 6px;
    overflow: hidden;
}
.account-menu[hidden] { display: none; }
.account-menu-header {
    padding: 8px 12px 4px;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.account-menu-empty {
    padding: 16px 12px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}
.account-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    transition: background .12s;
    flex-wrap: wrap;
}
.account-item:hover { background: #f1f5f9; }
.account-item.active {
    background: #eff6ff;
    color: var(--primary);
    cursor: default;
}
.account-item-email {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.account-item-host {
    font-size: 11px;
    color: var(--muted);
    flex-shrink: 0;
}
.account-item-badge {
    font-size: 10px;
    background: var(--primary);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.account-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 4px;
}
.account-item-add { color: var(--primary); }
.account-item-add .account-item-icon { font-size: 16px; font-weight: bold; }
.account-item-logout { color: var(--danger); }
.account-item-logout .account-item-icon { font-size: 14px; }

/* ====== CSRF 表单零样式（避免影响布局） ====== */
form.account-switch-form,
form.saved-account-form,
form.saved-account-delete-form {
    margin: 0;
    padding: 0;
    display: flex;
    flex: 1;
    min-width: 0;
}
.saved-account-form { flex: 1; }
.saved-account-delete-form { flex: 0 0 auto; }
.account-item-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
button.saved-account-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    font: inherit;
    color: var(--text);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
button.saved-account-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--muted);
    padding: 12px 14px;
    transition: color .15s, background .15s;
}
button.saved-account-delete:hover {
    color: var(--danger);
    background: #fef2f2;
}

/* ============ 邮件布局 ============ */
.mail-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    min-height: 600px;
}

.mail-sidebar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    height: fit-content;
}
.mail-sidebar h3 {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding: 0 8px;
}

.folder-list { list-style: none; }
.folder-list a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 2px;
}
.folder-list a:hover { background: #f1f5f9; text-decoration: none; }
.folder-list a.active {
    background: var(--primary);
    color: #fff;
}

.mail-list {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.mail-list-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mail-list-header h2 { font-size: 17px; }
.mail-list-header .count {
    font-size: 12px;
    color: var(--muted);
    font-weight: normal;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 12px;
    margin-left: 8px;
}

.message-list { list-style: none; }
.message-list li {
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition);
    position: relative;
}
.message-list li:last-child { border-bottom: none; }
.message-list li.unseen {
    border-left: 4px solid var(--primary);
    background: rgba(37, 99, 235, 0.02);
}
.message-list li.seen {
    border-left: 4px solid transparent;
}
.message-list li:hover {
    background: var(--hover);
    transform: translateX(2px);
}
.message-list a {
    display: block;
    padding: 16px 20px;
    color: var(--text);
    transition: all var(--transition);
}
.message-list a:hover {
    text-decoration: none;
}
.message-list li.unseen a { font-weight: 600; }

.msg-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.msg-from {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
    color: var(--text-secondary);
}
.msg-date {
    font-size: 12px;
    color: var(--muted-light);
    font-weight: 500;
    flex-shrink: 0;
}
.msg-subject {
    font-size: 14px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}
.msg-meta {
    font-size: 11px;
    color: var(--muted-light);
    margin-top: 4px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

/* ============ 邮件详情 ============ */
.mail-view {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 16px 1px;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}
.mail-view h2 {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 19px;
    line-height: 1.4;
    word-break: break-word;
}

.mail-meta-table {
    width: 100%;
    margin-bottom: 0px;
    font-size: 13px;
}
.mail-meta-table th {
    text-align: right;
    width: 80px;
    padding: 6px 12px 6px 0;
    color: var(--muted);
    font-weight: 500;
    vertical-align: top;
}
.mail-meta-table td { padding: 6px 0; color: var(--text); }

.attachment {
    display: inline-block;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 4px;
    margin-right: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--muted);
}

.mail-body {
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0px;
    min-height: 200px;
}
.mail-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
    font-size: 14px;
    line-height: 1.7;
}

.body-pane { animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ====== HTML 邮件 iframe 渲染 ====== */
.html-frame {
    width: 100%;
    min-height: 400px;
    border: none;
    border-radius: var(--radius-sm);
    background: #fff;
    display: block;
    box-sizing: border-box;
    margin-top: 4px;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .mail-layout { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .app-main { padding: 0px; }
    .card { padding: 24px 20px; }
    .auth-card { padding: 36px 28px; max-width: 360px; }
    .auth-icon { font-size: 44px; margin-bottom: 12px; }
    .auth-card h1 { font-size: 24px; }
    .mail-view { padding: 18px 1px; }
    .mail-view h2 { font-size: 17px; }

    /* 邮件详情表头元数据在平板尺寸就堆叠 */
    .view-header-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* 邮件元信息表格容器更紧凑 */
    .mail-meta-table { font-size: 12px; }
    .mail-meta-table th { width: 70px; }
}

/* 手机端优化（< 480px） */
@media (max-width: 480px) {
    /* 顶部导航更紧凑 */
    .app-header { padding: 8px 10px; }
    .app-brand { font-size: 15px; }
    .app-nav { gap: 4px; }

    /* 账号切换器：限制宽度，防止溢出 */
    .account-switcher-btn {
        max-width: 180px !important;
        padding: 5px 7px !important;
        gap: 3px !important;
        font-size: 12px;
    }
    .account-icon { display: none; }
    .account-email {
        max-width: 105px;
        font-size: 12px;
    }
    .account-arrow { font-size: 9px; }

    /* 下拉菜单占满宽度，不被裁切 */
    .account-menu {
        min-width: 260px;
        right: -8px;
        max-width: calc(100vw - 24px);
    }

    /* 退出系统按钮缩小 */
    .btn-small { padding: 5px 9px; font-size: 12px; }

    /* 主内容更小内边距 */
    .app-main { padding: 0px; }
    .card { padding: 18px 14px; border-radius: var(--radius-md); }
    .auth-card { padding: 28px 20px; max-width: 100%; border-radius: var(--radius-lg); }
    .auth-icon { font-size: 40px; margin-bottom: 10px; }
    .auth-card h1 { font-size: 22px; }
    .auth-subtitle { font-size: 13px; margin-bottom: 22px; }

    /* 表单间距紧凑 */
    .form-group { margin-bottom: 12px; }
    .form-group label { font-size: 12px; margin-bottom: 5px; }

    /* 邮件列表项紧凑化 */
    .message-list a { padding: 11px 12px; }
    .msg-row { margin-bottom: 3px; }
    .msg-from {
        max-width: 60%;
        font-size: 13px;
    }
    .msg-date { font-size: 11px; }
    .msg-subject { font-size: 13px; }
    .msg-meta { font-size: 10px; margin-top: 3px; }

    /* 邮件详情优化 */
    .mail-view { padding: 14px 1px; }
    .mail-view h2 { font-size: 15px; padding-bottom: 10px; margin-bottom: 12px; }
    .mail-meta-table { font-size: 11px; }
    .mail-meta-table th { width: 60px; padding: 6px 1px; }
    .mail-meta-table td { padding: 6px 1px; word-break: break-all; }

    /* iframe 邮件正文有最小高度，方便触摸滚动 */
    .html-frame { min-height: 55vh; border-radius: var(--radius-sm); }

    /* 文件夹列表横向滚动（不挤占邮件列表） */
    .folder-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 6px;
    }
    .folder-item {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 6px 12px;
        font-size: 12px;
    }

    /* 表单输入框触摸友好（≥44px 高度），避免 iOS 自动放大 */
    .input, .btn {
        font-size: 16px !important;
        min-height: 44px;
    }
    select.input { padding-right: 32px; }

    /* 历史账号卡片紧凑化 */
    .saved-account-item { padding: 10px 12px; gap: 10px; }
    .saved-account-icon { font-size: 18px; }
    .saved-account-email { font-size: 13px; }
    .saved-account-host { font-size: 10px; }
    .saved-account-delete { width: 40px; }

    /* 按钮触摸区扩大 */
    .btn-block { padding: 14px; font-size: 16px; }

    /* 视图页按钮横向排列 */
    .view-header { flex-direction: column; gap: 8px; }
    .view-header .btn-block { width: auto; }

    /* 警告/提示信息紧凑 */
    .alert { padding: 10px 12px; font-size: 13px; }

    /* body 行高更紧凑 */
    body { line-height: 1.55; }
}

/* 手机端优化（< 480px） */
@media (max-width: 480px) {
    /* 顶部导航更紧凑 */
    .app-header { padding: 10px 12px; }
    .app-brand { font-size: 16px; }
    .app-nav { gap: 4px; }

    /* 账号切换器：限制宽度，防止溢出 */
    .account-switcher-btn {
        max-width: 180px !important;
        padding: 6px 8px !important;
        gap: 4px !important;
    }
    .account-icon { display: none; }              /* 隐藏头像图标省空间 */
    .account-email {
        max-width: 110px;
        font-size: 12px;
    }
    .account-arrow { font-size: 9px; }

    /* 下拉菜单占满宽度，不被裁切 */
    .account-menu {
        min-width: 260px;
        right: -8px;
        max-width: calc(100vw - 24px);
    }

    /* "退出系统"按钮更小 */
    .btn-small { padding: 6px 10px; font-size: 12px; }

    /* 主内容更小内边距 */
    .app-main { padding: 0px; }
    .card { padding: 20px 16px; }
    .auth-card { padding: 24px 18px; }

    /* 邮件列表项紧凑化 */
    .message-list a { padding: 12px 14px; }
    .msg-row { margin-bottom: 2px; }
    .msg-from {
        max-width: 65%;
        font-size: 13px;
    }
    .msg-date { font-size: 11px; }
    .msg-subject { font-size: 13px; }
    .msg-meta { font-size: 11px; }

    /* 邮件详情页表头堆叠 */
    .view-header-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* iframe 邮件正文有最小高度，方便触摸滚动 */
    .html-frame { min-height: 60vh; }

    /* 文件夹列表横向滚动（不挤占邮件列表） */
    .folder-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 6px;
    }
    .folder-item {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* 表单输入框触摸友好（≥44px 高度） */
    .input, .btn {
        font-size: 15px;
        min-height: 42px;
    }

    /* 历史账号卡片紧凑化 */
    .saved-account-item { padding: 12px 14px; gap: 10px; }
    .saved-account-icon { font-size: 20px; }
    .saved-account-email { font-size: 13px; }
    .saved-account-host { font-size: 10px; }
    .saved-account-delete { width: 40px; }
}
