/* 只保留必要的布局样式，其他样式使用layui默认样式 */

/* 基础布局样式 - 确保页面占满全屏 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 确保主布局容器占满全屏 */
.layui-layout-admin {
    height: 100%;
    min-height: 100%;
}

/* 主内容区域样式 - 确保占满剩余空间 */
.layui-body {
    padding: 15px;
    background-color: #f5f7fa;
    overflow-y: auto;
}

/* 确保行容器能够正确扩展 */
.layui-layout-admin .layui-body {
    position: absolute;
    top: 60px;
    bottom: 0;
    left: 200px;
    right: 0;
    overflow-y: auto;
}

/* 适配小屏幕 */
@media screen and (max-width: 768px) {
    .layui-layout-admin .layui-body {
        left: 0;
    }
}

/* 页面内容区域 */
#page-content {
    flex: 1;
    min-height: 0;
}

/* 加载状态样式 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 18px;
    color: #666;
}

/* 错误消息样式 */
.error-message {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 18px;
    color: #f56c6c;
}

/* 登录容器样式 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

/* 任务详情页面样式 */
.task-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.task-detail-header {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.task-detail-header h2 {
    font-size: 24px;
    margin: 0;
    font-weight: 600;
}

/* 卡片阴影样式 */
.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.shadow-sm:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 信息项样式 */
.info-item {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.info-label {
    font-weight: 500;
    color: #606266;
    width: 120px;
    flex-shrink: 0;
    margin-right: 20px;
    padding-top: 4px;
    font-size: 14px;
}

.info-value {
    flex: 1;
    color: #303133;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

/* 统计卡片样式 */
.stats-grid {
    margin: 0 -7.5px;
}

.stat-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    padding: 25px 15px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.stat-value {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: #606266;
    font-weight: 500;
}

/* 确保带背景色的统计卡片中文字为白色 */
.stat-card[class*="layui-bg-"] .stat-value,
.stat-card[class*="layui-bg-"] .stat-label {
    color: #fff !important;
}

/* 图表容器样式 */
.chart-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: 350px;
    display: flex;
    flex-direction: column;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 10px;
    text-align: center;
    flex-shrink: 0;
}

.pie-chart-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

/* 确保canvas元素高度一致 */
.chart-container canvas {
    max-height: 280px !important;
    height: 280px !important;
}

/* 邮件历史记录样式 */
.email-history-list {
    margin: 0 -10px;
}

.email-history-item {
    background-color: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.email-history-header {
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    background-color: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.email-history-header:hover {
    background-color: #f5f5f5;
}

.email-recipient {
    font-weight: 500;
    color: #303133;
    font-size: 15px;
}

.email-history-body {
    padding: 20px;
    background-color: #fff;
}

/* 状态时间线样式 */
.status-timeline {
    margin-bottom: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #409eff;
    display: inline-block;
}

/* 提交信息样式 */
.submissions-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.submission-list {
    margin: 0 -10px;
}

.submission-item {
    background-color: #fafafa;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
}

.submission-header {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.submission-header:hover {
    background-color: #f0f0f0;
}

.submission-title {
    font-weight: 500;
    color: #303133;
    font-size: 14px;
}

.submission-time {
    color: #909399;
    font-size: 12px;
    margin-left: 8px;
}

.submission-body {
    padding: 15px;
    background-color: #fff;
}

/* 代码和数据样式 */
pre {
    margin: 0;
    padding: 10px;
    background-color: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

.submission-data {
    max-height: 200px;
    overflow-y: auto;
}

.user-agent {
    max-height: 100px;
    overflow-y: auto;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #909399;
    font-size: 14px;
    background-color: #fafafa;
    border-radius: 6px;
}

/* 错误状态样式 */
.error-state {
    text-align: center;
    padding: 40px 20px;
    color: #f56c6c;
    font-size: 14px;
    background-color: #fef0f0;
    border: 1px solid #fbc4c4;
    border-radius: 6px;
}

/* 间距样式 */
.mt-4 {
    margin-top: 20px;
}

.ml-2 {
    margin-left: 8px;
}

/* 响应式设计 */
@media screen and (max-width: 1200px) {
    .task-detail-container {
        max-width: 100%;
    }
}

@media screen and (max-width: 768px) {
    .info-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .info-label {
        width: auto;
        margin-right: 0;
        margin-bottom: 5px;
        padding-top: 0;
    }
    
    .stat-card {
        height: auto;
        padding: 20px 10px;
        margin-bottom: 10px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .email-history-header {
        padding: 12px 15px;
    }
    
    .email-history-body {
        padding: 15px;
    }
    
    .chart-container {
        padding: 15px;
    }
}

@media screen and (max-width: 480px) {
    .layui-body {
        padding: 10px;
    }
    
    .task-detail-container {
        padding: 0 10px;
    }
    
    .task-detail-header h2 {
        font-size: 20px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 13px;
    }
}

/* 过渡动画 */
.layui-card {
    transition: all 0.3s ease;
}

/* 按钮组间距 */
.layui-btn-container {
    gap: 8px;
}

/* 标题样式 */
.layui-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #303133;
}

/* 统计数据卡片颜色变体 - 根据安全度分类 */
.stat-card:nth-child(1),
.stat-card.layui-bg-green {
    background: linear-gradient(135deg, #e8f5e8 0%, #4caf50 100%); /* 发送总数、已发送 - 绿色 */
}

.stat-card:nth-child(2),
.stat-card.layui-bg-green {
    background: linear-gradient(135deg, #e8f5e8 0%, #4caf50 100%); /* 已发送 - 绿色 */
}

.stat-card:nth-child(3),
.stat-card.layui-bg-blue {
    background: linear-gradient(135deg, #e3f2fd 0%, #2196f3 100%); /* 已打开 - 蓝色 */
}

.stat-card:nth-child(4),
.stat-card.layui-bg-yellow {
    background: linear-gradient(135deg, #fff3e0 0%, #ff9800 100%); /* 点击链接数量 - 黄色 */
}

.stat-card:nth-child(5),
.stat-card.layui-bg-red {
    background: linear-gradient(135deg, #ffebee 0%, #f44336 100%); /* 提交信息数量 - 红色 */
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 通知功能样式 */
.notification-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

.notification-status.draft {
    background-color: #F0F2F5;
    color: #909399;
}

.notification-status.published {
    background-color: #F0F9EB;
    color: #67C23A;
}

.notification-status.recalled {
    background-color: #FEF0F0;
    color: #F56C6C;
}

.notification-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background-color: #FF4D4F;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    padding: 0;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    line-height: 16px;
    box-sizing: border-box;
}

.layui-nav-item .notification-badge {
    top: 8px;
    right: 8px;
}

.layui-nav.layui-layout-right .layui-nav-item {
    position: relative;
}

.layui-nav.layui-layout-right .layui-nav-child#notification-list {
    width: 300px;
    max-width: 90vw;
    background-color: #ffffff;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    top: 100% !important;
    margin: 0 !important;
    transform: none !important;
}

.notification-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s;
    background-color: #ffffff;
    margin: 0;
}

.notification-item:hover {
    background-color: #f5f7fa;
}

.notification-item.unread {
    background-color: #f0f9ff;
    font-weight: bold;
}

.notification-item.read {
    color: #666;
}

.notification-title {
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}

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

.notification-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    background-color: #ffffff;
    margin: 0;
}

.notification-actions {
    padding: 10px;
    text-align: center;
    background-color: #f5f7fa;
    border-top: 1px solid #f0f0f0;
    margin: 0;
}

.notification-detail {
    line-height: 1.6;
}

.notification-detail-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.notification-detail-meta {
    color: #999;
    font-size: 14px;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.notification-detail-content {
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.notification-detail-attachment {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}