/* 28打印 - RMB pages shared styles (keep close to existing toolCollection pages) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #171717;
  background: #f9fafb;
  -webkit-font-smoothing: antialiased
}

a {
  color: inherit;
  text-decoration: none
}

img {
  max-width: 100%;
  height: auto;
  display: block
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit
}

button:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px
}

/* Utilities (subset) */
.min-h-screen {
  min-height: 100vh
}

.bg-gray-50 {
  background-color: #f9fafb
}

.bg-white {
  background-color: #fff
}

.bg-blue-50 {
  background-color: #eff6ff
}

.bg-blue-600 {
  background-color: #2563eb
}

.bg-blue-700 {
  background-color: #1d4ed8
}

.bg-gray-100 {
  background-color: #f3f4f6
}

.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem
}

.text-sm {
  font-size: .875rem;
  line-height: 1.25rem
}

.text-xs {
  font-size: .75rem;
  line-height: 1rem
}

.font-bold {
  font-weight: 700
}

.font-semibold {
  font-weight: 600
}

.font-medium {
  font-weight: 500
}

.text-gray-900 {
  color: #111827
}

.text-gray-700 {
  color: #374151
}

.text-gray-600 {
  color: #4b5563
}

.text-gray-500 {
  color: #6b7280
}

.text-blue-600 {
  color: #2563eb
}

.text-blue-700 {
  color: #1d4ed8
}

.text-center {
  text-align: center
}

.max-w-7xl {
  max-width: 80rem
}

.mx-auto {
  margin-left: auto;
  margin-right: auto
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem
}

.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem
}

.py-3 {
  padding-top: .75rem;
  padding-bottom: .75rem
}

.p-6 {
  padding: 1.5rem
}

.mb-2 {
  margin-bottom: .5rem
}

.mb-4 {
  margin-bottom: 1rem
}

.mb-6 {
  margin-bottom: 1.5rem
}

.mb-8 {
  margin-bottom: 2rem
}

.mt-2 {
  margin-top: .5rem
}

.mt-4 {
  margin-top: 1rem
}

.mt-10 {
  margin-top: 2.5rem
}

.flex {
  display: flex
}

.items-center {
  align-items: center
}

.justify-between {
  justify-content: space-between
}

.justify-center {
  justify-content: center
}

.space-x-2 {
  gap: .5rem
}

.space-x-6 {
  gap: 1.5rem
}

.gap-8 {
  gap: 2rem
}

.h-16 {
  height: 4rem
}

.rounded-lg {
  border-radius: .5rem
}

.border-light {
  border: 1px solid #f3f4f6
}

.shadow-sm {
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05)
}

@media (min-width:640px) {
  .sm\:px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem
  }

  .sm\:text-sm {
    font-size: .875rem;
    line-height: 1.25rem
  }
}

@media (min-width:1024px) {
  .lg\:px-8 {
    padding-left: 2rem;
    padding-right: 2rem
  }
}

/* Header (same feel as existing pages) */
header {
  background: #fff;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);
  border-bottom: 1px solid #f3f4f6;
  position: sticky;
  top: 0;
  z-index: 40
}

nav {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem
}

@media (min-width:640px) {
  nav {
    padding: 0 1.5rem
  }
}

@media (min-width:1024px) {
  nav {
    padding: 0 2rem
  }
}

.nav-link {
  color: #374151;
  padding: .5rem .75rem;
  border-radius: .5rem;
  font-size: .875rem;
  transition: background-color .15s, color .15s
}

.nav-link:hover {
  color: #2563eb;
  background-color: #f3f4f6
}

.nav-link.active {
  color: #1d4ed8;
  font-weight: 600;
  background-color: #eff6ff;
  border-radius: .5rem
}

.hidden {
  display: none
}

@media (min-width:768px) {
  .md\:flex {
    display: flex
  }

  .md\:hidden {
    display: none
  }
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem;
  border-radius: .375rem
}

.btn-icon:hover {
  background: #f3f4f6
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1);
  border-top: 1px solid #f3f4f6;
  z-index: 50
}

.mobile-menu.active {
  display: block
}

.mobile-menu a {
  display: block;
  padding: .75rem 1rem;
  color: #374151;
  border-bottom: 1px solid #f3f4f6
}

.mobile-menu a.active {
  color: #1d4ed8;
  background-color: #eff6ff;
  font-weight: 600
}

/* Breadcrumb */
.border-b {
  border-bottom-width: 1px;
  border-bottom-style: solid
}

.border-gray-100 {
  border-color: #f3f4f6
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .75rem;
  overflow-x: auto
}

@media (min-width:640px) {
  .breadcrumb ol {
    font-size: .875rem;
    gap: .5rem
  }
}

/* Layout */
.grid {
  display: grid
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr))
}

@media (min-width:1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr))
  }

  .lg\:col-span-1 {
    grid-column: span 1/span 1
  }

  .lg\:col-span-2 {
    grid-column: span 2/span 2
  }
}

/* Buttons */
.btn-primary {
  padding: .5rem 1rem;
  background: #2563eb;
  color: #fff;
  border-radius: .5rem;
  font-size: .875rem;
  transition: background-color .15s
}

.btn-primary:hover {
  background: #1d4ed8
}

.btn-secondary {
  padding: .5rem 1rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  border-radius: .5rem;
  font-size: .875rem;
  transition: background-color .15s, border-color .15s
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db
}

/* Tabs */
.tabs {
  display: flex;
  gap: .5rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: .5rem;
  margin-bottom: 1rem
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border-radius: 9999px;
  font-size: .875rem;
  color: #374151;
  background: #f3f4f6
}

.tab.active {
  color: #1d4ed8;
  background: #eff6ff;
  font-weight: 600
}

/* Print preview area */
.print-box {
  width: 100%
}

.print-area {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  padding: 1.5rem;
  width: 100%;
  box-sizing: border-box;
  overflow: auto
}

.a4-pages {
  width: 100%;
  display: grid;
  gap: 1rem
}

.a4-page {
  width: min(100%, 840px);
  min-height: 1100px;
  background: #fff;
  margin: 0 auto;
  border-radius: .5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);
  padding: 18mm 20mm 18mm;
  box-sizing: border-box;
  position: relative
}

/* Print */
@media print {
  .no-print {
    display: none !important
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: white !important
  }

  .min-h-screen {
    min-height: 0 !important
  }

  main {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important
  }

  .print-area {
    border: none;
    padding: 0;
    overflow: visible !important
  }

  /* 打印时强制两列布局 */
  .q-list {
    column-count: 2 !important;
    column-gap: 18px !important;
  }

  .a4-pages {
    gap: 0
  }

  .a4-page {
    width: 210mm !important;
    height: 297mm !important;
    min-height: 0 !important;
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    break-after: page;
    page-break-after: always
  }

  .a4-page:last-child {
    break-after: auto;
    page-break-after: auto
  }

  @page {
    size: A4;
    margin: 0
  }
}

/* 移动端预览：根据屏幕宽度自动缩放整张 A4 页面 */
@media (max-width:768px) {
  .print-area {
    padding: .75rem;
  }

  .a4-page {
    width: 100%;
    min-height: auto;
    padding: 1rem;
  }
}