/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 主要配色 - 这些已在themes.css中定义，此处作为备用 */
:root {
    --primary-color: #4a6baf;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --light-gray: #f1f3f5;
    --dark-gray: #343a40;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* 布局组件 */
.top-bar {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    padding: 0.8rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px var(--shadow-color);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
}

.logo h1 {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 600;
}

.global-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-area {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background-color: var(--card-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--background-color);
}

.bottom-bar {
    background-color: var(--surface-color);
    color: var(--text-secondary);
    text-align: center;
    padding: 0.6rem;
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: var(--text-primary);
}

input, select, textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: var(--background-color);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(51, 102, 204, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.input-group {
    margin-top: 0.75rem;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

/* 按钮样式 */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn.primary {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}

.btn.primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px var(--shadow-color);
}

.btn.primary:active {
    background-color: var(--primary-active);
    transform: translateY(0);
    box-shadow: none;
}

.btn.primary:disabled {
    background-color: var(--primary-disabled);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn.secondary {
    background-color: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn.secondary:hover {
    background-color: var(--divider-color);
    border-color: var(--text-secondary);
}

.btn.secondary:active {
    background-color: var(--border-color);
}

.btn.secondary:disabled {
    background-color: var(--surface-color);
    color: var(--text-disabled);
    cursor: not-allowed;
}

.btn.tool {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0.45rem 0.8rem;
    border-radius: 4px;
}

.btn.tool:hover {
    background-color: var(--surface-color);
    color: var(--text-primary);
}

.full-width {
    width: 100%;
}

.mode-selector {
    margin-left: 0.75rem;
    padding: 0.4rem 0.6rem;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 500;
    color: var(--text-primary);
}

/* 配置面板 */
.config-panel {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-color);
}

.config-panel h2, .saved-articles h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.tool-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 1.25rem;
    gap: 0.6rem;
}

/* 百度知道问答选项 */
.qa-options {
    background-color: var(--surface-color);
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.advanced-options {
    margin-top: 1rem;
}

/* 已保存文章列表 */
.saved-articles {
    padding: 1.25rem;
    flex: 1;
    overflow-y: auto;
    background-color: var(--card-color);
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.article-item {
    padding: 0.85rem;
    background-color: var(--surface-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border-left: 3px solid transparent;
}

.article-item:hover {
    background-color: var(--divider-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px var(--shadow-color);
}

.article-item.active {
    background-color: var(--surface-color);
    border-left: 3px solid var(--primary-color);
}

/* 问答文章特殊标记 */
.article-item[data-type="qa"] {
    border-left-color: var(--info-color);
}

.article-item[data-type="qa"] .article-title::before {
    content: "问答: ";
    color: var(--info-color);
    font-weight: 400;
}

.article-title {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.article-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.article-keywords {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-top: 0.3rem;
    font-style: italic;
}

/* 删除按钮 */
.delete-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.8rem;
    line-height: 1;
    opacity: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.article-item:hover .delete-btn {
    opacity: 0.8;
}

.delete-btn:hover {
    opacity: 1;
}

.empty-message {
    padding: 1.5rem;
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
    background-color: var(--surface-color);
    border-radius: 8px;
    margin: 0.5rem 0;
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-color);
    overflow-x: auto;
}

.tab-btn {
    padding: 0.85rem 1.2rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    background-color: var(--card-color);
}

.tab-pane {
    display: none;
    height: 100%;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
}

/* 编辑器 */
.editor-toolbar {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background-color: var(--surface-color);
}

.editor-toolbar button {
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    color: var(--text-primary);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.editor-toolbar button:hover {
    background-color: var(--surface-color);
    border-color: var(--text-secondary);
}

.editor-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    outline: none;
    min-height: 350px;
    background-color: var(--background-color);
    color: var(--text-primary);
}

/* 问答页面专用样式 */
.editor-content h2 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.editor-content h2:first-child {
    margin-top: 0;
}

.editor-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* SEO分析 */
.analysis-container {
    padding: 1.5rem;
}

.seo-item {
    margin-bottom: 1.25rem;
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: transform 0.2s;
}

.seo-item:hover {
    transform: translateY(-2px);
}

.seo-item h3 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.seo-item.error {
    background-color: rgba(231, 76, 60, 0.1);
    border-left-color: var(--error-color);
}

.seo-item.warning {
    background-color: rgba(243, 156, 18, 0.1);
    border-left-color: var(--warning-color);
}

.seo-item.info {
    background-color: rgba(52, 152, 219, 0.1);
    border-left-color: var(--info-color);
}

.seo-item.success {
    background-color: rgba(39, 174, 96, 0.1);
    border-left-color: var(--success-color);
}

/* 长尾关键词 */
.longtail-container {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.longtail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.longtail-controls {
    display: flex;
    gap: 0.75rem;
}

.longtail-results {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.longtail-keyword {
    padding: 1.25rem;
    background-color: var(--surface-color);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
    transition: all 0.25s;
    box-shadow: 0 1px 3px var(--shadow-color);
}

.longtail-keyword:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.longtail-keyword.selected {
    background-color: rgba(51, 102, 204, 0.1);
    border-left-color: var(--success-color);
}

.longtail-keyword-text {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.longtail-keyword-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-label {
    font-weight: 500;
}

.generate-btn {
    margin-top: 0.75rem;
    width: 100%;
    padding: 0.4rem;
    font-size: 0.85rem;
}

/* 相关词面板 */
.related-words-container {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.view-toggle {
    display: flex;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.view-btn {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background-color: var(--surface-color);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.view-btn:hover {
    color: var(--primary-color);
}

.view-btn.active {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}

.related-words-view {
    display: none;
    flex: 1;
}

.related-words-view.active {
    display: block;
}

.keyword-graph {
    width: 100%;
    height: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--surface-color);
    min-height: 450px;
}

.related-words-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.related-words-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 550px;
    overflow-y: auto;
}

.related-word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--surface-color);
    border-radius: 8px;
    border-left: 3px solid;
    transition: all 0.25s;
    box-shadow: 0 1px 2px var(--shadow-color);
}

.related-word-item:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 4px var(--shadow-color);
}

.related-word-item.synonym {
    border-left-color: var(--info-color);
}

.related-word-item.broader {
    border-left-color: var(--primary-color);
}

.related-word-item.narrower {
    border-left-color: var(--success-color);
}

.related-word-item.related {
    border-left-color: var(--warning-color);
}

.related-word-info {
    flex: 1;
}

.related-word-text {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.related-word-category {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.related-word-relevance {
    font-size: 0.8rem;
    font-weight: 500;
    background-color: var(--surface-color);
    padding: 0.3rem 0.6rem;
    border-radius: 30px;
    margin-left: 0.5rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.related-word-actions {
    display: flex;
    gap: 0.5rem;
}

.copy-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.copy-btn:hover {
    background-color: var(--surface-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 批量生成 */
.batch-container {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.batch-controls {
    display: flex;
    gap: 0.75rem;
}

.batch-settings {
    margin-bottom: 1.75rem;
    background-color: var(--surface-color);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.batch-progress {
    margin-bottom: 1.75rem;
}

.progress-bar-container {
    height: 1.5rem;
    background-color: var(--surface-color);
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    margin-top: 0.75rem;
    border: 1px solid var(--border-color);
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s;
    border-radius: 30px;
}

.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-on-primary);
    font-weight: 500;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.batch-results {
    flex: 1;
    overflow-y: auto;
}

.batch-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: var(--surface-color);
    border-radius: 8px;
    border-left: 3px solid var(--border-color);
    transition: transform 0.2s;
    box-shadow: 0 1px 2px var(--shadow-color);
}

.batch-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px var(--shadow-color);
}

.batch-item.pending {
    border-left-color: var(--text-secondary);
}

.batch-item.processing {
    border-left-color: var(--warning-color);
}

.batch-item.success {
    border-left-color: var(--success-color);
}

.batch-item.error {
    border-left-color: var(--error-color);
}

.batch-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.batch-item-keyword {
    font-weight: 600;
    color: var(--text-primary);
}

.batch-item-status {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    background-color: var(--surface-color);
    color: var(--text-secondary);
    font-weight: 500;
}

.batch-item-status.pending {
    background-color: var(--surface-color);
    color: var(--text-secondary);
}

.batch-item-status.processing {
    background-color: rgba(243, 156, 18, 0.15);
    color: var(--warning-color);
}

.batch-item-status.success {
    background-color: rgba(39, 174, 96, 0.15);
    color: var(--success-color);
}

.batch-item-status.error {
    background-color: rgba(231, 76, 60, 0.15);
    color: var(--error-color);
}

.batch-item-error {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background-color: rgba(231, 76, 60, 0.1);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--error-color);
}

.batch-item-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

/* 底部操作栏 */
.action-bar {
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    background-color: var(--card-color);
    box-shadow: 0 -1px 3px var(--shadow-color);
}

.status-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.3s;
}

.status-message:not(:empty) {
    opacity: 1;
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 2rem;
    color: var(--text-secondary);
    text-align: center;
}

.loading::before {
    content: "";
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* 通用工具类 */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; } 