/* ================= 3D 立体文字生成器 ================= */
.t3d-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin: 18px 0 32px;
}

.t3d-panel {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 18px;
}

.t3d-field { margin-bottom: 16px; }
.t3d-field:last-child { margin-bottom: 0; }
.t3d-field > label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}

.t3d-field textarea,
.t3d-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg2);
  color: var(--ink);
  font-family: inherit;
  font-size: .95rem;
  line-height: 1.5;
  resize: vertical;
}
.t3d-field textarea:focus,
.t3d-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 滑块 */
.t3d-sliders { display: grid; gap: 12px; margin-bottom: 16px; }
.t3d-slider > label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.t3d-slider > label span { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.t3d-slider input[type="range"] {
  width: 100%;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* 颜色 */
.t3d-colors { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.t3d-colors input[type="color"] {
  width: 44px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg2);
  cursor: pointer;
}
.t3d-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg2);
  color: var(--ink);
  font-family: inherit;
  font-size: .8rem;
  cursor: pointer;
}
.t3d-mini-btn:hover { border-color: var(--accent); color: var(--accent); }

/* 开关 */
.t3d-switch-label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.t3d-switch { position: relative; display: inline-flex; width: 44px; height: 24px; }
.t3d-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.t3d-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--rule);
  transition: background .18s ease;
}
.t3d-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .18s ease;
}
.t3d-switch input:checked + .t3d-switch-track { background: var(--accent); }
.t3d-switch input:checked + .t3d-switch-track::after { transform: translateX(20px); }

.t3d-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 预览区 */
.t3d-preview-panel { display: flex; flex-direction: column; gap: 12px; }
.t3d-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.t3d-preview-head h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 700;
}

.t3d-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background-color: var(--bg2);
  background-image:
    linear-gradient(45deg, rgba(128, 128, 128, .12) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(128, 128, 128, .12) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(128, 128, 128, .12) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(128, 128, 128, .12) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  overflow: hidden;
}
.t3d-stage canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.t3d-hint {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  font-size: .8rem;
  line-height: 1.7;
  color: var(--muted);
}
.t3d-hint i { color: var(--accent); font-size: 1rem; flex-shrink: 0; margin-top: 2px; }

@media (max-width: 860px) {
  .t3d-layout { grid-template-columns: 1fr; gap: 14px; }
  .t3d-panel { padding: 15px; }
  .t3d-stage { min-height: 240px; padding: 14px; }
}
