/* ========== 一键生成样式 ========== */

/* 文章标签页样式 */
.article-tabs-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0;
    overflow-x: auto;
    border: 1px solid #e8eaed;
}

.article-tabs {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    padding: 2px 0;
}

.article-tabs::-webkit-scrollbar {
    height: 4px;
}

.article-tabs::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 2px;
}

.article-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #5f6368;
    white-space: nowrap;
    transition: all 0.2s;
    min-width: 80px;
    max-width: 150px;
}

.article-tab:hover {
    border-color: var(--business-color, #5B7FFF);
    color: var(--business-color, #5B7FFF);
}

.article-tab.active {
    background: var(--business-color, #5B7FFF);
    border-color: var(--business-color, #5B7FFF);
    color: white;
}

.article-tab.generating {
    background: rgba(251, 188, 4, 0.3);
    border-color: #fbbc04;
    color: #7c5800;
}

.article-tab.generating.active {
    background: rgba(251, 188, 4, 0.5);
    border-color: #fbbc04;
    color: #7c5800;
}

.article-tab.completed {
    background: rgba(52, 168, 83, 0.2);
    border-color: #34a853;
    color: #1e7e34;
}

.article-tab.completed.active {
    background: rgba(52, 168, 83, 0.4);
    border-color: #34a853;
    color: #1e7e34;
}

.article-tab.failed {
    background: rgba(234, 67, 53, 0.2);
    border-color: #ea4335;
    color: #c5221f;
}

.article-tab.failed.active {
    background: rgba(234, 67, 53, 0.4);
    border-color: #ea4335;
    color: #c5221f;
}

.article-tab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-tab-close {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0.6;
    transition: all 0.2s;
}

.article-tab-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.article-tab.active .article-tab-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.add-article-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px dashed #dadce0;
    background: white;
    color: #5f6368;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.add-article-btn:hover {
    border-color: var(--business-color, #5B7FFF);
    color: var(--business-color, #5B7FFF);
    background: rgba(91, 127, 255, 0.1);
}

.tabs-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    border-left: 1px solid #dadce0;
    flex-shrink: 0;
}

/* 平台选择栏 */
.platform-select-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background-color: #fafbfc;
    border-radius: 8px;
    /* margin-bottom: 12px; */
    /* border: 1px solid #e8eaed; */
    flex-wrap: wrap;
}

.platform-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.platform-select-label {
    color: #5f6368;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.platform-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-btn {
    padding: 6px 14px;
    font-size: 13px;
    color: #5f6368;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.platform-btn:hover {
    border-color: var(--business-color, #5B7FFF);
    color: var(--business-color, #5B7FFF);
    background: rgba(91, 127, 255, 0.1);
}

.platform-btn.active {
    background: var(--business-color, #5B7FFF);
    border-color: var(--business-color, #5B7FFF);
    color: white;
}

.platform-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* 平台按钮内的数量标签 */
.platform-btn .platform-count {
    font-size: 12px;
    opacity: 0.8;
}

.platform-btn.active .platform-count {
    opacity: 1;
}

/* 头部区域（不再固定悬浮） */
.oneclick-sticky-header {
    background-color: #ffffff;
    margin-bottom: 20px;
}

/* 顶部控制栏 */
.oneclick-top-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #e8eaed;
}

.oneclick-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label {
    color: #5f6368;
    font-size: 13px;
}

.info-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--business-color, #5B7FFF);
}

.batch-input {
    width: 60px;
    padding: 6px 10px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.batch-input:focus {
    outline: none;
    border-color: var(--business-color, #5B7FFF);
}

.oneclick-spacer {
    flex: 1;
}

/* 进度条区域 */
.oneclick-progress {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.batch-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8eaed;
    font-size: 14px;
    color: #3c4043;
}

.batch-progress-header span:last-child {
    font-weight: 600;
    color: var(--business-color, #5B7FFF);
}

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

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #dadce0;
    z-index: 0;
}

.progress-step:last-child::after {
    display: none;
}

.step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #dadce0;
    color: #5f6368;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.progress-step.active .step-icon {
    background: var(--business-color, #5B7FFF);
    color: white;
}

.progress-step.completed .step-icon {
    background: #34a853;
    color: white;
}

.step-text {
    margin-top: 6px;
    font-size: 11px;
    color: #5f6368;
}

.progress-step.active .step-text {
    color: var(--business-color, #5B7FFF);
    font-weight: 500;
}

.progress-step.completed .step-text {
    color: #34a853;
}

.progress-message {
    text-align: center;
    color: #5f6368;
    font-size: 13px;
}

/* 结果区域 */
.oneclick-result {
    /* 无外边框，使用内部区块的背景色区分 */
}

.result-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
}

.result-title-text {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    flex: 1;
    margin-right: 16px;
}

.result-title-actions {
    display: flex;
    gap: 8px;
}

.result-content-area {
    padding: 0;
}

.result-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.result-copy-btns {
    display: flex;
    gap: 8px;
}

/* 保存文章区域 */
.save-article-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding-left: 16px;
    border-left: 1px solid #e8eaed;
}

.platform-select {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    background: white;
    color: #3c4043;
    cursor: pointer;
    outline: none;
    min-width: 100px;
}

.platform-select:hover {
    border-color: var(--business-color, #5B7FFF);
}

.platform-select:focus {
    border-color: var(--business-color, #5B7FFF);
    box-shadow: 0 0 0 2px rgba(91, 127, 255, 0.2);
}

.btn-save-article {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    background: #34a853;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-article:hover {
    background: #2d9249;
    box-shadow: 0 2px 6px rgba(52, 168, 83, 0.3);
}

.btn-save-article:disabled {
    background: #a8dab5;
    cursor: not-allowed;
    box-shadow: none;
}

/* 顶部控制栏按钮组 */
.oneclick-btn-group {
    display: flex;
    gap: 8px;
}

.oneclick-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

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

/* 主色按钮 - 批量生成 */
.oneclick-btn-primary {
    background: var(--business-color, #5B7FFF);
}

.oneclick-btn-primary:hover:not(:disabled) {
    background: var(--business-color, #5B7FFF);
    filter: brightness(0.9);
    box-shadow: 0 2px 6px rgba(91, 127, 255, 0.3);
}

/* 成功色按钮 - 生成所有 */
.oneclick-btn-success {
    background: #34a853;
}

.oneclick-btn-success:hover:not(:disabled) {
    background: #2d9249;
    box-shadow: 0 2px 6px rgba(52, 168, 83, 0.3);
}

/* 警告色按钮 - 生成所有平台 */
.oneclick-btn-warning {
    background: #f59e0b;
}

.oneclick-btn-warning:hover:not(:disabled) {
    background: #d97706;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

/* 保存全部按钮 - 可保存状态（绿色） */
.oneclick-btn-blue.can-save {
    background: #34a853;
}

.oneclick-btn-blue.can-save:hover:not(:disabled) {
    background: #2d9249;
    box-shadow: 0 2px 6px rgba(52, 168, 83, 0.3);
}

/* 保存全部按钮 - 不可保存状态（灰色） */
.oneclick-btn-blue {
    background: #9aa0a6;
}

.oneclick-btn-blue:hover:not(:disabled) {
    background: #80868b;
    box-shadow: 0 2px 6px rgba(154, 160, 166, 0.3);
}

/* 一键生成页面的预览区样式覆盖 */
.oneclick-result .richtext-preview,
.oneclick-result .article-output {
    border: 1px solid #e8eaed;
    border-radius: 8px;
}

.oneclick-result .richtext-preview:empty::before {
    content: '排版后的文章预览将显示在这里...';
    color: #9aa0a6;
}

.oneclick-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9aa0a6;
}

.oneclick-empty p {
    font-size: 14px;
}

/* 显示原始数据按钮 */
.show-raw-data-toggle {
    margin-bottom: 12px;
}

.btn-show-raw {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 12px;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-show-raw:hover {
    background: #e8eaed;
    color: #3c4043;
}

.btn-show-raw.active {
    background: rgba(91, 127, 255, 0.1);
    border-color: var(--business-color, #5B7FFF);
    color: var(--business-color, #5B7FFF);
}

.show-raw-icon {
    font-size: 10px;
    transition: transform 0.2s;
}

.btn-show-raw.active .show-raw-icon {
    transform: rotate(90deg);
}

/* 折叠区域样式 */
.collapsible-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.collapsible-section {
    border: 1px solid #e8eaed;
    border-radius: 8px;
    overflow: hidden;
}

.collapsible-section.flex-1 {
    flex: 1;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fa;
    font-size: 13px;
    font-weight: 500;
    color: #3c4043;
}

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

.collapsible-title:hover {
    color: var(--business-color, #5B7FFF);
}

.collapse-icon {
    font-size: 10px;
    color: #5f6368;
    transition: transform 0.2s;
}

.collapse-icon.expanded {
    transform: rotate(180deg);
}

.copy-sm-btn {
    padding: 4px 10px;
    font-size: 12px;
    background: var(--business-color, #5B7FFF);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.copy-sm-btn:hover {
    background: var(--business-color, #5B7FFF);
    filter: brightness(0.9);
}

.collapsible-content {
    border-top: 1px solid #e8eaed;
}

.collapsible-body {
    background: white;
}

.prompt-text, .raw-article-text {
    background: white;
    padding: 12px;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    color: #3c4043;
}

/* ========== 关键词页面固定头部 ========== */
.keywords-sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
}

/* 工具栏固定样式 */
.keywords-sticky-header .toolbar {
    background: #fafbfc;
    border-bottom: 1px solid #e8eaed;
}

/* 平台选择栏固定样式 */
.keywords-sticky-header .platform-select-bar {
    background: #fafbfc;
    border-bottom: 1px solid #e8eaed;
    margin-bottom: 0;
    border-radius: 0;
}

/* 统计栏固定样式 */
.keywords-sticky-header .stats {
    background: #f8f9fa;
    border-bottom: 1px solid #e8eaed;
}

/* 固定头部底部阴影（滚动时显示） */
.keywords-sticky-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 4px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.keywords-sticky-header.scrolled::after {
    opacity: 1;
}

/* ========== 加载遮罩层样式 ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}

.loading-overlay.show {
    display: flex;
}

.loading-overlay .loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e8eaed;
    border-top-color: var(--business-color, #5B7FFF);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-overlay .loading-text {
    font-size: 15px;
    color: #3c4043;
    font-weight: 500;
}

.loading-overlay .loading-progress {
    font-size: 14px;
    color: #5f6368;
    margin-top: -8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
