/* PC530 在线修图 */
:root {
  --ps-bg: #1e1e1e;
  --ps-panel: #252526;
  --ps-border: #3c3c3c;
  --ps-text: #cccccc;
  --ps-muted: #858585;
  --ps-accent: #0e639c;
  --ps-accent-hover: #1177bb;
  --ps-danger: #c72e2e;
  --ps-topbar-h: 48px;
  --ps-toolbar-w: 52px;
  --ps-inspector-w: 260px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body.ps-body {
  margin: 0;
  height: 100%;
  background: var(--ps-bg);
  color: var(--ps-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.ps-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 480px;
}

.ps-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--ps-topbar-h);
  padding: 0 12px;
  background: #323233;
  border-bottom: 1px solid var(--ps-border);
  flex-shrink: 0;
}

.ps-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ps-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ps-text);
}

.ps-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--ps-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.ps-brand-text {
  font-size: 14px;
  font-weight: 600;
}

.ps-back-link {
  font-size: 12px;
  color: var(--ps-muted);
  text-decoration: none;
}

.ps-back-link:hover {
  color: var(--ps-text);
}

.ps-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.ps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--ps-border);
  border-radius: 4px;
  background: #3c3c3c;
  color: var(--ps-text);
  cursor: pointer;
  white-space: nowrap;
}

.ps-btn:hover {
  background: #454545;
}

.ps-btn-primary {
  background: var(--ps-accent);
  border-color: var(--ps-accent);
  color: #fff;
}

.ps-btn-primary:hover {
  background: var(--ps-accent-hover);
}

.ps-btn-ghost {
  background: transparent;
}

.ps-btn-block {
  width: 100%;
  margin-top: 6px;
}

.ps-btn-danger {
  color: #ffb4b4;
}

.ps-main {
  display: flex;
  flex: 1;
  min-height: 0;
}

.ps-toolbar {
  width: var(--ps-toolbar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 8px 6px;
  background: var(--ps-panel);
  border-right: 1px solid var(--ps-border);
  overflow-y: auto;
}

.ps-tool {
  padding: 8px 4px;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ps-text);
  cursor: pointer;
}

.ps-tool:hover {
  background: #333337;
}

.ps-tool.is-active {
  background: #094771;
  border-color: #007acc;
}

.ps-tool-danger:hover {
  background: rgba(199, 46, 46, 0.25);
}

.ps-toolbar-sep {
  border: none;
  border-top: 1px solid var(--ps-border);
  margin: 4px 0;
}

.ps-workspace-wrap {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #2d2d2d;
}

.ps-workspace {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 16px;
}

.ps-workspace .canvas-container {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.ps-drop-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 15px;
  color: var(--ps-muted);
  pointer-events: none;
  transition: opacity 0.2s;
}

.ps-drop-hint.is-hidden {
  opacity: 0;
}

.ps-status {
  flex-shrink: 0;
  margin: 0;
  padding: 6px 12px;
  font-size: 11px;
  color: var(--ps-muted);
  border-top: 1px solid var(--ps-border);
  background: var(--ps-panel);
}

.ps-status.is-ok {
  color: #7ee787;
}

.ps-status.is-error {
  color: #ffa198;
}

.ps-inspector {
  width: var(--ps-inspector-w);
  flex-shrink: 0;
  overflow-y: auto;
  background: var(--ps-panel);
  border-left: 1px solid var(--ps-border);
  padding: 10px;
}

.ps-panel {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ps-border);
}

.ps-panel:last-child {
  border-bottom: none;
}

.ps-panel-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ps-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ps-panel-hint {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ps-muted);
}

.ps-field,
.ps-field-row label {
  display: block;
  font-size: 11px;
  color: var(--ps-muted);
  margin-bottom: 8px;
}

.ps-field-row {
  display: flex;
  gap: 8px;
}

.ps-field-row label {
  flex: 1;
}

.ps-field input[type="range"],
.ps-field input[type="number"],
.ps-field-row input[type="number"] {
  width: 100%;
  margin-top: 4px;
}

.ps-field input[type="color"] {
  width: 100%;
  height: 28px;
  margin-top: 4px;
  padding: 0;
  border: 1px solid var(--ps-border);
  background: #1e1e1e;
}

.ps-layer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
}

.ps-layer-item {
  padding: 6px 8px;
  margin-bottom: 4px;
  font-size: 11px;
  border: 1px solid var(--ps-border);
  border-radius: 4px;
  cursor: pointer;
  background: #2a2a2a;
}

.ps-layer-item.is-active {
  border-color: #007acc;
  background: #094771;
}

@media (max-width: 900px) {
  .ps-main {
    flex-direction: column;
  }

  .ps-toolbar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--ps-border);
  }

  .ps-toolbar-sep {
    display: none;
  }

  .ps-inspector {
    width: 100%;
    max-height: 220px;
    border-left: none;
    border-top: 1px solid var(--ps-border);
  }

  .ps-brand-text {
    display: none;
  }
}
