/* ========== 奕界AI低代码平台 - 在线体验版样式 ========== */

[hidden] { display: none !important; }

.lc-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: #0A0A0F;
  color: #e5e7eb;
}

/* ---------- 顶栏 ---------- */
.lc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: rgba(10, 10, 15, 0.96);
  border-bottom: 1px solid rgba(123, 63, 242, 0.25);
  z-index: 20;
}

.lc-topbar-left {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}
.lc-logo {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  white-space: nowrap;
}
.lc-logo-sub {
  font-size: 0.8rem;
  color: #9ca3af;
  white-space: nowrap;
}

.lc-topbar-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
  min-width: 180px;
}
.lc-app-label {
  font-size: 0.8rem;
  color: #9ca3af;
  white-space: nowrap;
}
.lc-app-name {
  width: 220px;
  max-width: 100%;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  background: #1A1A2E;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.lc-app-name:focus {
  border-color: #7B3FF2;
}

.lc-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.lc-back-link {
  color: #9ca3af;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.lc-back-link:hover {
  color: #00F5FF;
}
.lc-btn {
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ---------- 提示条 ---------- */
.lc-notice {
  padding: 0.45rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: #a78bfa;
  background: rgba(123, 63, 242, 0.08);
  border-bottom: 1px solid rgba(123, 63, 242, 0.15);
}

/* ---------- 主布局 ---------- */
.lc-main {
  flex: 1;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 290px;
  min-height: 0;
}

.lc-panel {
  overflow-y: auto;
  background: #10101A;
  border-right: 1px solid rgba(123, 63, 242, 0.12);
  padding: 1rem;
}
.lc-inspector {
  border-right: none;
  border-left: 1px solid rgba(123, 63, 242, 0.12);
}

.lc-panel-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.lc-panel-hint {
  font-size: 0.7rem;
  font-weight: 400;
  color: #6b7280;
}

/* ---------- AI 生成 ---------- */
.lc-ai-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 245, 255, 0.15);
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 1.25rem;
}
.lc-ai-input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  background: #0A0A0F;
  color: #e5e7eb;
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.lc-ai-input:focus {
  border-color: #00F5FF;
}
.lc-ai-btn {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.55rem 0;
  font-size: 0.85rem;
}
.lc-ai-tip {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: #6b7280;
  line-height: 1.5;
}

/* ---------- 组件库 ---------- */
.lc-palette-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
.lc-palette-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.8rem 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(123, 63, 242, 0.15);
  border-radius: 0.7rem;
  color: #d1d5db;
  font-size: 0.78rem;
  cursor: grab;
  user-select: none;
  transition: all 0.2s;
  text-align: center;
}
.lc-palette-item:hover {
  border-color: rgba(0, 245, 255, 0.45);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
}
.lc-palette-item:active {
  cursor: grabbing;
}
.lc-palette-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, rgba(123, 63, 242, 0.3), rgba(0, 245, 255, 0.15));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---------- 画布 ---------- */
.lc-canvas-wrap {
  overflow: auto;
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background:
    radial-gradient(circle at 20% 20%, rgba(123, 63, 242, 0.06), transparent 50%),
    #0A0A0F;
}
.lc-canvas {
  width: 100%;
  max-width: 860px;
  min-height: 560px;
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 1.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  position: relative;
  color: #111827;
}

.lc-canvas-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #9ca3af;
  text-align: center;
  pointer-events: none;
  font-size: 0.95rem;
}
.lc-canvas-empty-icon {
  font-size: 2.4rem;
}

/* ---------- 编辑态组件 ---------- */
.lc-comp {
  position: relative;
  margin-bottom: 0.5rem;
  padding: 0.35rem;
  border: 1.5px dashed transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.lc-comp:hover {
  border-color: rgba(0, 245, 255, 0.5);
  background: rgba(0, 245, 255, 0.04);
}
.lc-comp.selected {
  border-color: #7B3FF2;
  background: rgba(123, 63, 242, 0.06);
}
.lc-comp-actions {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  display: none;
  gap: 0.2rem;
  z-index: 2;
}
.lc-comp:hover .lc-comp-actions,
.lc-comp.selected .lc-comp-actions {
  display: flex;
}
.lc-comp-actions button {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 0.35rem;
  background: #1A1A2E;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s;
}
.lc-comp-actions button:hover {
  background: #7B3FF2;
}

/* 画布内组件内容（编辑态与预览共用视觉） */
.lc-comp-body > * {
  pointer-events: none;
}

.lc-w-heading {
  color: #111827;
  line-height: 1.3;
  margin: 0.25rem 0;
}
.lc-w-heading h1 { font-size: 1.75rem; font-weight: 800; }
.lc-w-heading h2 { font-size: 1.4rem; font-weight: 700; }
.lc-w-heading h3 { font-size: 1.15rem; font-weight: 700; }

.lc-w-text {
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0.25rem 0;
}

.lc-w-btn {
  display: inline-block;
  padding: 0.5rem 1.4rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  margin: 0.25rem 0;
}
.lc-w-btn-primary {
  background: linear-gradient(to right, #7B3FF2, #4A5BFF);
  color: #fff;
}
.lc-w-btn-outline {
  background: transparent;
  color: #7B3FF2;
  border: 1.5px solid #7B3FF2;
}

.lc-w-field {
  margin: 0.4rem 0;
}
.lc-w-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.3rem;
}
.lc-w-input,
.lc-w-textarea,
.lc-w-select {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #fff;
  color: #6b7280;
  font-size: 0.85rem;
  min-height: 36px;
}
.lc-w-textarea {
  min-height: 70px;
  white-space: pre-wrap;
}

.lc-w-image {
  max-width: 100%;
  border-radius: 0.5rem;
  margin: 0.25rem 0;
}
.lc-w-image-placeholder {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #e0e7ff, #f0f9ff);
  color: #6b7280;
  font-size: 0.85rem;
}

.lc-w-table-wrap {
  margin: 0.5rem 0;
}
.lc-w-table-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}
.lc-w-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  color: #374151;
}
.lc-w-table th,
.lc-w-table td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.65rem;
  text-align: left;
}
.lc-w-table th {
  background: #f3f4f6;
  font-weight: 600;
}

.lc-w-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 0.75rem 0;
}

.lc-w-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
  background: #f9fafb;
  margin: 0.4rem 0;
}
.lc-w-card-title {
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.4rem;
}
.lc-w-card-body {
  color: #6b7280;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ---------- 属性面板 ---------- */
.lc-inspector-empty {
  color: #6b7280;
  font-size: 0.85rem;
  line-height: 1.7;
}
.lc-inspector-head {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(123, 63, 242, 0.2);
}
.lc-field {
  margin-bottom: 0.85rem;
}
.lc-field label {
  display: block;
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 0.3rem;
}
.lc-field input,
.lc-field textarea,
.lc-field select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 0.45rem;
  border: 1px solid #374151;
  background: #0A0A0F;
  color: #e5e7eb;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.lc-field input:focus,
.lc-field textarea:focus,
.lc-field select:focus {
  border-color: #7B3FF2;
}

/* ---------- 预览弹层 ---------- */
.lc-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: rgba(5, 5, 10, 0.96);
  backdrop-filter: blur(6px);
}
.lc-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(123, 63, 242, 0.2);
}
.lc-preview-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.lc-device-switch {
  display: flex;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem;
  border-radius: 9999px;
}
.lc-device-switch button {
  border: none;
  background: transparent;
  color: #9ca3af;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.lc-device-switch button.active {
  background: linear-gradient(to right, #7B3FF2, #4A5BFF);
  color: #fff;
}
.lc-preview-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: auto;
}
.lc-preview-frame {
  width: 100%;
  height: 100%;
  max-width: 100%;
  border: none;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
  transition: width 0.3s ease, max-width 0.3s ease;
}

/* ---------- Toast ---------- */
.lc-toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translate(-50%, 20px);
  background: #1A1A2E;
  color: #fff;
  border: 1px solid rgba(123, 63, 242, 0.4);
  border-radius: 0.75rem;
  padding: 0.7rem 1.2rem;
  font-size: 0.85rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
  max-width: min(90vw, 480px);
  text-align: center;
}
.lc-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.lc-toast.warn {
  border-color: rgba(234, 179, 8, 0.5);
}
.lc-toast.success {
  border-color: rgba(34, 197, 94, 0.5);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .lc-main {
    grid-template-columns: 220px minmax(0, 1fr) 250px;
  }
}

@media (max-width: 900px) {
  .lc-body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  .lc-topbar {
    justify-content: center;
  }
  .lc-topbar-center {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
  }
  .lc-main {
    display: flex;
    flex-direction: column;
  }
  .lc-palette,
  .lc-inspector {
    border: none;
    border-bottom: 1px solid rgba(123, 63, 242, 0.12);
  }
  .lc-canvas-wrap {
    min-height: 60vh;
  }
  .lc-canvas {
    min-height: 420px;
  }
}
