/* 全站樣式 10/16：週學習表模組（表單、列表、預覽／列印區、卡片式預覽） */
/* ============================================
   週學習表模組
   ============================================ */

/* 通用小按鈕 */
.btn-sm {
  padding: 5px 12px;
  border: 1px solid var(--separator);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-sm:active { transform: scale(0.96); }
.btn-sm.btn-primary { background: linear-gradient(135deg, #E07B35, #C9652A); color: white; border-color: transparent; }
.btn-sm.btn-danger { background: rgba(231,76,60,0.08); color: var(--red); border-color: rgba(231,76,60,0.2); }

/* 表單通用 */
.wt-form-wrap { max-width: 680px; }
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}
.form-section-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
  padding: 10px 0 6px;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 12px;
  margin-top: 8px;
}

/* 活動行 */
.wt-activity-row {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--separator);
}

/* 列表卡片 */
.wt-list-card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--separator);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(60,40,20,.08);
}
.wt-list-card:active { transform: scale(0.985); }
.wt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.wt-card-class {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 3px 9px;
  border-radius: 8px;
}
.wt-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 16px;
}
.wt-card-theme {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.wt-card-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.wt-return-reason {
  font-size: 0.75rem;
  color: var(--red);
  background: rgba(231,76,60,0.07);
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.wt-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 預覽/列印區 */
.wt-printable {
  background: white;
  border: 1px solid #EDE7DD;
  border-radius: 12px;
  padding: 20px;
  font-family: "Fraunces", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
.wt-print-header {
  text-align: center;
  margin-bottom: 14px;
  border-bottom: 2px solid #2D2A26;
  padding-bottom: 10px;
}
.wt-print-school {
  font-size: 1.375rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}
.wt-print-subtitle {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #6F6A63;
  margin-top: 4px;
}
.wt-print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.wt-print-table td {
  border: 1px solid #A39E96;
  padding: 7px 9px;
  vertical-align: middle;
}
.wt-label {
  background: #FBF8F3;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  font-size: 0.8125rem;
}
.wt-value { color: #2D2A26; min-height: 28px; }
.wt-value.bold { font-weight: 700; }
.wt-print-status {
  margin-top: 10px;
  font-size: 0.75rem;
  color: #6F6A63;
  text-align: right;
}

/* 列印模式 */
@media print {
  .no-print, #header, #main-nav, #header-row, .section-header { display: none !important; }
  .wt-printable { border: none; padding: 0; border-radius: 0; }
  .wt-card-preview { box-shadow: none !important; border: 1px solid #EDE7DD !important; }
  body { background: white; margin: 0; padding: 0; }
  /* 只顯示週學習表預覽頁，隱藏其他所有頁面 */
  .page { display: none !important; }
  #page-wt-preview.page { display: block !important; padding: 0 !important; max-width: none !important; }
  /* A4 頁面 */
  @page { size: A4 portrait; margin: 1.2cm 1.5cm; }
  /* 保留漸層色和背景色 */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  /* 避免內容被截斷 */
  #wt-print-area { max-width: none !important; page-break-inside: auto; }
  #wt-print-area > div { break-inside: avoid; }
}

/* ====== 卡片式預覽設計 ====== */
.wt-card-preview {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(60,40,20,.14);
  font-family: "Fraunces", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 0.9375rem;
  max-width: 800px;
}
.wt-cp-header {
  background: linear-gradient(135deg, #E07B35, #C9652A);
  padding: 20px 24px 18px;
  text-align: center;
  color: white;
}
.wt-cp-school {
  font-size: 1.375rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.wt-cp-subtitle {
  font-size: 0.8125rem;
  opacity: 0.88;
  margin-top: 3px;
  letter-spacing: 0.12em;
}
.wt-cp-theme-band {
  background: #FDEEDC;
  border-bottom: 2px solid #FDEEDC;
  padding: 16px 24px;
}
.wt-cp-theme-name {
  font-size: 1.375rem;
  font-weight: 900;
  color: #2D2A26;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.wt-cp-theme-meta {
  font-size: 0.8125rem;
  color: #6F6A63;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
}
.wt-cp-divider { margin: 0 6px; color: #EDE7DD; }
.wt-cp-info-grid {
  padding: 4px 0;
}
.wt-cp-info-row {
  display: flex;
  border-bottom: 1px solid #FDEEDC;
  min-height: 36px;
}
.wt-cp-info-row:last-child { border-bottom: none; }
.wt-cp-info-label {
  flex: 0 0 130px;
  background: #FBF8F3;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.8125rem;
  color: #6F6A63;
  border-right: 2px solid #EDE7DD;
  display: flex;
  align-items: flex-start;
  white-space: nowrap;
}
.wt-cp-info-value {
  flex: 1;
  padding: 10px 16px;
  color: #2D2A26;
  line-height: 1.6;
}
.wt-cp-section {
  border-top: 2px solid #FDEEDC;
  margin-top: 0;
}
.wt-cp-section-title {
  background: #FDEEDC;
  padding: 10px 24px;
  font-weight: 800;
  font-size: 0.9375rem;
  color: #E07B35;
  letter-spacing: 0.04em;
}
.wt-cp-activities {
  padding: 0 24px 12px;
}
.wt-cp-act-head {
  display: flex;
  background: #FBF8F3;
  border-radius: 8px;
  margin: 10px 0 4px;
  font-weight: 700;
  font-size: 0.75rem;
  color: #6F6A63;
  overflow: hidden;
}
.wt-cp-act-row {
  display: flex;
  border-radius: 8px;
  margin-bottom: 3px;
  min-height: 32px;
}
.wt-cp-act-alt { background: #FBF8F3; }
.wt-cp-act-name-col {
  flex: 0 0 180px;
  padding: 8px 12px;
  font-weight: 600;
  border-right: 1px solid #EDE7DD;
}
.wt-cp-act-goal-col {
  flex: 1;
  padding: 8px 12px;
  color: #6F6A63;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.wt-cp-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 2px solid #FDEEDC;
}
.wt-cp-bottom-grid > :only-child {
  grid-column: 1 / -1;
}
.wt-cp-bottom-card {
  padding: 14px 20px;
}
.wt-cp-home {
  background: linear-gradient(135deg, #E5F3E9, #E5F3E9);
  border-right: 1px solid #E5F3E9;
}
.wt-cp-notice {
  background: linear-gradient(135deg, #FDEEDC, #FDEEDC);
}
.wt-cp-bottom-title {
  font-weight: 800;
  font-size: 0.8125rem;
  margin-bottom: 6px;
  color: #2D2A26;
}
.wt-cp-bottom-text {
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #2D2A26;
}
.wt-cp-status-bar {
  background: #FBF8F3;
  border-top: 1px solid #EDE7DD;
  padding: 9px 20px;
  font-size: 0.75rem;
  color: #6F6A63;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

