/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

/* 顶部工具栏 */
.toolbar {
    background: #fff;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.toolbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 0 20px;
    flex-wrap: wrap;
}

/* 域名搜索区域 */
.domain-selector {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 260px;
}

.domain-search-input {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    min-width: 220px;
}

.domain-search-input:focus {
    outline: none;
    border-color: #4285f4;
}

.domain-not-found {
    font-size: 12px;
    color: #c00;
}

/* 邮箱输入框 */
.email-input {
    width: 320px;
    max-width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    color: #333;
}

.email-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.email-at {
    font-size: 16px;
    font-weight: 600;
    color: #666;
}

.domain-select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: #fff;
    font-size: 13px;
    min-width: 160px;
}

.email-input:focus {
    border-color: #4285f4;
}

.email-input.editable {
    border-color: #f5a623;
    background: #fffdf0;
}

/* 按钮通用样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    color: #fff;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn svg {
    flex-shrink: 0;
}

.btn-blue {
    background: #4285f4;
}

.btn-blue:hover {
    background: #3367d6;
}

.btn-yellow {
    background: #f5a623;
}

.btn-yellow:hover {
    background: #e09517;
}

.btn-green {
    background: #34a853;
}

.btn-green:hover {
    background: #2d9249;
}

.btn-dark {
    background: #333;
}

.btn-dark:hover {
    background: #555;
}

/* 主体容器 */
.main-container {
    max-width: 1200px;
    margin: 20px auto;
    display: flex;
    gap: 20px;
    padding: 0 20px;
    min-height: calc(100vh - 120px);
}

/* 面板 */
.panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

/* 左侧邮件列表面板 */
.email-list-panel {
    width: 40%;
    min-width: 300px;
}

/* 右侧邮件详情面板 */
.email-detail-panel {
    flex: 1;
}

/* 空状态 */
.empty-state {
    padding: 40px 24px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* 邮件列表 */
.email-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.email-item {
    padding: 14px 24px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.15s;
}

.email-item:hover {
    background: #f8f9fa;
}

.email-item.active {
    background: #e8f0fe;
    border-left: 3px solid #4285f4;
}

.email-item.unread {
    background: #fafafa;
}

.email-item.unread .email-item-subject {
    font-weight: 700;
}

.email-item-sender {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item-subject {
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item-time {
    font-size: 12px;
    color: #999;
}

/* 邮件详情 */
.email-detail {
    padding: 0;
}

.email-detail-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.email-detail-subject {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.email-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #666;
}

.email-detail-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.email-detail-body {
    padding: 24px;
}

.email-detail-body-text {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
    white-space: pre-wrap;
    word-break: break-word;
}

/* HTML 邮件 iframe */
.email-html-frame {
    width: 100%;
    border: none;
    min-height: 300px;
}

/* 标签切换 */
.detail-tabs {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
    padding: 0 24px;
}

.detail-tab {
    padding: 10px 16px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.detail-tab:hover {
    color: #333;
}

.detail-tab.active {
    color: #4285f4;
    border-bottom-color: #4285f4;
    font-weight: 600;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #333;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #4285f4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 未读标记 */
.unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4285f4;
    margin-right: 6px;
    vertical-align: middle;
}

/* 响应式 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .email-list-panel {
        width: 100%;
        min-width: auto;
    }

    .toolbar-inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .email-input {
        width: 100%;
    }

    .email-list {
        max-height: 300px;
    }
}
/* 邮箱输入组合框 */
.email-input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s;
}

.email-input-group:focus-within {
    border-color: #4285f4;
}

.email-input-group .email-input {
    border: none;
    border-radius: 0;
    width: 180px;
    padding: 12px 8px 12px 16px;
}

.email-input-group .email-input:focus {
    border-color: transparent;
}

.email-input-group .email-input.editable {
    background: #fffdf0;
}

.email-at {
    color: #999;
    font-size: 15px;
    padding: 0 4px;
    user-select: none;
}

.domain-select {
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
    background: transparent;
    padding: 12px 12px 12px 4px;
    cursor: pointer;
    appearance: auto;
}
