/**
 * 运营配置（奖励配置 / 进群欢迎 / 广告按钮）页面样式
 *
 * 骨架、页头、筛选表单、统计卡片、分页、空态、弹层与表单等通用样式
 * 复用 base.css / layout.css / users.css，本文件只补充三个运营配置
 * 页面特有的部分：
 *   1. 4 列统计卡片栅格
 *   2. 表格列宽、状态标签、剩余天数标签、链接与图片缩略图
 *   3. 行内操作按钮
 *   4. 进群欢迎图片的拖拽上传区（dropzone）
 */

/* ---------- 统计卡片：本页为 4 张卡 ---------- */

.stat-grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* 统计卡片图标底色（与 users.css / finance.css 的色彩语义保持一致） */
.stat-card .stat-icon.icon-blue {
    background: #e8f1ff;
}

.stat-card .stat-icon.icon-orange {
    background: #fff2e6;
}

.stat-card .stat-icon.icon-purple {
    background: #f1ecff;
}

/* ---------- 表格 ---------- */

.operation-table {
    min-width: 1080px;
}

.operation-table thead th {
    white-space: nowrap;
}

.operation-table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
}

/* 序号列：窄列 + 弱化颜色（与 finance.css 的序号列保持一致） */
.operation-table .col-index {
    width: 52px;
    text-align: center;
    font-size: 12px;
}

/* 主键列：等宽字体 */
.operation-table .col-id {
    width: 72px;
    font-family: Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* 操作列：固定宽度 + 不换行，避免按钮被挤压换行（含「编辑」+「启用/禁用」两个按钮） */
.operation-table .col-actions {
    width: 150px;
    text-align: right;
}

/* 行内操作按钮组：编辑 + 启用/禁用（广告为下架/恢复） */
.row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.operation-table th.text-center,
.operation-table td.text-center {
    text-align: center;
}

.operation-table th.text-right,
.operation-table td.text-right {
    text-align: right;
}

/* 时间列不换行，避免表格宽度抖动 */
.operation-table td.text-muted {
    white-space: nowrap;
}

/* 关键字列（奖励标识 / 广告标题）加粗显示 */
.operation-table td.cell-strong {
    font-weight: 600;
}

/* 奖励金额列：等宽 + 主色，便于纵向对齐比较 */
.amount-text {
    font-family: Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary, #2563eb);
    white-space: nowrap;
}

/* 奖励标识：代码风格标签 */
.code-tag {
    display: inline-block;
    padding: 2px 8px;
    font-family: Menlo, Consolas, monospace;
    font-size: 12px;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* 欢迎文本等长文本列：限宽 + 省略号，完整内容通过 title 查看 */
.operation-table .td-remark {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-muted);
}

/* ---------- 状态标签（启用/禁用、广告状态） ---------- */

.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 999px;
    white-space: nowrap;
}

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

.status-tag.status-on {
    color: #15803d;
    background: #e9f9ef;
}

.status-tag.status-off {
    color: #6b7280;
    background: #f1f5f9;
}

.status-tag.status-warn {
    color: #b45309;
    background: #fff6e5;
}

/* ---------- 剩余天数标签（广告按钮） ---------- */

.days-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.days-tag.days-soon {
    color: #b45309;
    background: #fff6e5;
}

.days-tag.days-expired {
    color: #b91c1c;
    background: #fdecec;
}

/* ---------- 链接与图片缩略图 ---------- */

.link-cell {
    color: var(--color-primary, #2563eb);
    text-decoration: none;
    word-break: break-all;
}

.link-cell:hover {
    text-decoration: underline;
}

.thumb-link {
    display: inline-block;
    line-height: 0;
}

.thumb-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    transition: transform var(--transition);
}

.thumb-link:hover .thumb-img {
    transform: scale(1.08);
}

/* ---------- 行内操作按钮 ---------- */

.btn-link {
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-primary, #2563eb);
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.btn-link:hover {
    background: #eef4ff;
}

.btn-link-warn {
    color: #b45309;
}

.btn-link-warn:hover {
    background: #fff6e5;
}

/* ---------- 图片拖拽上传区（进群欢迎） ---------- */

/* 弹层在窄屏下需要更宽，保证 7 个字段的栅格不至于过挤 */
.modal.modal-lg {
    max-width: 860px;
}

/* 图片字段独占整行：拖拽区需要足够宽度才好操作 */
.detail-field-wide {
    grid-column: 1 / -1;
}

.form-textarea {
    resize: vertical;
    min-height: 76px;
    font-family: inherit;
    line-height: 1.5;
}

.required-mark {
    margin-left: 2px;
    color: var(--color-danger, #dc2626);
}

.dropzone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 16px;
    background: var(--color-bg);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.dropzone:hover,
.dropzone:focus {
    border-color: var(--color-primary, #2563eb);
    background: #f8fbff;
    outline: none;
}

/* 拖拽悬停高亮 */
.dropzone.is-dragover {
    border-color: var(--color-primary, #2563eb);
    background: #eef4ff;
    box-shadow: inset 0 0 0 1px var(--color-primary, #2563eb);
}

.dropzone.has-image {
    border-style: solid;
}

/* 隐藏原生文件选择框，仅通过拖拽/按钮触发 */
.dropzone-input {
    display: none;
}

.dropzone-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    pointer-events: none;
}

.dropzone-icon {
    font-size: 26px;
    line-height: 1;
}

.dropzone-text {
    font-size: 13px;
    color: var(--color-text);
}

.dropzone-sub {
    font-size: 11px;
    color: var(--color-text-muted);
}

.dropzone-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    background: #fff;
}

/* 上传状态：成功 / 失败 / 上传中 */
.dropzone-status {
    position: absolute;
    right: 10px;
    bottom: 8px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.dropzone-status.is-success {
    color: #15803d;
}

.dropzone-status.is-error {
    color: #b91c1c;
}

.dropzone-status.is-loading {
    color: var(--color-primary, #2563eb);
}

/* 选择 / 移除图片按钮行 */
.dropzone-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.dropzone-actions .btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ---------- 全局通知（运营配置） ---------- */

/* 左表单 + 右预览/进度的两列布局 */
.notify-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 16px;
    align-items: start;
}

.notify-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 16px;
}

/* 两列同行字段（按钮文案 / 按钮链接） */
.notify-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* 字段说明文案 */
.field-hint {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-text-muted);
}

/* 通知类型单选项 */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.radio-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text);
    cursor: pointer;
}

.radio-item input[type="radio"] {
    width: 15px;
    height: 15px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* ---------- 提交区 ---------- */

.notify-submit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.notify-submit-hint {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* 校验未通过时提前给出提示 */
.notify-submit-hint.is-warn {
    color: var(--color-warning);
}

/* ---------- 消息预览（近似 Telegram 气泡） ---------- */

.notify-preview {
    padding: 12px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.notify-preview-head {
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.notify-preview-bubble {
    padding: 10px 12px;
    background: #eaf2ff;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px rgba(31, 45, 61, 0.08);
}

.notify-preview-img {
    display: block;
    width: 100%;
    max-height: 220px;
    margin-bottom: 8px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: #fff;
}

.notify-preview-title {
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.notify-preview-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.notify-preview-btn {
    margin-top: 10px;
    padding: 7px 10px;
    font-size: 13px;
    text-align: center;
    color: var(--color-primary);
    background: #fff;
    border-radius: var(--radius-sm);
    word-break: break-all;
}

/* ---------- 发送进度 ---------- */

.notify-progress-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.notify-progress-title {
    font-size: 12px;
    color: var(--color-text-muted);
}

.notify-progress-bar {
    height: 10px;
    overflow: hidden;
    background: var(--color-bg);
    border-radius: 999px;
}

.notify-progress-fill {
    height: 100%;
    width: 0;
    background: var(--color-primary);
    border-radius: 999px;
    transition: width var(--transition);
}

/* 发送结束：进度条转为成功色 */
.notify-progress-fill.is-done {
    background: var(--color-success);
}

.notify-progress-percent {
    margin-top: 8px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* 指标网格：2 列 × 3 行 */
.notify-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}

.notify-metric {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
}

.notify-metric-icon {
    font-size: 16px;
    line-height: 1;
}

.notify-metric-meta {
    min-width: 0;
}

.notify-metric-label {
    font-size: 11px;
    color: var(--color-text-muted);
}

.notify-metric-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

/* ---------- 响应式 ---------- */

@media (max-width: 1080px) {
    .notify-layout {
        grid-template-columns: 1fr;
    }

    .notify-side {
        position: static;
    }
}

@media (max-width: 640px) {
    .notify-form .form-row,
    .notify-metrics {
        grid-template-columns: 1fr;
    }
}

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
    .operation-table {
        min-width: 900px;
    }

    .operation-table .col-actions {
        width: 130px;
    }

    .dropzone {
        min-height: 120px;
    }
}


