/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 页面切换 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 登录页面样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.login-header h1 {
    color: #333;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.login-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background: #5a6fd8;
}

/* 主页面布局 */
#mainPage {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #34495e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header i {
    font-size: 1.5rem;
}

.sidebar-header span {
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-menu {
    flex: 1;
    list-style: none;
    padding: 1rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.menu-item:hover {
    background: #34495e;
}

.menu-item.active {
    background: #3498db;
}

.menu-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #34495e;
}

.logout-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background: #e74c3c;
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

/* 顶部导航 */
.top-header {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.sidebar-toggle:hover {
    background: #f8f9fa;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 20px;
}

/* 内容页面 */
.content-page {
    flex: 1;
    padding: 2rem;
    display: none;
}

.content-page.active {
    display: block;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h3 {
    color: #333;
    font-size: 1.5rem;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card:nth-child(1) .stat-icon {
    background: #3498db;
}

.stat-card:nth-child(2) .stat-icon {
    background: #2ecc71;
}

.stat-card:nth-child(3) .stat-icon {
    background: #f39c12;
}

.stat-card:nth-child(4) .stat-icon {
    background: #e74c3c;
}

.stat-content h3 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    color: #333;
}

.stat-content p {
    color: #666;
    font-size: 0.9rem;
}

/* 最近活动 */
.recent-activity {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.recent-activity h3 {
    margin-bottom: 1rem;
    color: #333;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: #333;
}

.activity-content p {
    font-size: 0.8rem;
    color: #666;
}

/* 表格样式 */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e9ecef;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* 状态标签 */
.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status.sent {
    background: #d4edda;
    color: #155724;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

.status.failed {
    background: #f8d7da;
    color: #721c24;
}

/* 邮件表单 */
.email-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

/* 编辑器工具栏 */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: #dee2e6;
    margin: 0 0.5rem;
}

.toolbar-btn {
    background: white;
    border: 1px solid #dee2e6;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    color: #495057;
}

.toolbar-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toolbar-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.toolbar-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toolbar-select {
    background: white;
    border: 1px solid #dee2e6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.toolbar-select:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

.toolbar-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.toolbar-color {
    width: 32px;
    height: 32px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    background: none;
    padding: 0;
    transition: all 0.2s;
}

.toolbar-color:hover {
    border-color: #adb5bd;
    transform: scale(1.05);
}

.toolbar-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.toolbar-color::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

/* 邮件编辑器 */
.email-editor {
    min-height: 300px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    line-height: 1.6;
    background: white;
}

.email-editor:empty:before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
}

.email-editor:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* 筛选控件 */
.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-controls select,
.filter-controls input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 800px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
}

.preview-modal {
    max-width: 1000px;
    width: 98%;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.modal-close:hover {
    background: #f8f9fa;
}

.modal-body {
    padding: 1.5rem;
}

/* 邮件预览 */
.email-preview {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 1rem;
    background: white;
    min-height: 400px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -250px;
        height: 100vh;
        z-index: 1000;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 98%;
        max-width: 95vw;
        margin: 1rem;
    }
    
    .preview-modal {
        width: 98%;
        max-width: 95vw;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .filter-controls {
        flex-direction: column;
        width: 100%;
    }
    
    /* 编辑器响应式 */
    .editor-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .toolbar-group {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .toolbar-separator {
        display: none;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
    }
    
    .template-actions {
        flex-direction: column;
    }
    
    .template-actions .btn {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .editor-toolbar {
        padding: 0.5rem;
    }
    
    .toolbar-btn {
        min-width: 28px;
        height: 28px;
        padding: 0.25rem;
    }
    
    .toolbar-select {
        min-width: 60px;
        font-size: 0.8rem;
    }
    
    .toolbar-color {
        width: 28px;
        height: 28px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-page.active {
    animation: fadeIn 0.3s ease-out;
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 密码修改弹窗样式 */
#changePasswordModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

#changePasswordModal .modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#changePasswordModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

#changePasswordModal .modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

#changePasswordModal .modal-header .close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#changePasswordModal .modal-header .close:hover {
    color: #333;
    background-color: #f5f5f5;
}

#changePasswordModal .modal-body {
    padding: 1.5rem;
}

#changePasswordModal .form-group {
    margin-bottom: 1.5rem;
}

#changePasswordModal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

#changePasswordModal .form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

#changePasswordModal .form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

#changePasswordModal .form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

#changePasswordModal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

#changePasswordModal .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#changePasswordModal .btn-secondary {
    background-color: #6c757d;
    color: white;
}

#changePasswordModal .btn-secondary:hover {
    background-color: #5a6268;
}

#changePasswordModal .btn-primary {
    background-color: #007bff;
    color: white;
}

#changePasswordModal .btn-primary:hover {
    background-color: #0056b3;
}

#changePasswordModal .btn-primary:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* 密码强度指示器 */
.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
    width: 0%;
}

.password-strength.weak .password-strength-bar {
    width: 33%;
    background-color: #dc3545;
}

.password-strength.medium .password-strength-bar {
    width: 66%;
    background-color: #ffc107;
}

.password-strength.strong .password-strength-bar {
    width: 100%;
    background-color: #28a745;
}

.password-strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: #6c757d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #changePasswordModal .modal-content {
        width: 95%;
        max-width: 95vw;
        margin: 2% auto;
        max-height: 95vh;
    }
    
    #changePasswordModal .modal-header {
        padding: 1rem;
    }
    
    #changePasswordModal .modal-body {
        padding: 1rem;
    }
    
    #changePasswordModal .form-actions {
        flex-direction: column;
    }
    
    #changePasswordModal .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #changePasswordModal .modal-content {
        width: 98%;
        margin: 1% auto;
    }
    
    #changePasswordModal .modal-header h3 {
        font-size: 1.1rem;
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ddd;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #999;
}

.empty-state p {
    color: #aaa;
}

/* 模板网格 */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.template-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.template-preview {
    height: 200px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    overflow: hidden;
    position: relative;
}

.template-preview-content {
    padding: 1rem;
    height: 100%;
    overflow: hidden;
    font-size: 0.9rem;
    line-height: 1.4;
}

.template-preview-content h1,
.template-preview-content h2,
.template-preview-content h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.template-preview-content p {
    margin: 0 0 0.5rem 0;
    color: #666;
}

.template-info {
    padding: 1rem;
}

.template-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.template-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.template-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: #999;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
}

.template-actions .btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.8rem;
}

.template-tag {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

/* 模板编辑器 */
.template-editor {
    min-height: 400px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    line-height: 1.6;
    background: white;
    font-family: inherit;
}

.template-editor:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.template-editor h1,
.template-editor h2,
.template-editor h3 {
    margin: 1rem 0 0.5rem 0;
    color: #333;
}

.template-editor p {
    margin: 0.5rem 0;
    color: #666;
}

/* 模板选择器 */
.template-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.template-option {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.template-option:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.template-option.selected {
    border-color: #007bff;
    background: #e3f2fd;
}

.template-option h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.template-option p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* HTML代码编辑器样式 */
.html-code-modal {
    max-width: 1200px;
    width: 98%;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-editor-container {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.code-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.code-info {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.code-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.html-code-editor {
    width: 100%;
    min-height: 400px;
    max-height: 500px;
    padding: 1rem;
    border: none;
    outline: none;
    font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
    background: #ffffff;
    color: #333;
    resize: vertical;
    tab-size: 2;
}

.html-code-editor:focus {
    box-shadow: none;
}

/* 代码高亮样式 */
.code-highlight {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 1rem;
    font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
}

.code-highlight .tag {
    color: #e83e8c;
    font-weight: bold;
}

.code-highlight .attr {
    color: #fd7e14;
}

.code-highlight .value {
    color: #20c997;
}

.code-highlight .comment {
    color: #6c757d;
    font-style: italic;
}

/* 语法错误提示 */
.syntax-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 0.5rem;
    margin: 0.5rem 0;
    border-radius: 0 4px 4px 0;
    color: #721c24;
    font-size: 0.875rem;
}

/* 代码编辑器工具栏按钮 */
.code-toolbar .btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 响应式代码编辑器 */
@media (max-width: 768px) {
    .html-code-modal {
        width: 98%;
        margin: 1rem;
    }
    
    .code-toolbar {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .code-info {
        justify-content: center;
    }
    
    .code-actions {
        justify-content: center;
    }
    
    .html-code-editor {
        min-height: 300px;
        font-size: 12px;
    }
}

/* EDM列表筛选控件样式 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-controls input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 250px;
}

.filter-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.filter-controls input:focus,
.filter-controls select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 模板管理样式 */
.template-stats {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    min-width: 120px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.template-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.template-preview {
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.template-preview-content {
    height: 100%;
    overflow: hidden;
    transform: scale(0.5);
    transform-origin: top left;
    width: 200%;
    height: 200%;
}

.template-info {
    padding: 20px;
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.template-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.template-category {
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.template-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.template-tags {
    margin-bottom: 15px;
}

.tag {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

.template-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.8rem;
    color: #666;
}

.template-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.template-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.template-actions .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-width: auto;
}

.loading-state,
.error-state,
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading-state i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #007bff;
}

.error-state {
    color: #dc3545;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ccc;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #666;
}

/* 模板详情样式 */
.template-detail {
    max-width: 800px;
}

.template-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.template-detail-header h3 {
    margin: 0;
    color: #333;
}

.template-detail-info {
    margin-bottom: 20px;
}

.template-detail-info .detail-item {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-start;
}

.template-detail-info .detail-item label {
    font-weight: 600;
    min-width: 100px;
    color: #333;
    margin-right: 10px;
}

.visibility.public {
    color: #28a745;
    font-weight: 600;
}

.visibility.private {
    color: #dc3545;
    font-weight: 600;
}

.template-preview-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.template-preview-section h4 {
    margin-bottom: 15px;
    color: #333;
}

.template-preview-section .template-preview-content {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background: #f8f9fa;
    max-height: 400px;
    overflow-y: auto;
}

/* 分类管理样式 */
.category-management {
    max-width: 800px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.category-list {
    max-height: 500px;
    overflow-y: auto;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
}

.category-item:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.category-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.category-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.category-details {
    flex: 1;
}

.category-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.category-description {
    color: #666;
    font-size: 0.9rem;
}

.category-actions {
    display: flex;
    gap: 8px;
}

.category-actions .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-width: auto;
}

/* 颜色选择器样式 */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.color-picker-group input[type="color"] {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.color-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-preset {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.color-preset:hover {
    transform: scale(1.1);
}

.color-preset.active {
    border-color: #333;
    box-shadow: 0 0 0 2px #333;
}

/* 表单样式增强 */
.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group input[type="number"] {
    width: 100px;
}

/* Quill编辑器样式 */
.quill-editor {
    min-height: 400px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Quill编辑器容器样式 */
.ql-container {
    border-radius: 0 0 4px 4px !important;
    font-family: Arial, sans-serif !important;
}

/* Quill编辑器工具栏样式 */
.ql-toolbar {
    background: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
    border-radius: 4px 4px 0 0 !important;
}

/* Quill编辑器内容区域样式 */
.ql-editor {
    background: white !important;
    min-height: 350px !important;
}

/* 响应式编辑器 */
@media (max-width: 768px) {
    .quill-editor {
        min-height: 300px;
    }
    
    .ql-editor {
        min-height: 250px !important;
    }
}

/* 大屏幕模态框优化 */
@media (min-width: 1200px) {
    .modal-content {
        max-width: 1000px;
    }
    
    .preview-modal {
        max-width: 1200px;
    }
    
    .html-code-modal {
        max-width: 1400px;
    }
}

/* 超大屏幕模态框优化 */
@media (min-width: 1600px) {
    .modal-content {
        max-width: 1200px;
    }
    
    .preview-modal {
        max-width: 1400px;
    }
    
    .html-code-modal {
        max-width: 1600px;
    }
}

/* ===== 仪表盘样式 ===== */

/* 仪表盘欢迎区域 */
.dashboard-welcome {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-content h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.welcome-content p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

.welcome-actions {
    display: flex;
    gap: 15px;
}

.welcome-actions .btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.welcome-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 增强统计卡片 */
.stat-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-trend {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #28a745;
    font-weight: 600;
    margin-top: 5px;
}

.stat-trend i {
    margin-right: 4px;
}

/* 仪表盘内容区域 */
.dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 图表卡片 */
.chart-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.chart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.chart-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.chart-body {
    position: relative;
    height: 300px;
}

/* 活动卡片 */
.activity-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.activity-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.activity-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 快速操作卡片 */
.quick-actions-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.quick-actions-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    background: white;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.quick-action-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.quick-action-btn i {
    font-size: 24px;
    margin-bottom: 8px;
}

.quick-action-btn span {
    font-size: 12px;
    font-weight: 500;
}

/* 系统状态卡片 */
.system-status-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.system-status-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.online {
    background: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
}

.status-indicator.offline {
    background: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.status-item span:first-of-type {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.status-value {
    font-weight: 600;
    color: #28a745;
}

/* 活动列表 */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f5f5f5;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 16px;
    color: white;
}

.activity-content h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.activity-content p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

/* 仪表盘响应式设计 */
@media (max-width: 1200px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
    
    .dashboard-right {
        order: -1;
    }
}

@media (max-width: 768px) {
    .dashboard-welcome {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .welcome-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .welcome-actions .btn {
        width: 100%;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
}
