/* 发布页局部设计变量 / Publish page local design tokens */
.publish-page {
  --color-bg-gray: #f7f9fc;
  --color-bg-orange: #fff7f0;
  --color-orange-primary: #ff6a00;
  --color-orange-dark: #e65f00;
  --color-text-main: #303743;
  --color-text-sub: #7f8895;
  --color-text-dark: #20242a;
  --color-border: #dfe5ee;
  --color-border-light: #edf0f4;
  --color-danger: #f04438;
  --radius-8: 8px;

  min-width: 0;
  padding: 24px 20px 40px;
  color: var(--color-text-dark);
}

.publish-page :deep(.el-input-number),
.publish-page :deep(.el-input),
.publish-page :deep(.el-date-editor) {
  width: 100%;
}

.publish-page :deep(.el-input__wrapper),
.publish-page :deep(.el-textarea__inner) {
  border-radius: var(--radius-8);
  box-shadow: 0 0 0 1px var(--color-border) inset;
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.publish-page :deep(.el-input__wrapper:hover),
.publish-page :deep(.el-textarea__inner:hover) {
  box-shadow: 0 0 0 1px var(--color-orange-primary) inset !important;
}

.publish-page :deep(.el-input__wrapper.is-focus),
.publish-page :deep(.el-textarea__inner:focus) {
  box-shadow: 0 0 0 1px var(--color-orange-primary) inset, 0 0 8px rgba(255, 106, 0, 0.15) !important;
}

.publish-layout {
  display: grid;
  grid-template-columns: minmax(760px, 1fr) 300px;
  align-items: start;
  gap: 24px;
  max-width: 1580px;
  margin: 0 auto;
  overflow: visible;
}

.form-column {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.form-column :deep(.form-section) {
  min-width: 0;
}

.panel-field-row,
.panel-input-grid,
.level-row,
.login-method-row,
.quantity-item,
.skin-group,
.region-panel,
.ratio-panel,
.time-preset-row,
.price-cell {
  padding: 12px;
  border-radius: var(--radius-8);
  background: var(--color-bg-gray);
}

.field-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 12px;
}

.field-row > label,
.input-block > span,
.quantity-meta strong {
  color: var(--color-text-main);
  font-size: 13px;
  font-weight: 800;
  line-height: 22px;
}

.field-row label span,
.input-block b,
.quantity-meta span,
.upload-copy span {
  color: var(--color-danger);
}

.field-hint {
  grid-column: 2;
  margin: 0;
  color: var(--color-text-sub);
  font-size: 12px;
  line-height: 1.55;
}

.login-method-row .field-hint {
  margin-top: -2px;
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.compact-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px 16px;
  border-radius: var(--radius-8);
  background: var(--color-bg-gray);
}

.panel-input-grid {
  align-items: center;
}

.panel-input-grid .input-block {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.panel-input-grid :deep(.el-input-number),
.panel-input-grid :deep(.el-input) {
  max-width: 140px;
}

.input-block {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.input-block > span {
  white-space: nowrap;
}

.level-panel,
.time-preset-panel,
.skin-groups {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.level-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

.level-row strong {
  font-size: 13px;
}

.level-row strong span {
  color: var(--color-danger);
}

.level-options {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
}

.level-btn,
.region-btn,
.mode-toggle button,
.ratio-mode-btn {
  border: 1px solid #d6dce5;
  background: #fff;
  color: #596474;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.level-btn,
.region-btn {
  min-width: 0;
}

.level-btn {
  height: 30px;
  padding: 0 8px;
  border-radius: 15px;
}

.region-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 16px;
}

.level-btn.active,
.region-btn.active {
  border-color: var(--color-orange-primary);
  background: var(--color-orange-primary);
  color: #fff;
}

.quantity-table {
  display: grid;
  gap: 8px;
}

.quantity-header,
.quantity-item {
  display: grid;
  grid-template-columns: minmax(180px, 3fr) minmax(80px, 1fr) minmax(100px, 1.2fr) minmax(140px, 1.5fr) minmax(80px, 1fr);
  gap: 10px;
  align-items: center;
}

.quantity-header {
  min-height: 30px;
  padding: 0 12px;
  color: #7b8492;
  font-size: 12px;
  font-weight: 800;
}

.quantity-header b {
  margin-left: 2px;
  color: var(--color-danger);
}

.quantity-item {
  min-height: 58px;
}

.quantity-item.disabled {
  opacity: 0.62;
}

.quantity-item > :deep(.el-input-number) {
  width: 100% !important;
  min-width: 0 !important;
  overflow: hidden;
}

.quantity-meta {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.quantity-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quantity-meta span {
  margin-right: 2px;
}

.quantity-meta small,
.quantity-price,
.quantity-status {
  color: var(--color-text-sub);
  font-size: 12px;
  font-weight: 700;
}

.quantity-price,
.quantity-status {
  white-space: nowrap;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-width: 0;
}

.mode-toggle button {
  height: 30px;
  min-width: 0;
  padding: 0 6px;
  border-radius: var(--radius-8);
  font-size: 12px;
  white-space: nowrap;
}

.mode-toggle button.active,
.ratio-mode-btn.active {
  border-color: var(--color-orange-primary);
  background: var(--color-bg-orange);
  color: var(--color-orange-dark);
}

.mode-toggle button:disabled,
.ratio-mode-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.skin-group {
  border: none;
}

.skin-title,
.region-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.skin-title {
  min-height: 34px;
  margin-bottom: 8px;
}

.region-title span {
  color: var(--color-text-sub);
  font-size: 12px;
  font-weight: 700;
}

.time-preset-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.time-preset-row strong {
  color: var(--color-text-main);
  font-size: 13px;
  font-weight: 800;
  line-height: 32px;
}

.time-preset-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.time-preset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.time-chip {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #d6dce5;
  border-radius: 15px;
  background: #fff;
  color: #596474;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.time-chip.active {
  border-color: var(--color-orange-primary);
  background: var(--color-orange-primary);
  color: #fff;
}

.time-input {
  width: 118px;
}

.login-region-panel {
  margin-top: 18px;
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

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

.upload-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 12px;
  align-items: center;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-8);
  background: var(--color-bg-gray);
}

.upload-copy {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.upload-copy strong {
  color: #232a35;
  font-size: 14px;
}

.upload-copy small {
  color: var(--color-text-sub);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.upload-add,
.upload-preview {
  width: 96px;
  height: 88px;
  border-radius: var(--radius-8);
}

.upload-add {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed #c7ceda;
  background: #fff;
  color: #727d8d;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.upload-add:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.upload-preview {
  position: relative;
  overflow: hidden;
  background: #e8edf4;
}

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

.upload-preview button {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: none;
  border-radius: var(--radius-8);
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  cursor: pointer;
}

.hidden-file {
  display: none;
}

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

.deposit-control :deep(.el-input-number) {
  width: 140px !important;
  flex: 0 0 140px;
}

.recommend-button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #ffba86;
  border-radius: var(--radius-8);
  background: var(--color-bg-orange);
  color: var(--color-orange-dark);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.recommend-button:hover {
  border-color: var(--color-orange-primary);
  background: #ffe3cd;
}

.deposit-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.deposit-breakdown span {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 12px;
  background: var(--color-bg-orange);
  color: var(--color-orange-dark);
  font-size: 12px;
  font-weight: 800;
}

.ratio-panel {
  margin-top: 14px;
}

.ratio-panel p {
  margin: 8px 0 14px;
  color: var(--color-text-sub);
  font-size: 12px;
  line-height: 1.5;
}

.ratio-reference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 12px;
  border-radius: var(--radius-8);
  background: #fff;
}

.ratio-reference span {
  color: var(--color-text-main);
  font-size: 13px;
  font-weight: 800;
}

.ratio-reference strong {
  color: var(--color-orange-primary);
  font-size: 22px;
  font-weight: 900;
}

.ratio-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ratio-mode-btn,
.ratio-custom-card {
  min-height: 72px;
  padding: 12px;
  border-radius: var(--radius-8);
  text-align: left;
}

.ratio-mode-btn {
  display: grid;
  gap: 6px;
}

.ratio-mode-btn span {
  color: var(--color-text-sub);
  font-size: 12px;
}

.ratio-custom-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  border: 1px solid #d6dce5;
  background: #fff;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.ratio-custom-card strong {
  color: #596474;
  font-size: 13px;
  font-weight: 800;
}

.ratio-custom-card :deep(.el-input-number) {
  width: 100% !important;
}

.ratio-custom-card :deep(.el-input__wrapper) {
  background-color: #fff !important;
}

.ratio-custom-card.active {
  border-color: var(--color-orange-primary);
  background: var(--color-bg-orange);
  color: var(--color-orange-primary);
}

.ratio-custom-card.active strong {
  color: var(--color-orange-primary);
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.price-cell {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 14px;
  border-left: 4px solid #ccd5e0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.price-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.price-cell span,
.summary-main span,
.summary-list span {
  color: #6f7a89;
  font-size: 12px;
  font-weight: 800;
}

.price-cell strong {
  overflow-wrap: anywhere;
  color: var(--color-orange-primary);
  font-size: 21px;
  font-weight: 900;
}

.price-cell.accent {
  border-left-color: var(--color-orange-primary);
  background: var(--color-bg-orange);
}

.remark {
  margin-top: 14px;
}

.summary-column {
  --summary-sticky-top: clamp(148px, 22vh, 240px);

  min-width: 0;
  position: sticky;
  top: var(--summary-sticky-top);
  align-self: start;
  max-height: calc(100vh - var(--summary-sticky-top) - 24px);
}

.summary-panel {
  padding: 16px;
  max-height: inherit;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #e6ebf2;
  border-radius: var(--radius-8);
  background: #fff;
  box-shadow: 0 12px 34px rgba(20, 34, 56, 0.05);
}

.summary-main {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-8);
  background: var(--color-bg-orange);
}

.summary-main strong {
  color: var(--color-orange-primary);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.summary-breakdown {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #ffe1c7;
  border-radius: var(--radius-8);
  background: #fffaf6;
}

.summary-breakdown-title {
  color: var(--color-orange-dark);
  font-size: 13px;
  font-weight: 900;
}

.summary-breakdown div:not(.summary-breakdown-title) {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.summary-breakdown span {
  color: #6f7a89;
  font-size: 12px;
  font-weight: 800;
}

.summary-breakdown strong {
  overflow-wrap: anywhere;
  color: var(--color-text-dark);
  font-size: 13px;
  text-align: right;
}

.summary-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f6;
}

.summary-list strong {
  overflow-wrap: anywhere;
  color: var(--color-text-dark);
  font-size: 13px;
  text-align: right;
}

.summary-actions {
  display: grid;
  gap: 10px;
}

.summary-actions :deep(.el-button) {
  width: 100%;
  margin-left: 0;
  border-radius: var(--radius-8);
}

.summary-actions :deep(.el-button.btn-publish) {
  border-color: var(--color-orange-primary);
  background-color: var(--color-orange-primary);
  color: #fff;
  font-weight: 800;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.summary-actions :deep(.el-button.btn-publish:hover) {
  border-color: var(--color-orange-dark);
  background-color: var(--color-orange-dark);
}

@media (max-width: 1120px) {
  .publish-layout {
    grid-template-columns: 1fr;
    max-width: 920px;
  }

  .summary-column {
    display: none;
  }
}

@media (max-width: 860px) {
  .field-row,
  .time-preset-row,
  .quantity-header,
  .quantity-item {
    grid-template-columns: 1fr;
  }

  .field-hint {
    grid-column: auto;
  }

  .compact-grid,
  .compact-grid.two,
  .upload-grid,
  .price-grid,
  .ratio-mode-grid,
  .deposit-control {
    grid-template-columns: 1fr;
  }

  .panel-input-grid .input-block {
    grid-template-columns: 1fr;
  }

  .panel-input-grid :deep(.el-input-number),
  .panel-input-grid :deep(.el-input) {
    max-width: none;
  }

  .quantity-header {
    display: none;
  }

  .upload-item {
    grid-template-columns: 1fr;
  }

  .upload-add,
  .upload-preview {
    width: 100%;
  }

  .deposit-control {
    display: grid;
  }

  .deposit-control :deep(.el-input-number) {
    width: 100% !important;
    flex: 1;
  }

  .region-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
