/* course-notice.css - 课程通知详情页排版 */

.course-notice-page {
  --cn-gold: #ffb347;
  --cn-orange: #ff8900;
  --cn-dark: #0a1628;
  --cn-muted: #64748b;
  max-width: 920px;
  margin: 0 auto 48px;
  padding: 0 4px;
}

.course-notice-hero {
  text-align: center;
  padding: 36px 24px 28px;
  margin-bottom: 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0a1628 0%, #1a2744 55%, #2a1810 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.course-notice-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,137,0,.18), transparent 70%);
  pointer-events: none;
}

.course-notice-badge {
  position: relative;
  display: inline-block;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--cn-gold);
  margin-bottom: 12px;
  font-weight: 600;
}

.course-notice-brand-link {
  color: var(--cn-gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,179,71,.45);
  transition: color .2s, border-color .2s;
}

.course-notice-brand-link:hover {
  color: #fff;
  border-bottom-color: #fff;
}

.course-notice-main-title {
  position: relative;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 900;
  line-height: 1.35;
  margin: 0 0 8px;
  color: #fff !important;
}

/* 覆盖文章详情页 .news-content h2 深色样式 */
.article-page-wrap .news-content .course-notice-page .course-notice-main-title {
  color: #fff !important;
}

.course-notice-month {
  position: relative;
  font-size: 14px;
  color: rgba(255,255,255,.72);
  margin: 0;
}

.course-schedule-block {
  margin-bottom: 32px;
}

.course-schedule-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cn-dark);
  margin: 0 0 14px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(255,137,0,.12), rgba(255,137,0,.04));
  border-left: 4px solid var(--cn-orange);
  border-radius: 0 8px 8px 0;
}

.course-schedule-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(10,35,66,.1);
  box-shadow: 0 4px 20px rgba(10,35,66,.06);
}

.course-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
}

.course-schedule-table thead {
  background: linear-gradient(135deg, #0a1628, #1e3a5f);
  color: #fff;
}

.course-schedule-table th {
  padding: 12px 14px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
  white-space: nowrap;
}

.course-schedule-table td {
  padding: 11px 14px;
  text-align: center;
  border-bottom: 1px solid rgba(10,35,66,.07);
  color: #334155;
}

.course-schedule-table tbody tr:last-child td {
  border-bottom: none;
}

.course-schedule-table tbody tr:nth-child(even) {
  background: rgba(255,137,0,.04);
}

.course-schedule-table tbody tr:hover {
  background: rgba(255,137,0,.08);
}

.course-schedule-table td.course-date-cell {
  font-weight: 600;
  color: var(--cn-orange);
  white-space: nowrap;
  vertical-align: middle;
  background: rgba(255,137,0,.06);
  border-right: 1px solid rgba(255,137,0,.12);
}

.course-schedule-table td.course-session-cell {
  color: #1c1c1c;
  font-weight: 600;
}

.course-instructor-link {
  color: #0a1628;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,137,0,.35);
  transition: color .2s;
  white-space: nowrap;
}
.course-instructor-inline {
  display: inline-block;
  white-space: nowrap;
  max-width: 100%;
}

.course-instructor-link:hover {
  color: var(--cn-orange);
}

.course-notice-footer {
  text-align: center;
  margin-top: 36px;
  padding: 16px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cn-orange), var(--cn-gold));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(255,137,0,.28);
}

.course-notice-footer i {
  margin-right: 6px;
}

/* 导出图片按钮 */
.course-notice-export {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}
.course-notice-export-btn {
  appearance: none;
  border: 1px solid rgba(10, 22, 40, 0.12);
  background: linear-gradient(180deg, #fff 0%, #f7fafc 100%);
  color: #0a1628;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(10, 35, 66, 0.06);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.course-notice-export-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 137, 0, 0.45);
  box-shadow: 0 6px 18px rgba(255, 137, 0, 0.14);
}
.course-notice-export-btn--all {
  background: linear-gradient(135deg, #0a1628, #1e3a5f);
  color: #fff;
  border-color: transparent;
}
.course-notice-export-btn--all:hover {
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(10, 22, 40, 0.28);
}
.course-notice-export-btn.is-busy,
.course-notice-export-btn:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}
.course-notice-export-btn i {
  color: var(--cn-orange);
}
.course-notice-export-btn--all i {
  color: var(--cn-gold);
}

/* 离屏导出画布宿主 — 竖版 576×1024（约 9:16） */
.cn-export-host {
  position: fixed;
  left: 0;
  top: 0;
  width: 576px;
  transform: translateX(-120%);
  pointer-events: none;
  opacity: 1;
  z-index: -1;
  /* iOS：避免完全移出视口导致 html2canvas 空白 */
  -webkit-transform: translateX(-120%);
}
.cn-export-poster {
  width: 576px;
  min-height: 1024px;
  box-sizing: border-box;
  padding: 36px 28px 28px;
  background-color: #c45a12;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #4a2a12;
}
.cn-export-poster--beginner,
.cn-export-poster--all {
  width: 576px;
}
.cn-export-sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: calc(1024px - 64px);
}
.cn-export-head {
  text-align: center;
  padding: 4px 8px 8px;
  margin-bottom: 0;
  border-bottom: none;
}
.cn-export-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.cn-export-logo {
  display: block;
  width: 280px;
  height: auto;
  max-width: 78%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(40, 10, 0, 0.35));
}
.cn-export-lotus,
.cn-export-brand-text,
.cn-export-brand-name,
.cn-export-brand-sub {
  display: none !important;
}
.cn-export-title {
  font-family: 'Noto Serif SC', 'Songti SC', serif;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.35;
  color: #fff8e4;
  text-shadow: 0 3px 10px rgba(60, 15, 0, 0.5);
  margin: 0 0 12px;
}
.cn-export-ribbon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: max-content;
  height: 30px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #6b3a12 0%, #3d2008 100%);
  color: #f6d889;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  border: 1px solid rgba(246, 216, 137, 0.55);
  box-shadow: 0 4px 14px rgba(40, 10, 0, 0.35);
}
.cn-export-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}
.cn-export-card {
  background: linear-gradient(180deg, #fffaf0 0%, #f7ecd7 100%);
  border-radius: 14px;
  padding: 12px 10px 12px;
  border: 3px solid #d4a84b;
  box-shadow:
    0 0 0 2px rgba(255, 236, 180, 0.55) inset,
    0 10px 28px rgba(40, 10, 0, 0.28);
}
.cn-export-card-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 92%;
  min-height: 38px;
  box-sizing: border-box;
  margin: -2px auto 12px;
  padding: 0 28px;
  text-align: center;
  font-family: 'Noto Serif SC', serif;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  color: #fff8e4;
  background: linear-gradient(180deg, #b45309 0%, #7c2d12 100%);
  border-radius: 8px;
  border: 1px solid rgba(255, 220, 150, 0.55);
  box-shadow: 0 4px 12px rgba(80, 20, 0, 0.25);
}
.cn-export-table-wrap {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(180, 120, 40, 0.28);
  box-shadow: none;
  background: #fffdf8;
}
.cn-export-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  background: #fffdf8;
  display: table !important;
}
.cn-export-table thead {
  display: table-header-group !important;
  background: #7a3410 !important;
  color: #ffffff !important;
}
.cn-export-table thead th {
  background: #7a3410 !important;
  color: #ffffff !important;
}
.cn-export-table thead th .cn-cell-txt {
  color: #ffffff !important;
}
.cn-export-table tbody {
  display: table-row-group !important;
}
.cn-export-table tr {
  display: table-row !important;
  height: 36px;
}
.cn-export-table th,
.cn-export-table td {
  display: table-cell !important;
  height: 36px;
  padding: 0 6px !important;
  text-align: center;
  vertical-align: middle !important;
  white-space: nowrap;
  writing-mode: horizontal-tb !important;
  font-weight: 600;
  line-height: 1 !important;
  border-right: 1px solid rgba(180, 120, 40, 0.12);
  border-bottom: 1px solid rgba(180, 120, 40, 0.16);
}
.cn-export-table th {
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: #ffffff !important;
  border-right-color: rgba(255, 236, 180, 0.18);
}
.cn-export-table th:last-child,
.cn-export-table td:last-child {
  border-right: none;
}
.cn-export-table tbody tr:nth-child(even) td {
  background: #f6ebd5;
}
.cn-export-table tbody tr:nth-child(odd) td {
  background: #fffdf8;
}
.cn-export-table tbody .cn-col-date {
  width: 18%;
  color: #9a3412;
  font-weight: 800;
  background: #f3e2c4 !important;
}
.cn-export-table .cn-col-session {
  width: 16%;
  color: #3f2a14;
}
.cn-export-table .cn-col-teacher {
  width: 34%;
  color: #4a2a12;
  white-space: nowrap;
  word-break: keep-all;
}
.cn-export-table .cn-col-city {
  width: 32%;
  color: #4a2a12;
  white-space: normal;
}
.cn-cell-txt,
.cn-pill-txt {
  display: inline-block;
  line-height: 1;
  /* html2canvas + 中文：光学上移，避免胶囊/表头视觉偏下 */
  transform: translateY(-5px);
}
.cn-export-empty {
  text-align: center;
  color: #fff8e4;
  padding: 40px 12px;
  font-weight: 700;
}
.cn-export-foot-wrap {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
}
.cn-export-foot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  box-sizing: border-box;
  padding: 0 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3b220f, #1f1208);
  color: #f6d889;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(246, 216, 137, 0.35);
  box-shadow: 0 6px 18px rgba(20, 5, 0, 0.35);
}
.cn-export-foot-ico {
  display: inline-flex;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(246, 216, 137, 0.22);
  line-height: 0;
  overflow: hidden;
}
.cn-export-foot-ico svg {
  display: block;
  width: 11px;
  height: 11px;
  margin: 0;
  flex-shrink: 0;
}
.cn-export-site {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff6d6;
  text-shadow: 0 2px 6px rgba(40, 10, 0, 0.45);
}

/* 嵌入文章详情页时 */
.news-detail-body .course-notice-page {
  margin-top: 8px;
}

@media (max-width: 640px) {
  /* 四列表格一屏完整显示，不横向拖动 */
  .article-page-wrap .news-content .course-notice-page {
    padding: 0;
    max-width: 100%;
  }
  .course-notice-page {
    overflow-x: hidden;
    padding: 0;
  }
  .course-schedule-table-wrap {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
  }
  .course-schedule-table {
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
    font-size: 11px;
    table-layout: fixed;
  }
  .course-schedule-table thead {
    display: table-header-group;
  }
  .course-schedule-table tbody {
    display: table-row-group;
  }
  .course-schedule-table tr {
    display: table-row;
    padding: 0;
    border-bottom: none;
  }
  .course-schedule-table th,
  .course-schedule-table td {
    display: table-cell;
    text-align: center;
    padding: 7px 2px;
    border-bottom: 1px solid rgba(10, 35, 66, 0.07);
    white-space: nowrap;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: clip;
    box-sizing: border-box;
  }
  .course-schedule-table th:nth-child(1),
  .course-schedule-table td.course-date-cell,
  .course-schedule-table td:nth-child(1) {
    width: 18%;
  }
  .course-schedule-table th:nth-child(2),
  .course-schedule-table td.course-session-cell,
  .course-schedule-table td:nth-child(2) {
    width: 14%;
  }
  .course-schedule-table th:nth-child(3),
  .course-schedule-table td.course-instructor-cell,
  .course-schedule-table td:nth-child(3) {
    width: 40%;
  }
  .course-schedule-table th:nth-child(4),
  .course-schedule-table td:nth-child(4) {
    width: 28%;
  }
  .course-schedule-table td.course-date-cell {
    display: table-cell;
    white-space: nowrap;
  }
  .course-schedule-table td.course-instructor-cell {
    white-space: nowrap !important;
  }
  .course-schedule-table tr[data-date]::before,
  .course-schedule-table td::before {
    content: none !important;
    display: none !important;
  }
  .course-schedule-table .course-instructor-inline,
  .course-schedule-table .course-instructor-link {
    display: inline;
    white-space: nowrap !important;
    font-size: 11px;
    letter-spacing: 0;
  }
  .course-schedule-name {
    font-size: 15px;
    padding-left: 10px;
  }
  .course-notice-export {
    flex-direction: column;
  }
  .course-notice-export-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    font-size: 14px;
  }
  .course-notice-footer {
    border-radius: 14px;
    font-size: 13px;
  }
}

/* 手机端导出预览层：长按保存 / 系统分享 */
.cn-export-preview {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(10, 16, 28, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.cn-export-preview-tip {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}
.cn-export-preview-img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  background: #fff;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
  pointer-events: auto;
}
.cn-export-preview-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.cn-export-preview-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #ff8900, #f5b942);
  color: #fff;
}
.cn-export-preview-btn--ghost {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
