/* 管理后台统一样式 */

/* ==========================================================================
   页面布局
   ========================================================================== */

/* 页面操作栏 */
.page-actions {
    display: flex;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

/* 主内容卡片 */
.main-card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

/* 表单容器 */
.form-container {
    max-width: 800px;
}

.form-container-narrow {
    max-width: 600px;
}

.form-container-full {
    width: 100%;
}

/* ==========================================================================
   统计卡片
   ========================================================================== */

.stats-card {
    margin-bottom: 1rem;
}

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-card .stats-icon {
    font-size: 3rem;
}

.stats-card .stats-number {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
}

.stats-card .stats-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ==========================================================================
   搜索和筛选
   ========================================================================== */

.search-filters {
    margin-bottom: 1.5rem;
}

.search-filters .card-body {
    padding: 1.5rem;
}

/* ==========================================================================
   数据列表
   ========================================================================== */

.data-table .table th {
    border-top: none;
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    padding: 1rem 0.75rem;
}

.data-table .table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.data-table .table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state .empty-icon {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6c757d;
    margin-bottom: 2rem;
}

/* ==========================================================================
   批量操作
   ========================================================================== */

.batch-actions {
    margin-bottom: 1.5rem;
    display: none;
}

.batch-actions.show {
    display: block;
}

.batch-actions .card-body {
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
}

/* ==========================================================================
   状态标记
   ========================================================================== */

.status-badge {
    font-size: 0.75em;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

/* ==========================================================================
   表单样式
   ========================================================================== */

.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
}

.form-section-title i {
    margin-right: 0.5rem;
}

.required-field::after {
    content: " *";
    color: #dc3545;
}

/* 右对齐标签 */
.form-label-right {
    text-align: right;
}

@media (max-width: 576px) {
    .form-label-right {
        text-align: left;
    }
}

/* ==========================================================================
   按钮样式
   ========================================================================== */

.btn-group-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-group-actions .btn {
    padding: 0.375rem 0.75rem;
}

/* ==========================================================================
   消息和提示
   ========================================================================== */

.message-container {
    margin-bottom: 1.5rem;
}

.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.alert .alert-icon {
    margin-right: 0.5rem;
}

/* ==========================================================================
   进度条
   ========================================================================== */

.progress-thin {
    height: 8px;
    border-radius: 4px;
}

/* ==========================================================================
   工具类
   ========================================================================== */

.text-large {
    font-size: 1.25rem;
}

.text-xlarge {
    font-size: 1.5rem;
}

.icon-sm {
    font-size: 1rem;
}

.icon-md {
    font-size: 1.5rem;
}

.icon-lg {
    font-size: 2rem;
}

.icon-xl {
    font-size: 3rem;
}

.icon-xxl {
    font-size: 4rem;
}

/* 显示/隐藏工具类 */
.hide {
    display: none !important;
}

.show {
    display: block !important;
}

/* ==========================================================================
   响应式调整
   ========================================================================== */

@media (max-width: 768px) {
    .page-actions {
        flex-direction: column;
    }
    
    .stats-card .stats-icon {
        font-size: 2rem;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state .empty-icon {
        font-size: 3rem;
    }
}

/* ==========================================================================
   消息营销系统样式
   ========================================================================== */

/* 消息模板预览 */
.message-preview {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.4;
    min-height: 60px;
}

.message-preview.empty {
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

/* 群组选择器 */
.group-selector {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem;
}

.group-item {
    padding: 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
    transition: background-color 0.15s ease-in-out;
}

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

.group-item.selected {
    background-color: #e7f3ff;
    border: 1px solid #b6d7ff;
}

/* 任务进度 */
.task-progress {
    position: relative;
    margin-bottom: 1rem;
}

.task-progress-bar {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.task-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    transition: width 0.3s ease;
}

.task-progress-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* 状态标签 */
.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

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

.status-badge.running {
    background-color: #cce5ff;
    color: #004085;
}

.status-badge.completed {
    background-color: #d4edda;
    color: #155724;
}

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

.status-badge.cancelled {
    background-color: #f1f3f4;
    color: #5f6368;
}

/* 时间选择器 */
.datetime-input {
    position: relative;
}

.datetime-input input[type="datetime-local"] {
    padding-right: 2.5rem;
}

/* 执行日志 */
.execution-log {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    max-height: 400px;
    overflow-y: auto;
}

.log-entry {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #dee2e6;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.success {
    background-color: #d4edda;
    color: #155724;
}

.log-entry.failed {
    background-color: #f8d7da;
    color: #721c24;
}

.log-timestamp {
    color: #6c757d;
    font-size: 0.75rem;
}

/* 活动配置器 */
.campaign-builder {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.campaign-task-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.campaign-task-item .task-order {
    position: absolute;
    top: -10px;
    left: 10px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.campaign-task-item .task-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .group-selector {
        max-height: 200px;
    }
    
    .campaign-task-item {
        padding: 0.75rem;
    }
    
    .campaign-task-item .task-order {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
    }
    
    .execution-log {
        max-height: 300px;
    }
}

/* 全局预览弹出层样式 */
#globalPreviewModal .modal-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
}

#globalPreviewModal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.75rem;
}

#globalPreviewModal .modal-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid #dee2e6;
}

.preview-text {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.3;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.95rem;
    min-height: 40px;
    margin: 0;
}

.preview-text:empty::before {
    content: "暂无内容";
    color: #6c757d;
    font-style: italic;
}

/* 消息预览按钮样式优化 */
.btn-preview {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
} 