:root {
  color-scheme: dark;
  --bg: #0b0b0a;
  --panel: #151514;
  --panel-2: #1d1c1a;
  --text: #f3f0e8;
  --muted: #aaa59a;
  --line: rgba(243, 240, 232, 0.14);
  --line-strong: rgba(243, 240, 232, 0.24);
  --accent: #c7a764;
  --accent-soft: rgba(199, 167, 100, 0.16);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body:not(.auth-locked) {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

button, input, select, textarea { font: inherit; }

button, a {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

button:hover, a:hover { border-color: var(--accent); }

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .admin-header,
body.auth-locked .admin-layout {
  display: none;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(199, 167, 100, 0.13), transparent 28rem),
    var(--bg);
}

.auth-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #151514, #10100f);
  padding: 32px;
}

.auth-card p {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 0 0 24px;
}

.auth-card label {
  display: grid;
  gap: 8px;
}

.auth-card span,
.auth-card small {
  color: var(--muted);
  font-size: 13px;
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

.auth-card input:focus {
  border-color: var(--accent);
}

.auth-card button {
  width: 100%;
  min-height: 44px;
  margin-top: 16px;
}

.auth-card button.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 700;
}

body:not(.auth-locked) .auth-gate {
  display: none;
}

/* ===== Header ===== */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 10, 0.88);
  padding: 20px 28px;
  backdrop-filter: blur(18px);
}

.admin-header p, .editor-title p, #previewType {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.admin-header h1, .editor-title h2 { margin: 0; }

.admin-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.sync-status {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.sync-status span {
  border: 1px solid rgba(243, 240, 232, 0.12);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
}

.sync-status[data-tone="success"] span:first-child { border-color: rgba(84, 190, 128, 0.45); color: #8fe0ad; }
.sync-status[data-tone="warning"] span:first-child { border-color: rgba(223, 177, 73, 0.55); color: #f0c96d; }
.sync-status[data-tone="error"] span:first-child { border-color: rgba(220, 88, 88, 0.55); color: #ff9a9a; }
.sync-status[data-tone="busy"] span:first-child { border-color: rgba(117, 166, 255, 0.55); color: #a9c8ff; }

.online-backup-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  border: 1px solid var(--line-strong);
  background: #11110f;
  color: var(--text);
  padding: 24px;
}

.online-backup-dialog::backdrop { background: rgba(0, 0, 0, 0.76); backdrop-filter: blur(5px); }
.online-backup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.online-backup-head p { margin: 0 0 6px; color: var(--accent); font-size: 11px; letter-spacing: 0.16em; }
.online-backup-head h2 { margin: 0; }
.online-backup-note { color: var(--muted); font-size: 13px; line-height: 1.7; }
.online-backup-list { display: grid; gap: 10px; margin: 20px 0; overflow: auto; }
.online-backup-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); padding: 12px 14px; }
.online-backup-row small { display: block; margin-top: 4px; color: var(--muted); word-break: break-all; }
.online-backup-row button { flex: 0 0 auto; padding: 8px 12px; }

.admin-header a, .admin-header button,
.sidebar-head button, .action-bar button {
  min-height: 42px;
  padding: 0 14px;
}

.admin-header a,
.admin-header button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border-color: rgba(243, 240, 232, 0.16);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.admin-header a:hover,
.admin-header button:hover {
  border-color: rgba(199, 167, 100, 0.7);
  background: rgba(199, 167, 100, 0.12);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ===== Layout ===== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

/* ===== Module Nav (Sidebar) ===== */
.module-nav {
  border-right: 1px solid var(--line);
  background: #10100f;
  padding: 10px 0;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.module-nav button {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 16px 22px;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  transition: background 140ms ease, color 140ms ease;
}

.module-nav button:last-child { border-bottom: 0; }

.module-nav button.active {
  background: var(--accent-soft);
  color: var(--text);
  border-left: 3px solid var(--accent);
}

.module-nav button:hover:not(.active) {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

/* ===== Editor Panel ===== */
.editor-panel {
  /* 顶部 padding 移到冻结标题栏内，保证 sticky 标题能盖住整个可视区顶部（否则内容从标题上方 28px 穿帮） */
  padding: 0 28px 28px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.editor-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  /* 冻结模块标题栏：负边距覆盖面板左右 padding，吸附后完全盖住滚动内容 */
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 -28px 24px;
  padding: 28px 28px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

#saveState {
  border: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

#saveState.saved {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Work Form ===== */
.work-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.work-form label {
  display: grid;
  gap: 8px;
}

.work-form label.span-2 { grid-column: span 2; }

.work-form label.span-3 { grid-column: span 3; }

.featured-editor-section {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px solid rgba(199, 167, 100, 0.42);
  background: linear-gradient(135deg, rgba(199, 167, 100, 0.11), rgba(255, 255, 255, 0.018) 58%);
}

.featured-editor-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.featured-editor-heading p {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.featured-editor-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 23px;
}

.featured-editor-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.featured-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.featured-editor-grid label {
  display: grid;
  gap: 8px;
}

.featured-editor-grid .span-2 {
  grid-column: 1 / -1;
}

.work-form span {
  color: var(--muted);
  font-size: 13px;
}

.work-form input,
.work-form select,
.work-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 12px;
  outline: none;
}

.work-form input:focus,
.work-form select:focus,
.work-form textarea:focus {
  border-color: var(--accent);
}

#brandsInput {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 12px;
  border-radius: 8px;
  outline: none;
  resize: vertical;
  line-height: 1.6;
}

#brandsInput:focus {
  border-color: var(--accent);
}

/* ===== Preview ===== */
.preview-panel {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 18px;
  margin-top: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
}

.preview-cover {
  aspect-ratio: 16 / 10;
  background: #050505;
  overflow: hidden;
}

.preview-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#previewTitle { margin: 0; font-size: 24px; line-height: 1.25; }
#previewMeta { display: block; margin-top: 12px; color: var(--muted); }
#previewStats { display: block; margin-top: 14px; color: var(--accent); }

/* ===== Action Bar ===== */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.action-bar .primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 700;
}

.note {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.75;
}

.module-hint {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.7;
}

.editable-map {
  margin-top: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
}

.editable-map h3 {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 16px;
}

.editable-map p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.editable-map .list-editor {
  margin-top: 14px;
}

.sortable-card {
  cursor: grab;
  transition: border-color 140ms ease, background 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.sortable-card:active {
  cursor: grabbing;
}

.sortable-card.dragging {
  opacity: 0.5;
  background: rgba(199, 167, 100, 0.08);
}

.sortable-card.drag-over {
  border-color: rgba(199, 167, 100, 0.8);
  box-shadow: inset 3px 0 0 var(--accent);
}

.drag-handle {
  display: inline-block;
  margin-right: 8px;
  color: var(--accent);
  letter-spacing: -0.2em;
  opacity: 0.72;
}

.image-picker {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.field-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.work-media-group {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px solid rgba(243, 240, 232, 0.14);
  background: rgba(255, 255, 255, 0.018);
}

.work-media-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(243, 240, 232, 0.1);
}

.work-media-heading p {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.work-media-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.work-media-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.work-media-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.playback-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-file-picker {
  min-height: 42px;
  margin-top: 0;
  color: var(--muted);
  font-size: 13px;
}

.video-upload-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.video-upload-control button {
  flex: 0 0 auto;
  min-height: 38px;
  border-color: rgba(199, 167, 100, 0.55);
  color: var(--accent);
}

.video-upload-control button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.video-upload-control span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-upload-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.video-upload-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8f6f35, var(--accent));
  transition: width 160ms ease;
}

.video-transcode-panel {
  align-content: start;
}

.video-transcode-panel input[readonly] {
  cursor: default;
  color: var(--muted);
}

.video-transcode-state {
  min-height: 38px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.video-transcode-state[data-tone="success"] { border-color: rgba(84, 190, 128, 0.45); color: #8fe0ad; }
.video-transcode-state[data-tone="warn"] { border-color: rgba(223, 177, 73, 0.55); color: #f0c96d; }
.video-transcode-state[data-tone="error"] { border-color: rgba(220, 88, 88, 0.55); color: #ff9a9a; }
.video-transcode-state[data-tone="progress"] { border-color: rgba(117, 166, 255, 0.55); color: #a9c8ff; }

#triggerVideoTranscodeBtn {
  min-height: 38px;
  border-color: rgba(199, 167, 100, 0.55);
  color: var(--accent);
}

#triggerVideoTranscodeBtn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ===== Skills Editor ===== */
.skills-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  background: var(--panel);
  cursor: default;
  transition: border-color 140ms ease;
}

.skill-chip .remove-skill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.skill-chip .remove-skill:hover {
  background: #c0392b;
  color: #fff;
}

.add-skill-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
}

.add-skill-row input {
  flex: 1;
  max-width: 300px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 10px 14px;
  outline: none;
}

.add-skill-row input:focus { border-color: var(--accent); }

/* ===== List Editor (Profile / Experience / Growth Path) ===== */
.list-editor {
  display: grid;
  gap: 14px;
}

.list-item-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
}

.list-item-card .item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.list-item-card .item-header strong {
  font-size: 16px;
}

.list-item-card .item-header button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  background: rgba(192, 57, 43, 0.15);
  border-color: rgba(192, 57, 43, 0.3);
  color: #e74c3c;
}

.list-item-card .item-header button:hover {
  background: rgba(192, 57, 43, 0.3);
}

.list-item-card .item-fields {
  display: grid;
  gap: 10px;
}

.list-item-card .item-fields.two-cols {
  grid-template-columns: minmax(160px, 0.45fr) minmax(220px, 1fr);
}

.metric-image-editor {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 12px;
}

.metric-image-editor > label {
  display: grid;
  align-content: start;
  gap: 5px;
}

.metric-image-editor > label > span {
  color: var(--muted);
  font-size: 12px;
}

.metric-image-preview {
  display: grid;
  min-height: 112px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
}

.metric-image-preview img {
  width: 100%;
  height: 112px;
  object-fit: cover;
}

.metric-image-preview i {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.list-item-card .item-fields label {
  display: grid;
  gap: 4px;
}

.list-item-card .item-fields span {
  color: var(--muted);
  font-size: 12px;
}

.list-item-card .item-fields input,
.list-item-card .item-fields select,
.list-item-card .item-fields textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 10px;
  outline: none;
}

.list-item-card .item-fields input:focus,
.list-item-card .item-fields select:focus,
.list-item-card .item-fields textarea:focus {
  border-color: var(--accent);
}

.list-item-card .array-field {
  display: grid;
  gap: 6px;
}

.list-item-card .array-field .array-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.list-item-card .array-field .array-row input {
  flex: 1;
}

.list-item-card .array-field .array-row button {
  min-height: 34px;
  width: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.add-item-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

.add-item-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ===== Work List ===== */
/* 桌面端固定高度 + 行高锁定：左右两列各自内部滚动，左侧列表区（含工具栏）完全冻结 */
.works-editor-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  /* 关键：隐式行默认 auto 会被右列长表单撑开，必须锁定为容器高度 */
  grid-template-rows: minmax(0, 1fr);
  gap: 22px;
  min-height: 0;
  align-items: stretch;
  height: calc(100vh - 320px);
  overflow: hidden;
}

.work-list-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.work-detail-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.work-list-head {
  flex-shrink: 0;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.work-list-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.work-list-actions button {
  min-height: 42px;
  padding: 8px 12px;
}

.work-list-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(220, 88, 88, 0.28);
  background: rgba(220, 88, 88, 0.055);
}

.work-list-danger-zone > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.work-list-danger-zone strong {
  color: #ff9a9a;
  font-size: 12px;
}

.work-list-danger-zone small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

#resetWorksBtn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 10px;
  border-color: rgba(220, 88, 88, 0.62);
  color: #ff9a9a;
  background: rgba(220, 88, 88, 0.08);
}

#resetWorksBtn:hover:not(:disabled) {
  border-color: #ff9a9a;
  color: #fff;
  background: rgba(192, 57, 43, 0.48);
}

#resetWorksBtn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

#workSearchInput {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
}

#workSearchInput:focus {
  border-color: var(--accent);
  outline: none;
}

.work-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.work-filter-chips button {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: transparent;
}

.work-filter-chips button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.work-filter-chips button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.work-list-count {
  margin: 8px 4px 0;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.work-list-empty {
  padding: 24px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.work-list {
  display: grid;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.work-list button {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  width: 100%;
  align-items: center;
  border: 0; border-bottom: 1px solid var(--line);
  padding: 16px 22px; text-align: left;
  cursor: grab;
  transition: background 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}
.work-list button:active { cursor: grabbing; }
.work-list button.active { background: var(--accent-soft); }
.work-list button.dragging {
  opacity: 0.48;
  background: rgba(199, 167, 100, 0.12);
}
.work-list button.drag-over {
  box-shadow: inset 3px 0 0 var(--accent), inset 0 1px 0 rgba(199, 167, 100, 0.45);
  background: rgba(199, 167, 100, 0.09);
}
.work-drag-handle {
  color: var(--accent);
  font-size: 15px;
  letter-spacing: -0.2em;
  opacity: 0.72;
  pointer-events: none;
}
.work-list-text {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.work-list strong { font-size: 15px; line-height: 1.35; }
.work-list span { color: var(--muted); font-size: 12px; }
.work-list-text strong {
  color: var(--text);
}

/* 已关联视频的作品标记（可进放映厅） */
.work-video-dot {
  color: #58d68d;
  font-size: 10px;
  justify-self: end;
}

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .metric-image-editor {
    grid-template-columns: 1fr;
  }

  body:not(.auth-locked) {
    height: auto;
    min-height: 100vh;
    overflow: auto;
    display: block;
  }
  .admin-layout { grid-template-columns: 1fr; }
  .works-editor-layout {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto;
    overflow: visible;
  }
  /* 移动端：标题栏不冻结（顶部导航已吸顶），列表工具栏冻结在导航下方 */
  .editor-title {
    position: static;
    margin: 0 0 24px;
    padding: 28px 0 0;
    border-bottom: 0;
  }
  .work-detail-panel {
    overflow: visible;
    padding-right: 0;
  }
  .work-list-panel {
    overflow: visible;
  }
  .work-list {
    overflow: visible;
  }
  .work-list-head {
    position: sticky;
    top: 56px;
    z-index: 20;
    background: var(--bg);
    padding: 8px 0;
  }
  .work-list-danger-zone {
    align-items: flex-start;
  }
  .module-nav {
    position: sticky;
    top: 0;
    z-index: 8;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0;
  }
  .module-nav button {
    width: auto;
    min-width: max-content;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .work-form { grid-template-columns: 1fr; }
  .featured-editor-section { grid-column: auto; padding: 18px; }
  .featured-editor-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .featured-editor-grid { grid-template-columns: 1fr; }
  .featured-editor-grid .span-2 { grid-column: auto; }
  .work-media-group { grid-column: auto; padding: 16px; }
  .work-media-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .work-media-grid,
  .playback-settings-grid { grid-template-columns: 1fr; }
  .list-item-card .item-fields.two-cols { grid-template-columns: 1fr; }
  .preview-panel { grid-template-columns: 1fr; }
  .work-form label.span-2 { grid-column: auto; }
  .admin-header { display: grid; }
}

/* ===== 模块位置标注（导航副标题）===== */
.module-nav button .module-pos {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 0.55;
}

.module-nav button.active .module-pos {
  opacity: 0.8;
}

/* ===== 模块说明（标题旁 ? 悬浮提示）===== */
.editor-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-hint-wrap {
  position: relative;
  display: inline-flex;
}

.editor-hint-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: help;
  background: transparent;
}

.editor-hint-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.editor-hint-tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  width: max-content;
  max-width: min(420px, 70vw);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
  font-weight: 400;
  white-space: normal;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.editor-hint-wrap:hover .editor-hint-tip,
.editor-hint-wrap.is-open .editor-hint-tip {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===== Banner 编辑器：预览图 + 启停开关 + 类型字段组 ===== */
.banner-editor-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
}

.banner-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  display: grid;
  place-items: center;
}

.banner-preview img,
.banner-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-preview-empty {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 12px;
  text-align: center;
  line-height: 1.6;
}

.banner-preview-empty.is-error {
  color: #d78a80;
}

.banner-preview-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* 类型字段组按卡片 data-kind 显隐 */
.banner-card[data-kind="image"] .field-video { display: none; }
.banner-card[data-kind="video"] .field-image { display: none; }

/* 启停开关 */
.banner-enabled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 12px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  user-select: none;
}

.banner-enabled input {
  appearance: none;
  width: 34px;
  height: 20px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-2);
  position: relative;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.banner-enabled input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s ease, background 0.18s ease;
}

.banner-enabled input:checked {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.banner-enabled input:checked::after {
  transform: translateX(14px);
  background: var(--accent);
}

.banner-enabled input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.banner-state-tag {
  margin-left: 10px;
  padding: 1px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.06em;
}

/* 停用态：整卡降透明度，预览去饱和，一眼可辨 */
.banner-card.is-disabled .banner-editor-body {
  opacity: 0.45;
}

.banner-card.is-disabled .banner-preview img,
.banner-card.is-disabled .banner-preview video {
  filter: saturate(0);
}

@media (max-width: 720px) {
  .banner-editor-body {
    grid-template-columns: 1fr;
  }
}

/* ===== 交付打磨：不完整标记 / 草稿圆点 / 表单图片预览 ===== */
.list-item-card.is-incomplete {
  border-style: dashed;
  border-color: rgba(199, 167, 100, 0.55);
}

.card-incomplete-hint {
  margin-left: auto;
  color: var(--accent);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* 侧边栏「有未发布改动」圆点 */
.module-nav button {
  position: relative;
}

.module-nav button.has-draft::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(199, 167, 100, 0.7);
}

/* 表单型字段的图片预览（方法论/成长路径/履历氛围图/图集）——固定小缩略图，绝不铺满 */
.form-image-preview {
  display: block;
  width: 168px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}

.form-image-preview[hidden],
.form-image-preview.is-broken {
  display: none;
}

/* 含预览的字段标签：缩略图居左并与右侧字段组整体垂直居中，字段共享同一左缘 */
label:has(.form-image-preview) {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 6px 14px;
  align-items: start;
}

label:has(.form-image-preview) > span,
label:has(.form-image-preview) > input,
label:has(.form-image-preview) > select {
  grid-column: 2;
}

label:has(.form-image-preview) > .form-image-preview {
  grid-column: 1;
  grid-row: 1 / span 3; /* 注意：隐式网格里 1 / -1 不生效，必须用正数 span */
  align-self: center;
  margin-top: 0;
}

label:has(.form-image-preview) > input[type="file"] {
  padding: 7px 10px;
  font-size: 12px;
}
