/* 后台管理界面通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 头部导航栏 */
.header {
    background: #fff;
    padding: 0 24px;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 20px;
    font-weight: 600;
    color: #1890ff;
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-item {
    color: #666;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    color: #1890ff;
    background-color: #e6f7ff;
}

/* 主容器 */
.container {
    margin-top: 64px;
    padding: 24px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* 页面标题 */
.page-header {
    background: #fff;
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #262626;
    margin-bottom: 8px;
}

.page-subtitle {
    color: #8c8c8c;
    font-size: 14px;
}

/* 工具栏 */
.toolbar {
    background: #fff;
    padding: 16px 24px;
    margin-bottom: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #666;
}

.btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.btn-primary {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.btn-primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
    color: #fff;
}

.btn-danger {
    background: #ff4d4f;
    border-color: #ff4d4f;
    color: #fff;
}

.btn-danger:hover {
    background: #ff7875;
    border-color: #ff7875;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

/* 输入框 */
.input {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    width: 200px;
}

.input:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.input-large {
    width: 300px;
}

/* 选择框 */
.select {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    min-width: 120px;
}

.select:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 表格样式 */
.table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    background: #fafafa;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #262626;
    border-bottom: 1px solid #e8e8e8;
    white-space: nowrap;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

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

.table tr:last-child td {
    border-bottom: none;
}

/* 状态标签 */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
    display: inline-block;
}

.status-waiting {
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

.status-analyzed {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-error {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.status-pending {
    background: #f0f0f0;
    color: #666;
    border: 1px solid #d9d9d9;
}

.status-confirmed {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.status-discarded {
    background: #fff1f0;
    color: #ff4d4f;
    border: 1px solid #ffa39e;
}

/* 分页 */
.pagination {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

.pagination-info {
    color: #8c8c8c;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    border-color: #1890ff;
    color: #1890ff;
}

.page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.page-btn.active {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: 600;
    color: #1890ff;
    margin-bottom: 4px;
}

.stat-label {
    color: #8c8c8c;
    font-size: 14px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #8c8c8c;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f0f0f0;
    border-top: 2px solid #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: auto;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

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

.modal-footer {
    padding: 0 24px 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 表单组 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #262626;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 消息提示 */
.message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid;
}

.message-success {
    background: #f6ffed;
    border-color: #b7eb8f;
    color: #52c41a;
}

.message-error {
    background: #fff2f0;
    border-color: #ffccc7;
    color: #ff4d4f;
}

.message-info {
    background: #e6f7ff;
    border-color: #91d5ff;
    color: #1890ff;
}

/* 数据容器和数据表格 - 补充样式 */
.data-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: #fafafa;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #262626;
    border-bottom: 1px solid #e8e8e8;
    white-space: nowrap;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

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

.data-table tr:last-child td {
    border-bottom: none;
}

/* 模态框修复 - 确保正常显示和隐藏 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #666;
}

/* 加载遮罩层 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Toast 消息提示 */
.toast {
    position: fixed;
    top: 100px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 4000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: #52c41a;
}

.toast-error {
    background: #ff4d4f;
}

.toast-info {
    background: #1890ff;
}

/* 监控管理页面特定样式 */
.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    min-height: 28px;
}

.btn-secondary {
    background: #f5f5f5;
    border-color: #d9d9d9;
    color: #666;
}

.btn-secondary:hover {
    background: #e6e6e6;
    border-color: #bfbfbf;
}

/* 监控操作按钮组 */
.monitor-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    min-width: 180px;
}

.monitor-actions .btn {
    flex-shrink: 0;
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    min-width: auto;
}

/* 表格内容优化 */
.data-table td {
    word-break: break-word;
    max-width: 200px;
}

.data-table td:nth-child(3) { /* 目标网站列 */
    max-width: 150px;
}

.data-table td:nth-child(4) { /* 配置信息列 */
    max-width: 120px;
    font-size: 12px;
}

.data-table td:nth-child(9) { /* 操作列 */
    min-width: 180px;
    width: 180px;
}

/* 间隔时间和下次执行时间列 */
.data-table td:nth-child(5),
.data-table td:nth-child(6) {
    white-space: nowrap;
    font-size: 12px;
}

/* 状态标签扩展 */
.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* 文本工具类 */
.text-muted {
    color: #8c8c8c;
}

.page-dots {
    color: #8c8c8c;
    padding: 0 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .toolbar {
        padding: 12px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .table-container, .data-container {
        overflow-x: auto;
    }
    
    .table, .data-table {
        min-width: 800px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination {
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

/* 详细执行日志样式 */
.execution-log-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-top: 12px;
}

.log-text-content {
    max-height: 400px;
    overflow-y: auto;
}

.log-text {
    background: #fff;
    border: none;
    padding: 16px;
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    color: #24292e;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-radius: 6px;
}

.log-summary {
    padding: 16px;
}

.log-summary p {
    margin-bottom: 8px;
    font-weight: 500;
}

.log-summary ul {
    list-style-type: none;
    padding-left: 0;
}

.log-summary li {
    padding: 4px 0;
    color: #666;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h4 {
    margin-bottom: 16px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}