/**
 * 旧版浏览器 Ant Design Vue 静态样式回退。
 * Ant Design Vue 4 依赖 CSS-in-JS，旧环境可能无法注入样式。
 * 所有规则仅在 html.legacy-env 下生效，不影响新浏览器。
 */

html.legacy-env {
  --background: 0 0% 100%;
  --background-deep: 216 20% 95%;
  --foreground: 210 6% 21%;
  --card: 0 0% 100%;
  --primary: 212 100% 45%;
  --muted-foreground: 240 4% 46%;
  --border: 240 6% 90%;
  --popup-z-index: 2000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #303133;
  background: #f0f2f5;
}

/* 通用工具类统一放在 legacy-fallback.css，本文件只保留 antd 组件相关规则 */

html.legacy-env .ant-space {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
}

html.legacy-env .ant-space-horizontal > .ant-space-item:not(:last-child) {
  margin-right: 8px;
  margin-bottom: 8px;
}

html.legacy-env .ant-btn {
  display: inline-block;
  height: 32px;
  padding: 4px 15px;
  font-size: 14px;
  line-height: 1.5715;
  color: rgba(0, 0, 0, 0.88);
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
}

html.legacy-env .ant-btn-primary {
  color: #fff;
  background: #1677ff;
  border-color: #1677ff;
}

html.legacy-env .ant-btn-link {
  height: auto;
  padding: 0 4px;
  color: #1677ff;
  background: transparent;
  border: none;
  box-shadow: none;
}

html.legacy-env .ant-btn-sm {
  height: 24px;
  padding: 0 7px;
  font-size: 12px;
}

html.legacy-env .ant-card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
}

html.legacy-env .ant-card-body {
  padding: 24px;
}

html.legacy-env .ant-table table {
  width: 100%;
  border-collapse: collapse;
}

html.legacy-env .ant-table-thead > tr > th {
  padding: 12px 16px;
  font-weight: 600;
  text-align: left;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

html.legacy-env .ant-table-tbody > tr > td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

html.legacy-env .ant-table-tbody td .ant-btn-link {
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}

html.legacy-env .ant-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  margin: 16px 0 0;
}

html.legacy-env .ant-pagination > * {
  margin-right: 8px;
}

html.legacy-env .ant-pagination-item,
html.legacy-env .ant-pagination-prev,
html.legacy-env .ant-pagination-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  cursor: pointer;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
}

html.legacy-env .ant-select-selector,
html.legacy-env .ant-input {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 11px;
  font-size: 14px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
}

html.legacy-env .ant-radio-group {
  display: inline-flex;
  align-items: center;
}

html.legacy-env .ant-radio-button-wrapper {
  display: inline-block;
  height: 32px;
  padding: 0 15px;
  line-height: 30px;
  cursor: pointer;
  background: #fff;
  border: 1px solid #d9d9d9;
}

html.legacy-env .ant-radio-button-wrapper-checked {
  color: #1677ff;
  border-color: #1677ff;
}

html.legacy-env .ant-tag {
  display: inline-block;
  padding: 0 7px;
  font-size: 12px;
  line-height: 20px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
}

html.legacy-env .ant-tag-blue {
  color: #1677ff;
  background: #e6f4ff;
  border-color: #91caff;
}

html.legacy-env .promo-tip-banner {
  display: flex;
  align-items: center;
}

html.legacy-env .promo-tip-banner > :not(:first-child) {
  margin-left: 8px;
}

html.legacy-env .promo-slot-name {
  display: inline-flex;
  align-items: center;
}

html.legacy-env .promo-slot-name > :not(:first-child) {
  margin-left: 6px;
}

html.legacy-env .promo-path-input-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

html.legacy-env .promo-path-input-row > :not(:first-child) {
  margin-left: 6px;
}

html.legacy-env .promo-path-display {
  flex: 1;
  min-width: 0;
  color: #303133;
  background: #fafafa;
  border: 1px solid #e5e6eb;
}

html.legacy-env .btn-copy-path {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #1677ff;
  cursor: pointer;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
}
