flash555588_ai-model-workbench/styles.css
flash555588 c877142beb fix: address Sourcery review feedback on PR #8
- styles.css: use var(--ai3d-embed-height, 300px) for embed canvas height
- helper-buttons.ts: add .catch() to clipboard writeText/write calls
- helper-buttons.ts: add FileReader onerror/onabort handlers
- app.ts: add .catch() to clipboard writeText fallback
- log.ts: restore console.info for Logger.info() (preserve log-level semantics)
- command-discovery.ts: guard process.platform/env with typeof check for mobile safety
2026-05-10 10:46:32 +08:00

1373 lines
27 KiB
CSS

/* ===== AI 3D Model Workbench — Obsidian-native Design ===== */
/* --- Utility Classes --- */
.is-hidden {
display: none !important;
}
.ai3d-canvas-full {
width: 100%;
height: 100%;
display: block;
}
.ai3d-settings-diagnostics {
margin-top: 0.5rem;
}
.ai3d-settings-status-block {
margin-bottom: 0.9rem;
}
.ai3d-annot-btn {
position: relative;
}
.ai3d-btn-active {
color: var(--interactive-accent);
}
.ai3d-res-btn {
font-size: 10px;
font-weight: 600;
min-width: 32px;
}
/* --- Layout --- */
.ai3d-workbench {
--ai3d-spacing: var(--size-4-3);
--ai3d-radius: var(--radius-s);
--ai3d-radius-l: var(--radius-l);
padding: var(--ai3d-spacing);
display: flex;
flex-direction: column;
gap: var(--ai3d-spacing);
height: 100%;
overflow-y: auto;
}
/* --- Section --- */
.ai3d-section {
border: 1px solid var(--background-modifier-border);
border-radius: var(--ai3d-radius-l);
background: var(--background-primary);
}
.ai3d-section-header {
padding: var(--ai3d-spacing) var(--ai3d-spacing) 0;
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: var(--size-4-2);
}
.ai3d-section-title {
font-size: var(--font-ui-small);
font-weight: 600;
color: var(--text-normal);
line-height: 1.4;
}
.ai3d-section-subtitle {
font-size: var(--font-ui-smaller);
color: var(--text-muted);
margin-top: 2px;
line-height: 1.4;
}
.ai3d-section-body {
padding: var(--ai3d-spacing);
display: flex;
flex-direction: column;
gap: var(--ai3d-spacing);
}
/* --- Model Status --- */
.ai3d-model-status {
display: flex;
align-items: center;
gap: var(--size-4-2);
padding: var(--size-4-2) var(--ai3d-spacing);
border-radius: var(--ai3d-radius);
background: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
min-height: 36px;
}
.ai3d-model-name {
font-size: var(--font-ui-small);
font-weight: 600;
color: var(--text-normal);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1;
min-width: 0;
}
.ai3d-model-meta {
font-size: var(--font-ui-smaller);
color: var(--text-muted);
white-space: nowrap;
}
.ai3d-status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--text-muted);
flex-shrink: 0;
}
.ai3d-status-dot.is-active {
background: var(--color-green);
}
.ai3d-status-dot.is-loading {
background: var(--color-yellow);
animation: ai3d-pulse 1.2s ease-in-out infinite;
}
.ai3d-status-dot.is-error {
background: var(--color-red);
}
@keyframes ai3d-pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.4; }
}
/* --- Toolbar --- */
.ai3d-toolbar {
display: flex;
gap: var(--size-4-1);
flex-wrap: wrap;
}
.ai3d-toolbar .clickable-icon {
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--ai3d-radius);
color: var(--text-muted);
cursor: pointer;
transition: color 0.15s ease, background 0.15s ease;
}
.ai3d-toolbar .clickable-icon:hover {
color: var(--text-normal);
background: var(--background-modifier-hover);
}
/* --- Preview Host --- */
.ai3d-preview-host {
min-height: var(--min-height, clamp(200px, 30vh, 400px));
max-width: var(--max-width, none);
border-radius: var(--ai3d-radius) var(--ai3d-radius) 0 0;
border: 1px solid var(--background-modifier-border);
overflow: hidden;
background: var(--background-secondary);
position: relative;
}
.ai3d-preview-host canvas {
width: 100%;
height: 100%;
display: block;
}
/* --- Empty / Loading States --- */
.ai3d-empty-state {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: var(--ai3d-spacing);
text-align: center;
gap: var(--size-4-2);
color: var(--text-muted);
}
.ai3d-empty-icon {
font-size: 28px;
opacity: 0.5;
}
.ai3d-empty-title {
font-size: var(--font-ui-small);
font-weight: 600;
color: var(--text-muted);
}
.ai3d-empty-text {
font-size: var(--font-ui-smaller);
color: var(--text-faint);
max-width: 240px;
line-height: 1.45;
}
.ai3d-inline-empty {
padding: var(--ai3d-spacing);
text-align: center;
color: var(--text-muted);
font-size: var(--font-ui-small);
line-height: 1.5;
}
/* --- File Path --- */
.ai3d-file-path {
font-size: var(--font-ui-smaller);
color: var(--text-faint);
word-break: break-all;
line-height: 1.4;
margin: 0;
}
/* --- Preview Summary Grid --- */
.ai3d-summary-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--size-4-1);
}
.ai3d-summary-item {
padding: var(--size-4-2);
border-radius: var(--ai3d-radius);
background: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
}
.ai3d-summary-label {
font-size: var(--font-ui-smaller);
color: var(--text-muted);
margin-bottom: 2px;
}
.ai3d-summary-value {
font-size: var(--font-ui-small);
font-weight: 600;
color: var(--text-normal);
}
/* --- Fields (form inputs) --- */
.ai3d-field {
display: flex;
flex-direction: column;
gap: var(--size-4-1);
}
.ai3d-field-label {
font-size: var(--font-ui-smaller);
font-weight: 600;
color: var(--text-muted);
}
.ai3d-input,
.ai3d-textarea {
width: 100%;
box-sizing: border-box;
border-radius: var(--ai3d-radius);
border: 1px solid var(--background-modifier-border);
background: var(--background-primary);
color: var(--text-normal);
font-size: var(--font-ui-small);
padding: var(--size-4-2) var(--size-4-3);
transition: border-color 0.15s ease;
}
.ai3d-input:focus,
.ai3d-textarea:focus {
border-color: var(--interactive-accent);
outline: none;
box-shadow: 0 0 0 1px var(--interactive-accent);
}
.ai3d-textarea {
resize: vertical;
min-height: 72px;
font-family: inherit;
}
/* --- Tag Chips --- */
.ai3d-tag-section {
display: flex;
flex-direction: column;
gap: var(--size-4-2);
}
.ai3d-tag-section-title {
font-size: var(--font-ui-smaller);
font-weight: 600;
color: var(--text-muted);
}
.ai3d-tag-list {
display: flex;
flex-wrap: wrap;
gap: var(--size-4-1);
}
.ai3d-tag-chip {
padding: 2px var(--size-4-2);
border-radius: var(--ai3d-radius);
border: 1px solid var(--background-modifier-border);
background: var(--background-secondary);
color: var(--text-normal);
font-size: var(--font-ui-smaller);
font-weight: 500;
line-height: 1.5;
}
.ai3d-tag-chip.is-accent {
background: var(--interactive-accent);
color: var(--text-on-accent);
border-color: transparent;
}
.ai3d-tag-empty {
font-size: var(--font-ui-smaller);
color: var(--text-faint);
font-style: italic;
}
/* --- Note Card --- */
.ai3d-note-card {
padding: var(--ai3d-spacing);
border-radius: var(--ai3d-radius);
background: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
display: flex;
flex-direction: column;
gap: var(--size-4-2);
}
.ai3d-note-row {
display: flex;
align-items: baseline;
gap: var(--size-4-2);
font-size: var(--font-ui-small);
line-height: 1.5;
}
.ai3d-note-label {
color: var(--text-muted);
white-space: nowrap;
flex-shrink: 0;
}
.ai3d-note-value {
color: var(--text-normal);
word-break: break-all;
}
/* --- Hint Text --- */
.ai3d-hint {
font-size: var(--font-ui-smaller);
color: var(--text-muted);
line-height: 1.5;
margin: 0;
}
/* --- Actions Row --- */
.ai3d-actions {
display: flex;
gap: var(--size-4-2);
flex-wrap: wrap;
}
/* --- Divider --- */
.ai3d-divider {
height: 1px;
background: var(--background-modifier-border);
margin: var(--size-4-1) 0;
}
/* --- Disassembly Controls --- */
.ai3d-disassemble-controls {
display: flex;
flex-direction: column;
gap: var(--size-4-2);
padding: var(--ai3d-spacing);
border-radius: var(--ai3d-radius);
background: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
}
.ai3d-slider-row {
display: flex;
align-items: center;
gap: var(--size-4-3);
}
.ai3d-slider-label {
font-size: var(--font-ui-smaller);
color: var(--text-muted);
white-space: nowrap;
min-width: 80px;
}
.ai3d-slider-value {
font-size: var(--font-ui-smaller);
color: var(--text-normal);
font-weight: 600;
min-width: 36px;
text-align: right;
}
.ai3d-slider {
flex: 1;
height: 4px;
-webkit-appearance: none;
appearance: none;
background: var(--background-modifier-border);
border-radius: 2px;
outline: none;
cursor: pointer;
}
.ai3d-slider::-webkit-slider-thumb {
-webkit-appearance: none;
width: 14px;
height: 14px;
border-radius: 50%;
background: var(--interactive-accent);
cursor: pointer;
transition: transform 0.1s ease;
}
.ai3d-slider::-webkit-slider-thumb:hover {
transform: scale(1.2);
}
.ai3d-axis-buttons {
display: flex;
gap: var(--size-4-1);
}
.ai3d-axis-btn {
padding: 2px 10px;
border-radius: var(--ai3d-radius);
border: 1px solid var(--background-modifier-border);
background: var(--background-primary);
color: var(--text-muted);
font-size: var(--font-ui-smaller);
font-weight: 600;
cursor: pointer;
transition: all 0.15s ease;
}
.ai3d-axis-btn:hover {
border-color: var(--text-muted);
color: var(--text-normal);
}
.ai3d-axis-btn.is-active {
background: var(--interactive-accent);
color: var(--text-on-accent);
border-color: transparent;
}
/* --- Piece Tags --- */
.ai3d-piece-list {
max-height: 200px;
overflow-y: auto;
border: 1px solid var(--background-modifier-border);
border-radius: var(--ai3d-radius);
}
.ai3d-piece-item {
display: flex;
align-items: center;
gap: var(--size-4-2);
padding: var(--size-4-1) var(--size-4-2);
font-size: var(--font-ui-small);
cursor: pointer;
transition: background 0.1s ease;
border-bottom: 1px solid var(--background-modifier-border);
}
.ai3d-piece-item:last-child {
border-bottom: none;
}
.ai3d-piece-item:hover {
background: var(--background-modifier-hover);
}
.ai3d-piece-item.is-selected {
background: var(--background-modifier-active-hover);
}
.ai3d-piece-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--text-faint);
flex-shrink: 0;
}
.ai3d-piece-item.is-tagged .ai3d-piece-dot {
background: var(--color-green);
}
.ai3d-piece-name {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ai3d-piece-tag-count {
font-size: var(--font-ui-smaller);
color: var(--text-faint);
}
.ai3d-piece-tag-editor {
display: flex;
flex-direction: column;
gap: var(--size-4-2);
padding: var(--ai3d-spacing);
border-radius: var(--ai3d-radius);
background: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
}
.ai3d-piece-tag-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: var(--size-4-2);
}
.ai3d-piece-tag-title {
font-size: var(--font-ui-small);
font-weight: 600;
color: var(--text-normal);
}
/* --- CM6 Widget: re-enable pointer events blocked by CodeMirror --- */
.ai3d-cm-widget,
.ai3d-inline-wrapper {
pointer-events: auto;
}
.ai3d-inline-toolbar,
.ai3d-inline-toolbar button,
.ai3d-inline-toolbar input,
.ai3d-helper-toolbar,
.ai3d-helper-toolbar button {
pointer-events: auto;
}
/* --- Inline Controls Toolbar --- */
.ai3d-inline-toolbar {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 10px;
background: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
border-radius: 8px 8px 0 0;
flex-wrap: wrap;
font-size: 12px;
}
.ai3d-inline-label {
color: var(--text-muted);
white-space: nowrap;
font-size: 11px;
}
.ai3d-inline-value {
color: var(--text-normal);
font-weight: 600;
min-width: 30px;
text-align: right;
font-size: 11px;
}
.ai3d-inline-slider {
flex: 1;
min-width: 60px;
height: 3px;
-webkit-appearance: none;
appearance: none;
background: var(--background-modifier-border);
border-radius: 2px;
outline: none;
cursor: pointer;
}
.ai3d-inline-slider::-webkit-slider-thumb {
-webkit-appearance: none;
width: 12px;
height: 12px;
border-radius: 50%;
background: var(--interactive-accent);
cursor: pointer;
}
.ai3d-inline-axis-btn,
.ai3d-inline-reset-btn {
padding: 2px 8px;
border-radius: var(--radius-s);
border: 1px solid var(--background-modifier-border);
background: var(--background-primary);
color: var(--text-muted);
font-size: 11px;
font-weight: 600;
cursor: pointer;
transition: all 0.15s ease;
}
.ai3d-inline-axis-btn:hover,
.ai3d-inline-reset-btn:hover {
border-color: var(--text-muted);
color: var(--text-normal);
}
.ai3d-inline-axis-btn.is-active {
background: var(--interactive-accent);
color: var(--text-on-accent);
border-color: transparent;
}
/* --- Inline Helper Toolbar (outside preview) --- */
.ai3d-helper-toolbar {
position: relative;
display: flex;
justify-content: flex-end;
gap: 4px;
padding: 4px 2px;
margin-top: -1px;
border: 1px solid var(--background-modifier-border);
border-top: none;
border-radius: 0 0 var(--radius-s) var(--radius-s);
background: var(--background-secondary);
}
.ai3d-inline-btn {
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
border: none;
border-radius: var(--radius-s);
background: var(--background-primary);
color: var(--text-muted);
cursor: pointer;
transition: color 0.15s ease, background 0.15s ease;
padding: 0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.ai3d-inline-btn:hover {
color: var(--text-normal);
background: var(--background-modifier-hover);
}
.ai3d-inline-btn svg {
width: 14px;
height: 14px;
}
/* --- Grid Host (3dgrid) --- */
.ai3d-grid-host {
height: var(--grid-height, auto);
border-radius: var(--ai3d-radius) var(--ai3d-radius) 0 0;
border: 1px solid var(--background-modifier-border);
overflow: hidden;
background: var(--background-secondary);
position: relative;
max-height: clamp(250px, 40vh, 450px);
}
.ai3d-grid-host canvas {
width: 100%;
height: 100%;
display: block;
}
/* --- JSON Config Error --- */
.ai3d-json-error {
padding: var(--ai3d-spacing);
border-radius: var(--radius-s);
background: var(--background-modifier-error);
border: 1px solid var(--color-red);
color: var(--text-normal);
font-size: var(--font-ui-small);
}
.ai3d-json-error pre {
margin: 0;
white-space: pre-wrap;
word-break: break-word;
font-family: var(--font-monospace);
font-size: var(--font-ui-smaller);
color: var(--text-muted);
}
/* --- Tooltip --- */
.ai3d-tooltip {
position: absolute;
bottom: calc(100% + 6px);
left: 50%;
transform: translateX(-50%);
padding: 3px 8px;
border-radius: var(--radius-s);
background: var(--background-primary);
color: var(--text-normal);
font-size: 11px;
white-space: nowrap;
pointer-events: none;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
animation: ai3d-fade-in 0.15s ease;
}
@keyframes ai3d-fade-in {
from { opacity: 0; transform: translateX(-50%) translateY(4px); }
to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
/* --- Direct File View --- */
.ai3d-direct-view {
height: 100%;
display: flex;
flex-direction: column;
}
.ai3d-direct-view .ai3d-preview-host {
flex: 1;
min-height: 300px;
}
/* --- Responsive: Narrow Sidebar --- */
@media (max-width: 400px) {
.ai3d-summary-grid {
grid-template-columns: repeat(2, 1fr);
}
.ai3d-preview-host {
min-height: 240px;
}
}
/* --- Live Preview Embed --- */
.ai3d-embed-preview {
position: relative;
width: 100%;
border-radius: var(--radius-s);
overflow: hidden;
border: 1px solid var(--background-modifier-border);
background: var(--background-primary);
}
.ai3d-embed-canvas {
display: block;
width: 100%;
height: var(--ai3d-embed-height, 300px);
touch-action: none;
}
.ai3d-embed-loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: var(--text-muted);
font-size: var(--font-ui-small);
}
.ai3d-embed-error {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: var(--text-error);
font-size: var(--font-ui-small);
text-align: center;
padding: 8px;
}
/* --- Loading Overlay --- */
.ai3d-loading-overlay {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 12px;
background: color-mix(in srgb, var(--background-primary) 85%, transparent);
z-index: 10;
pointer-events: none;
transition: opacity 0.3s ease;
}
.ai3d-loading-overlay.is-hiding {
opacity: 0;
}
.ai3d-loading-spinner {
width: 28px;
height: 28px;
border: 3px solid var(--background-modifier-border);
border-top-color: var(--interactive-accent);
border-radius: 50%;
animation: ai3d-spin 0.8s linear infinite;
}
@keyframes ai3d-spin {
to { transform: rotate(360deg); }
}
.ai3d-loading-text {
color: var(--text-muted);
font-size: var(--font-ui-small);
text-align: center;
}
.ai3d-loading-bar-track {
width: 160px;
height: 3px;
border-radius: 2px;
background: var(--background-modifier-border);
overflow: hidden;
}
.ai3d-loading-bar-fill {
height: 100%;
border-radius: 2px;
background: var(--interactive-accent);
width: var(--bar-width, 0%);
transition: width 0.4s ease;
}
.ai3d-loading-bar-fill.is-indeterminate {
width: 40%;
animation: ai3d-indeterminate 1.4s ease-in-out infinite;
}
@keyframes ai3d-indeterminate {
0% { transform: translateX(-100%); }
100% { transform: translateX(350%); }
}
/* ===== Annotation Pins ===== */
.ai3d-annotation-overlay {
position: absolute;
inset: 0;
z-index: 5;
pointer-events: none;
overflow: hidden;
}
/* Semi-transparent overlay when annotation mode is active */
.ai3d-annot-mode-overlay {
position: absolute;
inset: 0;
z-index: 4;
background: rgba(74, 158, 255, 0.06);
border: 2px solid rgba(74, 158, 255, 0.3);
border-radius: inherit;
pointer-events: none;
animation: ai3d-annot-pulse 2s ease-in-out infinite;
}
@keyframes ai3d-annot-pulse {
0%, 100% { border-color: rgba(74, 158, 255, 0.3); }
50% { border-color: rgba(74, 158, 255, 0.6); }
}
.ai3d-annotation-pin {
position: absolute;
left: var(--pin-left, 0);
top: var(--pin-top, 0);
transform: translate(-50%, -100%);
display: flex;
align-items: center;
gap: 5px;
pointer-events: auto;
cursor: default;
user-select: none;
padding: 3px 8px 3px 6px;
background: rgba(0, 0, 0, 0.55);
backdrop-filter: blur(6px);
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.15);
filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
transition: opacity 0.25s ease, transform 0.15s ease, filter 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.ai3d-annotation-pin:hover {
transform: translate(-50%, -100%) scale(1.05);
background: rgba(0, 0, 0, 0.7);
}
/* Occluded pin (behind model geometry) */
.ai3d-annotation-pin.ai3d-pin-occluded {
opacity: 0.25;
filter: blur(1.5px) drop-shadow(0 0 4px rgba(255, 255, 255, 0.15));
background: rgba(0, 0, 0, 0.3);
border-color: rgba(255, 255, 255, 0.06);
}
.ai3d-annotation-pin.ai3d-pin-occluded .ai3d-pin-dot {
box-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
}
.ai3d-annotation-pin.ai3d-pin-occluded .ai3d-pin-label {
color: rgba(255, 255, 255, 0.5);
}
/* Fully hidden pin (camera idle + occluded) */
.ai3d-annotation-pin.ai3d-pin-hidden {
visibility: hidden;
opacity: 0;
pointer-events: none;
}
.ai3d-pin-dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: var(--pin-color, #4a9eff);
border: 2px solid rgba(255, 255, 255, 0.8);
flex-shrink: 0;
box-shadow: 0 0 6px currentColor;
}
.ai3d-pin-label {
font-size: 11px;
font-weight: 600;
color: #fff;
white-space: nowrap;
}
.ai3d-pin-delete {
display: none;
background: rgba(255, 60, 60, 0.85);
color: #fff;
border: none;
border-radius: 50%;
width: 16px;
height: 16px;
font-size: 11px;
line-height: 16px;
text-align: center;
cursor: pointer;
padding: 0;
flex-shrink: 0;
}
.ai3d-annotation-pin:hover .ai3d-pin-delete {
display: block;
}
/* Annotation editor popup */
.ai3d-annotation-editor {
position: absolute;
left: var(--editor-left, 0);
top: var(--editor-top, 0);
z-index: 20;
background: var(--background-primary);
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-m);
padding: 8px;
min-width: 180px;
max-width: 240px;
pointer-events: auto;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
display: flex;
flex-direction: column;
gap: 6px;
}
.ai3d-annotation-editor-input {
width: 100%;
font-size: 13px;
padding: 4px 8px;
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-s);
background: var(--background-secondary);
color: var(--text-normal);
outline: none;
box-sizing: border-box;
}
.ai3d-annotation-editor-input:focus {
border-color: var(--interactive-accent);
}
.ai3d-annotation-editor-colors {
display: flex;
gap: 4px;
}
.ai3d-pin-color-swatch {
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--swatch-color);
border: 2px solid transparent;
cursor: pointer;
padding: 0;
transition: border-color 0.15s;
}
.ai3d-pin-color-swatch.active {
border-color: var(--text-normal);
}
.ai3d-pin-color-swatch:hover {
border-color: var(--text-muted);
}
.ai3d-annotation-editor-actions {
display: flex;
gap: 4px;
justify-content: flex-end;
}
.ai3d-annotation-editor-btn {
font-size: 12px;
padding: 3px 10px;
border-radius: var(--radius-s);
border: 1px solid var(--background-modifier-border);
background: var(--background-secondary);
color: var(--text-normal);
cursor: pointer;
}
.ai3d-annotation-editor-confirm {
background: var(--interactive-accent);
color: var(--text-on-accent);
border-color: var(--interactive-accent);
}
.ai3d-annotation-editor-delete {
background: var(--background-secondary);
color: var(--text-error);
border-color: var(--text-error);
margin-right: auto;
}
.ai3d-annotation-editor-delete:hover {
background: var(--text-error);
color: var(--text-on-accent);
}
/* Editor input wrapper */
.ai3d-editor-input-wrap {
position: relative;
width: 100%;
}
/* Binding tag: shown below input when a heading is selected */
.ai3d-editor-binding-tag {
display: inline-flex;
align-items: center;
gap: 3px;
margin-top: 3px;
padding: 1px 6px;
font-size: 11px;
background: var(--background-secondary);
color: var(--text-muted);
border-radius: var(--radius-s);
border: 1px solid var(--background-modifier-border);
max-width: 100%;
overflow: hidden;
white-space: nowrap;
}
.ai3d-editor-binding-text {
overflow: hidden;
text-overflow: ellipsis;
}
.ai3d-editor-binding-clear {
font-size: 10px;
line-height: 1;
border: none;
background: none;
color: var(--text-muted);
cursor: pointer;
padding: 0 2px;
}
.ai3d-editor-binding-clear:hover {
color: var(--text-error);
}
/* Content preview: shows heading section content */
.ai3d-editor-content-preview {
font-size: 12px;
line-height: 1.45;
color: var(--text-muted);
background: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-s);
padding: 6px 8px;
max-height: 100px;
overflow-y: auto;
white-space: pre-wrap;
word-break: break-word;
}
.ai3d-editor-content-preview--empty {
font-style: italic;
color: var(--text-faint);
}
/* Heading autocomplete dropdown */
.ai3d-heading-dropdown {
max-height: 180px;
overflow-y: auto;
background: var(--background-primary);
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-s);
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.ai3d-heading-dropdown-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 4px 8px;
font-size: 12px;
cursor: pointer;
gap: 6px;
}
.ai3d-heading-dropdown-item:hover,
.ai3d-heading-dropdown-item.active {
background: var(--background-modifier-hover);
}
.ai3d-heading-dropdown-heading {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--text-normal);
}
.ai3d-heading-dropdown-note {
flex-shrink: 0;
font-size: 11px;
color: var(--text-muted);
max-width: 80px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* Annotations panel section */
.ai3d-annot-section {
display: flex;
flex-direction: column;
gap: 8px;
}
.ai3d-annot-toggle-row {
display: flex;
align-items: center;
gap: 8px;
}
.ai3d-annot-hint {
font-size: var(--font-ui-smaller);
color: var(--text-muted);
}
.ai3d-annot-list {
display: flex;
flex-direction: column;
gap: 4px;
}
.ai3d-annot-item {
display: flex;
align-items: center;
gap: 6px;
padding: 4px 6px;
border-radius: var(--radius-s);
transition: background 0.15s ease;
}
.ai3d-annot-item:hover {
background: var(--background-modifier-hover);
}
.ai3d-annot-dot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.ai3d-annot-label {
font-size: var(--font-ui-small);
color: var(--text-normal);
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
}
.ai3d-annot-actions {
display: flex;
gap: 2px;
opacity: 0;
transition: opacity 0.15s ease;
flex-shrink: 0;
}
.ai3d-annot-item:hover .ai3d-annot-actions {
opacity: 1;
}
.ai3d-annot-action-btn {
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
border: none;
background: transparent;
color: var(--text-muted);
cursor: pointer;
border-radius: var(--radius-s);
padding: 0;
}
.ai3d-annot-action-btn:hover {
background: var(--background-modifier-hover);
color: var(--text-normal);
}
.ai3d-annot-action-btn.is-delete:hover {
color: var(--text-error);
}
/* Pin count badge on annotation toolbar button */
.ai3d-pin-badge {
position: absolute;
top: -4px;
right: -4px;
min-width: 14px;
height: 14px;
border-radius: 7px;
background: var(--interactive-accent);
color: var(--text-on-accent);
font-size: 9px;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
padding: 0 3px;
pointer-events: none;
}
/* --- Pin Hover Popover --- */
.ai3d-pin-popover {
position: fixed;
left: var(--popover-left, 0);
top: var(--popover-top, 0);
z-index: 100;
max-width: 320px;
max-height: 240px;
background: var(--background-primary);
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-s);
box-shadow: var(--shadow-s);
overflow: hidden;
transform: translateX(-50%);
pointer-events: none;
}
.ai3d-pin-popover-title {
padding: 6px 10px;
font-size: 12px;
font-weight: 600;
color: var(--text-accent);
border-bottom: 1px solid var(--background-modifier-border);
}
.ai3d-pin-popover-body {
padding: 8px 10px;
font-size: 12px;
color: var(--text-muted);
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 8;
-webkit-box-orient: vertical;
}
/* --- Pin Pulse Animation (note heading hover) --- */
@keyframes ai3d-pin-pulse {
0% { box-shadow: 0 0 0 0 rgba(74, 158, 255, 0.6); transform: scale(1); }
50% { box-shadow: 0 0 0 8px rgba(74, 158, 255, 0); transform: scale(1.2); }
100% { box-shadow: 0 0 0 0 rgba(74, 158, 255, 0); transform: scale(1); }
}
.ai3d-pin-pulse {
animation: ai3d-pin-pulse 1.2s ease-out;
}
/* --- Heading Pin Badge --- */
.ai3d-heading-pin-badge {
display: inline-flex;
align-items: center;
margin-left: 6px;
font-size: 0.75em;
cursor: pointer;
opacity: 0.5;
transition: opacity 0.15s, transform 0.15s;
vertical-align: middle;
}
.ai3d-heading-pin-badge:hover {
opacity: 1;
transform: scale(1.3);
}