/* ============================================================
   wx-article-creator v3.0 新增样式
   左右分栏布局 + 流式输出 + 配图预览
   ============================================================ */

/* 左右分栏容器 4:6 */
.wac-split {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-top: 20px;
}

/* 左侧：参数输入区 40% */
.wac-split-left {
    flex: 0 0 40%;
    max-width: 40%;
    min-width: 360px;
}

/* 右侧：输出容器 60% */
.wac-split-right {
    flex: 0 0 60%;
    max-width: 60%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 流式输出卡片 */
.wac-output-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    padding: 20px 24px 24px;
    min-height: 420px;
    display: flex;
    flex-direction: column;
}

.wac-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8ecf1;
}

.wac-output-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a73e8;
}

.wac-output-status {
    font-size: 12px;
    color: #888;
    background: #f0f4ff;
    padding: 3px 10px;
    border-radius: 20px;
}

/* 进度条（输出卡片内复用） */
.wac-output-card .wac-progress-bar {
    height: 6px;
    background: #e8ecf1;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.wac-output-card .wac-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a73e8, #f0a500);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

/* 流式文本输出区 */
.wac-stream-output {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
    padding: 12px 16px;
    background: #f7f8fc;
    border-radius: 10px;
    border: 1px solid #e2e6f0;
    font-size: 14px;
    line-height: 1.9;
    color: #2c3e50;
}

.wac-output-placeholder {
    color: #aab;
    text-align: center;
    padding: 60px 20px;
    font-size: 14px;
}

.wac-output-line {
    margin-bottom: 6px;
    word-break: break-word;
}

.wac-output-system {
    color: #1a73e8;
    font-size: 13px;
    font-weight: 500;
}

.wac-output-error {
    color: #e74c3c;
    font-size: 13px;
    font-weight: 500;
    background: #fef0f0;
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 3px solid #e74c3c;
}

.wac-output-paragraph-header {
    color: #f0a500;
    font-weight: 700;
    font-size: 13px;
    margin: 14px 0 4px;
    padding: 4px 0;
    border-bottom: 1px dashed #e8ecf1;
}

.wac-paragraph {
    margin: 6px 0 14px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e8ecf1;
    text-indent: 2em;
    animation: wac-fadein 0.3s ease;
}

@keyframes wac-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 配图预览卡片区 */
.wac-image-preview-card {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.wac-image-card {
    flex: 1;
    max-width: 48%;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 200px;
}

.wac-image-card-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    align-self: flex-start;
}

.wac-image-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #aab;
    font-size: 13px;
    gap: 8px;
    min-height: 160px;
    width: 100%;
    background: #f7f8fc;
    border-radius: 10px;
}

.wac-image-icon {
    font-size: 32px;
    opacity: 0.5;
}

.wac-image-img {
    max-width: 100%;
    max-height: 260px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: wac-fadein 0.5s ease;
}

/* 输出卡片内的推送按钮 */
.wac-output-card .wac-publish {
    margin-top: 16px;
    align-self: flex-end;
}

/* 超时弹窗 */
.wac-timeout-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.wac-timeout-content {
    background: #fff;
    border-radius: 16px;
    padding: 32px 40px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    max-width: 400px;
    animation: wac-fadein 0.3s ease;
}

.wac-timeout-content h3 {
    font-size: 18px;
    color: #e74c3c;
    margin-bottom: 12px;
}

.wac-timeout-content p {
    font-size: 14px;
    color: #555;
    margin-bottom: 24px;
}

.wac-timeout-retry {
    background: linear-gradient(135deg, #1a73e8, #4a90d9);
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 12px;
}

.wac-timeout-cancel {
    background: #f0f0f0;
    color: #666;
    border: none;
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.wac-timeout-retry:hover { opacity: 0.9; }
.wac-timeout-cancel:hover { background: #e0e0e0; }

/* 响应式：窄屏时上下堆叠 */
@media (max-width: 900px) {
    .wac-split {
        flex-direction: column;
    }
    .wac-split-left,
    .wac-split-right {
        flex: none;
        max-width: 100%;
        width: 100%;
    }
    .wac-image-preview-card {
        flex-direction: column;
    }
    .wac-image-card {
        max-width: 100%;
    }
}

/* ========== 推送状态增强样式（v3.1）========== */

/* 系统成功消息（绿色高亮） */
.wac-output-system-success {
    color: #16a34a;
    font-weight: 500;
}

/* 推送按钮-就绪态（双图已加载，脉冲提示） */
.wac-publish-ready {
    animation: wac-pulse-ready 1.8s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
}
@keyframes wac-pulse-ready {
    0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* 推送按钮-重试态（红色边框提醒） */
.wac-publish-retry {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    background: #fef2f2 !important;
}

/* 草稿预览链接 */
.wac-preview-link {
    margin-top: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}
.wac-preview-link a {
    color: #16a34a;
    font-weight: 600;
    text-decoration: none;
}
.wac-preview-link a:hover {
    text-decoration: underline;
}

/* ========== v4.0 全量故障修复样式 ==========
   三阶段进度指示器 + 配图重试按钮 + 文章内容渲染区 + 系统警告样式
   ============================================================ */

/* ---- 三阶段进度指示器（文字生成 / 封面配图 / 文中配图）---- */
.wac-stage-progress {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    padding: 10px 16px;
    background: #f8f9fb;
    border-radius: 10px;
    border: 1px solid #e8ecf1;
}

.wac-stage {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.wac-stage:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 50%;
    width: 20px;
    height: 2px;
    background: #d0d5dd;
    transform: translateY(-50%);
    z-index: 0;
}

/* 阶段圆点 */
.wac-stage-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d0d5dd;
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 1;
    position: relative;
}

/* pending: 灰色（默认） */
.wac-stage-dot.pending { background: #d0d5dd; }

/* running: 蓝色脉冲动画 */
.wac-stage-dot.running {
    background: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.2);
    animation: wac-stage-running 1.2s ease-in-out infinite;
}
@keyframes wac-stage-running {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.25); opacity: 0.7; }
}

/* done: 绿色勾 */
.wac-stage-dot.done {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
}
.wac-stage-dot.done::after {
    content: '\2713';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 7px;
    font-weight: bold;
    line-height: 1;
}

/* failed: 红色叉 */
.wac-stage-dot.failed {
    background: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231,76,60,0.15);
}
.wac-stage-dot.failed::after {
    content: '\2717';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 7px;
    font-weight: bold;
    line-height: 1;
}

/* 阶段标签文字 */
.wac-stage-label {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    transition: color 0.3s ease;
}
.wac-stage.running .wac-stage-label { color: #1a73e8; font-weight: 600; }
.wac-stage.done .wac-stage-label    { color: #16a34a; }
.wac-stage.failed .wac-stage-label  { color: #e74c3c; }

/* ---- 配图重试按钮 ---- */
.wac-img-retry {
    margin-top: 8px;
    padding: 6px 18px;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.wac-img-retry:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245,158,11,0.35);
}
.wac-img-retry:active {
    transform: translateY(0);
}

/* ---- 文章内容渲染容器（v4：从content_html直接渲染的正文区域）---- */
.wac-article-content {
    margin-top: 16px;
    padding: 20px 24px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e8ecf1;
    line-height: 1.85;
    color: #2c3e50;
    font-size: 15px;
    animation: wac-fadein 0.5s ease;
}

.wac-article-content h1,
.wac-article-content h2,
.wac-article-content h3 {
    color: #1a293d;
    margin: 16px 0 10px;
}

.wac-article-content p {
    margin: 10px 0;
    text-indent: 2em;
}

.wac-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px auto;
    display: block;
}

/* ---- 系统警告消息样式（v4）---- */
.wac-output-system-warn {
    color: #d97706;
    font-weight: 500;
    font-size: 13px;
    background: #fffbeb;
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
}

/* ---- 推送按钮-完成态增强（v4）---- */
.wac-publish-done {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    color: #fff !important;
}
