.miaosha-more-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  /* 同一排是 tdesign 按钮，align-items: normal 会按顶边对齐，
     高度差会直接变成错位；显式居中避免受兄弟元素高度影响 */
  align-self: center;
}

.miaosha-more-button,
.miaosha-more-menu-item,
.miaosha-more-text-button,
.miaosha-more-action-button {
  border: 1px solid var(--td-component-border, #dcdcdc);
  background: var(--td-bg-color-container, #fff);
  color: var(--td-text-color-primary, #1d2129);
  font: inherit;
  cursor: pointer;
}

.miaosha-more-button {
  /* 尺寸与同排的 tdesign 按钮逐项对齐：
     height 24 / line-height 20 / padding 0 7 / radius 3 / font 12，
     与 .t-button 实测值一致，避免高 4px、中位线低 2px 的错位。 */
  min-width: 40px;
  height: 24px;
  padding: 0 7px;
  border-radius: 3px;
  background: var(--td-brand-color, #5b7fd1);
  border-color: var(--td-brand-color, #5b7fd1);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
}

.miaosha-more-button:hover,
.miaosha-more-action-button.primary:hover {
  filter: brightness(1.08);
}

.miaosha-more-menu {
  position: absolute;
  z-index: 1200;
  right: 0;
  bottom: calc(100% + 6px);
  display: none;
  min-width: 132px;
  padding: 6px;
  border: 1px solid var(--td-component-border, #dcdcdc);
  border-radius: 7px;
  background: var(--td-bg-color-container, #fff);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.miaosha-more-menu.open {
  display: grid;
  gap: 2px;
}

.miaosha-more-menu-item {
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 4px;
  text-align: left;
  white-space: nowrap;
}

.miaosha-more-menu-item:hover {
  background: var(--td-bg-color-container-hover, #f2f3f5);
}

.miaosha-more-overlay {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.56);
}

.miaosha-more-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid var(--td-component-border, #dcdcdc);
  border-radius: 10px;
  background: var(--td-bg-color-container, #fff);
  color: var(--td-text-color-primary, #1d2129);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.miaosha-more-dialog-header,
.miaosha-more-dialog-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
}

.miaosha-more-dialog-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--td-component-stroke, #ececec);
  font-size: 16px;
}

.miaosha-more-dialog-body {
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding: 20px;
}

.miaosha-more-dialog-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--td-component-stroke, #ececec);
}

.miaosha-more-text-button,
.miaosha-more-action-button {
  min-width: 68px;
  min-height: 32px;
  padding: 6px 14px;
  border-radius: 4px;
}

.miaosha-more-text-button {
  border: 0;
  background: transparent;
}

.miaosha-more-action-button.primary {
  border-color: var(--td-brand-color, #5b7fd1);
  background: var(--td-brand-color, #5b7fd1);
  color: #fff;
}

.miaosha-more-action-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.miaosha-more-field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--td-text-color-secondary, #4e5969);
}

.miaosha-more-select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--td-component-border, #dcdcdc);
  border-radius: 4px;
  background: var(--td-bg-color-container, #fff);
  color: var(--td-text-color-primary, #1d2129);
}

.miaosha-more-loading,
.miaosha-more-empty,
.miaosha-more-error,
.miaosha-more-confirm-text {
  padding: 20px 8px;
  text-align: center;
  color: var(--td-text-color-secondary, #4e5969);
}

.miaosha-more-error {
  color: var(--td-error-color, #d54941);
}

.miaosha-progress-table {
  display: grid;
  min-width: 600px;
  border: 1px solid var(--td-component-stroke, #ececec);
  border-radius: 6px;
  overflow: hidden;
}

.miaosha-progress-row {
  display: grid;
  grid-template-columns: 160px 90px 70px minmax(220px, 1fr);
  border-top: 1px solid var(--td-component-stroke, #ececec);
}

.miaosha-progress-row:first-child {
  border-top: 0;
}

.miaosha-progress-row.head {
  background: var(--td-bg-color-secondarycontainer, #f3f3f3);
  font-weight: 600;
}

.miaosha-progress-row span {
  padding: 10px 12px;
  overflow-wrap: anywhere;
}

.miaosha-more-toast {
  position: fixed;
  z-index: 4000;
  top: 24px;
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 5px;
  background: #237804;
  color: #fff;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.miaosha-more-toast.error {
  background: #c12c1f;
}

.miaosha-more-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

[data-theme="dark"] .miaosha-more-dialog,
[data-theme="dark"] .miaosha-more-menu,
[data-theme="dark"] .miaosha-more-select,
html.dark .miaosha-more-dialog,
html.dark .miaosha-more-menu,
html.dark .miaosha-more-select,
body.dark .miaosha-more-dialog,
body.dark .miaosha-more-menu,
body.dark .miaosha-more-select {
  border-color: #3a3a3a;
  background: #1d1d1d;
  color: #e7e7e7;
}

[data-theme="dark"] .miaosha-more-menu-item,
html.dark .miaosha-more-menu-item,
body.dark .miaosha-more-menu-item {
  color: #e7e7e7;
}

[data-theme="dark"] .miaosha-more-menu-item:hover,
html.dark .miaosha-more-menu-item:hover,
body.dark .miaosha-more-menu-item:hover {
  background: #2a2a2a;
}

@media (max-width: 720px) {
  .miaosha-more-dialog-body {
    padding: 14px;
  }

  .miaosha-progress-table {
    min-width: 520px;
  }
}
