/**
 * 移除 Bootstrap 3 全量 CSS 后，保留弹窗、栅格、按钮等页面仍依赖的最小样式。
 * 与 Tailwind utilities、design-tokens、style.css 配合使用。
 */

/* ---- 无障碍：屏幕阅读器-only（原 Bootstrap .sr-only）---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Modal（Bootstrap 3 行为由 compat-query.js 驱动）---- */
.modal-open {
  overflow: hidden;
}

.modal {
  display: none;
  overflow: auto;
  overflow-y: auto;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 950;
  -webkit-overflow-scrolling: touch;
  outline: 0;
}

.modal.fade .modal-dialog {
  transition: transform 0.25s ease-out;
  transform: translate(0, -20px);
}

.modal.in .modal-dialog {
  transform: translate(0, 0);
}

.modal.in {
  display: block !important;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  background-color: #000;
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.in {
  opacity: 1;
  background-color: var(--backdrop-scrim, rgba(10, 12, 18, 0.45));
}

.modal-dialog {
  position: relative;
  width: auto;
  max-width: calc(100vw - 24px);
  margin: 16px 12px;
  z-index: 1055;
}

@media (min-width: 768px) {
  .modal-dialog {
    width: 440px;
    max-width: min(440px, calc(100vw - 32px));
    margin: 20px auto;
  }

  /* 快照等较宽弹窗（HTML 使用 .modal-lg） */
  .modal-dialog.modal-lg {
    width: min(620px, calc(100vw - 32px));
    max-width: min(620px, calc(100vw - 32px));
  }
}

.modal-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--c-border-primary, rgba(0, 0, 0, 0.08));
}

.modal-header .modal-title,
.modal-title {
  margin: 0;
  line-height: 1.35;
}

.modal-body {
  padding: 12px 14px;
}

.modal-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--c-border-primary, rgba(0, 0, 0, 0.08));
  text-align: right;
}

.modal-header .close {
  float: right;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.2;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.modal-header .close:hover,
.modal-header .close:focus {
  opacity: 0.5;
}

/* ---- 按钮（首选项 / 弹窗底部）---- */
.btn {
  display: inline-block;
  margin-bottom: 0;
  font-weight: 500;
  text-align: center;
  vertical-align: middle;
  touch-action: manipulation;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  padding: 0.4rem 0.85rem;
  font-size: var(--font-size-sm, 0.8125rem);
  line-height: 1.4;
  border-radius: var(--radius-lg, 8px);
  user-select: none;
  transition: background-color var(--t-fast, 120ms) var(--ease-ui, ease),
    border-color var(--t-fast, 120ms) var(--ease-ui, ease),
    color var(--t-fast, 120ms) var(--ease-ui, ease), box-shadow var(--t-fast, 120ms) var(--ease-ui, ease),
    transform var(--t-fast, 120ms) var(--ease-ui, ease);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px #fff, 0 0 0 4px #3d6a9e);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #fff;
  background-color: var(--btn-primary-bg, #3d6a9e);
  border-color: var(--btn-primary-border, #33587f);
}

.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  background-color: var(--btn-primary-bg-hover, #335c88);
  border-color: var(--btn-primary-border, #33587f);
}

.btn-danger {
  color: #fff;
  background-color: #b91c1c;
  border-color: #991b1b;
}

.btn-danger:hover,
.btn-danger:focus {
  color: #fff;
  background-color: #991b1b;
  border-color: #7f1d1d;
}

.btn-default {
  color: var(--c-text-primary);
  background-color: var(--c-bg-button);
  border-color: var(--c-border-strong);
}

.btn-default:hover,
.btn-default:focus {
  background-color: var(--surface-subtle);
  border-color: var(--c-text-secondary);
  color: var(--c-text-primary);
}

.btn-block {
  display: block;
  width: 100%;
}

/* ---- 表单栅格（首选项 modal 内 .form-horizontal）---- */
.form-horizontal .form-group {
  margin-right: -15px;
  margin-left: -15px;
}

.form-horizontal .form-group:before,
.form-horizontal .form-group:after,
.row:before,
.row:after {
  content: " ";
  display: table;
}

.form-horizontal .form-group:after,
.row:after {
  clear: both;
}

.col-sm-6,
.col-md-5,
.col-md-6 {
  position: relative;
  min-height: 1px;
  padding-left: 15px;
  padding-right: 15px;
}

.col-sm-6,
.col-md-6 {
  float: left;
  width: 50%;
}

.col-md-5 {
  float: left;
  width: 41.66666667%;
}

/* ---- 标签页（关于弹窗）---- */
.nav-tabs {
  border-bottom: 1px solid var(--c-border-primary, #ddd);
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.nav-tabs > li {
  float: left;
  margin-bottom: -1px;
}

.nav-tabs > li > a {
  margin-right: 2px;
  line-height: 1.42857143;
  border: 1px solid transparent;
  border-radius: 4px 4px 0 0;
  padding: 10px 15px;
  display: block;
  text-decoration: none;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  color: var(--c-text-primary);
  cursor: default;
  background-color: var(--surface-elevated, #fff);
  border: 1px solid var(--c-border-primary);
  border-bottom-color: transparent;
}

.tab-content > .tab-pane {
  display: none;
}

.tab-content > .tab-pane.active,
.tab-content > .tab-pane.in {
  display: block;
}

.nav-tabs:before,
.nav-tabs:after {
  content: " ";
  display: table;
}

.nav-tabs:after {
  clear: both;
}
