:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #626a73;
  --line: #d8dde3;
  --paper: #f7f8fa;
  --panel: #ffffff;
  --accent: #7a1f2b;
  --accent-strong: #5c1520;
  --blue: #1f5f8f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 11px 16px;
  cursor: pointer;
}

button:hover { background: var(--accent-strong); }

.ghost {
  background: #eef2f5;
  color: var(--ink);
}

.ghost:hover { background: #dfe6ed; }

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  width: min(520px, 100%);
  margin: 8vh auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}

.kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 8px;
}

h1, h2 { margin: 0; }

.login-panel h1,
.workspace-header h1 {
  font-size: 28px;
  line-height: 1.25;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

textarea { resize: vertical; }

.login-panel form,
.editor {
  display: grid;
  gap: 14px;
}

.workspace.hidden,
.hidden { display: none; }

.workspace {
  display: grid;
  gap: 18px;
}

.workspace-header,
.form-head,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.quick-actions button {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.quick-actions button.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 18px;
  align-items: start;
}

.editor,
.side-panel section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox input { width: auto; }

.side-panel {
  display: grid;
  gap: 18px;
}

.list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.list button {
  width: 100%;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: left;
}

iframe {
  width: 100%;
  height: 420px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  margin-top: 12px;
}

.status {
  min-height: 22px;
  color: var(--blue);
}

@media (max-width: 900px) {
  .app-shell { padding: 14px; }
  .editor-grid { grid-template-columns: 1fr; }
  .workspace-header,
  .form-head,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }
  button { width: 100%; }
}

.preview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #f6f3ec;
}

.preview-overlay.hidden {
  display: none;
}

.preview-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: var(--ink);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.preview-overlay-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-overlay-head .button-link,
.preview-overlay-head button {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  background: transparent;
}

#fullPreviewFrame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  margin: 0;
  background: #fff;
}

#fullPreviewButton,
#fullPreviewLink {
  margin-top: 8px;
}

.side-panel .preview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 8px 0 0;
}

#editorForm > .preview-actions,
.editor > .preview-actions,
.maintenance-form > .preview-actions {
  display: none;
}


/* FULL_PREVIEW_CLEAN_START */
#previewFullActions,
#alwaysPreviewActions,
#forcePreviewOverlay,
#previewOverlay {
  display: none !important;
}

#cleanPreviewActions {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 10px;
}

#cleanPreviewOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #f6f3ec;
}

#cleanPreviewOverlay.hidden {
  display: none;
}

#cleanPreviewHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: var(--ink);
  color: #fff;
}

#cleanPreviewHead button {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: transparent;
}

#cleanFullPreviewFrame {
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
  border-radius: 0;
  background: #fff;
}
/* FULL_PREVIEW_CLEAN_END */

