/* AI 详情页生成器 - 完整样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

/* 头部 */
.header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 0;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.header h1 {
    font-size: 20px;
    color: #333;
    margin-bottom: 6px;
}

.header p {
    font-size: 13px;
    color: #999;
}

/* 步骤条 */
.steps-bar {
    background: white;
    padding: 20px 0;
    border-bottom: 1px solid #e5e7eb;
}

.steps-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    position: relative;
}

.steps-container::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 50px;
    right: 50px;
    height: 1px;
    background: #e5e7eb;
    z-index: 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    background: white;
    padding: 0 10px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #999;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.step-item.active .step-number {
    background: #1f2937;
    border-color: #1f2937;
    color: white;
}

.step-item.completed .step-number {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.step-label {
    font-size: 12px;
    color: #666;
}

.step-item.active .step-label {
    color: #1f2937;
    font-weight: 600;
}

/* 主容器 */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
}

/* 左侧配置面板 */
.config-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.config-section {
    margin-bottom: 20px;
}

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

.config-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

/* 上传区域 */
.upload-box {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.upload-box:hover {
    border-color: #1f2937;
    background: #f3f4f6;
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 11px;
    color: #999;
}

.upload-box-small {
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.upload-box-small:hover {
    border-color: #1f2937;
}

#imageInput, #styleRefInput {
    display: none;
}

/* 选项卡 */
.tabs {
    display: flex;
    gap: 6px;
}

.tab-btn {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.tab-btn:hover {
    background: #f9fafb;
}

.tab-btn.active {
    background: #1f2937;
    color: white;
    border-color: #1f2937;
}

.tab-btn.hot::after {
    content: 'HOT';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 3px;
}

/* 表单控件 */
.select-box {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}

.select-box:focus {
    outline: none;
    border-color: #1f2937;
}

.input-box {
    width: 100%;
    min-height: 70px;
    padding: 9px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    resize: vertical;
    font-family: inherit;
}

.input-box:focus {
    outline: none;
    border-color: #1f2937;
}

.hint-text {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}

/* 生成按钮 */
.generate-btn {
    width: 100%;
    padding: 12px;
    background: #1f2937;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
}

.generate-btn:hover {
    background: #111827;
    transform: translateY(-1px);
}

.generate-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

/* 右侧内容区 */
.content-area {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 40px;
    min-height: 500px;
}

.content-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.content-desc {
    font-size: 13px;
    color: #999;
    margin-bottom: 30px;
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 40px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-text {
    font-size: 14px;
    color: #999;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 60px 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #1f2937;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
}

.loading-hint {
    font-size: 12px;
    color: #999;
}

/* 分析结果卡片 */
.analysis-card {
    background: #f9fafb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.analysis-card h3 {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-card h3::before {
    content: '';
    width: 3px;
    height: 14px;
    background: #1f2937;
    border-radius: 2px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #1f2937;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

/* 选择网格 */
.selections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.selection-card {
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    overflow: hidden;
    word-break: break-word;
}

.selection-card:hover {
    border-color: #1f2937;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.selection-card.selected {
    border-color: #1f2937;
    background: #f9fafb;
}

.direction-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

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

.selection-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.selection-confidence {
    font-size: 12px;
    color: #1f2937;
    background: #e5e7eb;
    padding: 3px 8px;
    border-radius: 4px;
}

.selection-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.direction-modules {
    font-size: 11px;
    color: #999;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
}

/* 按钮 */
.action-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background: #f3f4f6;
    color: #666;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-primary {
    background: #1f2937;
    color: white;
}

.btn-primary:hover {
    background: #111827;
}

.btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* 结果展示 */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.result-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

.result-card img {
    width: 100%;
    display: block;
}

/* 占位符样式 */
.result-placeholder {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
}

.placeholder-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #1f2937;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.placeholder-text {
    font-size: 14px;
    color: #666;
}

/* 错误样式 */
.result-error {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fef2f2;
    padding: 40px 20px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-text {
    font-size: 16px;
    color: #dc2626;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-msg {
    font-size: 12px;
    color: #991b1b;
    text-align: center;
    max-width: 250px;
}

.error-state {
    text-align: center;
    padding: 30px 20px;
}

.error-hint {
    font-size: 13px;
    color: #6b7280;
    margin-top: 8px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    word-break: break-all;
}

.result-footer {
    padding: 15px;
    text-align: center;
}

.result-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.btn-download {
    width: 100%;
    padding: 10px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download:hover {
    background: #059669;
}

/* 可编辑标签 */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1f2937;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.tag:hover { background: #374151; }
.tag .tag-delete { cursor: pointer; opacity: 0.6; }
.tag .tag-delete:hover { opacity: 1; color: #ef4444; }
.tag.editing { background: #667eea; padding: 2px 4px; }
.tag.editing input {
    background: transparent;
    border: none;
    color: white;
    font-size: 12px;
    width: 80px;
    outline: none;
}

/* 标签输入框 */
.tag-input {
    margin-top: 8px;
    padding: 6px 10px;
    border: 1px dashed #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    width: 130px;
}
.tag-input:focus { outline: none; border-color: #1f2937; }

/* 文本输入 */
.text-input, .text-input-large {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s;
}
.text-input { width: 100%; }
.text-input-large { width: 100%; font-size: 14px; }
.text-input:focus, .text-input-large:focus { outline: none; border-color: #1f2937; }

.edit-hint { font-size: 11px; color: #999; font-weight: normal; }

/* 文字按钮 */
.btn-text {
    background: none;
    border: none;
    color: #667eea;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.btn-text:hover { background: #f0f0ff; }

/* 数量选择器 */
.count-selector {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e5e7eb;
}
.count-label { font-size: 11px; color: #999; line-height: 28px; }
.count-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.count-btn:hover { border-color: #1f2937; }
.count-btn.active { background: #1f2937; color: white; border-color: #1f2937; }

/* 自定义风格 */
.custom-style-area { margin-top: 15px; }

/* 详情页模块列表 */
.detail-modules-list {
    margin: 12px 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.modules-header {
    padding: 8px 12px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e5e7eb;
}
.detail-module-item {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
    background: #fff;
}
.detail-module-item:last-child { border-bottom: none; }
.module-topline {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}
.module-num {
    width: 22px; height: 22px;
    background: #1f2937; color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: bold; flex-shrink: 0;
}
.module-title-wrap {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.module-name {
    font-weight: 600;
    color: #1e293b;
    min-width: 0;
    outline: none;
}
.module-purpose {
    color: #94a3b8;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.module-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.module-copy-stack {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 6px 8px;
    align-items: start;
}
.module-copy-label {
    color: #94a3b8;
    font-size: 10px;
    line-height: 24px;
    white-space: nowrap;
}
.module-copywriting {
    color: #64748b;
    font-size: 11px;
    background: #fef3c7;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: text;
    outline: none;
    min-width: 0;
    min-height: 24px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.module-headline {
    color: #1e293b;
    font-weight: 600;
}
.module-body {
    min-height: 42px;
}
.module-copywriting:hover { background: #fde68a; }
.module-copywriting:focus { background: #fff; box-shadow: 0 0 0 2px rgba(102,126,234,0.2); }

/* 模块单独重生成按钮 */
.module-regen {
    width: 20px; height: 20px;
    background: #e0f2fe; color: #0369a1;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; cursor: pointer; flex-shrink: 0;
    transition: all 0.15s;
}
.module-regen:hover { background: #0369a1; color: white; }

/* 模块删除按钮 */
.module-delete {
    width: 20px; height: 20px;
    background: #fee2e2; color: #ef4444;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: bold;
    cursor: pointer; flex-shrink: 0;
    transition: all 0.15s;
}
.module-delete:hover { background: #ef4444; color: white; }

/* 模块名可编辑 */
.module-name[contenteditable="true"] {
    outline: none; cursor: text;
    padding: 2px 4px; border-radius: 3px;
}
.module-name[contenteditable="true"]:hover { background: rgba(102,126,234,0.06); }
.module-name[contenteditable="true"]:focus { background: #fff; box-shadow: 0 0 0 2px rgba(102,126,234,0.2); }

/* 详情页设计看板 */
.detail-board-grid {
    grid-template-columns: 1fr;
    gap: 18px;
}

.detail-board-grid .direction-card {
    padding: 0;
    overflow: hidden;
    border-color: #d7dee8;
    background: #fbfcff;
}

.detail-board-grid .direction-card:hover {
    transform: none;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.detail-board-grid .direction-card.selected {
    background: #f8fbff;
    border-color: #1f2937;
    box-shadow: 0 0 0 4px rgba(31, 41, 55, 0.08);
}

.direction-board-header {
    padding: 16px 18px 12px;
    background: #fff;
    border-bottom: 1px solid #edf1f7;
}

.direction-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.direction-title-group .direction-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    border-radius: 8px;
    font-size: 22px;
}

.direction-subtitle {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 500;
}

.detail-board-grid .selection-desc {
    padding: 12px 18px 0;
    color: #475569;
    line-height: 1.7;
}

.detail-board-grid .dna-summary {
    margin: 12px 18px 0;
}

.detail-board-grid .detail-modules-list {
    margin: 16px 18px 18px;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.detail-board-grid .modules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 10px;
    background: transparent;
    border-bottom: none;
    color: #334155;
}

.detail-board-grid .detail-modules-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-board-grid .modules-header {
    grid-column: 1 / -1;
}

.detail-board-grid .detail-module-item {
    border: 1px solid #e4e9f2;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.detail-board-grid .detail-module-item:hover {
    border-color: #cbd5e1;
}

.detail-board-grid .module-num {
    background: #0f172a;
}

.detail-board-grid .module-purpose {
    white-space: normal;
    line-height: 1.35;
}

.detail-board-grid .module-actions {
    align-self: start;
}

.detail-board-grid .module-regen {
    width: auto;
    height: 24px;
    padding: 0 8px;
    border-radius: 5px;
    font-size: 11px;
    background: #edf6ff;
}

.detail-board-grid .module-delete {
    width: 24px;
    height: 24px;
    border-radius: 5px;
}

.detail-board-grid .module-copy-stack {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 7px 8px;
    padding-top: 8px;
    border-top: 1px dashed #edf1f7;
}

.detail-board-grid .module-copy-label {
    line-height: 28px;
}

.detail-board-grid .module-copywriting {
    min-height: 28px;
    background: #fff8df;
    border: 1px solid #f4e2a8;
}

.detail-board-grid .module-headline {
    font-size: 12px;
}

.detail-board-grid .module-body {
    min-height: 54px;
}

.detail-board-grid .detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 18px 18px;
}

.detail-board-grid .detail-actions .btn-mini {
    padding: 8px 10px;
    border-style: solid;
    border-radius: 6px;
    background: #fff;
}

/* 风格DNA标签 */
.dna-summary {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin: 8px 0; padding: 8px;
    background: #f0f9ff; border-radius: 6px;
}
.dna-tag {
    font-size: 10px; color: #0369a1;
    background: #e0f2fe; padding: 2px 6px; border-radius: 4px;
}

/* 详情页操作按钮 */
.detail-actions {
    margin-top: 8px;
}
.detail-actions .btn-mini {
    width: 100%;
    padding: 6px;
    border: 1px dashed #cbd5e1;
    background: #fff;
    border-radius: 4px;
    font-size: 11px;
    color: #64748b;
    cursor: pointer;
}
.detail-actions .btn-mini:hover {
    border-color: #667eea; color: #667eea; background: #f0f0ff;
}

/* 设计预览工作台 */
.design-spec-preview {
    margin: 8px 0;
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.spec-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 11px;
    color: #475569;
    line-height: 1.5;
}
.spec-row:last-child { margin-bottom: 0; }
.spec-icon { flex-shrink: 0; font-size: 13px; }
.spec-text { flex: 1; }

/* 文案预览 */
.copy-preview {
    margin: 8px 0;
    padding: 10px;
    background: #fef3c7;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.8;
    overflow: hidden;
    word-break: break-word;
}
.copy-preview.no-text {
    background: #f1f5f9;
    color: #94a3b8;
    padding: 8px 10px;
}
.copy-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.copy-line:last-child { margin-bottom: 0; }
.copy-badge {
    background: #ef4444;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}
.copy-price {
    color: #dc2626;
    font-weight: bold;
    font-size: 13px;
}
.copy-headline {
    font-weight: bold;
    color: #1e293b;
    font-size: 13px;
    display: block;
    overflow-wrap: break-word;
    max-width: 100%;
}
.copy-points {
    color: #64748b;
    font-size: 10px;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* 文案区 contenteditable 直接可编辑 */
.copy-badge[contenteditable="true"],
.copy-headline[contenteditable="true"],
.copy-points[contenteditable="true"] {
    outline: none;
    cursor: text;
    border-radius: 3px;
    padding: 2px 4px;
}
.copy-badge[contenteditable="true"]:hover,
.copy-headline[contenteditable="true"]:hover,
.copy-points[contenteditable="true"]:hover {
    background: rgba(102,126,234,0.06);
}
.copy-badge[contenteditable="true"]:focus,
.copy-headline[contenteditable="true"]:focus,
.copy-points[contenteditable="true"]:focus {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(102,126,234,0.2);
}

/* 自定义标签 */
.custom-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    color: #667eea;
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 3px;
}

/* 多图预览 */
.style-ref-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.style-ref-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}
.style-ref-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.style-ref-item .ref-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 10px;
    text-align: center;
    padding: 2px;
}
.style-ref-item .ref-delete {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* @mention 下拉 */
.at-mention-wrapper { position: relative; }
.at-dropdown {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    min-width: 250px;
}
.at-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
}
.at-dropdown-item:hover, .at-dropdown-item.active {
    background: #f0f0ff;
}
/* contenteditable 编辑器 */
.at-editor-wrapper { position: relative; margin-top: 8px; }
.at-editor {
    min-height: 50px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    line-height: 1.8;
}
.at-editor:focus { border-color: #1f2937; }
.at-editor:empty::before {
    content: attr(placeholder);
    color: #999;
    font-size: 12px;
    pointer-events: none;
}
.at-placeholder {
    position: absolute;
    top: 10px;
    left: 12px;
    font-size: 12px;
    color: #999;
    pointer-events: none;
    display: none;
}
/* 内联缩略图 */
.at-thumb {
    display: inline-block;
    vertical-align: middle;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    margin: 0 2px;
}

.at-dropdown-item img {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
}

/* 骨架屏动画 */
.skeleton-card {
    pointer-events: none;
    border-color: #e5e7eb;
    background: #fafafa;
}
.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}
.skeleton-title { width: 60%; height: 20px; }
.skeleton-text { width: 90%; }
.skeleton-text.short { width: 70%; }
.skeleton-count-row { display: flex; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f3f4f6; }
.skeleton-btn { width: 28px; height: 28px; background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 步骤内容淡入 */
.step-content {
    display: none;
    animation: fadeSlideIn 0.35s ease-out;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 选中卡片动画 */
.selection-card {
    transition: all 0.25s ease;
    border: 2px solid #e5e7eb;
}
.selection-card.selected {
    border-color: #1f2937;
    border-width: 3px;
    background: #f0f4ff;
    box-shadow: 0 0 0 4px rgba(31, 41, 55, 0.1);
    transform: translateY(-1px);
}
.selection-card:not(.selected) {
    opacity: 0.85;
}
.selection-card:not(.selected):hover {
    opacity: 1;
    border-color: #9ca3af;
}

/* 数量按钮 */
.count-btn {
    cursor: pointer;
}
.count-btn:hover {
    border-color: #1f2937;
}

/* 生成按钮加载态 */
.generate-btn.loading {
    pointer-events: none;
    background: #667eea;
    animation: btnPulse 1s ease-in-out infinite;
}
@keyframes btnPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.btn-retry {
    width: 100%;
    padding: 10px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-retry:hover {
    background: #dc2626;
}

/* Final detail-board overrides */
.detail-board-grid .direction-card.selected,
.detail-board-grid .direction-card:not(.selected) {
    opacity: 1;
}

.detail-board-grid .direction-card.selected {
    border-width: 2px;
    background: #f8fbff;
}

@media (max-width: 1100px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    .config-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .main-container {
        padding: 16px;
    }
    .content-area {
        padding: 20px;
    }
    .detail-board-grid .detail-modules-list {
        grid-template-columns: 1fr;
    }
    .detail-board-grid .detail-actions {
        grid-template-columns: 1fr;
    }
    .module-copy-stack {
        grid-template-columns: 1fr;
    }
    .module-copy-label {
        line-height: 1.2;
    }
}

/* Pro board redesign inspired by polished component systems */
:root {
    --pro-bg: #eef2f6;
    --pro-surface: #ffffff;
    --pro-surface-2: #f8fafc;
    --pro-ink: #101827;
    --pro-muted: #667085;
    --pro-faint: #98a2b3;
    --pro-line: #d9e2ec;
    --pro-line-2: #edf1f6;
    --pro-blue: #2563eb;
    --pro-blue-2: #1d4ed8;
    --pro-green: #0f9f6e;
    --pro-amber: #f59e0b;
    --pro-red: #dc2626;
    --pro-radius: 8px;
    --pro-shadow: 0 14px 34px rgba(16, 24, 39, 0.08);
    --pro-shadow-soft: 0 1px 2px rgba(16, 24, 39, 0.06);
    --pro-focus: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

html {
    background: var(--pro-bg);
}

body {
    background:
        radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.07), transparent 280px),
        linear-gradient(180deg, #f9fbfd 0%, var(--pro-bg) 360px);
    color: var(--pro-ink);
}

.header {
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 0;
}

.header-content {
    max-width: 1540px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(180deg, #1e293b, #111827);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.header h1 {
    color: #fff;
    font-size: 17px;
    line-height: 1.25;
    margin: 0 0 2px;
}

.header p {
    color: #a9b4c4;
    font-size: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
}

.status-pill-strong {
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(96, 165, 250, 0.26);
}

.steps-bar {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    padding: 10px 0;
    border-bottom: 1px solid var(--pro-line);
}

.steps-container {
    max-width: 760px;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--pro-line);
    background: #fff;
}

.step-item.active .step-number {
    background: var(--pro-blue);
    border-color: var(--pro-blue);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.step-item.completed .step-number {
    background: var(--pro-green);
    border-color: var(--pro-green);
}

.step-label {
    color: var(--pro-muted);
}

.main-container {
    max-width: 1540px;
    grid-template-columns: 336px minmax(0, 1fr);
    padding: 24px 36px 40px;
    gap: 22px;
}

.config-panel,
.content-area {
    border: 1px solid var(--pro-line);
    border-radius: 10px;
    background: rgba(255,255,255,0.96);
    box-shadow: var(--pro-shadow-soft);
}

.config-panel {
    padding: 16px;
}

.config-section {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--pro-line-2);
}

.config-title {
    color: #344054;
    font-size: 12px;
    letter-spacing: 0;
}

.upload-box,
.upload-box-small {
    position: relative;
    background:
        linear-gradient(180deg, #fff, #f8fafc);
    border: 1px dashed #b8c4d4;
    border-radius: var(--pro-radius);
}

.upload-box::after,
.upload-box-small::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(120deg, transparent 0%, rgba(37,99,235,0.06) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.upload-box:hover,
.upload-box-small:hover {
    border-color: var(--pro-blue);
    background: #f5f9ff;
}

.upload-box:hover::after,
.upload-box-small:hover::after {
    opacity: 1;
}

.tabs {
    padding: 4px;
    border-radius: 9px;
    background: #eef2f7;
}

.tab-btn {
    border: 0;
    border-radius: 7px;
    color: var(--pro-muted);
    font-weight: 700;
}

.tab-btn.active {
    background: #fff;
    color: var(--pro-ink);
    box-shadow: var(--pro-shadow-soft);
}

.select-box,
.input-box,
.text-input,
.text-input-large,
.at-editor,
.tag-input {
    border: 1px solid var(--pro-line);
    border-radius: 8px;
    background: #fff;
    color: var(--pro-ink);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.select-box:focus,
.input-box:focus,
.text-input:focus,
.text-input-large:focus,
.at-editor:focus,
.tag-input:focus {
    border-color: var(--pro-blue);
    box-shadow: var(--pro-focus);
}

.generate-btn,
.btn-primary {
    border-radius: 8px;
    background: var(--pro-blue);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.generate-btn:hover,
.btn-primary:hover {
    background: var(--pro-blue-2);
}

.btn-secondary {
    background: #eef2f7;
    color: #344054;
}

.content-area {
    padding: 24px;
    min-height: 690px;
}

.content-title {
    color: var(--pro-ink);
    font-size: 20px;
    font-weight: 750;
}

.content-desc {
    color: var(--pro-muted);
}

.empty-state,
.loading-state {
    border: 1px dashed #c8d2df;
    border-radius: 10px;
    background:
        linear-gradient(180deg, #fff, #f8fafc);
}

.analysis-card,
.selection-card,
.result-card {
    border: 1px solid var(--pro-line);
    border-radius: var(--pro-radius);
    background: #fff;
    box-shadow: var(--pro-shadow-soft);
}

.analysis-card h3::before {
    background: var(--pro-blue);
}

.tag {
    border: 1px solid #c7d7fe;
    background: #eaf1ff;
    color: #1d4ed8;
}

.selections-grid {
    gap: 16px;
}

.selection-card {
    padding: 16px;
}

.selection-card:hover {
    transform: translateY(-1px);
    border-color: #b9c5d5;
    box-shadow: var(--pro-shadow);
}

.selection-card.selected {
    border-color: var(--pro-blue);
    border-width: 1px;
    background: #f8fbff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13), var(--pro-shadow-soft);
}

.selection-confidence {
    border-radius: 999px;
    color: #1d4ed8;
    background: #eaf1ff;
}

.copy-preview {
    background: #fff7df;
    border: 1px solid #f0d995;
    border-radius: 7px;
}

.count-btn {
    border-radius: 7px;
}

.count-btn.active {
    background: var(--pro-blue);
    border-color: var(--pro-blue);
}

.detail-board-grid .direction-card {
    border-radius: 10px;
}

.detail-board-grid .detail-module-item {
    border-radius: 9px;
}

.detail-board-grid .module-copywriting {
    background: #fff8df;
    border-color: #f0d995;
}

.result-card {
    overflow: hidden;
}

.result-placeholder {
    background: #f8fafc;
}

.result-footer {
    border-top: 1px solid var(--pro-line-2);
}

.btn-download {
    background: var(--pro-green);
}

.btn-download:hover {
    background: #0b845b;
}

.at-dropdown {
    border-color: var(--pro-line);
    box-shadow: var(--pro-shadow);
}

@media (prefers-reduced-motion: no-preference) {
    .selection-card,
    .result-card,
    .upload-box,
    .generate-btn,
    .btn {
        transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    }
}

/* Board workspace skin: global UI refresh */
:root {
    --board-bg: #eef2f6;
    --panel-bg: #ffffff;
    --panel-soft: #f8fafc;
    --line: #dbe3ec;
    --line-strong: #c8d2df;
    --ink: #162033;
    --muted: #64748b;
    --soft: #94a3b8;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --success: #0f9f6e;
    --danger: #dc2626;
    --warn-bg: #fff7df;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 14px 34px rgba(15, 23, 42, 0.08);
}

body {
    background:
        linear-gradient(180deg, #f7f9fc 0%, var(--board-bg) 260px),
        var(--board-bg);
    color: var(--ink);
}

.header {
    background: #111827;
    border-bottom: none;
    padding: 14px 0;
    color: #fff;
}

.header-content {
    max-width: 1520px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header h1 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 3px;
    letter-spacing: 0;
}

.header p {
    color: #aab4c3;
    font-size: 12px;
}

.steps-bar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
    box-shadow: var(--shadow-sm);
}

.steps-container {
    max-width: 760px;
}

.steps-container::before {
    top: 14px;
    background: #d9e1eb;
}

.step-item {
    background: #fff;
    padding: 0 14px;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border-color: var(--line);
    color: var(--muted);
    margin-bottom: 6px;
}

.step-item.active .step-number {
    background: var(--accent);
    border-color: var(--accent);
}

.step-item.completed .step-number {
    background: var(--success);
    border-color: var(--success);
}

.step-label {
    color: var(--muted);
}

.main-container {
    max-width: 1520px;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 22px;
    padding: 24px 36px 36px;
}

.config-panel,
.content-area {
    background: rgba(255,255,255,0.96);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.config-panel {
    border-radius: 10px;
    padding: 16px;
    top: 18px;
}

.config-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #edf1f6;
}

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

.config-title {
    color: #334155;
    font-size: 12px;
    letter-spacing: 0;
    margin-bottom: 8px;
}

.upload-box,
.upload-box-small {
    background: #f8fafc;
    border-color: #cbd5e1;
    border-radius: 8px;
}

.upload-box {
    padding: 26px 18px;
}

.upload-box:hover,
.upload-box-small:hover {
    border-color: var(--accent);
    background: #f1f6ff;
}

.upload-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.upload-text,
.upload-hint {
    color: var(--muted);
}

.tabs {
    background: #eef2f7;
    padding: 4px;
    border-radius: 8px;
    gap: 4px;
}

.tab-btn {
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.7);
}

.tab-btn.active {
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.select-box,
.input-box,
.text-input,
.text-input-large,
.at-editor,
.tag-input {
    border-color: var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
}

.input-box {
    min-height: 84px;
}

.select-box:focus,
.input-box:focus,
.text-input:focus,
.text-input-large:focus,
.at-editor:focus,
.tag-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.generate-btn,
.btn-primary {
    background: var(--accent);
    border-radius: 7px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.generate-btn:hover,
.btn-primary:hover {
    background: var(--accent-dark);
}

.generate-btn:disabled,
.btn-primary:disabled {
    background: #cbd5e1;
    box-shadow: none;
}

.btn-secondary {
    background: #eef2f7;
    color: #334155;
}

.btn-secondary:hover {
    background: #dfe7f1;
}

.btn-text {
    color: var(--accent);
    font-weight: 600;
}

.btn-text:hover {
    background: #eaf1ff;
}

.content-area {
    border-radius: 10px;
    padding: 24px;
    min-height: 680px;
}

.content-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
}

.content-desc {
    color: var(--muted);
}

.empty-state,
.loading-state {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    margin-top: 12px;
}

.empty-icon {
    opacity: 0.45;
}

.spinner,
.placeholder-spinner {
    border-color: #dbe3ec;
    border-top-color: var(--accent);
}

.loading-text {
    color: var(--ink);
    font-weight: 600;
}

.loading-hint,
.empty-text {
    color: var(--muted);
}

.analysis-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.analysis-card h3 {
    color: #334155;
}

.analysis-card h3::before {
    background: var(--accent);
}

.tag {
    background: #eaf1ff;
    color: #1e3a8a;
    border: 1px solid #c7d8ff;
    border-radius: 6px;
}

.tag:hover {
    background: #dce9ff;
}

.tag .tag-delete {
    color: #1e3a8a;
}

.selections-grid {
    gap: 16px;
}

.selection-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    padding: 16px;
}

.selection-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.selection-card.selected {
    border-color: var(--accent);
    border-width: 1px;
    background: #f8fbff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), var(--shadow-sm);
}

.selection-name {
    color: var(--ink);
}

.selection-confidence {
    color: #1e3a8a;
    background: #eaf1ff;
    border-radius: 999px;
}

.selection-desc {
    color: var(--muted);
}

.copy-preview {
    background: var(--warn-bg);
    border: 1px solid #f3df9e;
    border-radius: 7px;
}

.count-selector {
    border-top-color: #edf1f6;
}

.count-btn {
    border-radius: 6px;
}

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

.results-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.result-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.result-placeholder {
    background: #f8fafc;
}

.result-footer {
    border-top: 1px solid #edf1f6;
    background: #fff;
}

.btn-download {
    background: var(--success);
    border-radius: 7px;
}

.btn-download:hover {
    background: #0b845b;
}

.result-error {
    background: #fff1f2;
}

.error-icon {
    color: var(--danger);
}

.error-text {
    color: var(--danger);
}

.style-ref-item {
    border-radius: 7px;
    border-color: var(--line);
}

.at-dropdown {
    border-color: var(--line);
    box-shadow: var(--shadow-md);
}

.at-dropdown-item:hover,
.at-dropdown-item.active {
    background: #eaf1ff;
}

/* 图片灯箱 */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    z-index: 1;
    line-height: 1;
}
.lightbox-close:hover {
    color: #ccc;
}
.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    cursor: default;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

/* 结果卡片图片可点击提示 */
.result-card img {
    cursor: zoom-in;
}

/* 文案字号选择器 */
.font-size-select {
    font-size: 10px;
    padding: 1px 4px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
}
.font-size-select:hover {
    border-color: #667eea;
}
.font-size-select:focus {
    outline: none;
    border-color: #667eea;
}
