/* ==========================================================================
   模态弹窗、速查卡、Toast 提示与 A4 打印样式
   ========================================================================== */

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-wide {
  max-width: 960px;
}

.modal-sm {
  max-width: 420px;
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-subtitle {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close {
  border: none;
  background: var(--bg-soft);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-secondary);
}

.btn-close:hover {
  background: #e2ddd0;
}

.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
}

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

/* 速查卡表格与区块 */
.cheat-section {
  margin-bottom: 18px;
}

.cheat-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--brand-blue-dark);
  border-bottom: 2px solid var(--bg-accent-soft);
  padding-bottom: 4px;
}

.cheat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.cheat-table th, .cheat-table td {
  border: 1px solid var(--border-light);
  padding: 8px 10px;
  text-align: left;
}

.cheat-table th {
  background: var(--bg-soft);
  font-weight: 700;
}

/* Toast 提示 */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  background: #1e293b;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: toastSlide 0.22s ease-out;
}

.toast-success { background: #15803d; }
.toast-warn { background: #b45309; }
.toast-error { background: #b91c1c; }

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

/* A4 打印样式（打印速查卡时只输出速查卡正文） */
@media print {
  .top-nav, .main-container, .toast-container, .modal-header-actions {
    display: none !important;
  }
  .modal-backdrop {
    position: static;
    background: none;
    padding: 0;
  }
  .modal-card {
    max-width: none;
    max-height: none;
    box-shadow: none;
    border: none;
  }
}
