/* Topic page editor styles. PC-only admin workspace; do not add mobile adaptation here. */

.topic-editor-page {
  display: grid;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
}

.topic-editor-actions,
.topic-editor-context,
.topic-slice-toolbar,
.topic-slice-toolbar > div,
.topic-slice-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.topic-editor-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.topic-floating-header {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  min-width: 0;
}

.topic-floating-header strong {
  color: var(--text);
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 700;
  line-height: 34px;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-floating-actions {
  align-items: center;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 12px;
  padding-bottom: 10px;
  width: 100%;
}

.topic-editor-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr auto;
  margin-bottom: 16px;
  min-width: 0;
  padding-bottom: 14px;
}

.topic-editor-toolbar strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-base-settings {
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 128px;
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.topic-base-settings label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.topic-base-settings span {
  color: #1f2937;
  font-size: 12px;
}

.topic-base-settings .plain-input {
  font-size: 13px;
  margin-bottom: 0;
  min-height: 34px;
  width: 100%;
}

.topic-selected-settings-wrap {
  position: static;
}

.topic-editor-mainbar {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
}

.topic-editor-actions .ghost-btn,
.topic-editor-actions .secondary-btn {
  font-size: 14px;
  height: 38px;
  min-height: 38px;
}

.topic-floating-actions .ghost-btn,
.topic-floating-actions .secondary-btn {
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
}

.topic-back-btn {
  flex: 0 0 auto;
  min-width: 92px;
}

.topic-zoom-control {
  align-items: center;
  display: flex;
  gap: 6px;
}

.topic-zoom-control span {
  color: var(--muted);
  font-size: 13px;
}

.topic-zoom-control .plain-input {
  min-height: 34px;
  width: 112px;
}

.topic-editor-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 660px max-content;
  justify-content: start;
  min-width: 0;
  overflow: visible;
  width: max-content;
}

.topic-editor-settings-column {
  background: #fff;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  display: grid;
  gap: 0;
  align-content: start;
  align-self: start;
  max-height: calc(100vh - 32px);
  min-width: 0;
  outline: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px;
  position: sticky;
  top: 16px;
  width: 660px;
  z-index: 5;
}

.topic-slice-panel {
  background: #fff;
  border-radius: 8px;
  min-width: 0;
  overflow: visible;
  padding: 0;
  width: max-content;
  justify-self: start;
}

.topic-settings-panel {
  min-width: 0;
}

.topic-slice-toolbar {
  justify-content: flex-end;
  margin-bottom: 8px;
}

.topic-slice-list {
  background: #fff;
  border-radius: 8px;
  display: grid;
  gap: 0;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  width: max-content;
}

.topic-slice-card {
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 0;
  min-width: 0;
  padding: 0;
  width: max-content;
}

.topic-slice-card.selected {
  box-shadow: none;
}

.topic-slice-meta {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1.6fr) minmax(180px, 0.8fr);
}

.topic-slice-meta label {
  display: grid;
  gap: 5px;
}

.topic-slice-meta span {
  color: var(--muted);
  font-size: 12px;
}

.topic-image-editor-frame {
  background: #f5f6f8;
  border: 0;
  margin: 0;
  min-height: 140px;
  overflow: hidden;
  position: relative;
  width: 1200px;
}

.topic-image-editor-frame.no-bg {
  min-height: 720px;
  background: #fff;
}

.fixed-page-layout-frame {
  min-height: 720px;
  background: #fff;
}

.fixed-page-layout-empty {
  align-items: flex-start;
  box-sizing: border-box;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  height: 720px;
  justify-content: flex-end;
  padding: 14px 18px;
  pointer-events: none;
}

.topic-image-editor-frame.zoom-fit {
  width: 1200px;
}

.topic-image-editor-frame.zoom-75 {
  width: 900px;
}

.topic-image-editor-frame.zoom-100 {
  width: 1200px;
}

.topic-slice-scroll {
  overflow-x: visible;
  overflow-y: hidden;
  width: max-content;
}

.topic-image-edit-box {
  display: grid;
  min-width: 0;
  width: max-content;
}

.topic-selected-settings-wrap {
  display: block;
  border-top: 1px solid var(--border) !important;
  box-shadow: inset 0 1px 0 var(--border);
  margin-top: 16px;
  padding-top: 16px;
}

.topic-image-settings-wrap {
  display: grid;
  gap: 12px;
}

.topic-image-editor-frame img {
  display: block;
  height: auto;
  width: 100%;
}

.topic-empty-media {
  align-items: center;
  color: var(--muted);
  display: flex;
  min-height: 140px;
  justify-content: center;
}

.topic-hotspot-box {
  align-items: center;
  background: rgba(247, 91, 43, 0.16);
  border: 2px dashed var(--brand);
  color: #18212f;
  cursor: move;
  display: flex;
  font-size: 12px;
  justify-content: center;
  min-height: 22px;
  min-width: 32px;
  padding: 0;
  position: absolute;
  text-align: center;
  z-index: 2;
}

.topic-layer-box img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.topic-layer-box.type-image,
.topic-layer-box.type-video {
  background: rgba(255, 255, 255, 0.78);
}

.topic-layer-box.type-text {
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.86);
  justify-content: flex-start;
  overflow: hidden;
  padding: 8px;
}

.topic-layer-box.type-text span {
  display: block;
  overflow: hidden;
  white-space: pre-wrap;
  width: 100%;
}

.topic-layer-box.type-video::after {
  background: rgba(0, 0, 0, 0.62);
  border-radius: 999px;
  color: #fff;
  content: "播放";
  font-size: 12px;
  left: 50%;
  padding: 3px 8px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.topic-hotspot-box.selected {
  background: rgba(102, 0, 153, 0.18);
  border-color: #660099;
}

.topic-hotspot-box i {
  background: #fff;
  border: 1px solid currentColor;
  bottom: -5px;
  cursor: nwse-resize;
  height: 10px;
  position: absolute;
  right: -5px;
  width: 10px;
}

.topic-settings-block {
  display: grid;
  gap: 12px;
}

.topic-settings-panel {
  background: transparent;
  border: 0;
  display: grid;
  gap: 10px;
  max-width: 420px;
  padding: 0;
  position: static;
}

.topic-card-settings {
  max-width: none;
  min-width: 0;
  position: static;
  width: 100%;
}

.topic-image-settings-wrap,
.topic-selected-settings-wrap {
  position: static;
}

.topic-image-list {
  max-height: 120px;
  overflow: auto;
}

.topic-settings-block {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.topic-settings-block h3,
.topic-settings-heading h3 {
  font-size: 15px;
  line-height: 1.2;
  margin: 0;
}

.topic-settings-block label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.topic-settings-block label span {
  color: #1f2937;
  font-size: 12px;
}

.topic-settings-block .plain-input {
  font-size: 13px;
  min-height: 34px;
  width: 100%;
}

.topic-position-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.topic-position-grid label {
  min-width: 0;
}

.topic-position-grid .plain-input {
  padding-left: 8px;
  padding-right: 6px;
}

.topic-settings-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}

.topic-layer-list {
  border: 1px solid var(--border);
  border-radius: 6px;
  display: grid;
  overflow: hidden;
}

.topic-layer-list button {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  min-height: 34px;
  padding: 7px 10px;
  text-align: left;
}

.topic-layer-list button:last-child {
  border-bottom: 0;
}

.topic-layer-list button.active {
  background: rgba(247, 91, 43, 0.1);
  color: var(--brand);
}

.topic-layer-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-layer-list em {
  color: var(--muted);
  flex: 0 0 auto;
  font-style: normal;
  margin-left: 8px;
}

.topic-layer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-layer-actions .table-action-btn {
  min-height: 30px;
  padding: 0 10px;
}

.topic-editor-settings-column .topic-floating-header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.topic-editor-settings-column .topic-floating-actions {
  border-bottom: 0;
  justify-content: flex-end;
  margin-bottom: 0;
  padding-bottom: 0;
  width: auto;
}

.topic-editor-settings-column .topic-card-settings {
  display: grid;
  gap: 12px;
}

.topic-editor-settings-column .topic-settings-block:has(.topic-image-list) .topic-layer-actions {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.topic-editor-settings-column .topic-selected-settings-wrap .topic-card-settings {
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-areas:
    "heading heading"
    "list type"
    "pick1 field1"
    "pick2 field2"
    "actions actions";
  gap: 12px 14px;
}

.topic-editor-settings-column .topic-selected-settings-wrap .topic-settings-heading {
  grid-area: heading;
}
.topic-editor-settings-column .topic-selected-settings-wrap .topic-layer-list,
.topic-editor-settings-column .topic-selected-settings-wrap .muted-note {
  grid-area: list;
}

.topic-editor-settings-column .topic-selected-settings-wrap label {
  align-content: start;
}

.topic-editor-settings-column .topic-selected-settings-wrap label:has(select[data-selected-hotspot-field="type"]) {
  grid-area: type;
}

.topic-editor-settings-column .topic-selected-settings-wrap label:has(input[data-selected-hotspot-field="url"]),
.topic-editor-settings-column .topic-selected-settings-wrap label:has(input[data-selected-hotspot-field="link_url"]) {
  grid-area: field1;
}

.topic-editor-settings-column .topic-selected-settings-wrap label:has(input[data-selected-hotspot-field="poster"]) {
  grid-area: field2;
}

.topic-editor-settings-column .topic-selected-settings-wrap .topic-text-field {
  grid-column: 1 / -1;
}

.topic-editor-settings-column .topic-selected-settings-wrap .topic-text-field textarea {
  min-height: 118px;
  resize: vertical;
}

.topic-text-style-grid,
.topic-position-grid {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.topic-text-style-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.topic-editor-settings-column .topic-selected-settings-wrap button[data-pick-selected-layer-image],
.topic-editor-settings-column .topic-selected-settings-wrap button[data-pick-selected-layer-video] {
  grid-area: pick1;
}

.topic-editor-settings-column .topic-selected-settings-wrap button[data-pick-selected-layer-poster] {
  grid-area: pick2;
}

.topic-editor-settings-column .topic-selected-settings-wrap button[data-pick-selected-layer-image],
.topic-editor-settings-column .topic-selected-settings-wrap button[data-pick-selected-layer-video],
.topic-editor-settings-column .topic-selected-settings-wrap button[data-pick-selected-layer-poster] {
  min-height: 32px;
  width: 100%;
}

.topic-editor-settings-column .topic-selected-settings-wrap .topic-layer-actions {
  grid-area: actions;
}

.topic-editor-settings-column .topic-selected-settings-wrap .topic-layer-actions {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
