/**
 * Dashboard Demo Styles - Real Workflow Version
 * 
 * 基于真实业务流程的4步展示样式
 * 宽度自适应，交互优化
 * 
 * @package Yali_Theme
 */

/* ==========================================================================
   Container
   ========================================================================== */

.workflow-showcase {
    width: 100%;
    max-width: 100%;
    background: linear-gradient(180deg, #1a1d29 0%, #13151f 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 20px 40px -10px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
}

/* ==========================================================================
   Step Screens
   ========================================================================== */

.step-screen {
    display: none;
    flex-direction: column;
    height: 360px;
    animation: fadeInScreen 0.3s ease;
}

.step-screen.active {
    display: flex;
}

@keyframes fadeInScreen {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Screen Header */
.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.screen-title {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.screen-title i {
    color: #6366f1;
    font-size: 12px;
}

.header-action {
    font-size: 11px;
    color: #fff;
    background: #6366f1;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.badge {
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.badge.active {
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.status-badge.processing {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.15);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: #6366f1;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Screen Body */
.screen-body {
    flex: 1;
    padding: 10px 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Step Label */
.step-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.step-num {
    font-size: 10px;
    font-weight: 700;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.15);
    padding: 4px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.step-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.step-name {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.step-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   Step 1: Rule Management
   ========================================================================== */

.form-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
}

.form-field {
    margin-bottom: 8px;
}

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

.form-field label {
    display: block;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.input-display {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 11px;
    color: #fff;
}

.rule-type-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.type-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    cursor: pointer;
}

.type-tag.active {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.type-tag i {
    font-size: 9px;
}

.category-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 8px;
}

.cat-selected {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #a5b4fc;
    padding: 3px 8px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 4px;
}

.cat-selected i {
    font-size: 10px;
    color: #6366f1;
}

.cat-more {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

.auto-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    margin-left: auto;
}

.auto-hint i {
    color: #f59e0b;
    font-size: 9px;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 6px;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.toggle {
    width: 28px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    position: relative;
    transition: background 0.3s;
}

.toggle::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle.active {
    background: #10b981;
}

.toggle.active::after {
    transform: translateX(12px);
}

.label-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.btn-save {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: #6366f1;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
}

/* ==========================================================================
   Step 2: Topic Management
   ========================================================================== */

.topics-list {
    flex: 1;
    margin-bottom: 10px;
}

.topic-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    margin-bottom: 6px;
}

.topic-item:last-child {
    margin-bottom: 0;
}

.topic-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.topic-status.available {
    background: #10b981;
}

.topic-status.used {
    background: rgba(255, 255, 255, 0.2);
}

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

.topic-title {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-meta {
    display: flex;
    gap: 8px;
}

.meta-tag {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 3px;
}

.meta-tag i {
    font-size: 8px;
}

.meta-tag.used {
    color: #10b981;
}

.btn-gen {
    padding: 4px 8px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 4px;
    color: #a5b4fc;
    font-size: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.published-hint {
    font-size: 10px;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.topics-stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
}

.topics-stats-bar .stat {
    text-align: center;
}

.topics-stats-bar .num {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.topics-stats-bar .label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
}

.topics-stats-bar .stat.action {
    flex-shrink: 0;
}

.btn-batch {
    padding: 5px 10px;
    background: #6366f1;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   Step 3: Article Task
   ========================================================================== */

.article-task-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

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

.workflow-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    margin-bottom: 10px;
}

.flow-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    flex-shrink: 0;
}

.flow-item i {
    font-size: 11px;
    color: inherit;
}

.flow-item.completed {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.flow-item.active {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.15);
}

.flow-item.active i {
    animation: iconPulse 2s infinite;
}

.flow-item.pending {
    color: rgba(255, 255, 255, 0.3);
}

.flow-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    font-weight: 300;
    flex-shrink: 0;
    margin: 0;
    line-height: 1;
}

.task-name {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.task-id {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.task-progress-section {
    flex: 1;
    margin-bottom: 10px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.progress-title {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.progress-value {
    font-size: 10px;
    font-weight: 600;
    color: #6366f1;
}

.progress-bar-wrap {
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 3px;
}

.progress-stats {
    display: flex;
    gap: 10px;
}

.progress-stats .stat {
    font-size: 9px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.progress-stats .stat.success {
    color: #10b981;
}

.progress-stats .stat.processing {
    color: #6366f1;
}

.progress-stats .stat.pending {
    color: rgba(255, 255, 255, 0.4);
}

.current-writing {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 6px;
    padding: 8px;
}

.writing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.typing-animation {
    display: flex;
    gap: 2px;
}

.typing-animation span {
    width: 4px;
    height: 4px;
    background: #6366f1;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-animation span:nth-child(1) { animation-delay: -0.32s; }
.typing-animation span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.writing-text {
    font-size: 10px;
    color: #a5b4fc;
}

.writing-meta {
    display: flex;
    gap: 12px;
}

.writing-meta span {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ==========================================================================
   Step 4: Success
   ========================================================================== */

.success-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.success-icon-wrap {
    margin-bottom: 10px;
}

.success-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981, #34d399);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
}

.success-icon i {
    font-size: 18px;
    color: #fff;
}

.success-icon-wrap h3 {
    font-size: 12px;
    font-weight: 600;
    color: #10b981;
}

.article-result {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    width: 100%;
    text-align: left;
}

.result-thumb {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    position: relative;
    flex-shrink: 0;
}

.result-thumb i {
    font-size: 16px;
    margin-bottom: 2px;
}

.ai-badge {
    font-size: 8px;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-info h4 {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.3;
}

.result-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
}

.result-meta span {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 3px;
}

.result-data {
    display: flex;
    gap: 10px;
}

.result-data span {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 3px;
}

.wp-notify {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    font-size: 11px;
    color: #a5b4fc;
}

.wp-notify i {
    font-size: 20px;
}

.publish-stats {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.publish-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.publish-stats i {
    font-size: 10px;
    color: #6366f1;
}

.wp-notify a {
    margin-left: auto;
    color: #6366f1;
    text-decoration: none;
    font-size: 10px;
}

/* ==========================================================================
   Navigation Controls
   ========================================================================== */

.nav-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.nav-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.step-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: #6366f1;
    width: 20px;
    border-radius: 4px;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.4);
}

.dot.active:hover {
    background: #6366f1;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .workflow-showcase {
        min-width: auto;
    }
    
    .step-screen {
        height: 340px;
    }
    
    .screen-body {
        padding: 10px 12px;
    }
    
    .step-label {
        padding: 8px 12px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 5px;
    }
    
    .radio-option {
        padding: 4px 8px;
    }
    
    .topic-item {
        padding: 6px;
    }
    
    .btn-gen {
        padding: 3px 6px;
        font-size: 9px;
    }
    
    .topics-stats-bar .stat .num {
        font-size: 12px;
    }
    
    .article-result {
        padding: 8px;
    }
    
    .result-thumb {
        width: 40px;
        height: 40px;
    }
    
    .workflow-bar {
        gap: 2px;
        padding: 6px 8px;
    }
    
    .flow-item {
        padding: 3px 6px;
        font-size: 9px;
    }
    
    .flow-item i {
        font-size: 10px;
    }
    
    .flow-arrow {
        font-size: 11px;
    }
}
