diff --git a/css/pages/facilities.css b/css/pages/facilities.css index 0ec20a8..1f165fd 100644 --- a/css/pages/facilities.css +++ b/css/pages/facilities.css @@ -313,7 +313,7 @@ .modal-title { font-size: 32px; font-weight: 700; - margin-bottom: 16px; + margin-bottom: 0; line-height: 1.2; } @@ -491,3 +491,643 @@ padding: 60px 24px 20px; } } + +/* ========== Editor Modal ========== */ + +.title-with-action { + display: flex; + align-items: center; + gap: 16px; +} + +.btn-add-facility { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 8px 18px; + background: var(--accent-color); + color: #fff; + border: none; + border-radius: 20px; + font-size: 13px; + font-weight: 600; + cursor: pointer; + transition: var(--transition); + white-space: nowrap; +} + +.btn-add-facility:hover { + background: #005bb5; + transform: translateY(-1px); +} + +.modal-title-row { + display: flex; + justify-content: space-between; + align-items: flex-start; + gap: 16px; + margin-bottom: 16px; +} + +.btn-edit-facility { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 6px 16px; + background: transparent; + color: var(--accent-color); + border: 1.5px solid var(--accent-color); + border-radius: 18px; + font-size: 13px; + font-weight: 600; + cursor: pointer; + transition: var(--transition); + white-space: nowrap; + flex-shrink: 0; +} + +.btn-edit-facility:hover { + background: var(--accent-color); + color: #fff; +} + +/* Editor Modal Layout */ +.editor-modal-content { + background-color: #fff; + margin: 20px auto; + border-radius: var(--radius-large); + max-width: 1280px; + width: 95%; + padding: 0; + box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); + position: relative; + max-height: calc(100vh - 40px); + overflow: hidden; + display: flex; + flex-direction: column; +} + +.close-editor-modal, +.close-json-modal { + position: absolute; + top: 16px; + right: 20px; + font-size: 24px; + color: var(--text-secondary); + cursor: pointer; + transition: 0.2s; + z-index: 10; + background: rgba(255,255,255,0.9); + width: 36px; + height: 36px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; +} + +.close-editor-modal:hover, +.close-json-modal:hover { + background: #f0f0f0; + color: var(--text-primary); +} + +.editor-modal-header { + padding: 20px 28px; + border-bottom: 1px solid rgba(0,0,0,0.08); + background: linear-gradient(to bottom, #fff, #fafafa); + border-radius: var(--radius-large) var(--radius-large) 0 0; + flex-shrink: 0; +} + +.editor-modal-header h3 { + font-size: 22px; + font-weight: 700; + display: flex; + align-items: center; + gap: 10px; +} + +.editor-layout { + display: flex; + flex: 1; + overflow: hidden; + min-height: 0; +} + +.editor-preview { + flex: 0 0 45%; + display: flex; + flex-direction: column; + border-right: 1px solid rgba(0,0,0,0.08); + background: #f5f5f7; +} + +.editor-panel-title { + font-size: 12px; + font-weight: 700; + color: var(--text-secondary); + padding: 14px 24px; + border-bottom: 1px solid rgba(0,0,0,0.05); + display: flex; + align-items: center; + gap: 8px; + text-transform: uppercase; + letter-spacing: 0.6px; + flex-shrink: 0; + background: rgba(255,255,255,0.6); +} + +.editor-preview-content { + flex: 1; + overflow-y: auto; + padding: 20px; +} + +.editor-preview-content::-webkit-scrollbar, +.editor-form-scroll::-webkit-scrollbar { + width: 5px; +} + +.editor-preview-content::-webkit-scrollbar-track, +.editor-form-scroll::-webkit-scrollbar-track { + background: transparent; +} + +.editor-preview-content::-webkit-scrollbar-thumb, +.editor-form-scroll::-webkit-scrollbar-thumb { + background: rgba(0,0,0,0.12); + border-radius: 10px; +} + +/* Preview Card */ +.preview-facility { + background: #fff; + border-radius: 16px; + box-shadow: 0 2px 12px rgba(0,0,0,0.06); + overflow: hidden; +} + +.preview-header { + padding: 24px 24px 16px; + background: linear-gradient(to bottom, #fff, #fafafa); + border-bottom: 1px solid rgba(0,0,0,0.05); +} + +.preview-title { + font-size: 22px; + font-weight: 700; + margin-bottom: 12px; + line-height: 1.2; +} + +.preview-body { + padding: 20px 24px 24px; +} + +.preview-body .modal-section { + margin-top: 20px; +} + +.preview-body .modal-section-title { + font-size: 14px; +} + +.preview-intro { + font-size: 15px; + line-height: 1.6; + color: var(--text-primary); + margin-bottom: 20px; +} + +.text-secondary { + color: var(--text-secondary); +} + +/* Editor Form */ +.editor-form { + flex: 0 0 55%; + display: flex; + flex-direction: column; + min-width: 0; +} + +.editor-form-scroll { + flex: 1; + overflow-y: auto; + padding: 24px 28px 40px; +} + +.form-group { + margin-bottom: 22px; +} + +.form-group > label { + display: block; + font-size: 12px; + font-weight: 700; + color: var(--text-secondary); + margin-bottom: 8px; + text-transform: uppercase; + letter-spacing: 0.4px; +} + +.form-group input[type="text"], +.form-group input[type="number"], +.form-group textarea, +.form-group select { + width: 100%; + padding: 10px 14px; + border: 1.5px solid rgba(0,0,0,0.1); + border-radius: 12px; + font-size: 14px; + font-family: inherit; + background: #f9f9fa; + transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; + color: var(--text-primary); +} + +.form-group input:focus, +.form-group textarea:focus, +.form-group select:focus { + outline: none; + border-color: var(--accent-color); + background: #fff; + box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1); +} + +.form-group textarea { + resize: vertical; + min-height: 60px; +} + +.form-row { + display: flex; + gap: 14px; +} + +.form-row .form-group { + flex: 1; +} + +/* Tags Input */ +.tags-input-wrapper { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 8px; + padding: 8px 12px; + border: 1.5px solid rgba(0,0,0,0.1); + border-radius: 12px; + background: #f9f9fa; + transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; + cursor: text; +} + +.tags-input-wrapper:focus-within { + border-color: var(--accent-color); + background: #fff; + box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1); +} + +.tags-list { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.editor-tag { + display: inline-flex; + align-items: center; + gap: 6px; + background: var(--accent-color); + color: #fff; + padding: 4px 10px; + border-radius: 14px; + font-size: 12px; + font-weight: 600; +} + +.editor-tag-remove { + cursor: pointer; + opacity: 0.7; + transition: 0.2s; + font-size: 10px; +} + +.editor-tag-remove:hover { + opacity: 1; +} + +.tags-input-wrapper input { + border: none !important; + background: transparent !important; + padding: 4px 0 !important; + font-size: 13px; + flex: 1; + min-width: 140px; + box-shadow: none !important; +} + +.tags-input-wrapper input:focus { + outline: none; +} + +/* Sortable List */ +.sortable-list { + min-height: 8px; + margin-bottom: 10px; +} + +.sortable-item { + display: flex; + align-items: flex-start; + gap: 10px; + padding: 10px 12px; + margin-bottom: 8px; + background: #fff; + border: 1.5px solid rgba(0,0,0,0.08); + border-radius: 12px; + transition: box-shadow 0.2s, border-color 0.2s, opacity 0.2s; +} + +.sortable-item:last-child { + margin-bottom: 0; +} + +.sortable-item:hover { + border-color: rgba(0,0,0,0.15); + box-shadow: 0 2px 8px rgba(0,0,0,0.04); +} + +.sortable-item.dragging { + opacity: 0.4; + border-color: var(--accent-color); +} + +.sortable-item.drag-over { + border-color: var(--accent-color); + box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.15); +} + +.drag-handle { + cursor: grab; + color: var(--text-secondary); + padding: 6px 2px; + font-size: 14px; + opacity: 0.35; + transition: 0.2s; + flex-shrink: 0; +} + +.drag-handle:active { + cursor: grabbing; +} + +.sortable-item:hover .drag-handle { + opacity: 0.7; +} + +.item-type-badge { + font-size: 10px; + font-weight: 700; + padding: 3px 8px; + border-radius: 6px; + white-space: nowrap; + flex-shrink: 0; + margin-top: 6px; + text-transform: uppercase; + letter-spacing: 0.3px; +} + +.badge-text { + background: #e8f5e9; + color: #2e7d32; +} + +.badge-image { + background: #e3f2fd; + color: #1565c0; +} + +.sortable-item .item-content { + flex: 1; + border: 1px solid rgba(0,0,0,0.06) !important; + border-radius: 8px !important; + padding: 8px 10px !important; + font-size: 13px !important; + background: #fafafa !important; + min-height: unset; + font-family: inherit; + resize: vertical; +} + +.sortable-item .item-content:focus { + border-color: var(--accent-color) !important; + background: #fff !important; + box-shadow: none !important; +} + +.remove-item-btn { + background: none; + border: none; + color: #ccc; + cursor: pointer; + padding: 6px; + border-radius: 8px; + transition: 0.2s; + flex-shrink: 0; + margin-top: 3px; + font-size: 13px; +} + +.remove-item-btn:hover { + color: #ef4444; + background: #fef2f2; +} + +.add-item-row { + display: flex; + gap: 8px; +} + +.add-item-btn { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 8px 14px; + background: #f5f5f7; + border: 1.5px dashed rgba(0,0,0,0.12); + border-radius: 10px; + font-size: 12px; + font-weight: 600; + color: var(--text-secondary); + cursor: pointer; + transition: var(--transition); +} + +.add-item-btn:hover { + border-color: var(--accent-color); + color: var(--accent-color); + background: #f0f7ff; +} + +/* Editor Actions */ +.editor-actions { + margin-top: 28px; + padding-top: 20px; + border-top: 1px solid rgba(0,0,0,0.08); + display: flex; + justify-content: flex-end; +} + +.btn-save-facility { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 12px 28px; + background: var(--brand-green); + color: #fff; + border: none; + border-radius: 14px; + font-size: 15px; + font-weight: 700; + cursor: pointer; + transition: var(--transition); +} + +.btn-save-facility:hover { + background: #2db84d; + transform: translateY(-1px); + box-shadow: 0 4px 16px rgba(52, 199, 89, 0.3); +} + +/* JSON Output Modal */ +.json-output-content { + background-color: #fff; + margin: 60px auto; + border-radius: var(--radius-large); + max-width: 640px; + width: 90%; + padding: 36px; + box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); + position: relative; +} + +.json-output-content h3 { + font-size: 20px; + font-weight: 700; + margin-bottom: 8px; + display: flex; + align-items: center; + gap: 10px; +} + +.json-output-hint { + font-size: 14px; + color: var(--text-secondary); + margin-bottom: 20px; + line-height: 1.5; +} + +#json-output { + width: 100%; + height: 300px; + padding: 16px; + border: 1.5px solid rgba(0,0,0,0.1); + border-radius: 12px; + font-family: 'Courier New', Courier, monospace; + font-size: 12px; + background: #f5f5f7; + color: var(--text-primary); + resize: vertical; + margin-bottom: 16px; +} + +#json-output:focus { + outline: none; + border-color: var(--accent-color); +} + +.btn-copy-json { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 10px 24px; + background: var(--accent-color); + color: #fff; + border: none; + border-radius: 12px; + font-size: 14px; + font-weight: 600; + cursor: pointer; + transition: var(--transition); + width: 100%; + justify-content: center; +} + +.btn-copy-json:hover { + background: #005bb5; +} + +/* ========== Editor Responsive ========== */ + +@media (max-width: 900px) { + .editor-modal-content { + margin: 0; + width: 100%; + max-width: 100%; + max-height: 100%; + height: 100%; + border-radius: 0; + } + + .editor-layout { + flex-direction: column; + } + + .editor-preview { + flex: none; + max-height: 35vh; + border-right: none; + border-bottom: 1px solid rgba(0,0,0,0.08); + } + + .editor-form { + flex: 1; + min-height: 0; + } + + .form-row { + flex-direction: column; + gap: 0; + } + + .close-editor-modal { + top: 12px; + right: 14px; + } +} + +@media (max-width: 768px) { + .title-with-action { + flex-wrap: wrap; + gap: 10px; + } + + .json-output-content { + margin: 0; + width: 100%; + height: 100%; + max-height: 100%; + border-radius: 0; + } + + .editor-modal-header { + padding: 16px 20px; + } + + .editor-form-scroll { + padding: 20px; + } +} diff --git a/facilities.html b/facilities.html index a476df1..6e64c24 100644 --- a/facilities.html +++ b/facilities.html @@ -26,7 +26,12 @@
${escapeHtml(intro)}
`; + + // Location + html += `${dimensionText}: X: ${escapeHtml(x)}, Y: ${escapeHtml(y)}, Z: ${escapeHtml(z)}
`; + html += `${escapeHtml(block.content) || '空文字'}
`; + } else { + html += block.content ? `空图片
'; + } + }); + } else { + html += `无
`; + } + html += `${escapeHtml(block.content) || '空文字'}
`; + } else { + html += block.content ? `空图片
'; + } + }); + } else { + html += `无
`; + } + html += `