/* ===== Checklist Page Styles ===== */

.checklist-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.checklist-page h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 0.25rem;
}

.checklist-page .page-subtitle {
  color: var(--c-text3);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--c-text3);
  font-size: 0.9rem;
  text-decoration: none;
  margin-bottom: 1rem;
}

.back-link:hover {
  color: var(--c-primary);
}

/* Tabs */
.checklist-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--c-border);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.checklist-tab {
  padding: 0.6rem 1.2rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--c-text3);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
  font-family: var(--font);
}

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

.checklist-tab.active {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
  font-weight: 600;
}

/* Toolbar */
.checklist-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--c-text3);
  margin-bottom: 0.5rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--c-bg3);
  border-radius: 4px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--c-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--c-bg3);
  border: 1px solid var(--c-border);
  border-radius: 0.5rem;
  font-size: 0.85rem;
  color: var(--c-text2);
  cursor: pointer;
  transition: background 0.2s;
  font-family: var(--font);
}

.print-btn:hover {
  background: var(--c-border);
}

/* Sections */
.checklist-section {
  margin-bottom: 1.5rem;
}

.checklist-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-text2);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checklist-section h3 .section-icon {
  font-size: 1.25rem;
}

/* Items */
.checklist-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--c-bg3);
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-item input[type="checkbox"] {
  margin-top: 0.1rem;
  width: 22px;
  height: 22px;
  min-width: 22px;
  accent-color: var(--c-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.checklist-item .item-content {
  flex: 1;
}

.checklist-item .item-text {
  font-size: 0.95rem;
  color: var(--c-text);
  line-height: 1.5;
}

.checklist-item .item-detail {
  font-size: 0.85rem;
  color: var(--c-text3);
  margin-top: 0.25rem;
  line-height: 1.5;
}

.checklist-item.checked .item-text {
  text-decoration: line-through;
  color: var(--c-text3);
}

/* Info box */
.info-box {
  background: var(--c-primary-l);
  border: 1px solid var(--c-border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

.info-box h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--c-primary);
  margin: 0 0 0.5rem;
}

.info-box p {
  font-size: 0.9rem;
  color: var(--c-text2);
  line-height: 1.6;
}

/* Warning box */
.warning-box {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

[data-theme="dark"] .warning-box {
  background: #422006;
  border-color: #854d0e;
}

.warning-box h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #92400e;
  margin: 0 0 0.5rem;
}

[data-theme="dark"] .warning-box h4 {
  color: #fbbf24;
}

.warning-box p {
  font-size: 0.9rem;
  color: #78350f;
  line-height: 1.6;
}

[data-theme="dark"] .warning-box p {
  color: #fde68a;
}

/* Disclaimer */
.disclaimer {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-top: 2rem;
}

[data-theme="dark"] .disclaimer {
  background: #431407;
  border-color: #9a3412;
}

.disclaimer h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #9a3412;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

[data-theme="dark"] .disclaimer h4 {
  color: #fb923c;
}

.disclaimer p {
  font-size: 0.85rem;
  color: #7c2d12;
  line-height: 1.6;
  margin: 0;
}

[data-theme="dark"] .disclaimer p {
  color: #fdba74;
}

/* Word breaking */
.info-box p,
.warning-box p,
.disclaimer p,
.item-detail,
.item-text {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Print */
@media print {
  .checklist-tabs,
  .print-btn,
  .back-link,
  .checklist-toolbar,
  #site-header,
  #site-footer {
    display: none !important;
  }

  .checklist-page {
    max-width: 100%;
    padding: 0;
  }

  .checklist-section {
    break-inside: avoid;
  }

  .checklist-item input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1.5px solid #333;
    border-radius: 2px;
  }

  .checklist-item.checked input[type="checkbox"]::after {
    content: '\2713';
    display: block;
    text-align: center;
    font-size: 11px;
    line-height: 14px;
  }

  /* Show all tabs' content when printing */
  .checklist-tab-content { display: block !important; }
}

/* Responsive */
@media (max-width: 640px) {
  .checklist-page {
    padding: 24px 16px 48px;
  }

  .checklist-page h1 {
    font-size: 1.3rem;
  }

  .checklist-page .page-subtitle {
    font-size: 0.9rem;
  }

  .checklist-tab {
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
  }

  .checklist-tabs {
    gap: 0.25rem;
    margin-bottom: 1rem;
  }

  .checklist-section h3 {
    font-size: 1rem;
  }

  .checklist-item {
    gap: 0.5rem;
    padding: 0.5rem 0;
  }

  .checklist-item .item-text {
    font-size: 0.9rem;
  }

  .checklist-item .item-detail {
    font-size: 0.8rem;
  }

  .info-box,
  .warning-box {
    padding: 0.85rem 1rem;
  }

  .info-box p,
  .warning-box p {
    font-size: 0.85rem;
  }

  .disclaimer {
    padding: 1rem;
  }

  .disclaimer p {
    font-size: 0.8rem;
  }

  .checklist-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .print-btn {
    align-self: flex-end;
  }
}
