/* WebPS Studio — light “online PS” style (inspired by common 在线PS layouts; original OVXOV) */
.webps-page {
  background: #e8eaed;
}

.webps-page .site-header {
  background: #fff;
  border-bottom: 1px solid #d0d4dc;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.webps-workspace {
  min-height: calc(100vh - 120px);
  background: #e8eaed;
  color: #1f2937;
}

/* App title row — similar cue to “产品名 + Undo” */
.webps-brand-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f5f6f8 100%);
  border-bottom: 1px solid #cfd6e0;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.8);
}

.webps-brand-bar__left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.webps-brand-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.webps-brand-mark {
  color: #1677ff;
  font-size: 1.15rem;
  line-height: 1;
}

.webps-brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #262626;
}

.webps-brand-tag {
  font-size: 0.72rem;
  color: #8c8c8c;
  padding: 0.15rem 0.45rem;
  background: #f0f0f0;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.webps-btn--bar {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #262626;
  cursor: pointer;
}

.webps-btn--bar:hover:not(:disabled) {
  border-color: #1677ff;
  color: #1677ff;
}

.webps-btn--bar:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.webps-btn--bar-outline {
  background: #fafafa;
}

/* Editor layout: left vertical tool rail + main (canvas + side) */
.webps-editor-shell {
  display: grid;
  grid-template-columns: minmax(12.5rem, 14rem) 1fr;
  align-items: stretch;
  min-height: calc(100vh - 152px);
  max-width: 100%;
}

.webps-tool-rail {
  background: linear-gradient(180deg, #fafbfc 0%, #f5f6f8 100%);
  border-right: 1px solid #cfd6e0;
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.75) inset;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 132px);
}

.webps-tool-rail__scroll {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  padding: 0.45rem 0.4rem 0.65rem;
  scrollbar-gutter: stable;
}

.webps-tool-section {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e6ed;
}

.webps-tool-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.webps-tool-section__title {
  margin: 0 0 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b92a0;
}

.webps-tool-section__btns {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.webps-tool-section__btns--tight {
  margin-top: 0.4rem;
}

.webps-tool-section__grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
}

.webps-btn--rail {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.webps-btn--rail-compact {
  padding: 0.28rem 0.2rem;
  font-size: 0.85rem;
  min-height: 1.85rem;
}

.webps-tool-section__fields {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.webps-tool-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  font-size: 0.72rem;
}

.webps-tool-field__l {
  color: #6b7280;
}

.webps-input--rail {
  width: 100%;
  box-sizing: border-box;
  height: 1.85rem;
}

.webps-input--rail[type='color'] {
  padding: 2px;
  cursor: pointer;
}

.webps-input--rail-range {
  width: 100%;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.webps-input--num-rail {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.webps-btn {
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.32rem 0.55rem;
  border-radius: 4px;
  border: 1px solid #c5ccd6;
  background: linear-gradient(180deg, #ffffff 0%, #f3f5f7 100%);
  color: #374151;
  cursor: pointer;
  line-height: 1.2;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.webps-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #f8fafc 0%, #e8ecf1 100%);
  border-color: #9ca3af;
  color: #111827;
}

.webps-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.webps-btn--accent {
  background: linear-gradient(180deg, #4096ff 0%, #1677ff 100%);
  border-color: #1677ff;
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 119, 255, 0.25);
}

.webps-btn--accent:hover:not(:disabled) {
  background: linear-gradient(180deg, #69b1ff 0%, #4096ff 100%);
  border-color: #4096ff;
  color: #fff;
}

.webps-btn--icon {
  min-width: 2rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.webps-btn--sm {
  font-size: 0.72rem;
  padding: 0.22rem 0.4rem;
}

.webps-tool.is-active {
  background: #e6f4ff;
  border-color: #1677ff;
  color: #0958d9;
  box-shadow: 0 0 0 1px rgba(22, 119, 255, 0.2);
}

.webps-label {
  font-size: 0.72rem;
  color: #6b7280;
  margin-right: 0.1rem;
}

.webps-input {
  height: 1.8rem;
  border-radius: 4px;
  border: 1px solid #c5ccd6;
  background: #fff;
  color: #1f2937;
  vertical-align: middle;
}

.webps-input:focus {
  outline: none;
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}

.webps-input--num {
  width: 3.25rem;
  padding: 0 0.35rem;
}

.webps-input--hex {
  width: 5.5rem;
  padding: 0 0.35rem;
  margin-left: 0.35rem;
}

.webps-input--wide {
  width: 100%;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.5rem;
  height: auto;
}

.webps-hidden {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.webps-main {
  display: grid;
  grid-template-columns: 1fr minmax(270px, 300px);
  gap: 0;
  align-items: start;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
}

.webps-main.is-panels-hidden {
  grid-template-columns: 1fr;
}

.webps-side.webps-side--hidden {
  display: none;
}

@media (max-width: 1024px) {
  .webps-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .webps-editor-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .webps-tool-rail {
    max-height: min(340px, 44vh);
    border-right: none;
    border-bottom: 1px solid #cfd6e0;
  }

  .webps-tool-rail__scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.45rem;
    align-content: start;
  }

  .webps-tool-section {
    margin-bottom: 0;
    padding: 0.45rem;
    border: 1px solid #e2e6ed;
    border-radius: 6px;
    background: #fff;
    border-bottom-width: 1px;
  }

  .webps-tool-section__btns {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .webps-btn--rail {
    width: auto;
    flex: 1 1 auto;
    min-width: 4rem;
  }

  .webps-tool-section__grid3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .webps-tool-section__fields {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .webps-tool-field {
    flex: 1 1 8rem;
    min-width: 7rem;
  }
}

.webps-canvas-col {
  min-width: 0;
  padding: 0.65rem 0.75rem 1rem;
}

.webps-zoom-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  color: #4b5563;
}

/* Canvas well — neutral surround like many web editors */
.webps-canvas-scroll {
  overflow: auto;
  max-height: calc(100vh - 200px);
  border-radius: 6px;
  border: 1px solid #b8c0cc;
  background-color: #b8b8b8;
  background-image: linear-gradient(45deg, #c4c4c4 25%, transparent 25%),
    linear-gradient(-45deg, #c4c4c4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #c4c4c4 75%),
    linear-gradient(-45deg, transparent 75%, #c4c4c4 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  padding: 1rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.webps-canvas-inner {
  display: inline-block;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.12);
  line-height: 0;
  background: #fff;
}

.webps-side {
  border-left: 1px solid #cfd6e0;
  background: #f2f4f7;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding: 0.5rem 0.55rem 1rem;
}

@media (max-width: 1024px) {
  .webps-side {
    border-left: none;
    border-top: 1px solid #cfd6e0;
    max-height: none;
  }
}

.webps-panel {
  margin-bottom: 0.55rem;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #d8dee8;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.webps-panel__title {
  margin: 0;
  padding: 0.5rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #374151;
  background: linear-gradient(180deg, #f8fafc 0%, #eef1f5 100%);
  border-bottom: 1px solid #e2e8f0;
}

.webps-panel__body {
  padding: 0.55rem 0.7rem 0.7rem;
  font-size: 0.84rem;
  color: #374151;
}

.webps-preview-img {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  border-radius: 4px;
  background-color: #e8e8e8;
  background-image: linear-gradient(45deg, #ddd 25%, transparent 25%),
    linear-gradient(-45deg, #ddd 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ddd 75%),
    linear-gradient(-45deg, transparent 75%, #ddd 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
  border: 1px solid #d1d5db;
}

.webps-field-row {
  margin-bottom: 0.5rem;
}

.webps-field-row label {
  display: block;
  font-size: 0.72rem;
  color: #6b7280;
  margin-bottom: 0.2rem;
}

.webps-info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.28rem 0.65rem;
  margin: 0;
  font-size: 0.8rem;
}

.webps-info-grid dt {
  margin: 0;
  color: #6b7280;
}

.webps-info-grid dd {
  margin: 0;
  color: #111827;
}

.webps-size-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.webps-label-block {
  display: block;
  font-size: 0.72rem;
  color: #6b7280;
  margin-bottom: 0.2rem;
}

.webps-opacity-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.webps-opacity-row input[type='range'] {
  flex: 1;
  min-width: 0;
}

.webps-hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.webps-radio-row,
.webps-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  font-size: 0.8rem;
  align-items: center;
  color: #374151;
}

.webps-check-row input {
  margin-right: 0.35rem;
}

.webps-filter-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

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

.webps-layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.4rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  border: 1px solid transparent;
}

.webps-layer-item:hover {
  background: #f0f7ff;
}

.webps-layer-item.is-active {
  background: #e6f4ff;
  border-color: #91caff;
}

.webps-layer-item__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webps-layer-item__eye {
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fafafa;
  color: #595959;
  cursor: pointer;
}

.webps-layer-item__eye:hover {
  border-color: #1677ff;
  color: #1677ff;
}

.webps-page .site-footer {
  background: #fff;
  color: #6b7280;
  border-top: 1px solid #d0d4dc;
}

.webps-page .footer-nav a {
  color: #595959;
}

.webps-page .footer-nav a:hover {
  color: #1677ff;
}
