/* 🛡️ 強制修復 FontAwesome 圖示顯示 */
.fas, .far, .fab, .fa { font-family: "Font Awesome 6 Free" !important; font-weight: 900 !important; display: inline-block !important; }
/* ======================================================
   🎨 TrueLink Schema Generator Theme (V19.1 佈局修復版)
   ====================================================== */
body { margin: 0; padding-top: 80px; font-family: 'Noto Sans TC', 'Inter', sans-serif; background: #050B14; color: #F8FAFC; }
.ts-wrapper { max-width: 1400px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: 1fr 400px; gap: 30px; }

.ts-form-section { background: #0F172A; border: 1px solid #1E293B; border-radius: 16px; padding: 30px; box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.ts-section-title { color: #38BDF8; font-size: 1.2rem; font-weight: 900; margin: 0 0 20px 0; padding-bottom: 10px; border-bottom: 1px dashed #334155; display: flex; align-items: center; gap: 10px; }
.ts-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

.form-group { margin-bottom: 20px; position: relative;}
.form-group label { display: flex; align-items: center; gap: 8px; color: #CBD5E1; font-weight: bold; margin-bottom: 8px; font-size: 0.95rem; }
.ts-input, .ts-select, .ts-textarea { width: 100%; background: #020617; border: 1px solid #334155; color: #FFF; padding: 12px 15px; border-radius: 8px; font-size: 1rem; box-sizing: border-box; outline: none; transition: 0.3s; }
.ts-input:focus, .ts-select:focus, .ts-textarea:focus { border-color: #38BDF8; box-shadow: 0 0 0 3px rgba(56,189,248,0.2); }
.ts-textarea { resize: vertical; min-height: 80px; }

/* 🌟 Tooltip */
.tl-tooltip { position: relative; display: inline-flex; align-items: center; justify-content: center; color: #94A3B8; cursor: help; font-size: 1rem; transition: 0.2s; }
.tl-tooltip:hover { color: #F59E0B; }
.tl-tooltip-text { visibility: hidden; opacity: 0; position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%) translateY(10px); width: 260px; background: #1E293B; color: #F8FAFC; text-align: left; padding: 12px 15px; border-radius: 8px; font-size: 0.85rem; font-weight: normal; line-height: 1.5; z-index: 100; box-shadow: 0 10px 25px rgba(0,0,0,0.8); border: 1px solid #38BDF8; transition: all 0.2s ease; pointer-events: none; }
.tl-tooltip-text::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -6px; border-width: 6px; border-style: solid; border-color: #38BDF8 transparent transparent transparent; }
.tl-tooltip:hover .tl-tooltip-text { visibility: visible; opacity: 1; transform: translateX(-50%) translateY(0); }

/* 🌟 擴充屬性專屬樣式 */
.ext-prop-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; background: rgba(56, 189, 248, 0.05); padding: 10px; border-radius: 8px; border: 1px dashed #334155;}
.ext-prop-key { flex: 1; max-width: 200px; }
.ext-prop-val { flex: 2; }

/* 🌟 雙引擎 Tabs */
.engine-tabs { display: flex; gap: 10px; margin-bottom: 25px; background: rgba(30, 41, 59, 0.5); padding: 8px; border-radius: 12px; border: 1px solid #334155; }
.engine-tab-btn { flex: 1; padding: 15px; background: transparent; border: none; color: #94A3B8; font-size: 1rem; font-weight: 800; border-radius: 8px; cursor: pointer; transition: 0.3s; display: flex; justify-content: center; align-items: center; gap: 8px; }
.engine-tab-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }
.engine-tab-btn.active { background: #38BDF8; color: #0F172A; box-shadow: 0 4px 15px rgba(56,189,248,0.3); }
.engine-tab-btn.active.tab-content-engine { background: #A855F7; box-shadow: 0 4px 15px rgba(168,85,247,0.3); }
.schema-view-section { display: none; animation: fadeUp 0.4s ease; }
.schema-view-section.active { display: block; }

/* 🌟 教育區塊與隱藏防呆樣式 */
.identity-info-box { background: rgba(30,41,59,0.5); border: 1px solid rgba(56,189,248,0.3); border-radius: 12px; padding: 20px; margin-bottom: 30px; display: none; }
.identity-info-box.active { display: block; animation: fadeUp 0.4s ease; }
.identity-title { color: #38BDF8; font-weight: 900; font-size: 1.1rem; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.identity-desc { color: #CBD5E1; font-size: 0.95rem; line-height: 1.8; }
.hidden-fields-group { display: none; animation: fadeUp 0.4s ease; }
.hidden-fields-group.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 右側預覽區 */
.ts-preview-section { background: #0F172A; border: 1px solid #1E293B; border-radius: 16px; padding: 25px; position: sticky; top: 100px; height: fit-content; }
#json-output { background: #020617; color: #10B981; padding: 15px; border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; overflow-x: auto; white-space: pre-wrap; max-height: 400px; border: 1px solid #334155; }

.ts-btn { padding: 10px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; border: none; transition: 0.3s; display: inline-flex; align-items: center; gap: 8px; }
.ts-btn-primary { background: linear-gradient(135deg, #0EA5E9, #2563EB); color: #fff; }
.ts-btn-primary:hover { box-shadow: 0 10px 20px rgba(14,165,233,0.4); transform: translateY(-2px); }
.ts-btn-outline { background: transparent; border: 1px dashed #64748B; color: #94A3B8; width: 100%; padding: 12px; margin-top: 10px; justify-content: center;}
.ts-btn-outline:hover { border-color: #38BDF8; color: #38BDF8; background: rgba(56,189,248,0.05); }

/* 🌟 底部懸浮操作列修復 */
.sticky-action-bar { position: fixed; bottom: 0; right: 0; left: 0; width: 100%; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(12px); border-top: 1px solid #334155; z-index: 9999; padding: 15px 0; box-shadow: 0 -10px 30px rgba(0,0,0,0.5); }
.sab-container { max-width: 1400px; margin: 0 auto; padding: 0 20px; display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 15px; }
.sab-left { display: flex; align-items: center; gap: 15px; }
.sab-right { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.sab-health { display: flex; align-items: center; background: #020617; padding: 8px 20px; border-radius: 30px; border: 1px solid #1E293B; white-space: nowrap; }
.sab-label { color: #94A3B8; font-size: 0.9rem; font-weight: bold; margin-right: 15px; }
.health-bar-bg { background: #1E293B; height: 8px; border-radius: 4px; width: 120px; overflow: hidden; margin-right: 15px; }
.health-bar-fill { height: 100%; background: linear-gradient(90deg, #EF4444, #F59E0B, #10B981); width: 0%; transition: width 0.5s ease-out; }

@media (max-width: 1024px) { .ts-wrapper { grid-template-columns: 1fr; } .ts-grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .sab-container { flex-direction: column; align-items: stretch; } .sab-left { justify-content: center; } .sab-right { flex-wrap: wrap; justify-content: center; } .sab-right .ts-btn { flex: 1; text-align: center; justify-content: center; } }

.ts-health-box { background: #0F172A; border: 1px solid #1E293B; border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.ts-id-box { background: rgba(56, 189, 248, 0.05); border: 1px dashed #38BDF8; border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.ts-preview-card { background: #fff; border-radius: 12px; padding: 25px; margin-bottom: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid #E2E8F0; padding-bottom: 15px; }
.preview-toggle { background: #F1F5F9; border-radius: 30px; padding: 4px; display: inline-flex; }
.pt-btn { padding: 6px 16px; border-radius: 20px; border: none; background: transparent; color: #64748B; font-weight: 800; cursor: pointer; font-size: 0.85rem; transition: 0.2s; }
.pt-btn.active { background: #fff; color: #0F172A; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.g-url { color: #202124; font-size: 13px; margin-bottom: 4px; }
.g-title { color: #1a0dab; font-size: 20px; text-decoration: none; margin-bottom: 4px; display: block; line-height: 1.3; font-weight: normal;}
.g-desc { color: #4d5156; font-size: 14px; line-height: 1.6; }
.ai-preview-box { background: linear-gradient(135deg, #F3E8FF, #FDF4FF); border: 1px solid #E9D5FF; border-radius: 12px; padding: 20px; display: none; }
.cta-premium-box { background: linear-gradient(145deg, #18181b 0%, #09090b 100%); border: 1px solid #a855f7; border-radius: 16px; padding: 25px; position: relative; overflow: hidden; margin-top: 25px;}
.cta-premium-box::before { content:''; position:absolute; top:0; left:0; width:100%; height:4px; background: linear-gradient(90deg, #38BDF8, #a855f7); }
.cta-feature-list { list-style: none; padding: 0; margin: 15px 0; color: #cbd5e1; font-size: 0.9rem; line-height: 1.8; }
.cta-feature-list li i { color: #10B981; margin-right: 8px; }