/* 管理后台样式 */
.admin-container {
    min-height: 100vh;
    background: #f8f9fa;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: #343a40;
    color: white;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #495057;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.sidebar-header .logo i {
    font-size: 1.5rem;
    color: #667eea;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    min-height: 0;
}

/* 自定义滚动条样式 */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: #495057;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #6c757d;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #495057;
    color: white;
}

.nav-item.active {
    background: #495057;
    color: white;
    border-left-color: #667eea;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #495057;
    background: #2c3237;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.3s;
    padding: 0.5rem;
    border-radius: 5px;
    border: 1px solid transparent;
}

.back-link:hover {
    color: white;
    background: #495057;
    border-color: #667eea;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 250px;
}

.admin-header {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-header h1 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* 内容区域 */
.content-section {
    display: none;
    padding: 2rem;
    flex: 1;
}

.content-section.active {
    display: block;
}

/* 仪表盘 */
.dashboard-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.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: #667eea; }
.stat-card:nth-child(2) .stat-icon { background: #28a745; }
.stat-card:nth-child(3) .stat-icon { background: #ffc107; }
.stat-card:nth-child(4) .stat-icon { background: #dc3545; }
.stat-card:nth-child(5) .stat-icon { background: #6f42c1; }

.stat-content h3 {
    font-size: 2rem;
    margin: 0;
    color: #333;
}

.stat-content p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* 快速操作 */
.quick-actions {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.quick-actions h3 {
    margin-bottom: 1rem;
    color: #333;
}

.quick-actions .action-buttons {
    display: table !important;
    width: 100% !important;
    table-layout: fixed !important;
    border-spacing: 1rem !important;
}

.quick-actions .action-btn {
    display: table-cell !important;
    vertical-align: middle !important;
    text-align: center !important;
    padding: 1rem !important;
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    text-decoration: none !important;
    color: #333 !important;
    box-sizing: border-box !important;
    height: 84px !important;
    width: 25% !important;
}

.quick-actions .action-btn i {
    display: block !important;
    font-size: 1.5rem !important;
    color: #667eea !important;
    margin-bottom: 0.5rem !important;
}

.action-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.action-btn i {
    font-size: 1.5rem;
    color: #667eea;
}

/* 系统状态 */
.system-status {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.system-status h3 {
    margin-bottom: 1rem;
    color: #333;
}

.status-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    font-weight: 500;
    color: #333;
}

.status-value {
    font-size: 0.9rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
}

.status-value.online {
    background: #d4edda;
    color: #155724;
}

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

.status-value.checking {
    background: #fff3cd;
    color: #856404;
}

/* 表格样式 */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
    overflow-y: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px; /* 确保表格有最小宽度 */
}

.data-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #dee2e6;
}

.data-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

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

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

/* 新闻摘要列样式 */
.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    max-width: 250px;
    width: 250px;
    vertical-align: top;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

/* 表格中的摘要样式 */
.data-table .news-summary {
    max-width: 250px;
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
    max-height: 4.2em; /* 限制最大高度为3行 */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.data-table .news-summary.empty {
    color: #999;
    font-style: italic;
}

/* 新闻管理页面表格宽度调整 */
#news-management .data-table {
    min-width: 1400px !important;
}

/* 新闻管理页面的摘要列宽度调整 */
#news-management .data-table th:nth-child(2),
#news-management .data-table td:nth-child(2) {
    max-width: 400px !important;
    width: 400px !important;
    min-width: 400px !important;
}

/* 新闻管理页面的摘要样式 - 完整显示 */
#news-management .data-table .news-summary {
    max-width: 380px !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
    -webkit-line-clamp: none !important;
    -webkit-box-orient: initial !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.4 !important;
    font-size: 0.9em !important;
    color: #555 !important;
    padding: 0 !important;
    margin: 0 !important;
    vertical-align: top !important;
}

/* 操作按钮 */
.action-buttons-table {
    display: flex;
    gap: 0.3rem;
    flex-wrap: nowrap;
    min-width: 160px;
    justify-content: flex-start;
}

/* 分类管理表格关键词列样式 */
#categoriesTable th:nth-child(3),
#categoriesTable td:nth-child(3) {
    max-width: 200px;
    width: 200px;
    word-wrap: break-word;
    white-space: normal;
}

/* 飞书发送管理表格专用样式 */
#feishu-messages .data-table {
    min-width: 1400px; /* 增加最小宽度以容纳更多列 */
}

/* 飞书表格列宽设置 */
#feishu-messages .data-table th:nth-child(1), /* ID */
#feishu-messages .data-table td:nth-child(1) {
    width: 60px;
    min-width: 60px;
}

#feishu-messages .data-table th:nth-child(2), /* 标题 */
#feishu-messages .data-table td:nth-child(2) {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
}

#feishu-messages .data-table th:nth-child(3), /* 类型 */
#feishu-messages .data-table td:nth-child(3) {
    width: 100px;
    min-width: 100px;
}

#feishu-messages .data-table th:nth-child(4), /* 状态 */
#feishu-messages .data-table td:nth-child(4) {
    width: 100px;
    min-width: 100px;
}

#feishu-messages .data-table th:nth-child(5), /* 新闻数量 */
#feishu-messages .data-table td:nth-child(5) {
    width: 80px;
    min-width: 80px;
    text-align: center;
}

#feishu-messages .data-table th:nth-child(6), /* 分类 */
#feishu-messages .data-table td:nth-child(6) {
    width: 100px;
    min-width: 100px;
}

#feishu-messages .data-table th:nth-child(7), /* 预定时间 */
#feishu-messages .data-table td:nth-child(7) {
    width: 140px;
    min-width: 140px;
    white-space: nowrap;
}

#feishu-messages .data-table th:nth-child(8), /* 发送时间 */
#feishu-messages .data-table td:nth-child(8) {
    width: 140px;
    min-width: 140px;
    white-space: nowrap;
}

#feishu-messages .data-table th:nth-child(9), /* 创建时间 */
#feishu-messages .data-table td:nth-child(9) {
    width: 140px;
    min-width: 140px;
    white-space: nowrap;
}

#feishu-messages .data-table th:nth-child(10), /* 操作 */
#feishu-messages .data-table td:nth-child(10) {
    width: 120px;
    min-width: 120px;
    white-space: nowrap;
}

/* 操作列宽度 */
.data-table th:last-child,
.data-table td:last-child {
    min-width: 160px;
    width: 160px;
    white-space: nowrap;
}

/* 新闻管理表格特定列宽 */
.data-table th:nth-child(1), /* 标题 */
.data-table td:nth-child(1) {
    max-width: 200px;
    width: 200px;
}

/* 新闻管理表格标题列支持换行 */
#news-management .data-table tbody td:nth-child(1) {
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    line-height: 1.4 !important;
    padding: 8px 12px !important;
    vertical-align: top !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
}

/* 新闻标题单元格样式 */
.news-title-cell {
    max-width: 300px;
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    line-height: 1.4 !important;
    overflow-wrap: break-word !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: top !important;
}

/* 新闻管理表格摘要列也支持换行（第2列） */
#news-management .data-table tbody td:nth-child(2) {
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    line-height: 1.4 !important;
    padding: 8px 12px !important;
    vertical-align: top !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
}

/* 确保摘要列内容与其他列对齐 */
#news-management .data-table tbody td:nth-child(2) .news-summary {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 确保所有新闻管理表格单元格内容顶部对齐 */
#news-management .data-table tbody td {
    vertical-align: top !important;
    padding: 8px 12px !important;
}

/* 确保表格内所有文本内容都从顶部开始 */
#news-management .data-table tbody td > * {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 新闻管理表格行高度自适应 */
#news-management .data-table tbody tr {
    height: auto !important;
    min-height: 50px !important;
}



.data-table th:nth-child(3), /* 来源 */
.data-table td:nth-child(3) {
    max-width: 80px;
    width: 80px;
}

.data-table th:nth-child(4), /* 分类 */
.data-table td:nth-child(4) {
    max-width: 60px;
    width: 60px;
}

.data-table th:nth-child(5), /* 发布时间 */
.data-table td:nth-child(5) {
    max-width: 100px;
    width: 100px;
}

.data-table th:nth-child(6), /* 浏览量 */
.data-table td:nth-child(6) {
    max-width: 60px;
    width: 60px;
}

.data-table th:nth-child(7), /* 重要性评分 */
.data-table td:nth-child(7) {
    max-width: 80px;
    width: 80px;
}

.data-table th:nth-child(8), /* 收藏 */
.data-table td:nth-child(8) {
    max-width: 50px;
    width: 50px;
}



.btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    border-radius: 3px;
    min-width: 32px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 飞书消息相关样式 */
.message-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.message-type-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.success {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-badge.failed {
    background: #ffebee;
    color: #c62828;
}

.status-badge.pending {
    background: #fff3e0;
    color: #ef6c00;
}

.status-badge.scheduled {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.sending {
    background: #f3e5f5;
    color: #7b1fa2;
}

.status-badge.cancelled {
    background: #f5f5f5;
    color: #616161;
}

/* 飞书表格响应式设计 */
#feishu-messages .table-container {
    overflow-x: auto;
    margin-bottom: 1rem;
}

/* 时间列样式优化 */
#feishu-messages .data-table td:nth-child(7),
#feishu-messages .data-table td:nth-child(8),
#feishu-messages .data-table td:nth-child(9) {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #666;
}

/* 操作按钮组优化 */
#feishu-messages .action-buttons {
    display: flex;
    gap: 4px;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

#feishu-messages .action-buttons .btn-sm {
    min-width: 28px;
    height: 24px;
    padding: 2px 6px;
}

/* 抓取按钮特殊样式 */
.btn-sm.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn-sm.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.btn-sm.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 123, 255, 0.3);
}

.btn-edit {
    background: #ffc107;
    color: #333;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #333;
    border: none;
}

.btn-warning:hover {
    background: #e0a800;
    color: #333;
}

.btn-info {
    background: #17a2b8;
    color: white;
    border: none;
}

.btn-info:hover {
    background: #138496;
    color: white;
}

.btn-toggle {
    background: #6c757d;
    color: white;
}

.btn-toggle:hover {
    background: #5a6268;
}

/* 收藏状态样式 */
.favorite-status {
    text-align: center;
    font-size: 1.2rem;
}

.favorite-status i {
    transition: all 0.2s ease;
}

.favorite-status i:hover {
    transform: scale(1.2);
}

/* 管理页面收藏按钮样式 */
.admin-favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 auto;
}

.admin-favorite-btn:hover {
    background: rgba(160, 82, 45, 0.1);
    transform: scale(1.1);
}

.admin-favorite-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.admin-favorite-btn i {
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

/* 飞书发送管理样式 */
.message-title {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

.message-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-success {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-error {
    background: #ffebee;
    color: #c62828;
}

.status-warning {
    background: #fff3e0;
    color: #ef6c00;
}

.status-info {
    background: #e3f2fd;
    color: #1976d2;
}

.status-default {
    background: #f5f5f5;
    color: #666;
}

.status-secondary {
    background: #e2e3e5;
    color: #6c757d;
}

/* 消息详情模态框样式 */
.message-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.detail-item span {
    color: #666;
}

.message-content {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #007bff;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.9rem;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #f44336;
    font-family: monospace;
    font-size: 0.9rem;
}

.news-ids {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    color: #666;
}

/* 配置卡片 */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.config-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.config-card h3 {
    margin-bottom: 1rem;
    color: #333;
}

/* 设置网格 */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.setting-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.setting-card h3 {
    margin-bottom: 1rem;
    color: #333;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* 筛选控件 */
.filter-controls {
    display: flex !important;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* 高级筛选控件 */
.advanced-filter-controls {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.advanced-filter-controls .filter-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.advanced-filter-controls .filter-row:last-child {
    margin-bottom: 0;
}

.advanced-filter-controls label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
    white-space: nowrap;
    margin: 0;
}

.advanced-filter-controls select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 13px;
    min-width: 120px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.advanced-filter-controls select:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.advanced-filter-controls select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.filter-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.filter-controls select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 120px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-controls select:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.filter-controls select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

/* 筛选标签 */
.filter-controls::before {
    content: "筛选：";
    font-weight: 500;
    color: #666;
    font-size: 14px;
}

/* 清除筛选按钮 */
.filter-controls .btn {
    padding: 0.4rem 0.8rem;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.filter-controls .btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.filter-controls .btn-secondary:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

/* 通用标签样式 */
.tag {
    background-color: #e9ecef;
    color: #495057;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 2px;
    display: inline-block;
    white-space: nowrap;
}

/* 分类标签样式 */
.category-tag {
    background-color: #6c757d;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 2px;
    display: inline-block;
    white-space: nowrap;
}

.category-tag:hover {
    opacity: 0.8;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* 多分类容器 */
.categories-container {
    max-width: 200px;
    line-height: 1.4;
}

/* 分页样式 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid #e9ecef;
}

.pagination-info {
    color: #6c757d;
    font-size: 14px;
}

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

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.page-number:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.page-number.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.page-number.disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
}

.page-size-selector select {
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .pagination-controls {
        justify-content: center;
    }

    .page-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-size-selector {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        order: 2;
    }

    .sidebar-nav {
        overflow-y: visible;
    }

    .main-content {
        margin-left: 0;
        order: 1;
    }

    .admin-container {
        display: flex;
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .quick-actions .action-buttons {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 1rem !important;
        border-spacing: 0 !important;
    }

    .quick-actions .action-btn {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 1 1 calc(50% - 0.5rem) !important;
        width: auto !important;
        height: auto !important;
        min-height: 84px !important;
    }

    .config-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .filter-controls {
        flex-direction: column;
    }
}

/* 超小屏幕 */
@media (max-width: 480px) {
    .quick-actions .action-btn {
        flex: 1 1 100% !important;
        padding: 0.8rem !important;
    }
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

/* 旧的模态框结构 - 用于飞书消息等 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

/* 新的模态框结构 - 用于新闻源管理等 - 必须放在后面以提高优先级 */
.modal-overlay .modal {
    background: white !important;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    display: block !important;
    /* 让模态框根据内容自适应高度 */
    height: auto !important;
    min-height: auto !important;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
    position: relative;
    /* 让模态框根据内容自适应高度 */
    height: auto;
    min-height: auto;
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 24px;
    /* 确保内容紧凑，避免不必要的空白 */
    min-height: auto;
    height: auto;
}

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

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-help {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* 确保添加新闻源表单紧凑 */
#addSourceForm, #editSourceForm {
    margin: 0;
    padding: 0;
}

#addSourceForm .form-group:last-child,
#editSourceForm .form-group:last-child {
    margin-bottom: 0;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 确保模态框可见 */
.modal-body, .modal-footer {
    display: block !important;
    visibility: visible !important;
}

/* 确保模态框头部使用flex布局 */
.modal-header {
    display: flex !important;
    visibility: visible !important;
}

/* 重复发送选项样式 */
.repeat-options {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.repeat-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 0;
}

.repeat-options input[type="checkbox"] {
    margin: 0;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-col {
    flex: 1;
}

.form-col:last-child {
    margin-bottom: 0;
}

.form-col label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-col input,
.form-col select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.form-col input:focus,
.form-col select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 预定消息样式 */
.scheduled-messages-container {
    max-height: 500px;
    overflow-y: auto;
}

.scheduled-message-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fff;
}

.scheduled-message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.scheduled-message-title {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.scheduled-message-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-scheduled {
    background: #fff3cd;
    color: #856404;
}

.status-sending {
    background: #d1ecf1;
    color: #0c5460;
}

.scheduled-message-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.scheduled-message-time {
    display: flex;
    align-items: center;
    gap: 6px;
}

.scheduled-message-repeat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.scheduled-message-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

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

/* 新闻详情模态框样式 */
.modal-overlay .news-detail-modal {
    max-width: 800px;
    width: 95%;
}

.news-detail-content {
    max-height: 70vh;
    overflow-y: auto;
}

.news-header {
    margin-bottom: 24px;
}

.news-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.news-meta {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.meta-row {
    display: flex;
    margin-bottom: 8px;
}

.meta-row:last-child {
    margin-bottom: 0;
}

.meta-label {
    font-weight: 600;
    color: #495057;
    min-width: 80px;
    flex-shrink: 0;
}

.meta-value {
    color: #6c757d;
    flex: 1;
}

/* 弹窗中的新闻详情样式 */
.news-detail-modal .news-summary,
.news-detail-modal .news-content,
.news-detail-modal .news-link {
    margin-bottom: 24px;
}

.news-detail-modal .news-summary h4,
.news-detail-modal .news-content h4,
.news-detail-modal .news-link h4 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.news-detail-modal .news-summary p {
    color: #495057;
    line-height: 1.6;
    margin: 0;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    max-width: none; /* 确保没有宽度限制 */
    overflow: visible; /* 确保内容可见 */
    display: block; /* 覆盖可能的flex-box设置 */
    -webkit-line-clamp: none; /* 移除行数限制 */
}

.content-text {
    color: #495057;
    line-height: 1.6;
    background: #ffffff;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.content-text img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 12px 0;
}

.news-link a {
    color: #007bff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.2s;
    word-break: break-all;
}

.news-link a:hover {
    background: #e9ecef;
    border-color: #007bff;
    color: #0056b3;
}

.news-link a i {
    flex-shrink: 0;
}

/* 状态样式 */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status.active {
    background: #d4edda;
    color: #155724;
}

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

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* 新建发送模态框样式 */
.large-modal .modal-content {
    max-width: 800px;
    width: 90%;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.filter-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filter-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-tab:hover {
    background: #f8f9fa;
}

.filter-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.news-selection-container {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    max-height: 400px;
    overflow: hidden;
}

.selection-header {
    padding: 0.75rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.selection-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-count {
    font-size: 0.875rem;
    color: #6c757d;
}

.news-list {
    max-height: 320px;
    overflow-y: auto;
}

.news-item-selectable {
    padding: 0.75rem;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s;
}

.news-item-selectable:hover {
    background: #f8f9fa;
}

.news-item-selectable.selected {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.news-item-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.news-item-content {
    flex: 1;
}

.news-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #212529;
    line-height: 1.4;
}

.news-item-summary {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.news-item-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #868e96;
}

.schedule-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    margin: 0;
}

#scheduleTimeContainer {
    margin-top: 0.5rem;
}

#scheduleTimeContainer input {
    width: 100%;
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}


/* === NewMessage Modal news list layout overrides === */
/* Fix checkbox being stretched by .form-group input { width:100% } */
.news-selection-container .news-list input[type="checkbox"] {
    width: auto !important;
    height: auto;
    flex: 0 0 auto;
    margin: 4px 0 0 0;
}

/* Ensure content can grow and wrap nicely */
.news-selection-container .news-item-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.news-selection-container .news-item-content {
    flex: 1 1 auto;
    min-width: 0;
}
.news-selection-container .news-item-title {
    font-size: 16px;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.news-selection-container .news-item-summary {
    font-size: 14px;
    color: #555;
}
.news-selection-container .news-item-meta {
    font-size: 12px;
}

/* Make checkbox a consistent size */
.news-selection-container .news-checkbox-input {
    width: 16px !important;
    height: 16px !important;
}

/* 新建/编辑预定消息样式 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.news-selection-section {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.time-filter-buttons {
    display: flex;
    gap: 8px;
}

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

.filter-btn:hover {
    background: #f8f9fa;
}

.filter-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.news-list-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.news-list .news-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s;
}

.news-list .news-item:hover {
    background-color: #f8f9fa;
}

.news-list .news-item:last-child {
    border-bottom: none;
}

.news-checkbox {
    margin-right: 12px;
    margin-top: 2px;
}

.news-content {
    flex: 1;
}

.news-header {
    margin-bottom: 8px;
}

.news-title {
    font-weight: 500;
    color: #333;
    cursor: pointer;
    display: block;
    margin-bottom: 4px;
}

.news-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

/* 这个样式被移动到表格特定的样式中 */

.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .time-filter-buttons {
        flex-wrap: wrap;
    }
}

/* 用户话题设置样式 */
.user-topics-settings {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.user-topics-settings h3 {
    margin: 0 0 1rem 0;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-topics-settings h3 i {
    color: #ffc107;
}

.topics-form .form-group {
    margin-bottom: 1rem;
}

.topics-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.topics-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.topics-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.25);
}

.form-hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal !important;
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    margin: 0 !important;
    flex-shrink: 0;
    width: auto !important;
    height: auto !important;
}

.checkbox-label span {
    line-height: 1.4;
    vertical-align: middle;
}

/* Webhook表单复选框对齐 */
.webhook-form .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.webhook-form .checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.webhook-form .checkbox-item input[type="checkbox"] {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    flex-shrink: 0;
}

.webhook-form .checkbox-item label {
    margin: 0 !important;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.topics-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.topics-preview {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.topics-preview h4 {
    margin: 0 0 0.75rem 0;
    font-size: 14px;
    color: #495057;
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.topic-tag {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.topic-tag.priority-high {
    background: #28a745;
}

.topic-tag.priority-medium {
    background: #17a2b8;
}

.topic-tag.priority-low {
    background: #6c757d;
}

.topics-stats {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    padding: 1rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-item .stat-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.stat-item .stat-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
}

/* 用户话题设置响应式 */
@media (max-width: 768px) {
    .topics-actions {
        flex-direction: column;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 重要性评分样式 */
.importance-score {
    text-align: center;
}

.importance-score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.score-value {
    font-weight: 600;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
    display: inline-block;
}

.score-level {
    font-size: 10px;
    font-weight: 500;
    padding: 1px 4px;
    border-radius: 2px;
    text-align: center;
    min-width: 20px;
    display: inline-block;
}

/* 评分等级颜色 */
.score-very-high {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.score-high {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.score-medium {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.score-low {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.score-very-low {
    background-color: #f5f5f5;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.score-none {
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
}

/* 时间点配置样式 */
.fetch-time-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.fetch-time-item input[type="time"] {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.fetch-time-item .btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.fetch-time-item .btn-remove:hover {
    background: #c82333;
}

.fetch-time-item .time-label {
    font-size: 12px;
    color: #6c757d;
    min-width: 60px;
}

#fetchTimesContainer {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.fetch-times-empty {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 4px;
}

/* OPML导入导出样式 */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-group {
    display: flex;
    gap: 5px;
}

.opml-preview {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background: #f8f9fa;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
}

/* OPML导入模态框checkbox对齐 */
.checkbox-container {
    margin-bottom: 8px;
}

.checkbox-container .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal !important;
    margin-bottom: 0 !important;
}

.checkbox-container .checkbox-label input[type="checkbox"] {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    flex-shrink: 0;
}

.checkbox-container .checkbox-label span {
    font-weight: 500;
    color: #333;
}

/* OPML源选择样式 */
.source-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.selection-controls {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
}

.btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.sources-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background: #fff;
}

/* 强制源项目使用正确的布局 */
#sourcesList .source-item,
.sources-list .source-item,
div.source-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    padding: 12px !important;
    border-bottom: 1px solid #f1f3f4 !important;
    transition: background-color 0.2s;
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: auto !important;
}

.source-item:hover {
    background-color: #f8f9fa;
}

.source-item:last-child {
    border-bottom: none;
}

/* 强制checkbox正确显示 */
#sourcesList .source-checkbox,
.sources-list .source-checkbox,
.source-item .source-checkbox {
    margin-right: 12px !important;
    margin-top: 2px !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
}

/* 强制源信息区域正确显示 */
#sourcesList .source-info,
.sources-list .source-info,
.source-item .source-info {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 强制标题正确显示 */
#sourcesList .source-title,
.sources-list .source-title,
.source-item .source-title {
    font-weight: 500 !important;
    color: #333 !important;
    margin-bottom: 4px !important;
    word-break: break-word !important;
    white-space: normal !important;
    display: block !important;
    writing-mode: horizontal-tb !important;
}

/* 强制URL正确显示 */
#sourcesList .source-url,
.sources-list .source-url,
.source-item .source-url {
    font-size: 12px !important;
    color: #666 !important;
    margin-bottom: 4px !important;
    word-break: break-all !important;
    white-space: normal !important;
    display: block !important;
    writing-mode: horizontal-tb !important;
}

/* 强制元数据正确显示 */
#sourcesList .source-meta,
.sources-list .source-meta,
.source-item .source-meta {
    display: flex !important;
    gap: 12px !important;
    font-size: 11px !important;
    color: #999 !important;
    flex-wrap: wrap !important;
    writing-mode: horizontal-tb !important;
}

.source-category {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 500;
}

.source-status {
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 500;
}

.source-status.exists {
    background: #fff3cd;
    color: #856404;
}

.source-status.new {
    background: #d4edda;
    color: #155724;
}

.selection-summary {
    margin-top: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.preview-placeholder {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
}

.preview-placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.import-progress {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #495057;
    font-weight: 500;
}

.import-result {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.result-summary h4 {
    margin: 0 0 15px 0;
    color: #28a745;
}

.result-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 4px;
    min-width: 80px;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
}

.stat-value.success {
    color: #28a745;
}

.stat-value.warning {
    color: #ffc107;
}

.stat-value.info {
    color: #17a2b8;
}

.result-details h5 {
    margin: 0 0 10px 0;
    color: #495057;
}

.details-list {
    max-height: 150px;
    overflow-y: auto;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
}

.details-list div {
    padding: 2px 0;
    font-size: 13px;
    color: #495057;
}

.details-list div:not(:last-child) {
    border-bottom: 1px solid #f8f9fa;
}

/* 文件输入样式 */
input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

input[type="file"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* OPML预览样式 */
.opml-preview-content h5 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.opml-preview-content p {
    margin: 5px 0;
    font-size: 13px;
    color: #6c757d;
}

.categories-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.category-tag {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.sources-preview {
    max-height: 100px;
    overflow-y: auto;
}

.source-item {
    padding: 5px 0;
    border-bottom: 1px solid #f1f3f4;
}

.source-item:last-child {
    border-bottom: none;
}

.source-item strong {
    display: block;
    font-size: 12px;
    color: #495057;
    margin-bottom: 2px;
}

.source-item small {
    font-size: 10px;
    color: #6c757d;
    word-break: break-all;
}

.more-indicator {
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
    padding: 5px 0;
}

/* ==================== 图片消息样式 ==================== */

/* 新闻选择容器 */
.news-selection-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

/* 新闻搜索栏 */
.news-search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.news-search-bar input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 新闻筛选栏 */
.news-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.news-filter-bar select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

/* 图片消息模态框中的筛选控件优化 */
#newImageMessageModal .advanced-filter-controls {
    padding: 8px 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

#newImageMessageModal .advanced-filter-controls .filter-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
    flex-wrap: nowrap;
}

#newImageMessageModal .advanced-filter-controls .filter-row:last-of-type {
    margin-bottom: 0;
}

#newImageMessageModal .advanced-filter-controls select {
    padding: 4px 6px;
    font-size: 12px;
    min-width: 100px;
    max-width: 140px;
    flex: 1;
}

#newImageMessageModal .advanced-filter-controls label {
    font-size: 12px;
    min-width: 50px;
    white-space: nowrap;
    flex: 0 0 auto;
    font-weight: 500;
}

/* 筛选操作按钮 */
#newImageMessageModal .filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

#newImageMessageModal .filter-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* 响应式设计 - 图片消息筛选 */
@media (max-width: 768px) {
    #newImageMessageModal .advanced-filter-controls .filter-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    #newImageMessageModal .advanced-filter-controls select {
        min-width: 80px;
        max-width: 120px;
    }

    #newImageMessageModal .advanced-filter-controls label {
        min-width: 45px;
        font-size: 11px;
    }
}

/* 图片消息模态框尺寸优化 */
#newImageMessageModal .modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
}

#newImageMessageModal .modal-body {
    max-height: 80vh;
    overflow-y: auto;
}

/* 进一步压缩筛选区域 */
#newImageMessageModal .news-search-bar {
    margin-bottom: 8px;
}

#newImageMessageModal .news-search-bar input {
    padding: 4px 8px;
    font-size: 13px;
}

#newImageMessageModal .news-search-bar button {
    padding: 4px 8px;
    font-size: 12px;
}

/* 新闻列表 */
.news-list {
    flex: 1;
    max-height: 500px;
    min-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.news-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.news-item:hover {
    background-color: #f8f9fa;
}

.news-item.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.news-item:last-child {
    border-bottom: none;
}

.news-checkbox {
    margin-top: 2px;
    cursor: pointer;
}

.news-content {
    flex: 1;
    min-width: 0;
}

.news-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.news-source {
    color: #2196f3;
}

.news-category {
    color: #4caf50;
}

.news-time {
    color: #999;
}

/* 已选新闻摘要 */
.selected-news-summary {
    margin-top: 8px;
    padding: 6px 10px;
    background: #e8f5e8;
    border-radius: 4px;
    font-size: 12px;
    color: #2e7d32;
    text-align: center;
    flex-shrink: 0;
}

/* 图片预览容器 */
.image-preview-container {
    text-align: center;
    padding: 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-preview-container .loading {
    font-size: 16px;
    color: #666;
}

/* 图片消息按钮样式 */
.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
    color: white;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .news-search-bar {
        flex-direction: column;
    }

    .news-filter-bar {
        flex-direction: column;
    }

    .news-meta {
        flex-direction: column;
        gap: 5px;
    }
}
