* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef1f5;
  color: #222;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

img,
iframe {
  display: block;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

.workspace-config {
  max-width: 1280px;
  margin: 0 auto;
}

.workspace-display {
  max-width: 760px;
  margin: 0 auto;
}

.config-panel,
.preview-panel {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 40px rgba(35, 46, 66, 0.08);
}

.config-panel {
  padding: 24px;
}

.config-panel-head,
.preview-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.config-panel-title,
.preview-panel-title {
  color: #171f2d;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.config-panel-desc,
.preview-panel-desc {
  margin-top: 6px;
  color: #6b7380;
  font-size: 14px;
  line-height: 1.6;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-section {
  margin-bottom: 20px;
}

.config-section-title {
  margin-bottom: 14px;
  color: #1c2432;
  font-size: 18px;
  font-weight: 700;
}

.config-subsection {
  margin-top: 16px;
}

.config-subtitle {
  margin-bottom: 12px;
  color: #222c3d;
  font-size: 15px;
  font-weight: 700;
}

.config-grid {
  display: grid;
  gap: 14px;
}

.config-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.config-field {
  min-width: 0;
}

.config-label {
  margin-bottom: 8px;
  color: #4d5765;
  font-size: 14px;
  font-weight: 600;
}

.config-note {
  margin-top: 6px;
  color: #8991a0;
  font-size: 12px;
  line-height: 1.5;
}

.product-editor-card {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #e8ebf0;
  border-radius: 16px;
  background: #fcfdff;
}

.product-editor-card-active {
  border-color: #f3a1a9;
  box-shadow: 0 0 0 3px rgba(229, 35, 57, 0.08);
}

.product-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.product-editor-title {
  color: #1f2735;
  font-size: 18px;
  font-weight: 700;
}

.product-editor-actions {
  display: flex;
  gap: 8px;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.config-thumb {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  object-fit: cover;
  background: #f0f2f5;
}

.file-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed #c7cfda;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}

.upload-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f7f9fc;
  color: #5a6372;
  font-size: 13px;
}

.preview-panel {
  padding: 20px;
}

.display-workspace {
  padding: 0;
}

.page-shell {
  width: 100%;
  max-width: 480px;
  min-height: calc(100vh - 140px);
  margin: 0 auto;
  background: #f5f5f5;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.screen {
  min-height: calc(100vh - 140px);
  background: #f5f5f5;
}

.screen-list {
  padding-top: 56px;
  background: linear-gradient(#ffffff 0 206px, #f1f1f1 206px 100%);
}

.page-header {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 48px), 480px);
  z-index: 20;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 12px 16px 0;
  height: 56px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.header-back {
  color: #242424;
  font-size: 38px;
  line-height: 1;
  font-weight: 300;
}

.header-back-placeholder {
  visibility: hidden;
}

.interactive-back {
  cursor: pointer;
}

.header-title {
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  color: #161616;
}

.header-actions {
  height: 1px;
}

.merchant-block {
  padding: 16px 20px 12px;
  background: #fff;
}

.merchant-line {
  margin-bottom: 6px;
  color: #4d4d4d;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.merchant-key {
  color: #242424;
}

.search-wrap {
  padding: 22px 20px 12px;
  background: #fff;
}

.search-wrap .ant-input-affix-wrapper {
  height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 20px;
  background: #f1f1f3;
  box-shadow: none;
}

.search-wrap .ant-input {
  color: #666;
  font-size: 16px;
  background: transparent;
}

.search-wrap .ant-input::placeholder {
  color: #b3b3b7;
}

.search-icon {
  display: inline-block;
  color: #9f9fa5;
  font-size: 18px;
  transform: scale(1.2);
}

.date-bar {
  height: 44px;
  border-top: 1px solid #ececec;
  background: #f5f5f5;
  color: #444;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  line-height: 44px;
}

.list-wrap {
  background: #fff;
}

.report-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.2s ease;
}

.report-item:hover {
  background: #fafafa;
}

.product-image {
  flex: none;
  object-fit: cover;
}

.report-item-image {
  width: 76px;
  height: 76px;
  border-radius: 6px;
}

.report-item-content {
  min-width: 0;
  flex: 1;
  padding-top: 2px;
}

.report-item-name {
  color: #373737;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.38;
}

.report-item-code {
  margin-top: 4px;
  color: #969696;
  font-size: 16px;
  line-height: 1.25;
}

.report-item-tag {
  flex: none;
  margin-top: 2px;
  padding: 2px 8px;
  border: 1px solid #31c992;
  border-radius: 4px;
  color: #31c992;
  font-size: 14px;
  font-weight: 700;
  line-height: 22px;
}

.list-empty {
  padding: 48px 20px 56px;
  color: #919191;
  text-align: center;
  font-size: 16px;
}

.screen-detail {
  padding-top: 56px;
  background: #f3f3f3;
}

.detail-content {
  min-height: calc(100vh - 196px);
  padding: 14px 14px 18px;
  overflow: auto;
}

.supplier-detail-content {
  min-height: calc(100vh - 56px);
  padding: 12px;
  overflow: auto;
}

.supplier-section-card {
  margin-bottom: 12px;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.supplier-section-title {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  color: #262626;
  font-size: 17px;
  font-weight: 700;
}

.supplier-info-row {
  padding: 14px 16px 16px;
  color: #555;
  font-size: 16px;
  line-height: 1.5;
}

.supplier-info-key {
  color: #666;
}

.supplier-info-value {
  color: #333;
}

.supplier-license-list {
  padding: 14px;
}

.supplier-license-item + .supplier-license-item {
  margin-top: 14px;
}

.supplier-license-name {
  margin-bottom: 10px;
  color: #4a5363;
  font-size: 14px;
  font-weight: 600;
}

.supplier-license-image {
  width: 100%;
  border: 1px solid #eceff3;
  border-radius: 8px;
  background: #fff;
}

.supplier-license-empty {
  padding: 22px 12px;
  color: #999;
  text-align: center;
  font-size: 14px;
}

.product-card {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.product-card-image {
  width: 108px;
  height: 108px;
  border-radius: 8px;
}

.product-card-content {
  min-width: 0;
  flex: 1;
  padding-top: 8px;
}

.product-card-name {
  color: #373737;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
}

.product-card-unit {
  margin-top: 18px;
  color: #707070;
  font-size: 18px;
}

.product-card-spec {
  margin-top: 10px;
  color: #707070;
  font-size: 18px;
}

.tabs-shell {
  min-height: calc(100vh - 340px);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tabs-shell .ant-tabs {
  min-height: calc(100vh - 340px);
}

.tabs-shell .ant-tabs-nav {
  margin: 0;
  padding: 0 10px;
}

.tabs-shell .ant-tabs-nav::before {
  border-bottom: 1px solid #f0f0f0;
}

.tabs-shell .ant-tabs-tab {
  padding: 16px 0 12px;
  color: #8c8c8c;
  font-size: 17px;
  font-weight: 700;
}

.tabs-shell .ant-tabs-tab + .ant-tabs-tab {
  margin-left: 38px;
}

.tabs-shell .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
  color: #2e2e2e;
}

.tabs-shell .ant-tabs-ink-bar {
  height: 4px !important;
  border-radius: 999px;
  background: #e52339;
}

.tabs-shell .ant-tabs-content-holder {
  min-height: calc(100vh - 396px);
}

.tabs-shell .ant-tabs-content,
.tabs-shell .ant-tabs-tabpane {
  min-height: calc(100vh - 396px);
}

.timeline-pane {
  min-height: calc(100vh - 396px);
  overflow: auto;
  padding: 8px 18px 18px;
}

.timeline-item {
  position: relative;
  padding: 0 0 26px 34px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 12px;
  bottom: -2px;
  width: 2px;
  background: #e1e1e1;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 8px;
  width: 22px;
  height: 22px;
  border: 5px solid #18b78d;
  border-radius: 50%;
  background: #18b78d;
}

.timeline-content {
  padding: 0 0 18px;
  border-bottom: 1px solid #f2f2f2;
}

.timeline-item:last-child .timeline-content {
  border-bottom: none;
}

.timeline-title {
  margin-bottom: 14px;
  color: #2c2c2c;
  font-size: 20px;
  font-weight: 700;
}

.timeline-line {
  margin-bottom: 8px;
  color: #808080;
  font-size: 17px;
  line-height: 1.38;
}

.timeline-line-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-detail-button.ant-btn.ant-btn-link {
  height: auto;
  padding: 0;
  color: #27b37f;
  font-size: 15px;
  font-weight: 700;
}

.timeline-link {
  color: #27b37f;
  font-weight: 700;
}

.report-pane {
  min-height: calc(100vh - 396px);
  overflow: auto;
  padding: 10px 14px 14px;
  background: #fff;
}

.report-pane-title {
  margin: 0 0 12px;
  color: #1c1c1c;
  font-size: 20px;
  font-weight: 700;
}

.report-file-block {
  margin-bottom: 16px;
}

.report-file-block:last-child {
  margin-bottom: 0;
}

.report-file-title {
  margin-bottom: 8px;
  color: #4a5363;
  font-size: 14px;
  font-weight: 600;
}

.report-sheet {
  position: relative;
  overflow: hidden;
  padding: 12px 10px 16px;
  border: 1px solid #e4e4e4;
  background: #fff;
}

.report-sheet-head {
  text-align: center;
}

.report-company {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.report-doc {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
}

.report-table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 10px;
  table-layout: fixed;
}

.report-table td {
  padding: 5px 3px;
  border: 1px solid #6d6d6d;
  text-align: center;
  vertical-align: middle;
  line-height: 1.35;
  word-break: break-word;
}

.report-header-row td {
  font-weight: 700;
}

.report-footer {
  margin-top: 8px;
  font-size: 10px;
}

.report-sign-area {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  min-height: 86px;
  padding-top: 18px;
}

.report-sign {
  font-size: 14px;
  font-family: "KaiTi", "STKaiti", serif;
}

.report-stamp {
  position: absolute;
  right: 28px;
  bottom: 4px;
  width: 110px;
  height: 110px;
  border: 4px solid rgba(180, 55, 41, 0.72);
  border-radius: 50%;
  color: rgba(180, 55, 41, 0.72);
  font-size: 16px;
  font-weight: 700;
  line-height: 102px;
  text-align: center;
  transform: rotate(-12deg);
}

.report-stamp::before,
.report-stamp::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  border-left: 4px solid rgba(180, 55, 41, 0.72);
  border-bottom: 4px solid rgba(180, 55, 41, 0.72);
  transform: translate(-50%, -50%) rotate(45deg);
}

.report-stamp::after {
  width: 20px;
  height: 20px;
  border-left: none;
  border-bottom: none;
  border-top: 4px solid rgba(180, 55, 41, 0.72);
  border-right: 4px solid rgba(180, 55, 41, 0.72);
}

.report-upload-preview {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #eceff3;
  background: #fff;
}

.pdf-preview-box {
  overflow: hidden;
  border: 1px solid #eceff3;
  border-radius: 12px;
  background: #fff;
}

.pdf-preview-name {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  color: #495163;
  font-size: 14px;
  font-weight: 600;
}

.pdf-preview-frame {
  width: 100%;
  min-height: 720px;
  border: none;
}

.global-loading-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 22, 0.22);
  backdrop-filter: blur(2px);
}

.global-loading-card {
  min-width: 148px;
  padding: 24px 28px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 40px rgba(28, 37, 54, 0.18);
  text-align: center;
}

.global-loading-text {
  margin-top: 14px;
  color: #4c5564;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 12px;
    gap: 12px;
  }

  .config-panel,
  .preview-panel {
    padding: 14px;
    border-radius: 16px;
  }

  .config-grid.two-col {
    grid-template-columns: 1fr;
  }

  .product-editor-header,
  .config-panel-head,
  .preview-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .page-shell {
    max-width: 100%;
  }

  .page-header {
    top: 12px;
    width: calc(100vw - 24px);
  }
}

@media (max-width: 480px) {
  .workspace {
    padding: 0;
  }

  .page-shell {
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

  .screen,
  .screen-list {
    min-height: 100vh;
  }

  .page-header {
    grid-template-columns: 32px 1fr 32px;
    top: 0;
    width: 100vw;
    padding: 10px 12px 0;
    height: 50px;
    border-radius: 0;
  }

  .header-back {
    font-size: 32px;
  }

  .header-title {
    font-size: 18px;
  }

  .merchant-block {
    padding: 14px 14px 10px;
  }

  .merchant-line {
    font-size: 14px;
  }

  .search-wrap {
    padding: 16px 14px 10px;
  }

  .search-wrap .ant-input-affix-wrapper {
    height: 36px;
  }

  .search-wrap .ant-input {
    font-size: 14px;
  }

  .date-bar {
    height: 40px;
    font-size: 16px;
    line-height: 40px;
  }

  .report-item {
    gap: 10px;
    padding: 14px;
  }

  .report-item-image {
    width: 64px;
    height: 64px;
  }

  .report-item-name {
    font-size: 16px;
  }

  .report-item-code,
  .report-item-tag {
    font-size: 13px;
  }

  .detail-content {
    min-height: calc(100vh - 172px);
    padding: 12px 12px 16px;
  }

  .supplier-detail-content {
    padding: 10px;
  }

  .supplier-section-title {
    padding: 12px 14px;
    font-size: 16px;
  }

  .supplier-info-row {
    padding: 12px 14px 14px;
    font-size: 14px;
  }

  .supplier-license-list {
    padding: 12px;
  }

  .supplier-license-name {
    font-size: 13px;
  }

  .product-card {
    gap: 12px;
    padding: 14px;
  }

  .product-card-image {
    width: 88px;
    height: 88px;
  }

  .product-card-name {
    font-size: 18px;
  }

  .product-card-unit,
  .product-card-spec {
    margin-top: 8px;
    font-size: 15px;
  }

  .tabs-shell {
    min-height: calc(100vh - 280px);
  }

  .tabs-shell .ant-tabs,
  .tabs-shell .ant-tabs-content-holder,
  .tabs-shell .ant-tabs-content,
  .tabs-shell .ant-tabs-tabpane,
  .timeline-pane,
  .report-pane {
    min-height: calc(100vh - 336px);
  }

  .tabs-shell .ant-tabs-nav {
    padding: 0 6px;
  }

  .tabs-shell .ant-tabs-tab {
    padding: 14px 0 10px;
    font-size: 15px;
  }

  .tabs-shell .ant-tabs-tab + .ant-tabs-tab {
    margin-left: 24px;
  }

  .timeline-pane {
    padding: 8px 14px 14px;
  }

  .timeline-item {
    padding-left: 28px;
  }

  .timeline-marker {
    top: 7px;
    width: 18px;
    height: 18px;
    border-width: 4px;
  }

  .timeline-item::before {
    left: 8px;
  }

  .timeline-title {
    margin-bottom: 10px;
    font-size: 17px;
  }

  .timeline-line {
    font-size: 14px;
  }

  .timeline-line-inner {
    gap: 8px;
  }

  .timeline-detail-button.ant-btn.ant-btn-link {
    font-size: 13px;
  }

  .report-pane {
    padding: 10px 12px 12px;
  }

  .report-pane-title {
    font-size: 18px;
  }

  .pdf-preview-frame {
    min-height: 520px;
  }
}
