/* ==================== 发布页面样式 ==================== */

:root {
    --color-primary: #FF2442;
    --color-primary-hover: #E01F3A;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-text: #1F2937;
    --color-text-secondary: #6B7280;
    --color-border: #E5E7EB;
    --color-bg: #F9FAFB;
    --color-bg-secondary: #FFFFFF;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ==================== 导航栏 ==================== */
.publish-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-text);
    transition: opacity 0.2s;
}

.nav-logo:hover {
    opacity: 0.8;
}

.logo-icon {
    font-size: 1.5rem;
}

.brand-logo-mark.logo-icon {
    width: 34px;
    height: 34px;
    display: block;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 600;
}

.nav-actions {
    display: flex;
    gap: 0.75rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* ==================== 主内容区 ==================== */
.publish-main {
    display: flex;
    gap: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: calc(100vh - 70px);
    align-items: flex-start;
}

/* ==================== 左侧工具栏 ==================== */
.toolbar-sidebar {
    width: 360px;
    flex-shrink: 0;
    position: sticky;
    top: 85px;
    height: fit-content;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.toolbar-content {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.toolbar-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.toolbar-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.toolbar-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.toolbar-title span:first-child {
    font-size: 1.125rem;
}

/* 笔记类型列表 */
.type-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.type-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.type-option:hover {
    border-color: var(--color-primary);
    background: rgba(255, 36, 66, 0.02);
}

.type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.type-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border);
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.type-option input:checked + .type-radio {
    border-color: var(--color-primary);
}

.type-option input:checked + .type-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 50%;
}

.type-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
}

.type-option .type-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.type-option .type-desc {
    font-size: 0.6875rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toolbar-actions {
    padding-top: 0.5rem;
}

/* ==================== 右侧内容区 ==================== */
.content-area {
    flex: 1;
    min-width: 0;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    min-height: 400px;
}

.empty-icon {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    line-height: 1;
}

.empty-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.empty-desc {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 1.25rem;
    max-width: 380px;
}

.empty-ai-tip {
    margin: 0 0 1.4rem;
    padding: 0.7rem 1rem;
    max-width: 560px;
    color: #4B5563;
    font-size: 0.875rem;
    line-height: 1.65;
    background: linear-gradient(135deg, rgba(255, 36, 66, 0.05), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 999px;
}

.empty-features {
    display: flex;
    gap: 0;
    flex-wrap: nowrap;
    justify-content: center;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    padding: 0.875rem 1.25rem;
    border-right: 1px solid var(--color-border);
}

.feature-item:last-child {
    border-right: none;
}

.feature-icon {
    font-size: 1.125rem;
}

/* ==================== 结果区 ==================== */
.results-section {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.results-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}


/* ==================== API状态 ==================== */
.api-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: var(--color-success);
}

.status-indicator.offline {
    background: var(--color-error);
    animation: none;
}

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

.status-text {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--color-text);
}

.status-action {
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.status-action:hover {
    background: var(--color-primary-hover);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group.half {
    margin-bottom: 0;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

.label-icon {
    font-size: 1rem;
}

.required {
    color: var(--color-error);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--color-text);
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-secondary);
}

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

.form-textarea.code {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.875rem;
}

.form-hint {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

/* ==================== 风格标签 ==================== */
.style-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.style-tag {
    position: relative;
    cursor: pointer;
}

.style-tag input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tag-label {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--color-text);
    transition: all 0.2s;
    user-select: none;
}

.style-tag:hover .tag-label {
    border-color: var(--color-primary);
}

.style-tag input:checked + .tag-label {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* ==================== 范围输入 ==================== */
.range-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-range {
    flex: 1;
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--color-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.form-range::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.range-value {
    min-width: 3rem;
    text-align: right;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
}

/* ==================== 按钮 ==================== */
.form-actions {
    margin-top: 2rem;
}

.btn-generate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 1rem 2rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-generate:hover:not(:disabled) {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-generate:disabled {
    background: var(--color-border);
    cursor: not-allowed;
}

.btn-primary,
.btn-secondary,
.btn-small {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

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

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

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    background: var(--color-primary);
    color: white;
    border: none;
}

.btn-small:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

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

/* ==================== 结果区 ==================== */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}


.results-meta {
    display: flex;
    gap: 1.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.25rem;
}

.result-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.08);
    transform: translateY(-1px);
}

.result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.result-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.result-style {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.result-style-tag {
    padding: 0.25rem 0.625rem;
    background: rgba(255, 36, 66, 0.1);
    color: var(--color-primary);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
}

.result-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.result-content {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    flex: 1;
}

.result-topics {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.result-topic {
    padding: 0.25rem 0.625rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border-radius: 100px;
    font-size: 0.75rem;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.btn-copy,
.btn-edit,
.btn-sync {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover,
.btn-edit:hover,
.btn-sync:hover {
    background: var(--color-bg);
    border-color: var(--color-text-secondary);
}

.btn-sync {
    color: #0066FF;
    border-color: rgba(0, 102, 255, 0.3);
}

.btn-sync:hover {
    background: rgba(0, 102, 255, 0.05);
    border-color: #0066FF;
}

.batch-sync-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.btn-batch-sync {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #0066FF;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-batch-sync:hover:not(:disabled) {
    background: #0052CC;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-batch-sync:disabled {
    background: var(--color-border);
    cursor: not-allowed;
}

/* ==================== 弹窗 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--color-border);
}

/* ==================== 配置区 ==================== */
.config-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.config-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.config-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.config-icon {
    font-size: 1.25rem;
}

.config-desc {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

.config-desc a {
    color: var(--color-primary);
    text-decoration: none;
}

.inline-code {
    display: inline;
    padding: 0.125rem 0.375rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.8125rem;
    color: var(--color-text);
}

.config-desc a:hover {
    text-decoration: underline;
}

.deepseek-guide {
    padding: 1.25rem;
    border: 1px solid rgba(255, 36, 66, 0.16);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(255, 36, 66, 0.08), rgba(37, 99, 235, 0.06));
}

.deepseek-guide .config-desc {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.deepseek-guide-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.deepseek-guide-steps div {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.875rem;
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 22px rgba(31, 41, 55, 0.05);
}

.deepseek-guide-steps strong {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.875rem;
    line-height: 1;
}

.deepseek-guide-steps span {
    color: var(--color-text);
    font-weight: 600;
    line-height: 1.45;
}

.deepseek-guide-steps small,
.deepseek-guide-steps a {
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.deepseek-guide-steps a {
    width: fit-content;
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.deepseek-guide-steps a:hover {
    text-decoration: underline;
}

.generation-rules {
    padding: 1.25rem;
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.07), rgba(255, 255, 255, 0.82));
}

.generation-rules .config-desc {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.generation-rule-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.generation-rule-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(229, 231, 235, 0.85);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 22px rgba(31, 41, 55, 0.04);
}

.generation-rule-card strong {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--color-text);
    font-size: 0.95rem;
}

.generation-rule-card p {
    margin: 0 0 0.75rem;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    line-height: 1.65;
}

.generation-rule-card ul {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding-left: 1.1rem;
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
    line-height: 1.55;
}

/* ==================== Toast提示 ==================== */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    max-width: 400px;
    padding: 1rem 1.5rem;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 2000;
    transform: translateX(calc(100% + 2rem));
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--color-success);
}

.toast.error {
    border-left: 4px solid var(--color-error);
}

.toast.info {
    border-left: 4px solid var(--color-primary);
}

.toast-message {
    font-size: 0.9375rem;
    color: var(--color-text);
}

/* ==================== 加载动画 ==================== */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .toolbar-sidebar {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .publish-main {
        flex-direction: column;
        padding: 1rem;
    }

    .toolbar-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .toolbar-content {
        padding: 1.25rem;
    }

    .content-area {
        width: 100%;
    }

    .results-section {
        padding: 1.25rem;
    }

    .empty-state {
        padding: 3rem 1.5rem;
    }

    .empty-icon {
        font-size: 3rem;
    }

    .empty-title {
        font-size: 1.25rem;
    }

    .empty-ai-tip {
        border-radius: var(--radius-lg);
        font-size: 0.8125rem;
    }

    .empty-features {
        flex-direction: column;
        gap: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem 1.25rem;
    }

    .deepseek-guide {
        padding: 1rem;
    }

    .deepseek-guide-steps {
        grid-template-columns: 1fr;
    }

    .generation-rules {
        padding: 1rem;
    }

    .generation-rule-grid {
        grid-template-columns: 1fr;
    }

    .toast {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .results-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn-copy,
    .btn-edit,
    .btn-sync {
        width: 100%;
        justify-content: center;
    }

    .results-container {
        grid-template-columns: 1fr;
    }

    .empty-features {
        flex-wrap: wrap;
    }

    .feature-item {
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.75rem 1rem;
    }

    .logo-text {
        display: none;
    }

    .toolbar-content {
        padding: 1rem;
    }

    .toolbar-section {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .type-list {
        grid-template-columns: 1fr;
    }

    .type-option {
        padding: 0.625rem;
    }

    .style-tags {
        gap: 0.5rem;
    }

    .empty-features {
        flex-wrap: wrap;
        font-size: 0.8125rem;
    }

    .feature-item {
        padding: 0.75rem 1rem;
    }

    .results-container {
        grid-template-columns: 1fr;
    }
}

/* ==================== 文件上传区域 ==================== */
.file-upload-zone {
    border: 1.5px dashed var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    margin-bottom: 0.75rem;
}

.file-upload-zone.drag-over {
    border-color: var(--color-primary);
    background: rgba(255, 36, 66, 0.03);
}

.upload-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: color 0.2s;
}

.upload-trigger:hover {
    color: var(--color-primary);
}

.upload-trigger svg {
    opacity: 0.6;
}

.upload-trigger:hover svg {
    opacity: 1;
}

.upload-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.upload-formats {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    opacity: 0.7;
}

/* 列选择器 */
.column-picker {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: var(--radius-md);
    padding: 0.875rem;
    margin-bottom: 0.75rem;
}

.picker-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #BBF7D0;
}

.picker-filename {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #166534;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.picker-stats {
    font-size: 0.75rem;
    color: #16A34A;
    background: #DCFCE7;
    padding: 0.125rem 0.5rem;
    border-radius: 100px;
    white-space: nowrap;
}

.picker-reset {
    width: 22px;
    height: 22px;
    background: transparent;
    border: 1px solid #BBF7D0;
    border-radius: 50%;
    color: #16A34A;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.picker-reset:hover {
    background: #DCFCE7;
}

.picker-field {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.picker-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #166534;
    white-space: nowrap;
    min-width: 52px;
}

.picker-select {
    flex: 1;
    padding: 0.4rem 0.625rem;
    font-size: 0.8125rem;
    background: white;
    border-color: #BBF7D0;
}

.picker-select:focus {
    border-color: #16A34A;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}

.btn-do-import {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: #16A34A;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-do-import:hover {
    background: #15803D;
}

/* 分隔线 */
.panel-divider {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0.75rem 0;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

.panel-divider::before,
.panel-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* ==================== 研报模式：隐藏无关区块 ==================== */
.toolbar-content.report-mode .hide-in-report {
    display: none !important;
}

/* ==================== 标签子分组 ==================== */
.tag-group {
    margin-top: 0.75rem;
}

.tag-group:first-child {
    margin-top: 0;
}

.tag-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* ==================== 生成模式切换 ==================== */
.mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.375rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.25rem;
}

.mode-tab {
    padding: 0.5rem 0.375rem;
    background: transparent;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    text-align: center;
}

.mode-tab:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.04);
}

.mode-tab.active {
    background: var(--color-bg-secondary);
    color: var(--color-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* ==================== 视图切换 ==================== */
.results-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-toggle {
    display: flex;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.2rem;
    gap: 0.2rem;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.375rem 0.625rem;
    background: transparent;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.18s;
    font-weight: 500;
}

.view-btn:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.04);
}

.view-btn.active {
    background: var(--color-bg-secondary);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

/* ==================== 表格视图 ==================== */
.table-view-container {
    margin-top: 0.5rem;
}

.results-table-wrap {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.results-table thead {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.results-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    letter-spacing: 0.02em;
    user-select: none;
}

.results-table .col-num {
    width: 40px;
    text-align: center;
    padding-left: 0.75rem;
    padding-right: 0.5rem;
}

.results-table .col-title {
    width: 32%;
}

.results-table .col-action {
    width: 80px;
    text-align: center;
}

.results-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s;
}

.results-table tbody tr:last-child {
    border-bottom: none;
}

.results-table tbody tr:hover {
    background: rgba(255, 36, 66, 0.025);
}

.results-table td {
    padding: 0.875rem 1rem;
    vertical-align: top;
    color: var(--color-text);
    line-height: 1.6;
}

.results-table td.col-num {
    text-align: center;
    padding-left: 0.75rem;
    padding-right: 0.5rem;
}

.table-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: rgba(255, 36, 66, 0.1);
    color: var(--color-primary);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.table-title-cell {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.9rem;
}

.table-content-cell {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    white-space: pre-wrap;
    max-height: 120px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.table-content-cell.expanded {
    max-height: none;
    -webkit-line-clamp: unset;
    display: block;
}

.table-action-cell {
    text-align: center;
}

.btn-table-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.625rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.btn-table-copy:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(255, 36, 66, 0.04);
}

.btn-table-copy.copied {
    border-color: var(--color-success);
    color: var(--color-success);
    background: rgba(16, 185, 129, 0.06);
}

.table-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.btn-copy-table {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--color-text);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy-table:hover {
    background: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-copy-table.copied {
    background: var(--color-success);
}

.table-hint {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

/* 研报模式输出特殊样式 */
.report-output {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--color-text);
    white-space: pre-wrap;
}

/* ========== AI 智能卡片生成器样式 ========== */
.btn-card-generator {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.btn-card-generator:hover {
    background: #334155;
}

.card-generator-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
}

.cg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cg-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    background: #f8fafc;
}

.cg-sidebar {
    width: 420px;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 20;
    height: 100%;
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

.cg-header {
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cg-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.5px;
    margin: 0;
}

.cg-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.cg-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.cg-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cg-section {
    background: #fff;
    padding: 0;
    margin-bottom: 10px;
}

.cg-section-publish {
    background: #fff5f7;
    border: 1px solid #ffe4e8;
    padding: 15px;
    border-radius: 12px;
}

.cg-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cg-section-publish .cg-section-title {
    color: #ff2442;
}

.cg-import-group {
    display: flex;
    gap: 8px;
}

.cg-import-btn {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    background: #eff6ff;
    color: #3b82f6;
}

.cg-import-btn:hover {
    background: #3b82f6;
    color: white;
}

.cg-textarea,
.cg-input,
.cg-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    outline: none;
    transition: 0.2s;
    color: #334155;
    font-family: inherit;
}

.cg-textarea {
    resize: vertical;
}

.cg-textarea:focus,
.cg-input:focus,
.cg-select:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.1);
}

.cg-textarea::placeholder,
.cg-input::placeholder {
    color: #cbd5e1;
}

.cg-btn-smart {
    background: #ff2442;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.cg-btn-smart:hover {
    background: #e11d3c;
}

.cg-btn-auto {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cg-btn-auto:hover {
    background: #0284c7;
    color: white;
}

.cg-btn-reset {
    background: #fff;
    color: #64748b;
    border: 1px solid #e2e8f0;
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: 0.2s;
}

.cg-btn-reset:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

.cg-bg-control {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
}

.cg-batch-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 12px;
    margin-top: 20px;
}

.cg-batch-header {
    font-size: 12px;
    font-weight: 800;
    color: #475569;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cg-batch-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.cg-batch-label {
    font-size: 11px;
    color: #64748b;
    width: 50px;
    font-weight: 600;
}

.cg-file-custom {
    flex: 1;
    font-size: 12px;
    color: #64748b;
    background: white;
    border: 1px solid #cbd5e1;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    transition: 0.2s;
}

.cg-file-custom:hover {
    border-color: #94a3b8;
}

.cg-footer {
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.cg-btn-group {
    display: flex;
    gap: 12px;
}

.cg-btn-main {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #1e293b;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}

.cg-btn-main:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.cg-btn-save {
    background: #ff2442;
}

.cg-btn-save:hover {
    background: #e11d3c;
}

.cg-btn-outline {
    background: white;
    color: #333;
    border: 1px solid #cbd5e1;
}

.cg-btn-outline:hover {
    background: #f8fafc;
}

.cg-preview-area {
    flex: 1;
    background: #eef2f6;
    padding: 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: flex-start;
}

/* 卡片样式 */
.cg-card-wrapper {
    position: relative;
    margin-bottom: 10px;
    transition: 0.3s;
}

.cg-card-container {
    width: 375px;
    min-height: 500px;
    background: var(--card-bg, #fff);
    color: var(--card-text, #222);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.cg-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

.cg-layout-cover {
    padding: 40px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cg-cover-title {
    font-size: 50px;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 20px;
    white-space: pre-wrap;
    position: relative;
    z-index: 1;
}

.cg-cover-sub {
    font-size: 18px;
    font-weight: 500;
    opacity: 0.8;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.cg-cover-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.cg-tag {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid currentColor;
}

.cg-layout-content {
    justify-content: space-between;
}

.cg-content-body {
    flex: 1;
    padding: 45px 36px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.cg-content-text p {
    margin-bottom: 20px;
    text-align: justify;
    white-space: pre-wrap;
    letter-spacing: 0.05em;
    line-height: 1.8;
}

.cg-card-footer {
    height: 50px;
    padding: 0 36px;
    display: flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    opacity: 0.5;
    border-top: 1px solid rgba(0,0,0,0.05);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    margin-top: auto;
}

.cg-btn-card-del {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: 0.2s;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.cg-card-wrapper:hover .cg-btn-card-del {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.cg-btn-card-del:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* 卡片主题 */
.cg-theme-rednote { --card-bg: #fff; --card-text: #222; --accent: #ff2442; }
.cg-theme-rednote .cg-tag { background: #ff2442; color: #fff; border: none; }

.cg-theme-dark { --card-bg: #111; --card-text: #f5f5f5; --accent: #d4af37; }
.cg-theme-dark .cg-tag { color: #d4af37; border-color: #d4af37; }

.cg-theme-acid { background: linear-gradient(135deg, #ccff00 0%, #00ff99 100%); --card-text: #000; --accent: #000; }
.cg-theme-acid .cg-tag { background: #000; color: #ccff00; border: none; border-radius: 0; }
.cg-theme-acid .cg-card-container { border: 2px solid #000; }

.cg-theme-mag { --card-bg: #fdfdfd; --card-text: #1a1a1a; --accent: #1a1a1a; }
.cg-theme-mag .cg-layout-cover { align-items: flex-start !important; text-align: left !important; }
.cg-theme-mag .cg-cover-title { font-size: 60px; letter-spacing: -2px; }
.cg-theme-mag .cg-tag { border: 1px solid #000; color: #000; background: transparent; }

.cg-theme-warning { --card-bg: #ffcc00; --card-text: #000; --accent: #000; }
.cg-theme-warning .cg-tag { background: #000; color: #ffcc00; border: none; }

.cg-theme-serif { --card-bg: #f4f0e6; --card-text: #4a3b2a; --accent: #8b5a2b; font-family: "Noto Serif SC", serif; }
.cg-theme-serif .cg-tag { border: 1px solid #8b5a2b; color: #8b5a2b; }

.cg-theme-blue { --card-bg: #f0f7ff; --card-text: #003366; --accent: #0056b3; }
.cg-theme-green { --card-bg: #e8f5e9; --card-text: #1b5e20; --accent: #2e7d32; }
.cg-theme-pink { --card-bg: #fff0f5; --card-text: #880e4f; --accent: #d81b60; }
.cg-theme-orange { --card-bg: #fff8e1; --card-text: #bf360c; --accent: #ff6f00; }

.cg-theme-cyber { background: linear-gradient(45deg, #120458, #ff00ff); --card-text: #00ffff; --accent: #ffff00; }
.cg-theme-cyber .cg-cover-title { text-shadow: 2px 2px 0px #ff00ff; }

.cg-theme-morandi { --card-bg: #e6e6e6; --card-text: #5c5c5c; --accent: #7a8b8b; }
.cg-theme-news { --card-bg: #fcf6e5; --card-text: #2f2f2f; --accent: #c0392b; }
.cg-theme-news .cg-card-container { border: 1px solid #ddd; }

.cg-theme-luxury { background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%); --card-text: #fcd34d; --accent: #f59e0b; }
.cg-theme-luxury .cg-tag { border: 1px solid #fcd34d; color: #fcd34d; }

.cg-theme-outline { --card-bg: #fff; --card-text: #000; --accent: #000; }
.cg-theme-outline .cg-card-container { border: 4px solid #000; }
.cg-theme-outline .cg-tag { border: 2px solid #000; font-weight: 900; }

/* 卡片仓库 */
.cg-warehouse-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100;
}

.cg-warehouse-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8fafc;
}

.cg-warehouse-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.cg-wh-header {
    background: #fff;
    padding: 15px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.cg-wh-title {
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e293b;
}

.cg-wh-close {
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.cg-wh-close:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #fff5f7;
}

.cg-wh-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    width: 100%;
    background: #f8fafc;
}

.cg-draft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.cg-draft-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    transition: 0.3s;
    border: 1px solid #f1f5f9;
    position: relative;
}

.cg-draft-img-box {
    width: 100%;
    height: 220px;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.cg-draft-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.cg-draft-body {
    padding: 15px;
}

.cg-draft-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #334155;
}

.cg-draft-date {
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cg-draft-actions {
    display: flex;
    gap: 10px;
}

.cg-btn-wh-pub {
    width: 100%;
    background: #222;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
}

.cg-btn-wh-del {
    background: #fff0f0;
    color: #ff2442;
    border: 1px solid #ffcccc;
    width: 40px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.cg-btn-wh-edit {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
    width: 40px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

/* 字体样式 */
.cg-font-default { font-family: "Noto Sans SC", sans-serif; }
.cg-font-serif { font-family: "Noto Serif SC", "Songti SC", serif; }
.cg-font-kaiti { font-family: "Kaiti SC", "KaiTi", "STKaiti", serif; }
.cg-font-heavy { font-family: "Noto Sans SC", sans-serif; font-weight: 900; }
.cg-font-mono { font-family: "Menlo", "Monaco", "Courier New", monospace; }
.cg-font-round { font-family: "Varela Round", "Yuanti SC", "YouYuan", sans-serif; }
.cg-font-kuaile { font-family: "ZCOOL KuaiLe", cursive; }
.cg-font-brush { font-family: "Ma Shan Zheng", cursive; }
.cg-font-condensed { font-family: "ZCOOL QingKe HuangYou", sans-serif; }
.cg-font-elegant { font-family: "ZCOOL XiaoWei", serif; }

@media (max-width: 768px) {
    .cg-sidebar {
        width: 100%;
        height: auto;
    }

    .cg-container {
        flex-direction: column;
        overflow-y: auto;
    }

    .cg-preview-area {
        display: block;
        padding: 20px;
        min-height: 500px;
    }

    .cg-draft-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 批量方案样式 ========== */
.cg-batch-container {
    margin-bottom: 30px;
}

.cg-batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
    border: 1px solid #e2e8f0;
}

.cg-batch-title {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cg-btn-sync {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.cg-btn-sync:hover {
    background: #0284c7;
    color: white;
}

.cg-btn-del-batch {
    color: #ef4444;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 6px;
    transition: 0.2s;
    border: 1px solid transparent;
}

.cg-btn-del-batch:hover {
    background: #fef2f2;
    border-color: #fee2e2;
}

.cg-card-list-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.cg-card-info {
    position: absolute;
    top: -20px;
    left: 0;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
}

.cg-btn-card-del {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: 0.2s;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.cg-card-wrapper:hover .cg-btn-card-del {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.cg-btn-card-del:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.cg-layout-content {
    justify-content: space-between;
}

.contenteditable:true {
    outline: none;
    cursor: text;
}

[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: #cbd5e1;
}

[contenteditable="true"]:focus {
    background: rgba(148, 163, 184, 0.05);
}

/* Homepage-aligned visual layer. Existing content-generation selectors and JS stay unchanged. */
:root {
    --color-primary: #146ef5;
    --color-primary-hover: #0956d7;
    --color-text: #101b31;
    --color-text-secondary: #71809b;
    --color-border: #dce8fa;
    --color-bg: #f6f9ff;
    --color-bg-secondary: #ffffff;
    --radius-md: 14px;
    --radius-lg: 24px;
    --shadow-sm: 0 12px 32px rgba(33, 76, 143, 0.08);
    --shadow-md: 0 18px 44px rgba(33, 76, 143, 0.12);
}

body {
    background:
        linear-gradient(rgba(27, 105, 232, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(27, 105, 232, 0.045) 1px, transparent 1px),
        radial-gradient(circle at 15% 0%, rgba(102, 170, 255, 0.18), transparent 28rem),
        #f8fbff;
    background-size: 56px 56px, 56px 56px, auto, auto;
    font-family: "PingFang SC", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.publish-nav {
    height: 76px;
    border-bottom: 1px solid rgba(20, 110, 245, 0.12);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 8px 28px rgba(28, 64, 120, 0.05);
}

.nav-container {
    max-width: 1440px;
    height: 76px;
    padding: 0 30px;
}

.nav-logo { gap: 11px; }
.brand-logo-mark.logo-icon { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 8px 20px rgba(30, 64, 120, 0.1); }
.logo-text { font-size: 17px; font-weight: 760; letter-spacing: -0.02em; }
.nav-btn {
    border-color: rgba(20, 110, 245, 0.14);
    background: rgba(20, 110, 245, 0.06);
    color: #1765d1;
    border-radius: 999px;
    padding: 10px 15px;
    font-weight: 700;
}
.nav-btn:hover { color: #fff; background: #146ef5; border-color: #146ef5; }

.publish-main {
    max-width: 1440px;
    gap: 26px;
    padding: 30px;
    min-height: calc(100vh - 76px);
}

.toolbar-sidebar { width: 370px; top: 98px; max-height: calc(100vh - 120px); }
.toolbar-content {
    padding: 24px;
    border: 1px solid rgba(20, 110, 245, 0.12);
    border-radius: 26px;
    background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(242, 248, 255, 0.95));
    box-shadow: 0 20px 46px rgba(33, 76, 143, 0.1);
}
.publish-tool-intro { padding: 2px 2px 19px; border-bottom: 1px solid rgba(20, 110, 245, 0.12); }
.publish-tool-intro > span,
.empty-kicker {
    color: #146ef5;
    font-size: 11px;
    letter-spacing: 0.16em;
    font-weight: 800;
}
.publish-tool-intro h1 {
    margin: 8px 0 8px;
    color: #101b31;
    font-family: "Songti SC", STSong, "Noto Serif SC", serif;
    font-size: 31px;
    line-height: 1.16;
    letter-spacing: -0.055em;
}
.publish-tool-intro p { margin: 0; color: var(--color-text-secondary); font-size: 13px; line-height: 1.75; }
.toolbar-section { margin-bottom: 18px; padding: 19px 0 0; border-bottom: 0; }
.toolbar-title { margin: 0 0 12px; color: #1e3256; font-size: 15px; font-weight: 760; }
.toolbar-title span:first-child { display: none; }
.api-status {
    border: 1px solid rgba(20, 110, 245, 0.14);
    background: #f5f9ff;
    border-radius: 14px;
    padding: 11px 13px;
}
.api-status .status-text { font-size: 13px; font-weight: 650; color: #536784; }
.api-status .status-action { margin-left: auto; border-radius: 9px; background: #146ef5; color: #fff; box-shadow: none; }
.api-status .status-action:hover { background: #0956d7; }
.mode-tabs { padding: 5px; gap: 5px; border: 1px solid rgba(20, 110, 245, 0.12); border-radius: 15px; background: #f4f8ff; }
.mode-tab { border-radius: 10px; padding: 10px 12px; font-weight: 720; }
.mode-tab.active { color: #fff; background: linear-gradient(135deg, #1477f8, #246be2); box-shadow: 0 8px 16px rgba(20, 110, 245, 0.2); }
.file-upload-zone { border-radius: 16px; }
.upload-trigger { min-height: 126px; border: 1.5px dashed rgba(20, 110, 245, 0.35); border-radius: 16px; background: linear-gradient(145deg, rgba(20, 110, 245, 0.07), rgba(255,255,255,0.9)); }
.upload-trigger:hover { border-color: #146ef5; background: rgba(20, 110, 245, 0.1); }
.upload-trigger svg { color: #146ef5; width: 22px; height: 22px; }
.upload-text { font-size: 13px; font-weight: 720; color: #2a4168; }
.upload-formats, .form-hint { color: #8290a8; font-size: 12px; line-height: 1.65; }
.form-label, .tag-group-label { color: #466080; font-size: 12px; font-weight: 760; }
.form-input, .form-select {
    border: 1px solid rgba(20, 110, 245, 0.16);
    border-radius: 12px;
    background: rgba(255,255,255,0.84);
    color: #1a2b48;
    box-shadow: none;
}
.form-input:focus, .form-select:focus { border-color: #146ef5; box-shadow: 0 0 0 4px rgba(20, 110, 245, 0.1); }
.style-tag .tag-label { border-radius: 999px; border-color: #dbe8fb; background: #f8fbff; color: #536784; }
.style-tag input:checked + .tag-label { border-color: rgba(20, 110, 245, 0.3); background: rgba(20, 110, 245, 0.1); color: #1462cd; }
.toolbar-actions { position: sticky; bottom: -24px; z-index: 2; padding: 18px 0 2px; background: linear-gradient(to bottom, rgba(247,251,255,0), rgba(247,251,255,0.98) 28%); }
.btn-generate { border-radius: 15px; padding: 15px 18px; background: linear-gradient(135deg, #146ef5, #2b72e6); box-shadow: 0 14px 24px rgba(20, 110, 245, 0.24); }
.btn-generate:hover:not(:disabled) { background: linear-gradient(135deg, #0d62dc, #155fcd); box-shadow: 0 18px 32px rgba(20, 110, 245, 0.3); }

.content-area { min-height: 680px; }
.empty-state {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 650px;
    padding: 74px 52px 56px;
    border: 1px solid rgba(20, 110, 245, 0.13);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(238,246,255,0.95));
    box-shadow: 0 20px 50px rgba(33, 76, 143, 0.09);
}
.empty-state::before, .empty-state::after { content: ""; position: absolute; z-index: -1; border-radius: 999px; pointer-events: none; }
.empty-state::before { width: 350px; height: 350px; right: -120px; top: -110px; background: radial-gradient(circle, rgba(74, 145, 255, 0.21), rgba(74, 145, 255, 0)); }
.empty-state::after { width: 280px; height: 280px; left: -140px; bottom: -150px; background: radial-gradient(circle, rgba(255, 112, 112, 0.14), rgba(255,112,112,0)); }
.empty-kicker { margin-bottom: 17px; }
.empty-icon {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    margin: 0 0 22px;
    border: 1px solid rgba(20, 110, 245, 0.14);
    border-radius: 22px;
    background: linear-gradient(135deg, #1477f8, #6ba6ff);
    color: #fff;
    font-size: 34px;
    box-shadow: 0 18px 32px rgba(20, 110, 245, 0.2);
}
.empty-title {
    max-width: 620px;
    margin: 0;
    color: #101b31;
    font-family: "Songti SC", STSong, "Noto Serif SC", serif;
    font-size: clamp(34px, 4vw, 52px);
    line-height: 1.18;
    letter-spacing: -0.055em;
}
.empty-desc { max-width: 630px; margin: 22px 0 0; color: #71809b; font-size: 16px; line-height: 1.85; }
.empty-ai-tip { margin: 22px 0 0; padding: 9px 14px; border-radius: 999px; color: #2564bf; background: rgba(20, 110, 245, 0.08); font-size: 13px; }
.empty-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(740px, 100%); margin-top: 38px; border: 0; background: transparent; }
.feature-item { min-height: 104px; padding: 18px; border: 1px solid rgba(20, 110, 245, 0.12); border-radius: 16px; background: rgba(255,255,255,0.76); text-align: left; }
.feature-icon { display: block; margin: 0 0 10px; color: #146ef5; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; }
.feature-text { color: #273c60; font-size: 14px; font-weight: 720; }

.results-section { padding: 28px; border: 1px solid rgba(20, 110, 245, 0.13); border-radius: 28px; background: rgba(255,255,255,0.9); box-shadow: 0 20px 50px rgba(33, 76, 143, 0.09); }
.results-header { padding-bottom: 18px; border-bottom-color: rgba(20, 110, 245, 0.12); }
.results-title { font-family: "Songti SC", STSong, "Noto Serif SC", serif; color: #101b31; font-size: 30px; letter-spacing: -0.04em; }
.view-toggle { border-color: rgba(20, 110, 245, 0.14); background: #f4f8ff; }
.view-btn.active { color: #fff; background: #146ef5; }
.btn-copy-table, .btn-batch-sync { border-radius: 12px; }

@media (max-width: 900px) {
    /* Keep the publishing tool's header horizontal on phones. The shared site
       stylesheet switches generic navigation to a vertical stack on mobile. */
    body { padding-top: 0; }
    .publish-nav, .publish-nav .nav-container { height: 64px; }
    .publish-nav .nav-container {
        min-height: 64px;
        padding: 0 18px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
    }
    .publish-nav .nav-logo {
        width: auto;
        flex: 1 1 auto;
        justify-content: flex-start;
        padding: 0;
    }
    .publish-nav .nav-actions {
        display: flex;
        flex: 0 0 auto;
        margin-left: 12px;
    }
    .logo-text { font-size: 14px; }
    .nav-btn { width: 40px; height: 40px; padding: 0; font-size: 0; }
    .nav-btn svg { margin: 0; }
    .publish-main { padding: 18px; gap: 18px; }
    .toolbar-sidebar { width: 100%; position: static; max-height: none; }
    .toolbar-content { border-radius: 22px; }
    .content-area { min-height: auto; }
    .empty-state { min-height: 540px; padding: 52px 24px 34px; border-radius: 22px; }
}

@media (max-width: 620px) {
    .publish-main { padding: 12px; }
    .publish-tool-intro h1 { font-size: 28px; }
    .empty-title { font-size: 36px; }
    .empty-desc { font-size: 14px; }
    .empty-features { grid-template-columns: 1fr; gap: 10px; margin-top: 26px; }
    .feature-item { min-height: auto; display: flex; align-items: center; gap: 10px; padding: 14px; }
    .feature-icon { margin: 0; }
    .results-section { padding: 18px; border-radius: 22px; }
}

/* Shares the red theme selected on the homepage through yaowen_home_theme. */
html[data-home-theme="red"] {
    --color-primary: #ee4d5d;
    --color-primary-hover: #d9364b;
    --color-border: #f3d9d6;
    --color-bg: #fff7f5;
}
html[data-home-theme="red"] body {
    background:
        linear-gradient(rgba(238, 77, 93, 0.048) 1px, transparent 1px),
        linear-gradient(90deg, rgba(238, 77, 93, 0.048) 1px, transparent 1px),
        radial-gradient(circle at 15% 0%, rgba(255, 151, 146, 0.2), transparent 28rem),
        #fffaf9;
    background-size: 56px 56px, 56px 56px, auto, auto;
}
html[data-home-theme="red"] .publish-nav { border-bottom-color: rgba(238, 77, 93, 0.14); }
html[data-home-theme="red"] .nav-btn { border-color: rgba(238, 77, 93, 0.16); background: rgba(238, 77, 93, 0.07); color: #d94252; }
html[data-home-theme="red"] .nav-btn:hover { border-color: #ee4d5d; background: #ee4d5d; }
html[data-home-theme="red"] .toolbar-content { border-color: rgba(238, 77, 93, 0.15); background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(255,246,244,0.96)); }
html[data-home-theme="red"] .publish-tool-intro { border-bottom-color: rgba(238, 77, 93, 0.13); }
html[data-home-theme="red"] .publish-tool-intro > span,
html[data-home-theme="red"] .empty-kicker,
html[data-home-theme="red"] .feature-icon { color: #e74757; }
html[data-home-theme="red"] .api-status { border-color: rgba(238, 77, 93, 0.15); background: #fff7f6; }
html[data-home-theme="red"] .api-status .status-action,
html[data-home-theme="red"] .mode-tab.active,
html[data-home-theme="red"] .btn-generate { background: linear-gradient(135deg, #f25765, #e74154); }
html[data-home-theme="red"] .api-status .status-action:hover,
html[data-home-theme="red"] .btn-generate:hover:not(:disabled) { background: #d9364b; }
html[data-home-theme="red"] .mode-tabs { border-color: rgba(238, 77, 93, 0.14); background: #fff5f4; }
html[data-home-theme="red"] .upload-trigger { border-color: rgba(238, 77, 93, 0.38); background: linear-gradient(145deg, rgba(238,77,93,0.07), rgba(255,255,255,0.9)); }
html[data-home-theme="red"] .upload-trigger:hover { border-color: #ee4d5d; background: rgba(238,77,93,0.1); }
html[data-home-theme="red"] .upload-trigger svg { color: #e74757; }
html[data-home-theme="red"] .form-input:focus,
html[data-home-theme="red"] .form-select:focus { border-color: #ee4d5d; box-shadow: 0 0 0 4px rgba(238,77,93,0.1); }
html[data-home-theme="red"] .style-tag input:checked + .tag-label { border-color: rgba(238,77,93,0.3); background: rgba(238,77,93,0.1); color: #d94252; }
html[data-home-theme="red"] .empty-state { border-color: rgba(238,77,93,0.14); background: linear-gradient(135deg, rgba(255,255,255,0.97), rgba(255,244,243,0.96)); }
html[data-home-theme="red"] .empty-state::before { background: radial-gradient(circle, rgba(255, 113, 108, 0.23), rgba(255,113,108,0)); }
html[data-home-theme="red"] .empty-state::after { background: radial-gradient(circle, rgba(238,77,93,0.13), rgba(238,77,93,0)); }
html[data-home-theme="red"] .empty-icon { border-color: rgba(238,77,93,0.14); background: linear-gradient(135deg, #f25765, #ff9791); box-shadow: 0 18px 32px rgba(238,77,93,0.2); }
html[data-home-theme="red"] .empty-ai-tip { color: #d94252; background: rgba(238,77,93,0.08); }
html[data-home-theme="red"] .feature-item,
html[data-home-theme="red"] .results-section { border-color: rgba(238,77,93,0.14); }
html[data-home-theme="red"] .view-btn.active { background: #ee4d5d; }
