:root {
    /* 核心色值 - 苹果风优雅色调 */
    --accent-blue: #0071e3;
    --accent-blue-hover: #0077ed;
    --accent-green: #34c759;
    --accent-red: #ff3b30;
    --accent-orange: #ff9500;
    --accent-purple: #af52de;
    
    --bg-main: #f5f5f7;
    --bg-card: rgba(255, 255, 255, 0.85); /* 玻璃拟态基础 */
    --bg-navbar: rgba(255, 255, 255, 0.75);
    
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-inverse: #ffffff;
    
    --border-color: rgba(0, 0, 0, 0.1);
    --border-light: rgba(0, 0, 0, 0.05);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    
    --nav-height: 72px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-standard: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Outfit', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

button, input, textarea {
    font-family: inherit;
    outline: none;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* 布局控制 */
.apple-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部导航栏 (Glassmorphism) */
.navbar {
    height: var(--nav-height);
    background-color: var(--bg-navbar);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-tabs {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px;
    border-radius: 12px;
}

.nav-tab {
    background: transparent;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-tab i {
    font-size: 1.2rem;
}

.nav-tab:hover {
    color: var(--text-primary);
}

.nav-tab.active {
    background: var(--text-inverse);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* 主视口 */
.viewport {
    flex: 1;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 仪表盘样式 */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--text-inverse);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-standard);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
}

.bg-blue { background: linear-gradient(135deg, #0071e3, #00c6ff); }
.bg-green { background: linear-gradient(135deg, #28a745, #34c759); }
.bg-red { background: linear-gradient(135deg, #dc3545, #ff3b30); }

.stat-info .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-info .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    margin-top: 4px;
}

.welcome-card {
    background: linear-gradient(135deg, #1d1d1f, #333336);
    border-radius: var(--radius-lg);
    padding: 60px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.welcome-text h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.welcome-text p {
    font-size: 1.1rem;
    opacity: 0.8;
    max-width: 600px;
    margin-bottom: 30px;
}

.feature-list {
    list-style: none;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-weight: 500;
}

.feature-list i {
    color: var(--accent-green);
}

.welcome-img {
    font-size: 12rem;
    opacity: 0.1;
    position: absolute;
    right: -20px;
    bottom: -40px;
    transform: rotate(-15deg);
}

/* 卡片基础款式 */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--text-inverse);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    overflow: hidden;
}

/* 控制面板 */
.control-panel {
    padding: 24px;
}

.panel-section.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--accent-blue);
}

.input-group {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.form-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-item.grow { flex: 1; }

.form-item label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding-left: 4px;
}

.input-field {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.input-field:focus {
    background: var(--text-inverse);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.small-input { width: 100px; text-align: center; }

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper i {
    position: absolute;
    left: 16px;
    color: var(--text-secondary);
}

.search-wrapper input {
    width: 100%;
    padding-left: 44px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

/* 按钮基础样式 */
.btn {
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn:active { transform: scale(0.96); }

.btn-primary { background: var(--accent-blue); color: white; }
.btn-primary:hover { background: var(--accent-blue-hover); }

.btn-secondary { background: rgba(0, 0, 0, 0.08); color: var(--text-primary); }
.btn-secondary:hover { background: rgba(0, 0, 0, 0.12); }

.btn-success { background: var(--accent-green); color: white; }
.btn-success:hover { background: #2fb952; }

.btn-warning { background: var(--accent-orange); color: white; }
.btn-danger { background: var(--accent-red); color: white; }
.btn-purple { background: var(--accent-purple); color: white; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--accent-blue);
    color: var(--accent-blue);
}

.btn-outline:hover { background: rgba(0, 113, 227, 0.05); }

.btn-sm { padding: 6px 14px; font-size: 0.85rem; border-radius: 8px; }

/* 拖拽区域 */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px 20px;
    text-align: center;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    background: rgba(0, 0, 0, 0.02);
}

.drop-zone.dragover {
    border-color: var(--accent-blue);
    background: rgba(0, 113, 227, 0.05);
    color: var(--accent-blue);
}

.drop-zone i { font-size: 1.8rem; margin-bottom: 6px; display: block; }
.drop-zone p { font-size: 0.85rem; margin: 0; }

/* 表格样式 */
.table-container { padding: 0; }

.table-header {
    padding: 24px;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

.modern-table th {
    background: rgba(0, 0, 0, 0.015);
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
}

.modern-table td {
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    vertical-align: middle;
}

.modern-table tr:hover { background: #fafafa; }

/* 极致列表组件 */
.cell-content {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.data-capsule {
    background: #f3f3f3;
    color: #444;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    max-width: 200px; /* 调小至更协调的尺寸 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.03);
}

.data-capsule.wide { max-width: 80px; } /* 缩小 ID 显示 */
.data-capsule.password { max-width: none; min-width: 80px; }

.password-toggle-btn {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    font-size: 14px;
    transition: color 0.2s;
}

.password-toggle-btn:hover { color: var(--accent-blue); }

.is-masked {
    font-family: 'password' !important; /* Placeholder for masked if using font */
    letter-spacing: 2px;
}

/* 使用 -webkit-text-security 进行字符遮罩 */
.masked-text {
    -webkit-text-security: disc;
    text-security: disc;
}


.copy-btn {
    background: transparent;
    border: none;
    color: #bbb;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.copy-btn:hover { color: var(--accent-blue); background: rgba(0, 113, 227, 0.05); }

.token-badge-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-pill {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-pill.unknown { background: #f0f0f0; color: #888; }
.status-pill.success { background: #e8f7ed; color: #2fb952; }
.status-pill.error { background: #fdf2f2; color: #ff3b30; }
.status-pill.working { background: #eef7ff; color: #0071e3; }

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* 操作列按钮 */
.btn-table-row {
    display: flex;
    gap: 6px;
}

.btn-row {
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-row.blue { background: #eef7ff; color: #0071e3; }
.btn-row.blue:hover { background: #0071e3; color: white; }

.btn-row.purple { background: #f5f0ff; color: #7c4dff; }
.btn-row.purple:hover { background: #7c4dff; color: white; }

/* 合并后的主按钮样式 - 增强版进入邮箱 */
.btn-row.main-action {
    background: linear-gradient(135deg, #0071e3, #5e5ce6);
    color: white;
    padding: 8px 18px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 113, 227, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-row.main-action::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.btn-row.main-action:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 113, 227, 0.4);
    filter: brightness(1.1);
}

.btn-row.main-action:hover::after {
    left: 100%;
}

.btn-row.main-action i {
    font-size: 1.1rem;
}


.btn-row.red { background: #fdf2f2; color: #ff3b30; }
.btn-row.red:hover { background: #ff3b30; color: white; }

/* 分页组件样式 */
.table-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.01);
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.page-size-selector select {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    margin-left: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.page-navigator {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-info {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
    text-align: center;
}

.p-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.p-btn:hover {
    background: var(--bg-main);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.p-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: transparent;
}

.jump-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jump-input {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
}


/* 模态框与抽屉核心 */
.modal-overlay, .drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active, .drawer-overlay.active { display: flex; }

.modal {
    width: 500px;
    max-width: 90%;
    animation: modalScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.large { width: 900px; }

@keyframes modalScale {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header h3 { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin: 0; }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px 24px;
}

.close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.close-modal:hover {
    color: var(--accent-red);
}

/* 撰写邮件专用样式 */
.compose-modal {
    max-width: 650px;
    width: 90%;
    overflow: hidden;
}

.glass-header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sender-badge.mini {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 113, 227, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--accent-blue);
    font-weight: 600;
}

.close-modal-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.close-modal-circle:hover {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

.modal-body-seamless {
    background: white;
}

.input-rows {
    padding: 0 24px;
}

.input-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.input-row label {
    width: 70px;
    font-size: 0.9rem;
    color: #999;
    font-weight: 500;
}

.input-row input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0;
    background: transparent;
}

.input-row input::placeholder { color: #ccc; }

.composer-body {
    padding: 20px 24px;
}

.composer-body textarea {
    width: 100%;
    height: 300px;
    border: none;
    outline: none;
    resize: none;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: transparent;
}

.modal-footer-glass {
    padding: 16px 24px;
    background: rgba(250, 250, 252, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel-ghost {
    background: transparent;
    border: none;
    color: #888;
    font-weight: 600;
    padding: 0 16px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.btn-cancel-ghost:hover { color: var(--text-primary); }

.btn-send-glam {
    background: linear-gradient(135deg, #0071e3, #5e5ce6);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-send-glam:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.35);
}

.btn-send-glam:active { transform: scale(0.98); }
.modal-body.scrollable { max-height: 70vh; overflow-y: auto; }

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.01);
}

textarea {
    width: 100%;
    height: 200px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 16px;
    font-size: 0.95rem;
    resize: none;
    transition: var(--transition-fast);
}

textarea:focus {
    background: white;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

/* 抽屉样式 */
.drawer-overlay { justify-content: flex-end; }

.drawer {
    width: 850px;
    height: 100vh;
    background: var(--bg-main);

    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.drawer-header {
    height: 80px;
    padding: 0 30px;
    background: white;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.drawer-title { flex: 1; font-weight: 700; font-size: 1.1rem; }

.drawer-body { flex: 1; overflow: hidden; padding: 20px; }

/* 双栏取件布局 */
.dual-mail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 100%;
}

.mail-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.column-header {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.05);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-light);
}

.folder-select-all {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-blue);
}

.btn-column-action {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-column-action:hover {
    background: rgba(255, 59, 48, 0.1);
}


.mail-list-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.mail-items { display: flex; flex-direction: column; gap: 10px; }

/* 邮件列表展示 */
.mail-item {
    background: white;
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.03);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    gap: 12px;
}

.mail-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    padding-top: 4px;
}

.mail-checkbox {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--accent-blue);
}

.mail-item-main {
    flex: 1;
    min-width: 0;
}


.mail-item:hover { 
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-color: var(--accent-blue);
    background: #fdfdfd;
}

.mail-item-head { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    gap: 16px;
    margin-bottom: 8px; 
}

.mail-subject { 
    font-weight: 700; 
    font-size: 0.95rem; 
    color: var(--text-primary); 
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-time { 
    font-size: 0.75rem; 
    color: var(--text-secondary); 
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
    opacity: 0.8;
}

.mail-sender-line { 
    font-size: 0.8rem; 
    color: var(--accent-blue); 
    font-weight: 600; 
    margin-bottom: 8px;
    background: rgba(0, 113, 227, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
}

.mail-preview { 
    font-size: 0.85rem; 
    color: #666; 
    line-height: 1.5; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    line-clamp: 2;
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}

/* 邮件内容查看详情样式 */
.content-viewer-modal {
    width: 900px;
    max-width: 95%;
    display: flex;
    flex-direction: column;
}

.content-header-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.subject-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge-subject {
    background: var(--accent-blue);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

#contentSubject {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.sender-info-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.sender-info-pill i { color: var(--accent-blue); font-size: 1.1rem; }

.modal-body-content {
    background: white;
    padding: 0; /* 移除外层 Padding，由 iframe 内部或容器自适应 */
    flex: 1;
    overflow: hidden; /* 由 iframe 或内部滚动 */
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.mail-html-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#mailContentBody iframe {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
    display: block;
}

.mail-html-content table {
    width: 100% !important;     /* 关键：防止大型表格溢出 */
    max-width: 100% !important;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
}

.modal-footer-lux {
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-danger-soft {
    background: rgba(255, 59, 48, 0.08);
    color: #ff3b30;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger-soft:hover { background: #ff3b30; color: white; }

.btn-primary-soft {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.2);
}

textarea {
    width: 100%;
    height: 200px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    font-size: 0.95rem;
    resize: none;
    transition: var(--transition-fast);
}

/* 其他中心组件 */
.empty-state, .mail-loader, .mail-empty {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-secondary);
}

.empty-state i, .mail-loader i, .mail-empty i { font-size: 4rem; margin-bottom: 16px; opacity: 0.2; display: block; }

.spin { animation: rotate 1.5s linear infinite; }
@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Toast 通告系统 */
.toast-container { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: toastUp 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes toastUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* 基础通用类 */
.btn-icon { background: transparent; border: none; font-size: 1.25rem; cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent-blue); }
.hidden { display: none !important; }

/* 响应式调整 */
@media (max-width: 1024px) {
    .viewport { padding: 20px; }
    .dash-grid { grid-template-columns: 1fr; }
    .drawer { width: 100%; }
}

/* 手机端完美适配 */
@media (max-width: 768px) {
    .viewport { padding: 10px; }
    
    /* 顶部导航折叠 */
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
        gap: 15px;
    }
    .nav-tabs {
        width: 100%;
        justify-content: space-around;
    }
    
    /* 表格横向滚动 */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 10px;
    }
    
    /* 输入框换行 */
    .input-group {
        flex-direction: column;
        gap: 15px;
    }
    .form-item.grow .search-wrapper {
        width: 100%;
    }
    .small-input {
        width: 100%;
    }
    
    /* 卡片边距缩小 */
    .card {
        margin-bottom: 15px;
    }
    .welcome-card {
        padding: 30px 20px;
        flex-direction: column;
        text-align: center;
    }
    .welcome-img { display: none; }
    
    /* 按钮换行展示 */
    .button-row {
        justify-content: space-between;
    }
    .button-row .btn {
        flex: 1 1 45%;
        margin-bottom: 5px;
    }
    
    /* 双栏抽屉变成单栏上下结构 */
    .dual-mail-container {
        flex-direction: column;
    }
}
