﻿/* =========================================================
   榛戠尗 Lottie 缂栬緫鍣?& 璐╂ⅵ宸ヤ綔娴?- 鍏ㄥ眬鏍峰紡琛?(缁堟瀬鐗?
========================================================= */

/* === 1. 鏍稿績 CSS 鍙橀噺涓庝富棰樼毊鑲?=== */
:root {
  --bg-gradient: radial-gradient(circle at 10% 20%, #e0eafc, #cfdef3), radial-gradient(circle at 90% 80%, #fbc2eb, #a6c1ee);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --panel-bg: rgba(255, 255, 255, 0.5);
  --text-main: #1d1d1f;
  --text-sub: #86868b;
  --accent: #0071e3;
  --danger: #ff3b30;
  --track-bg: rgba(0, 0, 0, 0.03);
  --clip-bg: rgba(0, 113, 227, 0.85);
  --list-hover: rgba(0, 0, 0, 0.06);
  --ease-apple: cubic-bezier(0.25, 1, 0.5, 1);
}

html[data-theme="sunset"] { 
  --bg-gradient: radial-gradient(circle at 10% 20%, #fdfbfb, #ebedee), radial-gradient(circle at 90% 80%, #f6d365, #fda085); 
  --glass-bg: rgba(255, 255, 255, 0.75); 
  --glass-border: rgba(255, 255, 255, 0.6); 
  --panel-bg: rgba(255, 245, 238, 0.6); 
  --text-main: #3e2723; 
  --text-sub: #8d6e63; 
  --accent: #ff7043; 
  --danger: #e53935; 
  --track-bg: rgba(0, 0, 0, 0.03); 
  --clip-bg: rgba(255, 112, 67, 0.9); 
  --list-hover: rgba(255, 112, 67, 0.08); 
}

html[data-theme="dark"] { 
  --bg-gradient: radial-gradient(circle at 10% 20%, #1a1a2e, #16213e), radial-gradient(circle at 90% 80%, #0f3460, #000000); 
  --glass-bg: rgba(30, 30, 32, 0.75); 
  --glass-border: rgba(255, 255, 255, 0.1); 
  --panel-bg: rgba(40, 40, 45, 0.6); 
  --text-main: #f5f5f7; 
  --text-sub: #a1a1a6; 
  --accent: #0a84ff; 
  --track-bg: rgba(0, 0, 0, 0.2); 
  --clip-bg: rgba(10, 132, 255, 0.85); 
  --list-hover: rgba(255, 255, 255, 0.1); 
}

html[data-theme="ocean"] { 
  --bg-gradient: radial-gradient(circle at 10% 20%, #0f2027, #203a43), radial-gradient(circle at 90% 80%, #2c5364, #000000); 
  --glass-bg: rgba(15, 32, 39, 0.8); 
  --glass-border: rgba(0, 229, 255, 0.15); 
  --panel-bg: rgba(32, 58, 67, 0.6); 
  --text-main: #e0f2f1; 
  --text-sub: #90a4ae; 
  --accent: #00e5ff; 
  --danger: #ff5252; 
  --track-bg: rgba(0, 0, 0, 0.25); 
  --clip-bg: rgba(0, 184, 212, 0.85); 
  --list-hover: rgba(0, 229, 255, 0.1); 
}

html[data-theme="forest"] { 
  --bg-gradient: radial-gradient(circle at 10% 20%, #1c2e26, #2d4a3e), radial-gradient(circle at 90% 80%, #15241d, #000000); 
  --glass-bg: rgba(28, 46, 38, 0.85); 
  --glass-border: rgba(255, 255, 255, 0.12); 
  --panel-bg: rgba(45, 74, 62, 0.5); 
  --text-main: #e8f5e9; 
  --text-sub: #a5d6a7; 
  --accent: #00e676; 
  --danger: #ff5252; 
  --track-bg: rgba(0, 0, 0, 0.2); 
  --clip-bg: rgba(0, 200, 83, 0.85); 
  --list-hover: rgba(0, 230, 118, 0.1); 
}

/* === 2. 鍩虹 Reset 涓庨〉闈㈢粨鏋?=== */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Arial, sans-serif; user-select: none; }
body { background: var(--bg-gradient); background-blend-mode: multiply; color: var(--text-main); display: flex; flex-direction: column; align-items: center; min-height: 100vh; overflow-y: auto; overflow-x: hidden; transition: background 0.6s var(--ease-apple); }
.empty-text { font-size: 12px; color: var(--text-sub); text-align: center; }

/* 椤堕儴瀵艰埅鏍?*/
.top-nav { width: min(1480px, 98vw); height: 66px; margin-top: 1vh; background: linear-gradient(180deg, color-mix(in srgb, var(--glass-bg) 92%, white), var(--glass-bg)); backdrop-filter: blur(28px); border: 1px solid var(--glass-border); border-radius: 20px; display: flex; justify-content: space-between; align-items: center; padding: 0 16px; box-shadow: 0 12px 36px rgba(0,0,0,0.10); z-index: 100; flex-shrink: 0; }
.nav-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; cursor: pointer; letter-spacing: 0.2px; white-space: nowrap; }
#mini-logo { width: 32px; height: 32px; border-radius: 8px; background: rgba(0,0,0,0.1); }
.nav-tabs { display: flex; gap: 8px; background: rgba(0,0,0,0.04); padding: 4px; border-radius: 16px; overflow-x: auto; max-width: 100%; scrollbar-width: none; box-shadow: inset 0 1px 2px rgba(255,255,255,0.45); }
.nav-tab { padding: 10px 16px; border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-sub); transition: transform 0.24s var(--ease-apple), background 0.24s var(--ease-apple), color 0.24s var(--ease-apple), box-shadow 0.24s var(--ease-apple); white-space: nowrap; letter-spacing: 0.02em; }
.nav-tab:hover:not(.active) { background: var(--list-hover); color: var(--text-main); transform: translateY(-1px); }
.nav-tab.active { background: linear-gradient(180deg, color-mix(in srgb, var(--glass-bg) 88%, white), var(--glass-bg)); color: var(--text-main); box-shadow: 0 6px 18px rgba(0,0,0,0.10); }

/* 涓婚閫夋嫨鍣?*/
.theme-picker { display: flex; gap: 10px; align-items: center; }
.theme-btn { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--glass-border); cursor: pointer; transition: all 0.3s; box-shadow: inset 0 2px 4px rgba(255,255,255,0.3), 0 2px 6px rgba(0,0,0,0.1); }
.theme-btn:hover { transform: scale(1.25); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.theme-btn.active { transform: scale(1.15); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* 涓讳綋瀹瑰櫒 */
.app-container { width: min(1460px, 98vw); height: calc(97vh - 72px); min-height: 650px; margin-top: 1vh; margin-bottom: 2vh; background: color-mix(in srgb, var(--glass-bg) 88%, transparent); backdrop-filter: blur(44px); border: 1px solid var(--glass-border); border-radius: 26px; box-shadow: 0 24px 70px rgba(0,0,0,0.12); display: flex; overflow: hidden; position: relative; }
.view-section { display: none; width: 100%; height: 100%; animation: fadeIn 0.4s; }
.view-section.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 渚ц竟鏍忎笌閫氱敤鍗＄墖 */
.sidebar { width: 280px; background: rgba(255, 255, 255, 0.05); display: flex; flex-direction: column; z-index: 10; border-right: 1px solid var(--glass-border); transition: width 0.3s var(--ease-apple), transform 0.3s var(--ease-apple), opacity 0.3s var(--ease-apple); }
.sidebar-right { border-left: 1px solid var(--glass-border); border-right: none; width: 300px; }
.sidebar-content { padding: 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.section-title { font-size: 11px; font-weight: 700; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.08em; margin: 16px 0 8px 0; }
.card { background: linear-gradient(180deg, color-mix(in srgb, var(--panel-bg) 97%, white), var(--panel-bg)); border-radius: 18px; padding: 12px; border: 1px solid var(--glass-border); margin-bottom: 12px; box-shadow: 0 14px 28px rgba(0,0,0,0.06); }
.info-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; align-items: center; }
.info-label { color: var(--text-sub); }

/* 鎸夐挳涓庤緭鍏ユ */
.btn { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 96%, white), var(--accent)); color: #fff; border: none; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer; transition: transform 0.24s var(--ease-apple), box-shadow 0.24s var(--ease-apple), filter 0.24s var(--ease-apple); width: 100%; display: flex; justify-content: center; gap: 6px; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12); filter: brightness(1.05); }
.btn:active { transform: scale(0.96); }
.btn-secondary { background: var(--list-hover); color: var(--text-main); }
.btn-secondary:hover { background: rgba(0,0,0,0.1); }
input[type="number"], input[type="text"] { width: 70px; padding: 4px 6px; border: 1px solid var(--glass-border); border-radius: 6px; text-align: right; background: rgba(0,0,0,0.03); color: var(--text-main); outline: none; font-size: 12px; font-weight: 500; transition: all 0.3s; }
input[type="number"]:focus { border-color: var(--accent); background: var(--glass-bg); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2); transform: scale(1.04); }

/* === 3. 璧勬簮搴撴ā寮?(妯″紡 1) === */
.anim-list { display: flex; flex-direction: column; gap: 6px; max-height: none; overflow-y: auto; min-height: 0; }
.anim-list-item { padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer; transition: transform 0.24s var(--ease-apple), background 0.24s var(--ease-apple), box-shadow 0.24s var(--ease-apple); white-space: normal; overflow: visible; text-overflow: clip; color: var(--text-main); border: 1px solid transparent; }
.anim-list-item:hover { background: var(--list-hover); transform: translateY(-1px); }
.anim-list-item.active { background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 84%, black)); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 18px rgba(0,113,227,0.22); }
.stage { flex: 1; position: relative; display: flex; justify-content: center; align-items: center; }
#lottie-view { width: 84%; height: 84%; pointer-events: none; filter: drop-shadow(0 18px 40px rgba(0,0,0,0.12)); transform: translateZ(0); }
.asset-item { display: flex; align-items: flex-start; gap: 12px; padding: 8px; background: var(--list-hover); border-radius: 8px; margin-bottom: 8px; transition: all 0.3s; }
.asset-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: contain; cursor: pointer; border: 1px dashed var(--glass-border); background: rgba(0,0,0,0.02); transition: all 0.3s; }
.asset-thumb:hover { border-color: var(--accent); transform: scale(1.15); }
.asset-info { flex: 1; overflow: hidden; }
.asset-name { font-size: 12px; font-weight: 650; color: var(--text-main); white-space: normal; overflow: visible; text-overflow: clip; }

/* === 4. 鏃堕棿杞寸紪杈戝櫒 (妯″紡 2) === */
.editor-layout { display: flex; flex-direction: column; width: 100%; height: 100%; }
.editor-top { display: flex; flex: 1; border-bottom: 1px solid var(--glass-border); overflow: hidden; min-height: 0; }
.editor-library { width: 260px; border-right: 1px solid var(--glass-border); display: flex; flex-direction: column; background: var(--panel-bg); }
.library-header { padding: 16px; border-bottom: 1px solid var(--glass-border); font-weight: 600; font-size: 14px; }
.library-items { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.lib-item { padding: 12px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 8px; font-size: 12px; cursor: grab; display: flex; flex-direction: column; gap: 4px; transition: all 0.3s; }
.lib-item:hover { transform: scale(1.02); border-color: var(--accent); }
.lib-item-name { font-weight: 600; white-space: normal; overflow: visible; text-overflow: clip; }

.editor-preview { flex: 1; display: flex; flex-direction: column; background: transparent; min-height: 0; }
.editor-stage { flex: 1; display: flex; justify-content: center; align-items: center; position: relative; min-height: 0; overflow: hidden; cursor: default; }
#editor-lottie-view { position: relative; width: 100%; height: 100%; max-width: 600px; max-height: 600px; filter: drop-shadow(0 15px 35px rgba(0,0,0,0.15)); }

.preview-toolbar { padding: 10px 16px; border-top: 1px solid var(--glass-border); display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.02); flex-shrink: 0; z-index: 10; }
.editor-properties { width: 280px; border-left: 1px solid var(--glass-border); background: var(--panel-bg); padding: 16px; display: flex; flex-direction: column; overflow-y: auto; }

.bg-pickers { display: flex; gap: 8px; align-items: center; }
.bg-btn { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: all 0.3s; }
.bg-btn:hover { transform: scale(1.2); }
.bg-btn.active { border-color: var(--accent); transform: scale(1.1); box-shadow: 0 0 0 2px var(--accent); }
.bg-checker { background: repeating-conic-gradient(#dfdfdf 0% 25%, #fff 0% 50%) 50% / 12px 12px; }
.bg-light { background: #f5f5f7; }
.bg-dark { background: #1d1d1f; }
input[type="color"] { width: 22px; height: 22px; border: none; border-radius: 50%; cursor: pointer; padding: 0; background: transparent; transition: all 0.3s; }

/* 杞ㄩ亾涓庢椂闂磋酱 */
.timeline-panel { height: 280px; background: var(--glass-bg); display: flex; flex-direction: column; border-top: 1px solid var(--glass-border); flex-shrink: 0; }
.tl-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 16px; border-bottom: 1px solid var(--glass-border); background: rgba(0,0,0,0.02); }
.tl-zoom-ctrl { display: flex; align-items: flex-start; gap: 8px; font-size: 11px; color: var(--text-sub); font-weight: 600; }
input[type="range"] { -webkit-appearance: none; width: 100px; height: 4px; background: var(--glass-border); border-radius: 2px; outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); cursor: pointer; }

.tl-main { display: flex; flex: 1; overflow: hidden; }
.tl-left { width: 150px; display: flex; flex-direction: column; border-right: 1px solid var(--glass-border); flex-shrink: 0; background: rgba(0,0,0,0.02); }
.tl-corner { height: 30px; display: flex; align-items: flex-start; padding-left: 16px; font-size: 11px; font-weight: 600; color: var(--text-sub); border-bottom: 1px solid var(--glass-border); flex-shrink: 0; }
.tl-track-headers { flex: 1; overflow: hidden; } 
.tl-track-head { height: 50px; display: flex; justify-content: space-between; align-items: center; padding: 0 12px 0 16px; font-size: 12px; font-weight: 600; color: var(--text-sub); border-bottom: 1px solid var(--glass-border); }
.track-del-btn { cursor: pointer; font-size: 14px; opacity: 0.3; transition: all 0.3s; }
.track-del-btn:hover { opacity: 1; color: var(--danger); transform: scale(1.3); }

.tl-right { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.tl-ruler-container { height: 30px; overflow: hidden; border-bottom: 1px solid var(--glass-border); position: relative; background: rgba(0,0,0,0.03); cursor: ew-resize; flex-shrink: 0; }
.tl-ruler { position: relative; min-width: 100%; height: 100%; }
.tl-tracks-scroll { flex: 1; overflow: auto; position: relative; }
.tl-tracks-area { position: relative; min-width: 100%; display: flex; flex-direction: column; }
.tl-track-wrapper { position: relative; min-width: 100%; display: flex; flex-direction: column; }
.tl-track { height: 50px; border-bottom: 1px solid var(--glass-border); background: var(--track-bg); position: relative; }
.tl-track.drag-over { background: rgba(0, 113, 227, 0.15); border: 2px dashed var(--accent); box-sizing: border-box; }

.tl-clip { position: absolute; height: 38px; top: 6px; background: var(--clip-bg); border-radius: 6px; border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 2px 8px rgba(0,0,0,0.1); cursor: grab; display: flex; align-items: flex-start; padding: 0 8px; overflow: hidden; font-size: 11px; color: #fff; font-weight: 500; transition: filter 0.3s, box-shadow 0.3s, transform 0.3s; will-change: transform; z-index: 10; }
.tl-clip:hover:not(.dragging) { filter: brightness(1.15); transform: scale(1.02); z-index: 15; }
.tl-clip.active:not(.dragging) { outline: 2px solid #fff; box-shadow: 0 0 0 2px var(--accent), 0 6px 16px rgba(0,0,0,0.2); z-index: 11; transform: scale(1.02); }
.tl-clip.dragging { opacity: 0.85; z-index: 20; cursor: grabbing; box-shadow: 0 12px 24px rgba(0,0,0,0.3); transition: none; }

.playhead-handle { position: absolute; top: 0; left: -8px; width: 16px; height: 16px; pointer-events: none; z-index: 51; }
.playhead-handle::before { content: ''; position: absolute; top: 0; left: 2.5px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--danger); }
.playhead-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--danger); z-index: 40; pointer-events: none; transform: translateX(0); box-shadow: 0 0 4px rgba(255,59,48,0.5); }
.snap-guide { position: absolute; top: 0; bottom: 0; width: 1px; background: #00d4ff; z-index: 39; pointer-events: none; box-shadow: 0 0 6px #00d4ff; display: none; }

/* === 5. 鎷栨嫿涓庡脊绐?=== */
.drop-overlay { position: absolute; inset: 0; background: rgba(255,255,255,0.82); backdrop-filter: blur(12px); z-index: 500; display: flex; flex-direction: column; justify-content: center; align-items: center; border: 3px dashed var(--accent); border-radius: 20px; opacity: 0; pointer-events: none; transition: all 0.32s var(--ease-apple); transform: scale(1.02); }
.drop-overlay.active { opacity: 1; pointer-events: all; transform: scale(1); }
.drop-overlay h2 { color: var(--accent); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(8px); z-index: 999; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content { width: 90%; max-width: 420px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 24px; padding: 32px; box-shadow: 0 24px 48px rgba(0,0,0,0.2); transform: translateY(20px) scale(0.95); transition: all 0.4s; text-align: center; }
.modal-overlay.active .modal-content { transform: translateY(0) scale(1); }
.modal-title { font-size: 20px; font-weight: 700; color: var(--text-main); margin-bottom: 16px; }
.modal-body { font-size: 14px; color: var(--text-sub); line-height: 1.6; margin-bottom: 32px; text-align: left; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.3); border-radius: 10px; }

/* === 6. AI 鍔ㄦ晥瀹為獙瀹ゆ牱寮?(妯″紡 3) === */
#ai-prompt:focus { border-color: var(--accent); background: var(--glass-bg); box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1); transform: scale(1.01); }
.btn-loading { pointer-events: none; opacity: 0.6; filter: grayscale(0.5); }


/* =========================================================
   === 7. 宸ュ叿绠?(SaaS 楂樼骇渚ц竟鏍忔灦鏋? ===
========================================================= */
.tools-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* 渚ц竟鏍忓熀纭€鏍峰紡 */
.tools-sidebar {
  width: 200px;
  background: rgba(0, 0, 0, 0.02);
  border-right: 1px solid var(--glass-border);
  transition: width 0.3s var(--ease-apple);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  z-index: 10;
}

.tools-sidebar-header {
  height: 60px;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-main);
}

.ts-title {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.3s;
}

.btn-icon:hover {
  background: var(--glass-border);
}

/* 鑿滃崟椤规牱寮?*/
.tools-menu {
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}

.tools-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-sub);
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
}

.tools-menu-item:hover {
  background: var(--list-hover);
  color: var(--text-main);
}

.tools-menu-item.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.2);
}

.tm-icon {
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
}

.tm-text {
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.2s;
}

/* =========================================================
   === 楂樼骇 Hover 灞曞紑/鏀剁缉浜や簰鏍稿績閫昏緫 ===
========================================================= */

/* 鏀剁缉鐘舵€佷笅鐨勪晶杈规爮 (鍙湁褰撻紶鏍囩Щ寮€鏃讹紝鎵嶇湡姝ｆ墽琛屾敹缂? */
.tools-sidebar.collapsed:not(:hover) { 
  width: 60px; 
}

.tools-sidebar.collapsed:not(:hover) .ts-title { 
  opacity: 0; 
  pointer-events: none; 
  width: 0; 
}

.tools-sidebar.collapsed:not(:hover) .tools-sidebar-header { 
  justify-content: center; 
}

.tools-sidebar.collapsed:not(:hover) .btn-icon { 
  margin: 0; 
}

/* 鏀剁缉鏃堕殣钘忔枃瀛楋紝灞呬腑鍥炬爣 */
.tools-sidebar.collapsed:not(:hover) .tm-text { 
  opacity: 0; 
  width: 0; 
}

.tools-sidebar.collapsed:not(:hover) .tools-menu-item { 
  justify-content: center; 
  padding: 10px 0; 
}


/* === 鍙充晶宸ヤ綔鍖?=== */
.tools-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  position: relative;
  transition: all 0.3s;
}

.construction-state {
  text-align: center;
  animation: fadeIn 0.5s ease-out;
  padding: 40px;
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.cons-icon {
  font-size: 50px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

.construction-state h2 {
  font-size: 24px;
  color: var(--text-main);
  margin-bottom: 8px;
}

.construction-state p {
  color: var(--text-sub);
  font-size: 13px;
}

/* =========================================================
   === Lottie 淇涓撳 - 涓夋爮楂樼骇 UI ===
========================================================= */
.lottie-repair-layout { display: flex; width: 100%; height: 100%; gap: 16px; padding: 16px; animation: fadeIn 0.4s; }
.repair-panel { background: var(--panel-bg); border: 1px solid var(--glass-border); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; backdrop-filter: blur(20px); box-shadow: 0 10px 30px rgba(0,0,0,0.05); }

/* 宸︿晶锛氬睘鎬ф爲 */
.repair-tree-panel { width: 280px; flex-shrink: 0; }
.panel-header { padding: 12px 16px; border-bottom: 1px solid var(--glass-border); font-weight: 600; font-size: 13px; color: var(--text-main); background: rgba(0,0,0,0.02); }
.tree-content { flex: 1; overflow-y: auto; padding: 8px; }
.tree-node { padding: 8px 12px; font-size: 12px; cursor: pointer; border-radius: 6px; color: var(--text-main); transition: background 0.2s; white-space: normal; overflow: visible; text-overflow: clip; display: flex; align-items: flex-start; gap: 8px; }
.tree-node:hover { background: var(--list-hover); }
.layer-node { font-weight: 600; margin-top: 4px; background: rgba(0,0,0,0.02); }
.prop-node { padding-left: 28px; color: var(--text-sub); border-left: 1px dashed var(--glass-border); margin-left: 12px; }
.prop-node.active { background: var(--accent); color: white; border-color: transparent; }

/* 涓棿锛氶瑙堝尯 */
.repair-preview-panel { flex: 1; }
.repair-stage { flex: 1; display: flex; justify-content: center; align-items: center; background: repeating-conic-gradient(#dfdfdf 0% 25%, #fff 0% 50%) 50% / 12px 12px; overflow: hidden; }
#repair-lottie-view { width: 80%; height: 80%; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.2)); }
.repair-toolbar { padding: 12px 16px; border-top: 1px solid var(--glass-border); display: flex; justify-content: flex-end; gap: 12px; background: var(--glass-bg); }

/* 鍙充晶锛氫唬鐮佺紪杈戝櫒 */
.repair-editor-panel { width: 340px; flex-shrink: 0; }
.ai-suggestion { padding: 16px; font-size: 12px; line-height: 1.6; color: var(--text-sub); border-bottom: 1px solid var(--glass-border); background: rgba(0, 113, 227, 0.05); }
#repair-json-editor { flex: 1; width: 100%; border: none; background: transparent; padding: 16px; font-family: 'Courier New', Courier, monospace; font-size: 13px; color: var(--text-main); outline: none; resize: none; line-height: 1.5; }
#repair-json-editor:focus { background: rgba(0,0,0,0.01); }

/* === CodeMirror 涓?AI 淇敼鍖烘牱寮?=== */
.CodeMirror {
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, Courier, monospace !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  height: 100% !important;
}

.ai-modifier-box {
  padding: 12px;
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#repair-ai-prompt {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.03);
  color: var(--text-main);
  font-size: 12px;
  outline: none;
  transition: all 0.3s;
  text-align: left;
}

#repair-ai-prompt:focus {
  border-color: var(--accent);
  background: var(--panel-bg);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.btn-ai-loading {
  background: linear-gradient(90deg, #0071e3, #a6c1ee);
  background-size: 200% 200%;
  animation: aiPulse 2s ease infinite;
  pointer-events: none;
  border: none;
}

/* =========================================================
/* =========================================================
   === 馃 AI 鍔ㄦ晥瀵煎笀 - 鑱婂ぉ鐣岄潰 UI (绮句慨缇庡寲鐗? ===
========================================================= */
.ai-mentor-layout { padding: 16px; animation: fadeIn 0.4s; display: flex; justify-content: center; }
.chat-container { display: flex; flex-direction: column; width: 100%; max-width: 850px; height: 100%; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 24px; backdrop-filter: blur(40px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); overflow: hidden; }

.chat-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--glass-border); background: linear-gradient(180deg, rgba(255,255,255,0.1), transparent); }
.chat-title { display: flex; align-items: flex-start; gap: 12px; }
.chat-title h3 { font-size: 15px; font-weight: 700; color: var(--text-main); margin: 0; }
.chat-title p { font-size: 12px; color: var(--text-sub); margin: 4px 0 0 0; }

.chat-messages { flex: 1; padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.chat-bubble { max-width: 75%; padding: 12px 18px; border-radius: 20px; font-size: 14px; line-height: 1.6; word-wrap: break-word; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.chat-bubble code { background: rgba(0,0,0,0.06); padding: 2px 6px; border-radius: 6px; font-family: 'SF Mono', Consolas, monospace; font-size: 12px; }
.chat-bubble pre { background: #1e1e1e; color: #d4d4d4; padding: 16px; border-radius: 12px; overflow-x: auto; margin-top: 8px; font-size: 13px; }
.chat-bubble pre code { background: transparent; padding: 0; color: inherit; }

/* AI 鐏拌壊姘旀场 */
.ai-bubble { background: #ffffff; border: 1px solid rgba(0,0,0,0.05); color: #333; align-self: flex-start; border-bottom-left-radius: 4px; }
html[data-theme="dark"] .ai-bubble { background: #2c2c2e; border: 1px solid rgba(255,255,255,0.05); color: #fff; }

/* 鐢ㄦ埛钃濊壊姘旀场 */
.user-bubble { background: linear-gradient(135deg, #007aff, #0056b3); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; border: none; }

.chat-input-area { padding: 16px 24px; border-top: 1px solid var(--glass-border); display: flex; gap: 12px; background: rgba(0,0,0,0.02); align-items: flex-end; }
#chat-input-box { flex: 1; height: 46px; min-height: 46px; max-height: 120px; padding: 12px 20px; border-radius: 23px; border: 1px solid var(--glass-border); background: var(--panel-bg); color: var(--text-main); font-size: 14px; outline: none; resize: none; transition: all 0.3s; font-family: inherit; line-height: 1.5; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); }
#chat-input-box:focus { border-color: #007aff; box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2); background: #fff; }
html[data-theme="dark"] #chat-input-box:focus { background: #1c1c1e; }

/* 馃毃 鏍稿績淇锛氬己鍒跺彂閫佹寜閽笉瑕佸崰婊″搴︼紒 */
.chat-send-btn { 
  width: auto !important; /* 寮哄埗瑕嗙洊鍏ㄥ眬鐨?width:100% */
  border-radius: 23px; 
  padding: 0 24px; 
  height: 46px; 
  font-weight: 600; 
  flex-shrink: 0; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 6px; 
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3); 
  transition: all 0.3s; 
}
.chat-send-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4); }
@keyframes aiPulse {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}
.asset-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--panel-bg) 96%, white), var(--panel-bg)); border: 1px solid var(--glass-border); margin-bottom: 8px; box-shadow: 0 8px 18px rgba(0,0,0,0.04); min-height: 60px; }
.asset-thumb { width: 42px; height: 42px; object-fit: contain; border-radius: 10px; background: rgba(255,255,255,0.55); flex-shrink: 0; }
.asset-info { min-width: 0; flex: 1; }
.asset-name { font-size: 12px; font-weight: 650; color: var(--text-main); white-space: normal; overflow: visible; text-overflow: clip; }
.anim-list-item, .lib-item-name, .asset-name, .tm-text { word-break: break-all; }

@media (max-width: 1366px) {
  .top-nav, .app-container { width: min(1480px, 98vw); }
  .sidebar { width: 250px; }
  .sidebar-right { width: 260px; }
  .nav-brand { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
  .nav-tab { padding: 8px 12px; font-size: 12px; }
  .theme-picker { gap: 6px; }
  .theme-btn { width: 20px; height: 20px; }
  .section-title { margin-top: 12px; }
}

@media (max-width: 1100px) {
  .top-nav { height: auto; padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .nav-tabs { order: 3; width: 100%; }
  .theme-picker { margin-left: auto; }
  .app-container { height: auto; min-height: calc(100vh - 120px); flex-direction: column; }
  .view-section.active { flex-direction: column; }
  .sidebar, .sidebar-right { width: 100%; border-left: none; border-right: none; border-bottom: 1px solid var(--glass-border); }
  .stage { min-height: 360px; }
  .editor-layout, .tools-layout { min-height: 0; }
}

@media (max-width: 900px) {
  .top-nav { width: 96vw; }
  .app-container { width: 96vw; }
  .nav-brand { max-width: 100%; }
  .nav-tab { padding: 8px 10px; }
  .btn { font-size: 12px; }
  .card { padding: 10px; }
}



.nav-brand { font-size: 16px; letter-spacing: 0.01em; }
.nav-brand #mini-logo { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.nav-tab { min-width: 84px; text-align: center; }
.view-section.active { gap: 0; }
.sidebar-content { padding: 18px; }
.card { backdrop-filter: blur(10px); }
.anim-list { max-height: min(44vh, 520px); padding: 2px; }
.anim-list-item { line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-name { word-break: break-word; white-space: normal; overflow: visible; }
.asset-info { min-width: 0; }
.asset-item { align-items: flex-start; }
.asset-thumb { margin-top: 1px; }
@media (max-width: 1100px) {
  .nav-brand { width: 100%; justify-content: flex-start; }
  .nav-tabs { width: 100%; }
  .theme-picker { width: 100%; justify-content: flex-start; }
  .sidebar-content { padding: 14px; }
  .card { padding: 10px; }
  .anim-list { max-height: min(38vh, 420px); }
}

.anim-list-card { flex: 1 1 auto; display: flex; min-height: 180px; max-height: calc(100vh - 240px); }
.anim-list-card .anim-list { flex: 1; max-height: none; min-height: 0; overflow-y: auto; }
