/* 万店投—铺货系统 组件样式 */

/* === 按钮组件 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  outline: none;
  white-space: nowrap;
  user-select: none;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

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

.btn-secondary:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-text {
  background: transparent;
  color: var(--primary-color);
  border: none;
  padding: 4px 8px;
}

.btn-text:hover {
  background: rgba(224, 32, 32, 0.06);
}

.btn-danger {
  background: #fff;
  color: var(--error-color);
  border-color: var(--error-color);
}

.btn-danger:hover {
  background: var(--error-color);
  color: #fff;
}

.btn-disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-large {
  padding: 10px 20px;
  font-size: 15px;
}

.btn-small {
  padding: 4px 12px;
  font-size: 13px;
}

.btn-icon {
  padding: 8px;
  width: 32px;
  height: 32px;
}

/* === 表单组件 === */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

.form-label.required::before {
  content: "*";
  color: var(--error-color);
  margin-right: 4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
  transition: all 0.3s;
  outline: none;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--primary-color);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(224, 32, 32, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error-color);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-tertiary);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-error {
  color: var(--error-color);
  font-size: 12px;
  margin-top: 4px;
}

.form-help {
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 4px;
}

/* 搜索框 */
.search-input {
  position: relative;
  display: inline-block;
}

.search-input input {
  padding-left: 36px;
  width: 240px;
}

.search-input::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-tertiary);
}

/* 数字输入框 */
.number-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background: #fff;
  width: fit-content;
}

.number-input input {
  width: 80px;
  border: none;
  padding: 8px 12px;
  text-align: center;
  outline: none;
}

.number-input button {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.number-input button:hover {
  color: var(--primary-color);
}

/* 单选框和复选框 */
.radio-group,
.checkbox-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.radio-item,
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.radio-item input,
.checkbox-item input {
  cursor: pointer;
}

/* 开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 22px;
}

.switch-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .switch-slider {
  background-color: var(--primary-color);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(22px);
}

/* === 状态标签 === */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
}

/* 铺货计划状态 */
.status-draft {
  background: #f5f5f5;
  color: #666;
}

.status-pending-payment {
  background: #fff7e6;
  color: #fa8c16;
}

.status-reviewing {
  background: #e6f7ff;
  color: #1890ff;
}

.status-rejected {
  background: #fff1f0;
  color: #e02020;
}

.status-active {
  background: #f6ffed;
  color: #52c41a;
}

.status-paused {
  background: #fff7e6;
  color: #fa8c16;
}

.status-finished {
  background: #f5f5f5;
  color: #999;
}

.status-early-finished {
  background: #f5f5f5;
  color: #999;
}

.status-terminated {
  background: #f5f5f5;
  color: #999;
}

/* 订单状态 */
.status-pending-ship {
  background: #fff7e6;
  color: #fa8c16;
}

.status-shipping {
  background: #e6f7ff;
  color: #1890ff;
}

.status-pending-receive {
  background: #fff7e6;
  color: #fa8c16;
}

.status-pending-distribution {
  background: #fff7e6;
  color: #fa8c16;
}

.status-completed {
  background: #f6ffed;
  color: #52c41a;
}

.status-closed {
  background: #f5f5f5;
  color: #999;
}

/* 履约状态 */
.status-not-started {
  background: #f5f5f5;
  color: #999;
}

.status-in-progress {
  background: #e6f7ff;
  color: #1890ff;
}

.status-exception {
  background: #fff1f0;
  color: #e02020;
}

/* 验收状态 */
.status-pending-confirm {
  background: #fff7e6;
  color: #fa8c16;
}

.status-pending-rectify {
  background: #fff1f0;
  color: #e02020;
}

.status-pending-review {
  background: #e6f7ff;
  color: #1890ff;
}

.status-qualified {
  background: #f6ffed;
  color: #52c41a;
}

.status-auto-confirmed {
  background: #f6ffed;
  color: #52c41a;
}

/* === Tab标签页 === */
.tabs {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-list {
  display: flex;
  gap: 32px;
}

.tab-item {
  padding: 12px 0;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: color 0.3s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-item:hover {
  color: var(--primary-color);
}

.tab-item.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* === 步骤条 === */
.steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 0 40px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
}

.step-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--border-color);
  z-index: 0;
}

.step-item.completed:not(:last-child)::after {
  background: var(--primary-color);
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.step-item.active .step-number {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.step-item.completed .step-number {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.step-title {
  font-size: 14px;
  color: var(--text-tertiary);
}

.step-item.active .step-title {
  color: var(--primary-color);
  font-weight: 500;
}

.step-item.completed .step-title {
  color: var(--text-primary);
}

/* === 进度条 === */
.progress {
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s;
}

.progress-bar.success {
  background: var(--success-color);
}

.progress-bar.warning {
  background: var(--warning-color);
}

/* === 弹窗 === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s;
}

.modal {
  background: #fff;
  border-radius: var(--radius-medium);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s;
}

.modal-small {
  width: 420px;
}

.modal-medium {
  width: 640px;
}

.modal-large {
  width: 920px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  cursor: pointer;
  font-size: 20px;
  color: var(--text-tertiary);
  transition: color 0.3s;
  background: none;
  border: none;
  padding: 0;
  width: 24px;
  height: 24px;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === 抽屉 === */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2000;
  animation: fadeIn 0.3s;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 2001;
  animation: slideInRight 0.3s;
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* === Toast提示 === */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border-radius: var(--radius-small);
  font-size: 14px;
  z-index: 3000;
  animation: slideDown 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success {
  background: rgba(82, 196, 26, 0.9);
}

.toast.error {
  background: rgba(224, 32, 32, 0.9);
}

.toast.warning {
  background: rgba(250, 140, 22, 0.9);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* === 气泡提示 === */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip-text {
  visibility: hidden;
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  text-align: center;
  padding: 6px 12px;
  border-radius: var(--radius-small);
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* === 隐藏类 === */
.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}

/* === 商品图片占位 === */
.product-image {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  border-radius: var(--radius-small);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 24px;
}

.product-image-large {
  width: 100px;
  height: 100px;
}

/* === 操作链接 === */
.action-link {
  color: var(--primary-color);
  cursor: pointer;
  transition: opacity 0.3s;
}

.action-link:hover {
  opacity: 0.8;
}

.action-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-divider {
  color: var(--border-color);
}
