/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: #1a2035;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
}

.nav-menu {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background: rgba(64, 158, 255, 0.15);
    color: #409eff;
    border-left: 3px solid #409eff;
}

.nav-item .icon {
    margin-right: 10px;
    font-size: 18px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 20px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

h2 {
    margin-bottom: 20px;
    color: #1a2035;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    font-size: 40px;
    margin-right: 15px;
}

.stat-info h3 {
    font-size: 28px;
    color: #1a2035;
    margin-bottom: 5px;
}

.stat-info p {
    color: #909399;
    font-size: 14px;
}

/* 快速操作 */
.quick-actions {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.quick-actions h3 {
    margin-bottom: 15px;
    color: #1a2035;
}

/* 页面头部 */
.page-header {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: #409eff;
    color: #fff;
}

.btn-primary:hover {
    background: #337ecc;
}

.btn-secondary {
    background: #e4e7ed;
    color: #606266;
}

.btn-secondary:hover {
    background: #d3d6de;
}

.btn-danger {
    background: #f56c6c;
    color: #fff;
}

.btn-danger:hover {
    background: #d9534f;
}

.btn-success {
    background: #67c23a;
    color: #fff;
}

.btn-success:hover {
    background: #529b2e;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 表格 */
.table-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f5f7fa;
}

.data-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #606266;
    border-bottom: 1px solid #ebeef5;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ebeef5;
}

.data-table tbody tr:hover {
    background: #f5f7fa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #606266;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #409eff;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    background: #fff;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #909399;
    font-size: 12px;
}

/* 编辑器标签 */
.editor-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.tab-btn {
    padding: 8px 16px;
    border: 1px solid #dcdfe6;
    background: #fff;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 14px;
}

.tab-btn.active {
    background: #409eff;
    color: #fff;
    border-color: #409eff;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* 状态消息 */
.status-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    display: none;
}

.status-message.success {
    background: #f0f9eb;
    color: #67c23a;
    display: block;
}

.status-message.error {
    background: #fef0f0;
    color: #f56c6c;
    display: block;
}

.status-message.info {
    background: #ecf5ff;
    color: #409eff;
    display: block;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ebeef5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #1a2035;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #909399;
}

.close-btn:hover {
    color: #606266;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ebeef5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 状态标签 */
.status-tag {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-tag.success {
    background: #f0f9eb;
    color: #67c23a;
}

.status-tag.warning {
    background: #fdf6ec;
    color: #e6a23c;
}

.status-tag.danger {
    background: #fef0f0;
    color: #f56c6c;
}

.status-tag.info {
    background: #ecf5ff;
    color: #409eff;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #ebeef5;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #409eff, #67c23a);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #409eff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .logo h1 {
        font-size: 14px;
    }
    
    .nav-item span:not(.icon) {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 5px;
}

/* 邮箱列表 */
.email-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    padding: 10px;
}

.email-item {
    padding: 8px;
    border-bottom: 1px solid #ebeef5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.email-item:last-child {
    border-bottom: none;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #909399;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* 预览邮件 */
#preview-content {
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    padding: 20px;
    min-height: 300px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
