:root {
  --topbar-height: 64px;
  --tabs-height: 47px;
  --ink: #17221d;
  --paper: #ebe7dc;
  --surface: #fffdf7;
  --surface-soft: rgba(255, 253, 247, 0.86);
  --moss: #46584e;
  --copper: #8f5d32;
  --line: rgba(23, 34, 29, 0.24);
  --line-strong: rgba(23, 34, 29, 0.46);
  --red: #913f36;
  --green: #356448;
  --blue: #285f6b;
  --amber: #875a25;
  --shadow: 0 18px 50px rgba(23, 34, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100vh;
  overflow: hidden;
}

body {
  height: 100vh;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 2%, rgba(255, 255, 255, 0.74), transparent 32rem),
    linear-gradient(135deg, var(--paper), #ebe8df);
  color: var(--ink);
  font-family: Manrope, sans-serif;
}

.login-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  overflow: auto;
  background:
    linear-gradient(115deg, rgba(16, 29, 23, 0.96), rgba(29, 43, 35, 0.9)),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255, 255, 255, 0.035) 79px 80px);
}

.login-gate::before {
  position: fixed;
  width: 560px;
  height: 560px;
  border: 1px solid rgba(211, 175, 126, 0.16);
  border-radius: 50%;
  content: "";
  transform: translate(42vw, -35vh);
}

.login-card {
  position: relative;
  width: min(430px, 100%);
  padding: 36px;
  border: 1px solid rgba(235, 231, 220, 0.32);
  background: rgba(247, 243, 234, 0.97);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.34);
}

.login-mark {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 34px;
  place-items: center;
  border: 1px solid var(--ink);
  color: var(--ink);
  font: 500 12px DM Mono, monospace;
  letter-spacing: 0.1em;
}

.login-heading {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.login-heading h1 {
  margin: 0;
  font: 500 30px Newsreader, serif;
}

.login-heading p {
  margin: 10px 0 0;
  color: var(--moss);
  font-size: 12px;
  line-height: 1.7;
}

.login-form {
  display: grid;
}

.login-form input {
  min-height: 48px;
}

.login-form .primary {
  width: 100%;
  margin-top: 4px;
}

.login-error {
  margin: -2px 0 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--red);
  background: rgba(145, 63, 54, 0.08);
  color: var(--red);
  font-size: 12px;
}

.login-footnote {
  display: block;
  margin-top: 24px;
  color: rgba(70, 88, 78, 0.72);
  font: 9px DM Mono, monospace;
  letter-spacing: 0.1em;
  text-align: center;
}

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

button,
select,
input[type="file"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

.topbar {
  z-index: 30;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--line);
  background: rgba(240, 237, 228, 0.9);
  backdrop-filter: blur(18px);
  flex-shrink: 0;
}

.topbar-inner {
  width: min(1280px, 92vw);
  height: 100%;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  font: 500 12px DM Mono, monospace;
  letter-spacing: 0.14em;
}

.brand img {
  height: 22px;
  width: auto;
  flex: 0 0 auto;
  filter: brightness(0) saturate(100%);
  object-fit: contain;
}

.brand small {
  padding-left: 12px;
  border-left: 1px solid var(--line);
  color: var(--moss);
  font-size: 10px;
}

.session-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.identity {
  overflow: hidden;
  max-width: 320px;
  color: var(--moss);
  font: 11px DM Mono, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--moss);
  font: 10px DM Mono, monospace;
}

.logout-button:hover {
  border-color: var(--copper);
  color: var(--copper);
}

.environment {
  padding: 7px 10px;
  border: 1px solid currentColor;
  color: var(--moss);
  font: 500 10px DM Mono, monospace;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.environment[data-mode="local"] {
  background: rgba(40, 95, 107, 0.08);
  color: var(--blue);
}

.environment[data-mode="staging"] {
  background: rgba(135, 90, 37, 0.08);
  color: var(--amber);
}

.environment[data-mode="production"] {
  background: rgba(145, 63, 54, 0.08);
  color: var(--red);
}

main {
  width: min(1280px, 92vw);
  height: calc(100vh - var(--topbar-height));
  margin: auto;
  overflow: clip;
}

.step {
  color: var(--copper);
  font: 500 11px DM Mono, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--copper);
  font: 500 10px DM Mono, monospace;
  letter-spacing: 0.16em;
}

.tabs {
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(240, 237, 228, 0.94);
  backdrop-filter: blur(18px);
  flex-shrink: 0;
}

.tabs-left {
  display: flex;
  gap: 30px;
}

.tabs-right {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 4px;
}

.tab {
  position: relative;
  padding: 16px 0 14px;
  border: 0;
  background: none;
  color: var(--moss);
  font: 600 12px Manrope, sans-serif;
}

.tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: transparent;
  content: "";
}

.tab.active {
  color: var(--ink);
}

.tab.active::after {
  background: var(--copper);
}

.tab-save-button {
  min-height: 34px;
  padding: 8px 16px;
  font-size: 11px;
  white-space: nowrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  background: rgba(82, 100, 90, 0.08);
  color: var(--moss);
  font: 500 10px DM Mono, monospace;
  white-space: nowrap;
}

.status-chip[data-tone="warning"] {
  border-color: rgba(135, 90, 37, 0.4);
  background: rgba(135, 90, 37, 0.1);
  color: var(--amber);
}

.status-chip[data-tone="saved"] {
  border-color: rgba(53, 100, 72, 0.34);
  background: rgba(53, 100, 72, 0.08);
  color: var(--green);
}

.status-chip[data-tone="live"] {
  border-color: rgba(145, 63, 54, 0.35);
  background: rgba(145, 63, 54, 0.08);
  color: var(--red);
}

.panel {
  display: none;
}

.panel.active {
  display: flex;
  flex-direction: column;
  animation: panel-in 280ms ease both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.workspace {
  padding: 22px 0 12px;
  height: 100%;
  overflow: hidden;
}

#catalogPanel,
#assetsPanel,
#contentPanel {
  height: 85vh;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.section-head h2 {
  margin: 0;
  font: 600 28px Manrope, sans-serif;
  letter-spacing: -0.025em;
}

.section-head > div > .section-note {
  margin-top: 5px;
}

.section-note {
  margin: 0 0 3px;
  color: var(--moss);
  font-size: 13px;
}

.notice {
  position: relative;
  margin-bottom: 18px;
  padding: 13px 16px 13px 42px;
  border: 1px solid rgba(82, 100, 90, 0.18);
  background: rgba(255, 253, 247, 0.72);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  flex-shrink: 0;
}

.notice::before {
  position: absolute;
  top: 50%;
  left: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--moss);
  content: "";
  transform: translateY(-50%);
}

.notice[data-tone="success"] {
  border-color: rgba(53, 100, 72, 0.26);
  background: rgba(53, 100, 72, 0.08);
  color: var(--green);
}

.notice[data-tone="success"]::before {
  background: var(--green);
}

.notice[data-tone="warning"] {
  border-color: rgba(135, 90, 37, 0.28);
  background: rgba(135, 90, 37, 0.08);
  color: var(--amber);
}

.notice[data-tone="warning"]::before {
  background: var(--amber);
}

.notice[data-tone="error"] {
  border-color: rgba(145, 63, 54, 0.28);
  background: rgba(145, 63, 54, 0.08);
  color: var(--red);
}

.notice[data-tone="error"]::before {
  background: var(--red);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.content-form-card,
.content-grid > .preview-card {
  height: 100%;
  min-height: 0;
}

.content-form-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-form-card .card-head,
.content-form-card .readonly-path,
.content-form-card #saveContentButton {
  flex-shrink: 0;
}

.content-page-picker {
  width: min(240px, 52%);
  margin: 0;
}

.content-page-picker span {
  color: var(--moss);
  font: 500 10px DM Mono, monospace;
  letter-spacing: 0.04em;
}

.content-page-picker select {
  min-height: 40px;
  padding-block: 8px;
}

.content-form-card #contentForm {
  flex: 1;
  min-height: 0;
  padding-right: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.content-form-card #saveContentButton {
  margin-top: 14px;
}

.content-grid > .preview-card {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* ── 页面资源管理 ──────────────────────────────────────────────── */

.asset-page-tabs {
  display: flex;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.asset-page-tab {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--moss);
  font: 500 12px DM Mono, monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.asset-page-tab:hover {
  background: rgba(82, 100, 90, 0.06);
  color: var(--ink);
}

.asset-page-tab.active {
  border-color: rgba(143, 93, 50, 0.5);
  background: rgba(143, 93, 50, 0.14);
  color: var(--ink);
}

.asset-page-tab small {
  color: var(--moss);
  font-size: 9px;
  font-weight: 400;
}

.asset-slot-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding-top: 14px;
}

.asset-slot-card {
  display: grid;
  grid-template-rows: 140px auto auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.asset-slot-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 24px rgba(23, 34, 29, 0.08);
}

.asset-slot-card.drag-over {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(143, 93, 50, 0.16);
  transform: translateY(-2px);
}

.asset-slot-card.uploading {
  opacity: 0.55;
  pointer-events: none;
}

.asset-slot-preview {
  height: 140px;
  background: #1a1e1a;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

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

.slot-preview-file {
  color: var(--moss);
  font: 500 14px DM Mono, monospace;
}

.slot-uploading-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.5);
  color: white;
  font: 500 10px DM Mono, monospace;
}

.asset-slot-info {
  padding: 12px;
  display: grid;
  gap: 5px;
}

.asset-slot-info strong {
  font-size: 13px;
  font-weight: 600;
}

.asset-slot-info code {
  font: 10px DM Mono, monospace;
  color: var(--moss);
  word-break: break-all;
  line-height: 1.5;
}

.asset-slot-action {
  margin: 0 12px 12px;
  display: block;
}

.asset-slot-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.asset-slot-action span {
  display: block;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  text-align: center;
  color: var(--ink);
  font: 500 11px DM Mono, monospace;
  cursor: pointer;
}

.asset-slot-action span:hover {
  border-color: var(--copper);
  color: var(--copper);
}

.asset-slot-action:focus-within span,
.content-upload-button:focus-within span,
.resource-upload:focus-within span {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

.card {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.catalog-editor,
.preview-card {
  border-color: var(--line-strong);
  box-shadow: 0 12px 34px rgba(23, 34, 29, 0.07), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.form-card,
.preview-card {
  padding: 22px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.card-head h3 {
  margin: 5px 0 0;
  font: 500 18px Manrope, sans-serif;
  letter-spacing: -0.02em;
}

.card-index {
  color: rgba(23, 34, 29, 0.24);
  font: 400 30px Newsreader, serif;
}

.counter {
  padding: 6px 9px;
  border: 1px solid var(--line);
  color: var(--moss);
  font: 500 10px DM Mono, monospace;
  white-space: nowrap;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--moss);
  font-size: 13px;
  font-weight: 600;
}

label small,
#contentForm small {
  color: var(--moss);
  font: 11px/1.5 DM Mono, monospace;
  font-weight: 400;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 2px rgba(143, 93, 50, 0.1);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.field-group,
#contentForm {
  display: grid;
  gap: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.file-picker {
  gap: 5px;
  padding: 18px;
  border: 1px dashed var(--copper);
  background: rgba(143, 93, 50, 0.045);
}

.picker-title {
  color: var(--ink);
  font-size: 13px;
}

.picker-copy {
  color: var(--moss);
  font-size: 11px;
  font-weight: 400;
}

.file-picker input {
  min-height: auto;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
}

button {
  border: 0;
}

.primary {
  min-height: 46px;
  padding: 13px 22px;
  background: var(--ink);
  color: white;
  font: 600 12px DM Mono, monospace;
  letter-spacing: 0.04em;
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.primary:hover:not(:disabled) {
  background: var(--moss);
  transform: translateY(-1px);
}

.primary:disabled {
  background: #a7aaa5;
  color: #f4f2ec;
  cursor: not-allowed;
}

.full-width {
  width: 100%;
}

.preview-card {
  min-height: 350px;
}

.local-hint {
  margin: -4px 0 18px;
  padding: 11px 13px;
  border-left: 3px solid var(--blue);
  background: rgba(40, 95, 107, 0.07);
  color: var(--blue);
  font-size: 11px;
  line-height: 1.6;
}

.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
  padding: 30px;
  color: var(--moss);
  text-align: center;
}

.empty span {
  font: 400 24px Newsreader, serif;
}

.empty small {
  max-width: 360px;
  font-size: 12px;
  line-height: 1.6;
}

.path-preview {
  display: grid;
  gap: 14px;
}

.file-result {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.26);
}

.file-result.overwrite {
  border-color: rgba(145, 63, 54, 0.38);
  box-shadow: 3px 0 0 var(--red) inset;
}

.file-result.success {
  border-color: rgba(53, 100, 72, 0.34);
  box-shadow: 3px 0 0 var(--green) inset;
}

.file-visual {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  overflow: hidden;
  background: rgba(82, 100, 90, 0.1);
  color: var(--moss);
  font: 500 10px DM Mono, monospace;
}

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

.file-detail {
  min-width: 0;
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.result-head strong,
.result-head small {
  display: block;
}

.result-head strong {
  font-size: 13px;
}

.result-head small {
  margin-top: 4px;
  color: var(--moss);
  font-size: 11px;
}

.status {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid var(--line);
  color: var(--moss);
  font: 500 9px DM Mono, monospace;
  white-space: nowrap;
}

.status-checking,
.status-uploading {
  border-color: rgba(40, 95, 107, 0.3);
  color: var(--blue);
}

.status-ready {
  border-color: rgba(135, 90, 37, 0.3);
  color: var(--amber);
}

.status-succeeded {
  border-color: rgba(53, 100, 72, 0.3);
  color: var(--green);
}

.status-failed {
  border-color: rgba(145, 63, 54, 0.3);
  color: var(--red);
}

.segments {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 9px;
}

.segments span {
  padding: 4px 6px;
  background: rgba(82, 100, 90, 0.1);
  color: var(--moss);
  font: 9px DM Mono, monospace;
}

.key-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.key-row code,
.target-url,
.readonly-path code,
#contentPreview {
  overflow-wrap: anywhere;
  font-family: DM Mono, monospace;
}

.key-row code {
  flex: 1;
  padding-top: 5px;
  font-size: 11px;
  line-height: 1.6;
}

.copy-button {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--moss);
  font-size: 10px;
}

.copy-button:hover {
  border-color: var(--copper);
  color: var(--copper);
}

.target-url {
  display: block;
  margin-top: 8px;
  color: var(--copper);
  font-size: 10px;
  line-height: 1.65;
  text-decoration: none;
}

.target-url span {
  display: block;
  margin-bottom: 2px;
  color: var(--moss);
  font: 9px DM Mono, monospace;
  letter-spacing: 0.08em;
}

a.target-url:hover {
  text-decoration: underline;
}

.object-meta,
.warning-text,
.error-text {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.55;
}

.object-meta {
  color: var(--moss);
}

.warning-text {
  color: var(--amber);
}

.error-text {
  color: var(--red);
}

.upload-actions {
  position: sticky;
  z-index: 15;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  background: rgba(248, 245, 237, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.action-summary {
  display: grid;
  gap: 4px;
}

.action-summary strong {
  font-size: 14px;
}

.action-summary small {
  color: var(--moss);
  font-size: 11px;
}

.readonly-path {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.readonly-path span {
  color: var(--moss);
  font-size: 11px;
  font-weight: 600;
}

.readonly-path code {
  font-size: 11px;
}

#contentPreview {
  max-height: 68vh;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.75;
}

.hidden {
  display: none !important;
}

.content-asset-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 10px;
  align-items: end;
}

.content-asset-actions {
  display: grid;
  gap: 8px;
}

.content-filename-field {
  gap: 5px;
  margin: 0;
}

.content-filename-field > span {
  font-size: 10px;
}

.content-filename-field input {
  min-height: 38px;
  padding: 8px 9px;
  font-size: 11px;
}

.content-filename-field small {
  font-size: 9px;
}

.content-upload-button {
  position: relative;
  margin: 0 0 16px;
}

.content-upload-button input {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.content-upload-button span {
  min-height: 43px;
  display: grid;
  place-items: center;
  padding: 9px 12px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  color: var(--ink);
  font: 500 10px DM Mono, monospace;
  white-space: nowrap;
}

.content-upload-button:hover span {
  border-color: var(--copper);
  color: var(--copper);
}

.catalog-section-head {
  align-items: end;
}

.catalog-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.catalog-status {
  display: grid;
  justify-items: end;
  gap: 7px;
  color: var(--moss);
  font: 10px DM Mono, monospace;
}

.catalog-status strong {
  color: var(--amber);
  font-weight: 500;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 230px 250px minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.catalog-column,
.catalog-editor {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.editor-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(240, 237, 228, 0.72);
  flex-shrink: 0;
}

.editor-tabs button {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--moss);
  font: 500 12px DM Mono, monospace;
}

.editor-tabs button:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(82, 100, 90, 0.06);
}

.editor-tabs button.active {
  border-color: rgba(143, 93, 50, 0.48);
  background: rgba(143, 93, 50, 0.14);
  color: var(--ink);
}

.editor-tabs button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.editor-tab-panel {
  display: none;
}

.editor-tab-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

#catalogEditorContent {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#catalogEditorContent.hidden {
  display: none;
}

.catalog-context {
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(23, 34, 29, 0.035);
  color: var(--moss);
  font: 11px DM Mono, monospace;
  flex-shrink: 0;
}

.catalog-context strong {
  color: var(--ink);
  font-weight: 500;
}

.catalog-context span {
  padding: 0 7px;
  color: var(--copper);
}

.catalog-column {
  min-height: 0;
}

.catalog-column-head,
.editor-title-row,
.subsection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.catalog-column-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.catalog-column-head h3,
.editor-title-row h3,
.subsection-head h4 {
  margin: 4px 0 0;
  font: 500 17px Manrope, sans-serif;
}

.compact-button {
  min-width: 56px;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: 500 11px DM Mono, monospace;
}

.compact-button:hover:not(:disabled) {
  border-color: var(--copper);
  color: var(--copper);
}

.compact-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.catalog-list {
  flex: 1;
  min-height: 0;
  padding: 8px;
  overflow-y: auto;
}

.catalog-list-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 12px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.catalog-list-item:hover {
  background: rgba(82, 100, 90, 0.07);
}

.catalog-list-item.active {
  border-color: rgba(143, 93, 50, 0.48);
  background: rgba(143, 93, 50, 0.14);
  box-shadow: 3px 0 0 var(--copper) inset;
}

.catalog-list-item strong,
.catalog-list-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-list-item strong {
  font-size: 13px;
  font-weight: 600;
}

.catalog-list-item small {
  margin-top: 4px;
  color: var(--moss);
  font: 10px DM Mono, monospace;
}

.catalog-order {
  color: rgba(23, 34, 29, 0.4);
  font: 10px DM Mono, monospace;
}

.catalog-placeholder,
.catalog-editor-empty,
.catalog-product-empty {
  color: var(--moss);
  font: 11px/1.7 DM Mono, monospace;
  text-align: center;
}

.series-editor .catalog-product-empty {
  margin-top: 20px;
  padding: 18px 12px 4px;
  border-top: 1px dashed var(--line);
}

.catalog-placeholder {
  padding: 34px 12px;
}

.catalog-editor-empty,
.catalog-product-empty {
  flex: 1;
  min-height: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 32px;
}

.catalog-editor-empty span {
  color: var(--ink);
  font: 500 22px Newsreader, serif;
}

.catalog-editor-empty small {
  max-width: 390px;
}

.editor-section {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.editor-title-row,
.subsection-head {
  margin-bottom: 20px;
}

.resource-tab-head {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.series-editor {
  background: rgba(82, 100, 90, 0.035);
}

.readonly-input {
  color: var(--moss);
  background: rgba(23, 34, 29, 0.04);
  font-family: DM Mono, monospace;
}

.toggle-label {
  align-content: end;
  grid-template-columns: 1fr auto;
  min-height: 66px;
  padding: 0 2px 10px;
}

.toggle-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-label i {
  position: relative;
  width: 42px;
  height: 23px;
  border-radius: 99px;
  background: #b9b9b3;
  transition: background 160ms ease;
}

.toggle-label i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
  transition: transform 160ms ease;
}

.toggle-label input:checked + i {
  background: var(--green);
}

.toggle-label input:checked + i::after {
  transform: translateX(19px);
}

.toggle-label:focus-within i {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

.three-fields {
  grid-template-columns: 1fr 1fr 1fr;
}

.row-actions {
  display: flex;
  gap: 5px;
}

.row-actions button {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--moss);
  font: 500 12px DM Mono, monospace;
}

.row-actions button:hover:not(:disabled) {
  border-color: var(--copper);
  color: var(--copper);
}

.row-actions .danger-link {
  color: var(--red);
}

.subsection-head {
  align-items: end;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.subsection-head p {
  margin: 7px 0 0;
  color: var(--moss);
  font: 10px/1.6 DM Mono, monospace;
}

.resource-upload {
  min-width: 140px;
  margin: 0;
}

.resource-upload-controls {
  display: flex;
  align-items: end;
  gap: 9px;
}

.resource-folder-picker {
  min-width: 130px;
  margin: 0;
  font-size: 10px;
}

.resource-folder-picker select {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 11px;
}

.resource-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.resource-upload span {
  display: block;
  padding: 10px 13px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--ink);
  color: white;
  font: 500 10px DM Mono, monospace;
  text-align: center;
}

.resource-list {
  display: grid;
  gap: 9px;
}

.catalog-resource {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.28);
  transition: border-color 140ms ease, opacity 140ms ease, transform 140ms ease;
}

.catalog-resource.is-dragging {
  opacity: 0.45;
}

.catalog-resource.drag-target {
  border-color: var(--copper);
  box-shadow: 4px 0 0 var(--copper) inset;
  transform: translateX(3px);
}

.catalog-resource-visual {
  position: relative;
  height: 112px;
  overflow: hidden;
  border-radius: 7px;
  background: #242823;
}

.catalog-resource-visual img,
.catalog-resource-visual video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-resource-visual span,
.catalog-resource-visual strong {
  position: absolute;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(13, 18, 15, 0.78);
  color: white;
  font: 8px DM Mono, monospace;
}

.resource-folder-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 6px;
  border: 1px solid rgba(143, 93, 50, 0.32);
  border-radius: 4px;
  background: rgba(143, 93, 50, 0.09);
  color: var(--copper);
  font: 8px DM Mono, monospace;
  text-transform: uppercase;
}

.catalog-resource-visual span {
  top: 6px;
  left: 6px;
}

.catalog-resource-visual strong {
  right: 6px;
  bottom: 6px;
  background: var(--copper);
  font-weight: 500;
}

.catalog-resource-fields {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 8px 10px;
}

.catalog-resource-fields label {
  margin: 0;
  font-size: 10px;
}

.catalog-resource-fields input,
.catalog-resource-fields select {
  padding: 9px 10px;
  font-size: 11px;
}

.resource-key {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  gap: 9px;
  align-items: center;
}

.resource-key code {
  overflow: hidden;
  color: var(--moss);
  font: 9px DM Mono, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vertical-actions {
  flex-direction: column;
}

.drag-handle {
  display: grid;
  width: 36px;
  height: 24px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 5px;
  color: var(--moss);
  font: 8px DM Mono, monospace;
  cursor: grab;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.resource-placeholder {
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
}

.specification-list {
  display: grid;
  gap: 7px;
}

.specification-row {
  display: grid;
  grid-template-columns: 28px minmax(120px, 0.7fr) minmax(180px, 1.3fr) auto;
  gap: 8px;
  align-items: center;
}

.specification-row input {
  padding: 10px 11px;
  font-size: 12px;
}


.content-visual-preview {
  display: grid;
  gap: 10px;
}

.content-preview-heading {
  margin: 0 0 8px;
  font: 500 25px Newsreader, serif;
}

.content-preview-copy {
  margin: 0 0 18px;
  color: var(--moss);
  font-size: 13px;
  line-height: 1.7;
}

.content-preview-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.content-preview-field {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.content-preview-field small,
.content-preview-field strong {
  display: block;
}

.content-preview-field small {
  margin-bottom: 6px;
  color: var(--copper);
  font: 9px DM Mono, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.content-preview-field strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  text-overflow: ellipsis;
}

.content-preview-media {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #20251f;
}

.content-preview-media img,
.content-preview-media video {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.content-preview-media span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 7px;
  background: rgba(17, 23, 19, 0.8);
  color: white;
  font: 9px DM Mono, monospace;
}

.empty-preview {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--moss);
  font: 12px DM Mono, monospace;
}

.json-details {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.json-details summary {
  color: var(--moss);
  font: 500 11px DM Mono, monospace;
  cursor: pointer;
}

.json-details[open] summary {
  margin-bottom: 14px;
  color: var(--ink);
}

.secondary-button {
  min-height: 46px;
  padding: 12px 20px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font: 500 12px DM Mono, monospace;
}

.secondary-button:hover {
  border-color: var(--copper);
  color: var(--copper);
}

.cms-dialog {
  width: min(520px, calc(100vw - 48px));
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(10, 17, 13, 0.28);
}

.cms-dialog::backdrop {
  background: rgba(18, 25, 21, 0.48);
  backdrop-filter: blur(4px);
}

.cms-dialog form {
  padding: 26px;
}

.dialog-head {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 0;
  font: 600 23px Manrope, sans-serif;
}

.dialog-head p {
  margin: 8px 0 0;
  color: var(--moss);
  font-size: 13px;
  line-height: 1.65;
}

.dialog-error {
  margin: 4px 0 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--red);
  background: rgba(145, 63, 54, 0.08);
  color: var(--red);
  font-size: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.cms-dialog[data-tone="danger"] #dialogConfirm {
  background: var(--red);
}

.cms-dialog[data-tone="danger"] #dialogConfirm:hover {
  background: #71332d;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
