/* Trip 3D - 3D模型创作页面样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #fafafa; overflow: hidden; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.18); }

.page-container { width: 100vw; height: 100vh; margin: 0; padding: 2px; display: flex; flex-direction: column; overflow: hidden; background: #fafafa; }
.editor-container { flex: 1; display: flex; gap: 0; min-height: 0; }

/* 控制面板 */
.control-panel { width: 350px; background: #fff; padding: 20px; border-right: 1px solid rgba(0,0,0,0.06); overflow-y: auto; flex-shrink: 0; }
.panel-title { font-size: 18px; font-weight: 600; margin-bottom: 0; padding-bottom: 10px; border-bottom: 1px solid rgba(0,0,0,0.06); color: #333; }

.form-group { margin-bottom: 0; padding: 16px 0; border-bottom: 1px solid rgba(0,0,0,0.06); }
.form-group:last-child { border-bottom: none; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #333; font-size: 13px; }

.form-control { width: 100%; padding: 12px 15px; border: 1px solid rgba(0,0,0,0.1); border-radius: 8px; font-size: 14px; transition: all 0.2s; font-family: inherit; background: rgba(0,0,0,0.03); color: #444; resize: vertical; }
.form-control:focus { outline: none; border-color: #3444fe; background: rgba(0,0,0,0.06); box-shadow: 0 0 0 2px rgba(52,68,254,0.2); }
.form-control::placeholder { color: rgba(0,0,0,0.25); }

/* 类型选择器 */
.type-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-btn { padding: 10px; border: 2px solid rgba(0,0,0,0.08); border-radius: 8px; background: rgba(0,0,0,0.03); color: #555; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; text-align: center; }
.type-btn:hover { border-color: rgba(52,68,254,0.3); color: #3444fe; }
.type-btn.active { border-color: #3444fe; background: rgba(52,68,254,0.08); color: #3444fe; font-weight: 600; }

/* 图片上传 */
.upload-area-compact { border: 2px dashed rgba(0,0,0,0.12); border-radius: 10px; padding: 24px; text-align: center; cursor: pointer; transition: all 0.2s; background: rgba(0,0,0,0.02); }
.upload-area-compact:hover { border-color: #3444fe; background: rgba(52,68,254,0.03); }
.upload-plus-icon { font-size: 24px; display: block; margin-bottom: 6px; }
.upload-text { font-size: 12px; color: #999; }

.uploaded-preview { position: relative; border-radius: 10px; overflow: hidden; margin-top: 10px; }
.uploaded-preview img { width: 100%; max-height: 200px; object-fit: cover; border-radius: 10px; }
.remove-image-btn { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; border: none; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; }

/* 提示词 */
.prompt-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.prompt-label-row label { margin-bottom: 0; }
.char-count { font-size: 12px; color: #999; }

/* 材质选项 */
.texture-options { display: flex; flex-direction: column; gap: 8px; }
.texture-option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid rgba(0,0,0,0.08); border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.texture-option:hover { border-color: rgba(52,68,254,0.3); }
.texture-option input[type="radio"] { accent-color: #3444fe; }
.texture-option input[type="radio"]:checked ~ .texture-label { color: #3444fe; font-weight: 600; }
.texture-label { font-size: 13px; color: #555; flex: 1; }
.texture-price { font-size: 12px; color: #3444fe; font-weight: 600; }

/* 生成按钮 */
.generate-btn { width: 100%; background: linear-gradient(135deg, #3444fe 0%, #2a36cb 100%); color: #fff; border: none; padding: 16px 24px; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; }
.generate-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.generate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-power { background: rgba(255,255,255,0.2); padding: 2px 10px; border-radius: 12px; font-size: 13px; }

/* 预览面板 */
.preview-panel { flex: 1; background: #fff; display: flex; flex-direction: column; min-width: 0; }
.preview-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.06); flex-shrink: 0; }
.preview-header h3 { font-size: 16px; font-weight: 600; color: #333; }
.preview-actions { display: flex; gap: 10px; }
.action-btn { padding: 8px 16px; background: rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.1); border-radius: 6px; color: #444; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.action-btn:hover { background: rgba(52,68,254,0.08); color: #3444fe; border-color: rgba(52,68,254,0.3); }

.preview-content { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; overflow: hidden; background: #fafafa; }
.preview-placeholder { text-align: center; color: #999; }
.placeholder-icon { font-size: 48px; display: block; margin-bottom: 16px; color: #ccc; }
.placeholder-icon svg { width: 48px; height: 48px; }
.preview-placeholder p { font-size: 16px; margin-bottom: 4px; }
.placeholder-hint { font-size: 13px; color: #bbb; }

/* 3D模型查看器 */
model-viewer { width: 100%; height: 100%; min-height: 400px; background-color: #fafafa; border-radius: 12px; --poster-color: transparent; }
.model-rendered-image { max-width: 100%; max-height: calc(100vh - 200px); object-fit: contain; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); }

/* 进度条 */
.generation-progress-inline { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 300px; margin: 0 20px; }
.progress-bar-inline { flex: 1; height: 6px; background: rgba(0,0,0,0.08); border-radius: 3px; overflow: hidden; }
.progress-fill-inline { height: 100%; background: linear-gradient(90deg, #3444fe, #2a36cb); width: 0%; transition: width 0.3s; }
.progress-text-inline { color: #3444fe; font-size: 13px; font-weight: 500; white-space: nowrap; }

/* 历史面板 */
.history-panel { width: 300px; background: #fff; border-left: 1px solid rgba(0,0,0,0.06); display: flex; flex-direction: column; flex-shrink: 0; padding-top: 50px; /* 🔥 避开父页面固定 nav-right */ }
.history-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.history-header h3 { font-size: 14px; font-weight: 600; color: #333; }
.clear-history-btn { background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px; }
/* 全局隐藏「生成历史/处理历史」标题区（含标题文字 + 清空按钮） */
.history-header { display: none !important; }
.history-list { flex: 1; overflow-y: auto; padding: 8px; }

.history-item { background: rgba(0,0,0,0.03); border-radius: 8px; padding: 12px; margin-bottom: 12px; cursor: pointer; transition: all 0.2s ease; border: 1px solid transparent; position: relative; }
.history-item:hover { background: rgba(52, 68, 254, 0.1); border-color: rgba(52, 68, 254, 0.3); }
.history-item-content { display: flex; flex-direction: column; gap: 4px; }

/* 删除按钮 */
.history-delete-btn { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.5); border: none; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 12px; opacity: 0; transition: all 0.2s ease; z-index: 10; }
.history-item:hover .history-delete-btn { opacity: 0.7; }
.history-delete-btn:hover { opacity: 1 !important; background: rgba(255,0,0,0.6); }

/* 缩略图 */
.history-thumbnail { width: 100%; border-radius: 6px; overflow: hidden; background: rgba(0,0,0,0.04); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.history-thumbnail img { width: 100%; height: auto; object-fit: contain; }
.history-thumbnail .no-preview { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }

/* 处理中指示器 */
.processing-indicator { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px; color: #3444fe; font-size: 12px; width: 100%; height: 100%; }
.processing-spinner { width: 24px; height: 24px; border: 2px solid rgba(52,68,254,0.2); border-top-color: #3444fe; border-radius: 50%; animation: spin3d 0.8s linear infinite; }
@keyframes spin3d { to { transform: rotate(360deg); } }

/* 失败指示器 */
.failed-indicator { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #e53935; font-size: 12px; width: 100%; height: 100%; }

.history-prompt { font-size: 12px; color: #666; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-time { font-size: 11px; color: #999; }
.history-model-name { font-size: 11px; color: #999; margin-top: 2px; }

/* 响应式 */
@media (max-width: 900px) {
    body { overflow-x: hidden; }
    .page-container { height: auto; min-height: 100vh; overflow-y: auto; }
    .editor-container { flex-direction: column; }
    .control-panel { width: 100%; order: 1; }
    .preview-panel { width: 100%; order: 2; min-height: 400px; }
    .history-panel { width: 100%; order: 3; max-height: 400px; }
    .form-control { font-size: 16px; }
}

