/* 用户设计页作者卡：复用公开主页身份信息，不干扰编辑器主流程。 */
.template-overview-card {
  margin-bottom: 26px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* 模板编号与低频操作降权，保留足够的桌面点击热区。 */
.layer-panel-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.layer-panel-meta-id {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 2px;
}

.layer-panel-meta-id__text {
  min-width: 0;
  overflow: hidden;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-panel-meta-copy,
.layer-panel-favorite-action {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.layer-panel-meta-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.layer-panel-icon-button,
.layer-panel-complaint-link {
  display: inline-flex;
  min-width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.layer-panel-icon-button {
  padding: 0;
}

.layer-panel-icon-button:hover,
.layer-panel-complaint-link:hover {
  background: color-mix(in srgb, var(--primary, #846feb) 7%, transparent);
  color: var(--primary, #846feb);
}

.layer-panel-icon-button:focus-visible,
.layer-panel-complaint-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary, #846feb) 30%, transparent);
  outline-offset: 1px;
}

.layer-panel-icon-button:disabled,
.layer-panel-icon-button[data-disabled='1'] {
  cursor: not-allowed;
}

.layer-panel-icon-button svg {
  width: 14px !important;
  height: 14px !important;
  pointer-events: none;
}

.layer-panel-complaint-link {
  min-width: auto;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
}

.layer-panel-name-row {
  margin: 0;
}

.layer-panel-name-text {
  display: -webkit-box;
  overflow: hidden;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.template-author-entry {
  margin: -2px 0 16px;
}

.template-overview-card .template-author-entry {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid #ececf3;
}

.template-author-entry[hidden],
.template-author-avatar[hidden],
.template-author-card__level[hidden] {
  display: none !important;
}

.template-author-card {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 72px;
  gap: 11px;
  padding: 9px;
  border: 1px solid #ececf3;
  border-radius: 14px;
  background: #ffffff;
  color: var(--foreground, #1a1b25);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(33, 35, 58, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.template-author-card:hover {
  border-color: color-mix(in srgb, var(--primary, #846feb) 42%, white);
  box-shadow: 0 7px 18px rgba(75, 62, 140, 0.09);
}

.template-author-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary, #846feb) 22%, transparent);
  outline-offset: 2px;
  border-color: var(--primary, #846feb);
}

.template-author-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: var(--muted, #f1f1f8);
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(50, 44, 85, 0.14);
}

.template-author-card__body {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.template-author-card__meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.template-author-card__name {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #18181b;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-author-card__level {
  color: var(--primary, #846feb);
}

.template-author-card__identity {
  color: #9a9aa2;
}

/* 平面信息区内不再嵌套作者卡，仅保留整行主页链接能力。 */
.template-overview-card .template-author-card {
  min-height: 64px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.template-overview-card .template-author-card:hover {
  border-color: transparent;
  background: color-mix(in srgb, var(--primary, #846feb) 5%, transparent);
  box-shadow: none;
}

.template-overview-card .template-author-card:focus-visible {
  border-color: transparent;
}

/* 图层管理使用专业工具式平面列表，仅悬浮和选中态提供表面反馈。 */
#layersPanel #layers-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#layersPanel .layer-item {
  min-height: 46px;
  margin: 0 !important;
  padding: 6px 8px !important;
  border: 0 !important;
  border-left: 2px solid transparent !important;
  border-radius: 6px !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: background-color 160ms ease, border-color 160ms ease !important;
}

#layersPanel .layer-item:hover {
  border-left-color: transparent !important;
  background: color-mix(in srgb, var(--primary, #846feb) 5%, transparent) !important;
  box-shadow: none !important;
}

#layersPanel .layer-item.active,
#layersPanel .layer-item.hidden-layer.active {
  border-left-color: var(--primary, #846feb) !important;
  background: color-mix(in srgb, var(--primary, #846feb) 12%, white) !important;
  box-shadow: none !important;
}

#layersPanel .layer-item.active .layer-name {
  color: #3f356f !important;
  font-weight: 600;
}

#layersPanel .layer-item.hidden-layer:not(.active) {
  border-left-color: transparent !important;
  background: transparent !important;
}

#layersPanel .layer-item.dragging,
#layersPanel .layer-item.long-press-active {
  border: 1px solid var(--primary, #846feb) !important;
  border-left-width: 2px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 20px rgba(75, 62, 140, 0.15) !important;
}

#layersPanel .layer-actions {
  width: 28px;
  margin: 0 8px 0 0 !important;
  gap: 0;
}

#layersPanel .layer-visibility-icon {
  width: 28px !important;
  height: 28px !important;
}

#layersPanel .background-canvas-layer .layer-visibility-toggle svg {
  width: 16px;
  height: 16px;
}

#layersPanel .layer-content {
  min-width: 0;
}

#layersPanel .layer-thumbnail,
#layersPanel .layer-thumbnail-placeholder {
  width: 24px;
  height: 24px;
  margin: 0 8px 0 0;
  flex: 0 0 24px;
}

#layersPanel .layer-thumbnail-placeholder {
  border: 0;
  background: #f3f4f8;
  color: #8b8d98;
  font-size: 12px;
}

#layersPanel .layer-thumbnail-placeholder svg {
  width: 15px;
  height: 15px;
}

#layersPanel .layer-name {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.bm-mobile-layout .mobile-template-author-card {
  padding: 10px;
}

.bm-mobile-layout .mobile-template-author-card .template-author-card {
  min-height: 78px;
  padding: 11px 12px;
  border: 0;
  background: #ffffff;
  box-shadow: 0 3px 14px rgba(75, 62, 140, 0.08);
}

.bm-mobile-layout .mobile-template-author-card .template-author-avatar {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
}

.bm-mobile-layout #layersPanel #layers-list {
  gap: 4px;
}

.bm-mobile-layout #layersPanel .layer-item {
  min-height: 52px;
  margin: 0 !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
}

.bm-mobile-layout #layersPanel .layer-name {
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .template-author-card {
    transition: none;
  }
}
