* {
  -webkit-tap-highlight-color: transparent;
}

.schedule-title-badge {
  display: inline-block;
  color: #006699;
  padding: 0 0 5px 0;
  border-bottom: 2px solid #006699;
  font-weight: bold;
  font-size: inherit;
  font-family: inherit;
  letter-spacing: 1px;
  transform: translateY(-3px);
}

.watermark-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='450' height='300'><text x='50%' y='50%' transform='rotate(-30 225 150)' fill='rgba(0,0,0,0.06)' font-size='28' font-weight='bold' font-family='Microsoft JhengHei, sans-serif' text-anchor='middle' dominant-baseline='middle'>模擬系統，非實際選課頁面</text></svg>");
  background-repeat: repeat;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.modal-content {
  background-color: white;
  padding: 20px 30px;
  border-radius: 4px;
  width: 85%;
  max-width: 450px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #999;
  font-family: "Microsoft JhengHei", Arial, sans-serif;
  animation: modalFadeIn 0.2s ease-in-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-title {
  text-align: left;
  font-weight: bold;
  font-size: 20px;
  margin-top: 0;
  margin-bottom: 15px;
  color: #333;
  border-bottom: 2px solid #5d7b9d;
  padding-bottom: 10px;
}

.modal-title.danger {
  border-bottom: 2px solid #d9534f;
  color: #d9534f;
}

.modal-text {
  text-align: left;
  line-height: 1.6;
  font-size: 15px;
  color: #444;
  margin-bottom: 24px;
}

.modal-text ol {
  margin: 0;
  padding-left: 22px;
}

.modal-text li {
  margin-bottom: 10px;
}

#customAlertText {
  max-height: 50vh;
  overflow-y: auto;
  padding: 5px 10px 5px 0;
  background-color: transparent;
  border: none;
}

#customAlertText::-webkit-scrollbar {
  width: 5px;
}

#customAlertText::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

#customAlertText::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

#customAlertText::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.modal-btn {
  padding: 8px 20px;
  border-radius: 4px;
  border: 1px solid #888;
  background-color: #f8f8f8;
  color: #333;
  font-size: 15px;
  cursor: pointer;
  font-family: "Microsoft JhengHei", Arial, sans-serif;
  transition: 0.2s;
  -webkit-appearance: none;
}

.modal-btn:hover {
  background-color: #e8e8e8;
}

.modal-btn.primary-btn {
  background-color: #006699;
  color: white;
  border-color: #006699;
}

.modal-btn.primary-btn:hover {
  background-color: #005580;
}

.modal-btn.danger-btn {
  background-color: #d9534f;
  color: white;
  border-color: #d9534f;
}

.modal-btn.danger-btn:hover {
  background-color: #c9302c;
}

.modal-btn:disabled {
  background-color: #eee;
  color: #aaa;
  cursor: not-allowed;
  border-color: #ccc;
}

.tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: none;
}

.tour-highlight {
  position: relative;
  z-index: 10001 !important;
  background-color: white !important;
  border-radius: 6px;
  box-shadow: 0 0 0 6px white, 0 4px 15px rgba(0, 0, 0, 0.4) !important;
  pointer-events: none;
  color: #333 !important;
}

th.tour-highlight {
  color: #006699 !important;
}

body.tour-active #tour-step-3,
body.tour-active #tour-step-4 {
  overflow: visible !important;
  overflow-x: visible !important;
}

.tour-tooltip {
  position: absolute;
  z-index: 10002;
  background: white;
  border-radius: 8px;
  padding: 24px;
  width: 340px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-family: "Microsoft JhengHei", Arial, sans-serif;
  display: none;
  transition: top 0.3s ease, left 0.3s ease;
}

.tour-tooltip::-webkit-scrollbar {
  width: 6px;
}

.tour-tooltip::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.tour-tooltip::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.tour-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tour-progress-pill {
  background-color: #eef5f9;
  color: #006699;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
}

.tour-close-btn {
  font-size: 24px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.tour-close-btn:hover {
  color: #333;
}

.tour-text {
  margin-bottom: 24px;
  margin-top: 4px;
  padding-right: 25px;
  font-size: 16px;
  font-weight: bold;
  line-height: 1.6;
  color: #333;
  text-align: left;
}

@media screen and (min-width: 768px) {
  .tour-text {
    font-size: 16px;
  }
}

.tour-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.tour-btn {
  flex: 1;
  padding: 10px 0;
  border: 1px solid #0084b4;
  background: white;
  color: #0084b4;
  border-radius: 4px;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
  transition: 0.2s;
  -webkit-appearance: none;
}

.tour-btn-primary {
  background: #0084b4;
  color: white;
}

.tour-btn:hover {
  opacity: 0.8;
}

.tour-btn:disabled {
  border-color: #ccc;
  color: #ccc;
  cursor: not-allowed;
  opacity: 1;
  background: white;
}

.floating-widgets {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10005;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  font-family: "Microsoft JhengHei", Arial, sans-serif;
}

.tour-bot-icon {
  width: 60px;
  height: 60px;
  background-color: rgba(243, 156, 18, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
  color: white;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  line-height: 1.2;
}

.tour-bot-icon:hover {
  transform: scale(1.08);
  background-color: rgba(243, 156, 18, 1);
}

.line-bot-icon {
  width: 60px;
  height: 60px;
  background-color: rgba(6, 199, 85, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.line-bot-icon:hover {
  transform: scale(1.08);
  background-color: rgba(6, 199, 85, 1);
}

.line-bot-icon::before {
  content: 'LINE';
  color: white;
  font-weight: bold;
  font-size: 16px;
}

.download-btn-icon {
  width: 60px;
  height: 60px;
  background-color: rgba(0, 102, 153, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
  color: white;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  line-height: 1.2;
}

.download-btn-icon:hover {
  transform: scale(1.08);
  background-color: rgba(0, 102, 153, 1);
}

.download-btn-icon.loading {
  background-color: #888;
  cursor: not-allowed;
  transform: none;
}

.scroll-nav-group {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.scroll-nav-group.show {
  display: flex;
  animation: popUp 0.3s ease forwards;
}

.scroll-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: #666;
  transition: all 0.2s ease;
  -webkit-appearance: none;
}

.scroll-btn:hover {
  background: rgba(255, 255, 255, 1);
  color: #006699;
  transform: scale(1.08);
}

.line-bot-card {
  position: absolute;
  bottom: 75px;
  right: 0;
  width: 260px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: none;
  flex-direction: column;
  transform-origin: bottom right;
  animation: popUp 0.3s ease forwards;
}

.line-bot-card.show {
  display: flex;
}

.line-bot-header {
  background-color: #06C755;
  color: white;
  padding: 12px 15px;
  font-weight: bold;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.line-bot-header .close-card {
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.line-bot-body {
  padding: 15px;
  font-size: 14px;
  color: #333;
}

.line-bot-body p {
  margin: 0 0 10px 0;
}

.line-bot-body ul {
  margin: 0 0 15px 0;
  padding-left: 0;
  list-style: none;
}

.line-bot-body li {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}

.line-bot-body li::before {
  content: '✅';
  margin-right: 6px;
  font-size: 12px;
}

.line-add-btn {
  display: block;
  background-color: #06C755;
  color: white !important;
  text-align: center;
  padding: 10px 0;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.2s;
}

.line-add-btn:hover {
  background-color: #05b34c;
}

.MozCenter {
  width: 80%;
  margin-right: auto;
  margin-left: auto;
  background-color: #F7F6F3;
  border-color: #E6E2D8;
  border-spacing: 4px;
  border-style: Solid;
  Border-width: 1px;
  Color: #333333;
  box-sizing: border-box;
}

ul.MozCenter {
  padding: 15px 25px;
}

ul li,
ul {
  list-style-position: inside;
  text-align: justify;
}

.style2 {
  text-align: center;
  color: #cc0000;
  font-weight: bold;
  font-size: large;
}

.center {
  width: 100%;
  text-align: center;
  align-content: center;
}

.auto-style1 {
  color: #cc0000;
}

.auto-style2 {
  padding: 10px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: x-large;
  margin: 4px 2px;
  border-radius: 12px;
  cursor: pointer;
  -webkit-transition-duration: 0.4s;
  transition-duration: 0.4s;
}

.auto-right {
  text-align: right;
}

.table1 {
  border-collapse: separate;
  border-spacing: 15px;
  margin-left: auto;
  margin-right: auto;
}

.auto-style3 {
  color: #FF0000;
}

.btn {
  padding: 5px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 2px 2px;
  border-radius: 6px;
  cursor: pointer;
  -webkit-appearance: none;
  -webkit-transition-duration: 0.4s;
  transition-duration: 0.4s;
}

.btn:hover {
  background-color: #4CAF50;
  color: white !important;
}

.button5 {
  background-color: white;
  color: black;
  border: 2px solid #555555;
  border-radius: 4px;
}

.button5:hover {
  background-color: #555555;
  color: white;
}

input {
  cursor: pointer;
}

body {
  background-image: url('https://i.imgur.com/meS5ada.gif');
  margin: 8px;
  font-family: "Microsoft JhengHei", Arial, sans-serif;
}

/* 全站及原生表單控制項，統一使用使用者提供之學校新版頁面字體。 */
button, input, select, textarea, option, optgroup {
  font-family: "Microsoft JhengHei", Arial, sans-serif;
}


.hidden {
  display: none;
}

.mobile-break {
  display: none;
}

.course-row {
  background-color: white;
  transition: background-color 0.1s;
}

@media (hover: hover) {
  .course-row:hover {
    background-color: #CCCCCC;
  }
}

#loginPage,
#coursePage,
#schedulePage {
  position: relative;
  min-height: calc(100vh - 16px);
  padding-bottom: 260px;
  box-sizing: border-box;
}

.site-footer {
  position: absolute;
  bottom: -8px;
  left: -8px;
  right: -8px;
  z-index: 9999;
  padding: 36px 20px;
  background-color: #343a40;
  text-align: center;
  font-family: "Microsoft JhengHei", Arial, sans-serif;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.site-footer .footer-main {
  font-size: 15px;
  color: #f8f9fa;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.site-footer .footer-link {
  color: #20c997;
  text-decoration: none;
  font-weight: bold;
  margin: 0 6px;
  transition: all 0.3s ease;
}

.site-footer .footer-link:hover {
  color: #38d39f;
}

.site-footer .footer-divider {
  width: 50px;
  height: 2px;
  background-color: #495057;
  border-radius: 2px;
  margin: 2px 0;
}

.site-footer .footer-note {
  font-size: 13px;
  color: #adb5bd;
  line-height: 1.6;
  max-width: 550px;
}

.footer-stats-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(32, 201, 151, 0.22);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
  white-space: nowrap;
  cursor: pointer;
  color: inherit;
  font: inherit;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.footer-stats-box:hover,
.footer-stats-box:focus,
.footer-stats-box:focus-visible,
.footer-stats-box:active {
  border-color: rgba(32, 201, 151, 0.48);
  background: rgba(255, 255, 255, 0.12);
}

.footer-stats-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

.footer-stats-label {
  font-size: 13px;
  color: #ced4da;
  font-weight: 500;
}

.footer-stats-item strong {
  font-size: 17px;
  font-weight: 900;
  color: #20c997;
  min-width: 20px;
  text-align: right;
  letter-spacing: 0.3px;
}

.footer-stats-unit {
  font-size: 12px;
  color: #adb5bd;
}

.footer-stats-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #20c997;
  box-shadow: 0 0 0 4px rgba(32, 201, 151, 0.14);
  flex: 0 0 auto;
}

.footer-stats-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%) translateY(6px);
  z-index: 10020;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(20, 24, 28, 0.96);
  color: #f8f9fa;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.footer-stats-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(20, 24, 28, 0.96) transparent transparent transparent;
}

.footer-stats-tooltip strong {
  color: #20c997;
  font-size: 14px;
  font-weight: 900;
}

.footer-stats-box:hover .footer-stats-tooltip,
.footer-stats-box:focus .footer-stats-tooltip,
.footer-stats-box:focus-visible .footer-stats-tooltip,
.footer-stats-box:active .footer-stats-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.site-stats-loading .footer-stats-dot {
  background: #adb5bd;
  box-shadow: 0 0 0 4px rgba(173, 181, 189, 0.14);
}

.site-stats-error .footer-stats-dot {
  background: #ff4b4b;
  box-shadow: 0 0 0 4px rgba(255, 75, 75, 0.14);
}

.site-stats-error [data-site-online-count],
.site-stats-error [data-site-total-count] {
  color: #ff6b6b;
}

#tour-step-1 td,
#tour-step-2 td {
  display: inline-block;
  margin: 2px 4px;
  text-align: left;
}

:root {
  --time-col-width: 70px;
}

.schedule-wrapper {
  width: 96%;
  max-width: 720px;
  margin: 20px auto 40px auto;
}

.schedule-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.schedule-capture-wrap {
  margin-top: 10px;
  width: 100%;
}

.schedule-capture {
  position: relative;
  z-index: 9999;
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin: 0 auto;
  font-family: "Microsoft JhengHei", Arial, sans-serif;
}

.schedule-grid {
  padding: 0;
}

.grid-header,
.grid-row {
  display: grid;
  align-items: stretch;
}

.grid-header {
  background: #f5f7fa;
  font-weight: bold;
  font-size: 13px;
  text-align: center;
}

.grid-header > div {
  padding: 10px 2px;
  border-right: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  text-align: center;
  line-height: 1.3;
}

.grid-header > div:last-child {
  border-right: none;
}

.grid-row {
  border-bottom: 1px solid #eceff3;
  min-height: 56px;
}

.grid-row:nth-child(even) {
  background: #fafbfc;
}

.time-cell {
  padding: 4px 2px;
  border-right: 1px solid #eceff3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
}

.time-cell .period {
  font-size: 15px;
  font-weight: bold;
  color: #444;
  line-height: 1.1;
}

.time-cell .time {
  font-size: 11px;
  color: #7a7a7a;
  line-height: 1.2;
  text-align: center;
}

.course-cell {
  border-right: 1px solid #eceff3;
  padding: 4px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.course-cell:last-child {
  border-right: none;
}

.course-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  text-align: center;
}

.course-name {
  font-size: 12px;
  font-weight: bold;
  color: #333;
  line-height: 1.25;
  word-break: break-word;
}

.course-teacher {
  font-size: 11px;
  color: #8b8b8b;
  line-height: 1.2;
  word-break: break-word;
}

.course-room {
  font-size: 11px;
  color: #007aff;
  line-height: 1.2;
  word-break: break-word;
}

#activeFiltersContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#activeFiltersContainer:not(:empty) {
  margin-bottom: 8px;
}

#activeFiltersContainer:empty {
  display: none;
}

.active-filter-pill {
  display: flex;
  align-items: center;
  background-color: #e9ecef;
  border: 1px solid #dee2e6;
  border-radius: 16px;
  padding: 2px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #495057;
  animation: fadeIn 0.2s ease-in-out;
}

.active-filter-pill:hover {
  background-color: #dee2e6;
}

.active-filter-pill .remove-pill {
  margin-left: 6px;
  cursor: pointer;
  color: #adb5bd;
  font-weight: bold;
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
}

.active-filter-pill .remove-pill:hover {
  color: #d9534f;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#searchBarContainer {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  max-width: 360px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: #999;
  width: 16px;
  height: 16px;
  pointer-events: none;
  z-index: 2;
}

#searchInput {
  padding: 8px 30px 8px 34px !important;
  box-sizing: border-box;
  width: 100%;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin: 0;
}

.search-clear-btn {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 30px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
  font-size: 18px;
  z-index: 5;
  background-color: transparent;
  border-radius: 0 3px 3px 0;
}

.search-clear-btn:hover {
  color: #d9534f;
}

.filter-btn {
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: background 0.2s;
}

.filter-btn:hover {
  background: #f0f0f0;
}

.filter-panel {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 5px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 15px;
  width: 280px;
  z-index: 100;
  display: none;
}

.filter-panel.show {
  display: block;
}

.filter-section {
  margin-bottom: 12px;
}

.filter-title {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 8px;
  color: #333;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  padding: 4px 10px;
  border: 1px solid #ccc;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  background: white;
  color: #555;
  transition: all 0.2s;
}

.filter-chip.active {
  background: #006699;
  color: white;
  border-color: #006699;
}

#filterStatusBar {
  display: none;
  background: #f0f7ff;
  border: 1px solid #cce5ff;
  padding: 6px 12px;
  margin-bottom: 10px;
  border-radius: 4px;
  font-size: 13px;
  color: #004085;
  align-items: center;
  justify-content: space-between;
}

@media screen and (max-width: 768px) {
  :root {
    --time-col-width: 48px;
  }

  .mobile-break {
    display: block;
  }

  .MozCenter {
    width: 96%;
  }

  .table1 {
    border-spacing: 5px;
  }

  .auto-style2 {
    font-size: 18px;
    width: 85% !important;
  }

  table {
    max-width: 100%;
  }

  #coursePage > table:nth-of-type(1) td:empty {
    display: none;
  }

  select {
    max-width: 100%;
  }

  #GVOpencourse,
  #GVStudSelect {
    width: 100%;
    font-size: 16px;
    table-layout: auto;
  }

  #GVOpencourse th,
  #GVOpencourse td,
  #GVStudSelect th,
  #GVStudSelect td {
    padding: 3px 1px;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
  }

  .tour-tooltip {
    width: 85vw;
    max-width: 320px;
    padding: 16px;
  }

  .tour-text {
    font-size: 15px;
  }

  .tour-btn {
    padding: 6px 0;
    font-size: 14px;
  }

  .schedule-wrapper {
    width: 100%;
    margin: 10px auto;
    padding: 0 4px;
    box-sizing: border-box;
  }

  .schedule-capture {
    border-radius: 8px;
  }

  .grid-header {
    font-size: 11px;
  }

  .grid-header > div {
    padding: 6px 1px;
  }

  .time-cell {
    padding: 2px 1px;
  }

  .time-cell .period {
    font-size: 13px;
  }

  .time-cell .time {
    font-size: 10px;
    transform: scale(0.9);
  }

  .grid-row {
    min-height: 48px;
  }

  .course-cell {
    padding: 2px 1px;
  }

  .course-name {
    font-size: 11px;
    line-height: 1.15;
  }

  .course-teacher,
  .course-room {
    font-size: 10px;
    line-height: 1.1;
    letter-spacing: -0.5px;
  }

  .floating-widgets {
    bottom: 15px;
    right: 15px;
    gap: 10px;
  }

  .tour-bot-icon,
  .line-bot-icon,
  .download-btn-icon {
    width: 48px;
    height: 48px;
    font-size: 11px;
  }

  .line-bot-icon::before {
    font-size: 12px;
  }

  .scroll-nav-group {
    gap: 10px;
  }

  .scroll-btn {
    width: 36px;
    height: 36px;
  }

  .scroll-btn svg {
    width: 16px;
    height: 16px;
  }

  .line-bot-card {
    bottom: 60px;
  }

  #loginPage,
  #coursePage,
  #schedulePage {
    padding-bottom: 310px;
  }

  .site-footer {
    padding: 28px 14px;
    gap: 13px;
  }

  .site-footer .footer-main {
    font-size: 14px;
    line-height: 1.6;
  }

  .site-footer .footer-note {
    font-size: 12px;
    line-height: 1.7;
  }

  .footer-stats-box {
    width: auto;
    max-width: 100%;
    flex-wrap: nowrap;
    gap: 7px;
    padding: 10px 15px;
    border-radius: 999px;
    box-sizing: border-box;
  }

  .footer-stats-item {
    gap: 4px;
  }

  .footer-stats-label {
    font-size: 12px;
  }

  .footer-stats-item strong {
    font-size: 16px;
  }

  .footer-stats-unit {
    font-size: 11px;
  }

  .footer-stats-tooltip {
    bottom: calc(100% + 10px);
    font-size: 12px;
    padding: 8px 11px;
  }
}

@keyframes spinner-spin {
  100% {
    transform: rotate(360deg);
  }
}


.user-class-filter-bar {
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  width: min(100%, 560px);
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #e7d7a5;
  border-left: 4px solid #d6a73b;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffdf8 0%, #fff9ee 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.user-class-filter-content {
  min-width: 0;
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-class-filter-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: #d6a73b;
  box-shadow: 0 0 0 4px rgba(214, 167, 59, 0.12);
}

.user-class-filter-text {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1.45;
  color: #5d4a1f;
  font-weight: 600;
}

.user-class-filter-prefix,
.user-class-filter-suffix,
.user-class-filter-empty {
  color: #6a5730;
}

.user-class-filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 9px;
  border-radius: 999px;
  background: #fff6da;
  border: 1px solid #efd899;
  color: #7a5a0f;
  font-weight: 700;
  max-width: 100%;
  word-break: break-word;
}

.user-class-filter-btn {
  flex: 0 0 auto;
  height: 32px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #e3c983;
  border-radius: 999px;
  background: #fffef9;
  color: #7b5a12;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}

.user-class-filter-btn:hover {
  background: #fff6dd !important;
  border-color: #d9b45e;
  color: #6a4c0d !important;
}

.user-class-filter-btn:active {
  transform: translateY(1px);
}

@media (max-width: 640px) {
  .user-class-filter-bar {
    width: 100%;
    padding: 10px 11px;
  }

  .user-class-filter-content {
    flex-basis: 100%;
  }

  .user-class-filter-btn {
    width: 100%;
    height: 34px;
  }
}


#ddl_semester.semester-old-warning {
  background-color: #fff1f2;
  border-color: #dc2626;
  color: #991b1b;
  font-weight: bold;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.16);
}

#ddl_semester.semester-old-warning:hover,
#ddl_semester.semester-old-warning:focus {
  background-color: #ffe4e6;
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22);
  outline: none;
}


/* 與搜尋欄同風格的班級群組顯示列 */
.user-class-filter-bar {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 560px;
  margin: 10px 0;
  padding: 0;
  border: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
}

.user-class-filter-main {
  min-height: 38px;
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 9px;
  box-sizing: border-box;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #555;
  line-height: 1.45;
}

.user-class-filter-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #999;
}

.user-class-filter-text {
  min-width: 0;
  display: inline;
  font-size: 14px;
  line-height: 1.45;
  color: #555;
  font-weight: 500;
  word-break: break-word;
}

.user-class-filter-empty {
  color: #777;
  font-weight: 500;
}

.user-class-filter-value {
  color: #333;
  font-weight: 700;
}

.user-class-filter-prefix,
.user-class-filter-suffix,
.user-class-filter-pill,
.user-class-filter-dot,
.user-class-filter-content {
  all: unset;
}

.user-class-filter-btn {
  min-height: 38px;
  flex: 0 0 auto;
  box-sizing: border-box;
  margin: 0;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.user-class-filter-btn:hover {
  background: #f0f0f0 !important;
  border-color: #bbb;
  color: #333 !important;
}

.user-class-filter-btn:active {
  transform: translateY(1px);
}

@media (max-width: 640px) {
  .user-class-filter-bar {
    max-width: 100%;
  }

  .user-class-filter-main {
    flex-basis: 100%;
  }

  .user-class-filter-btn {
    width: 100%;
    height: 38px;
  }
}

.course-faq-preview-btn {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 10006;
  width: 48px;
  height: 38px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #555;
  font-size: 13px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  font-family: "Microsoft JhengHei", Arial, sans-serif;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.12s;
  -webkit-appearance: none;
  appearance: none;
}

.course-faq-preview-btn:hover {
  background: #f0f0f0;
  border-color: #bbb;
  color: #333;
}

.course-faq-preview-btn:active {
  transform: translateY(1px);
}

.course-faq-modal-content {
  width: min(92vw, 680px) !important;
  max-width: 680px !important;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.course-faq-modal-content #modalBody {
  margin-bottom: 16px;
  overflow-y: auto;
  max-height: calc(86vh - 150px);
  padding-right: 4px;
}

.course-faq-modal-title {
  border-bottom-color: #006699;
  color: #333;
}

.course-faq-modal-body {
  font-family: "Microsoft JhengHei", Arial, sans-serif;
}

.course-faq-note {
  margin: 0 0 12px 0;
  padding: 9px 11px;
  border: 1px solid #dbe7ef;
  border-radius: 4px;
  background: #f6fbff;
  color: #50616f;
  font-size: 13px;
  line-height: 1.5;
}

.course-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.course-faq-item {
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.course-faq-question {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  background: #fff;
  color: #333;
  text-align: left;
  font-size: 14px;
  font-weight: bold;
  line-height: 1.45;
  cursor: pointer;
  font-family: "Microsoft JhengHei", Arial, sans-serif;
}

.course-faq-question:hover {
  background: #f7f7f7;
}

.course-faq-question-text {
  min-width: 0;
  word-break: break-word;
}

.course-faq-arrow {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid #777;
  border-bottom: 2px solid #777;
  transform: rotate(45deg);
  transition: transform 0.2s;
  margin-right: 2px;
}

.course-faq-question[aria-expanded="true"] .course-faq-arrow {
  transform: rotate(225deg);
}

.course-faq-answer {
  padding: 0 12px 12px 12px;
  color: #555;
  font-size: 14px;
  line-height: 1.65;
  text-align: left;
  background: #fff;
}

@media (max-width: 640px) {
  .course-faq-preview-btn {
    left: 14px;
    bottom: 14px;
    width: 46px;
    height: 36px;
    font-size: 12px;
  }

  .course-faq-modal-content {
    width: 94vw !important;
    max-height: 88vh;
    padding: 18px 16px !important;
  }

  .course-faq-modal-content #modalBody {
    max-height: calc(88vh - 145px);
  }

  .course-faq-question {
    min-height: 44px;
    padding: 11px 10px;
    font-size: 14px;
  }

  .course-faq-answer {
    padding: 0 10px 11px 10px;
    font-size: 13.5px;
  }
}

.floating-widgets {
  right: 18px;
  bottom: 22px;
  gap: 10px;
  align-items: flex-end;
}

.tour-bot-icon,
.line-bot-icon,
.download-btn-icon {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.13);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
  font-size: 0;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}

.tour-bot-icon:hover,
.line-bot-icon:hover,
.download-btn-icon:hover,
.tour-bot-icon:focus-visible,
.line-bot-icon:focus-visible,
.download-btn-icon:focus-visible {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
  filter: saturate(1.05);
  outline: none;
}

.tour-bot-icon {
  background: linear-gradient(180deg, #fff4eb 0%, #ffe9d6 100%);
  color: #c86a16;
}

.line-bot-icon {
  background: linear-gradient(180deg, #effcf4 0%, #dcf7e6 100%);
  color: #16a34a;
}

.download-btn-icon {
  background: linear-gradient(180deg, #edf5ff 0%, #dcecff 100%);
  color: #2563eb;
}

.tour-bot-icon svg,
.line-bot-icon svg,
.download-btn-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  flex: 0 0 auto;
}

.line-bot-icon::before {
  content: none !important;
}

.tour-bot-icon::after,
.line-bot-icon::after,
.download-btn-icon::after {
  content: attr(data-label);
  position: absolute;
  right: 62px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  opacity: 0;
  visibility: hidden;
  white-space: nowrap;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.tour-bot-icon:hover::after,
.line-bot-icon:hover::after,
.download-btn-icon:hover::after,
.tour-bot-icon:focus-visible::after,
.line-bot-icon:focus-visible::after,
.download-btn-icon:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.download-btn-icon.loading {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: #64748b;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.download-btn-icon.loading svg {
  opacity: 0.45;
}

.download-btn-icon.loading::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(100, 116, 139, 0.22);
  border-top-color: #64748b;
  animation: floatingBtnSpin 0.8s linear infinite;
}

@keyframes floatingBtnSpin {
  to { transform: rotate(360deg); }
}

.line-bot-card {
  bottom: 74px;
  right: 0;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.14);
}

.line-bot-header {
  background: #f0fdf4;
  color: #15803d;
  border-bottom: 1px solid #dcfce7;
}

.line-add-btn {
  background-color: #16a34a;
  border-radius: 10px;
}

.line-add-btn:hover {
  background-color: #15803d;
}

@media (max-width: 768px) {
  .floating-widgets {
    right: 12px;
    bottom: 16px;
    gap: 9px;
    align-items: flex-end;
  }

  .tour-bot-icon,
  .line-bot-icon,
  .download-btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 0;
  }

  .tour-bot-icon svg,
  .line-bot-icon svg,
  .download-btn-icon svg {
    width: 22px;
    height: 22px;
  }

  .tour-bot-icon::after,
  .line-bot-icon::after,
  .download-btn-icon::after {
    display: none;
  }

  .line-bot-card {
    right: 0;
    bottom: 66px;
    width: min(260px, calc(100vw - 88px));
  }
}

.course-outline-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.course-outline-link:hover {
  color: #1d4ed8;
  text-decoration: none;
}

.course-outline-link:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 3px;
  border-radius: 4px;
}

.course-outline-modal {
  text-align: left;
  color: #1f2937;
  line-height: 1.7;
}

.course-outline-term {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.course-outline-title {
  font-size: 20px;
  font-weight: 900;
  color: #111827;
  margin-bottom: 8px;
  line-height: 1.45;
}

.course-outline-match {
  margin-bottom: 6px;
  color: #64748b;
  font-size: 13px;
}

.course-outline-tried {
  margin-bottom: 14px;
  color: #94a3b8;
  font-size: 12px;
}

.course-outline-section {
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.course-outline-section-title {
  margin-bottom: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.course-outline-section-content {
  color: #1f2937;
  font-size: 14px;
  word-break: break-word;
}

.course-outline-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  color: #868e96;
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 760px) {
  .course-outline-title {
    font-size: 18px;
  }

  .course-outline-section {
    padding: 12px;
  }

  .course-outline-section-content {
    font-size: 13px;
  }
}

#dynamicModal .modal-content:has(.course-outline-modal) {
  width: min(92vw, 780px);
  max-width: 780px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  padding: 22px 26px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
}

#dynamicModal .modal-content:has(.course-outline-modal) .modal-title {
  color: #1d4ed8;
  border-bottom: 2px solid #dbeafe;
  margin-bottom: 14px;
}

#dynamicModal .modal-content:has(.course-outline-modal) #modalBody {
  max-height: min(68vh, 620px);
  overflow-y: auto;
  padding-right: 8px;
  margin-bottom: 18px;
}

#dynamicModal .modal-content:has(.course-outline-modal) #modalBody::-webkit-scrollbar {
  width: 8px;
}

#dynamicModal .modal-content:has(.course-outline-modal) #modalBody::-webkit-scrollbar-track {
  background: #eff6ff;
  border-radius: 999px;
}

#dynamicModal .modal-content:has(.course-outline-modal) #modalBody::-webkit-scrollbar-thumb {
  background: #bfdbfe;
  border-radius: 999px;
}

#dynamicModal .modal-content:has(.course-outline-modal) #modalFooter {
  flex: 0 0 auto;
  margin-top: 0 !important;
}

.course-outline-modal {
  text-align: left;
  color: #1f2937;
  line-height: 1.7;
}

.course-outline-term {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 9px;
}

.course-outline-title {
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 14px;
  line-height: 1.45;
}

.course-outline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.course-outline-section {
  margin-top: 0;
  padding: 14px 15px;
  border-radius: 14px;
  background: #f8fbff;
  border: 1px solid #dbeafe;
}

.course-outline-section-title {
  margin-bottom: 7px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.course-outline-section-content {
  color: #1f2937;
  font-size: 14px;
  word-break: break-word;
}

.course-outline-note {
  margin-top: 14px;
  padding: 12px 13px;
  border-top: 0;
  border-radius: 12px;
  background: #eff6ff;
  color: #64748b;
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 760px) {
  #dynamicModal .modal-content:has(.course-outline-modal) {
    width: calc(100vw - 24px);
    max-width: none;
    max-height: 88vh;
    padding: 18px 16px;
    border-radius: 16px;
  }

  #dynamicModal .modal-content:has(.course-outline-modal) #modalBody {
    max-height: 66vh;
    padding-right: 6px;
  }

  .course-outline-title {
    font-size: 19px;
  }

  .course-outline-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .course-outline-section {
    padding: 12px;
  }

  .course-outline-section-content {
    font-size: 13px;
  }
}

#dynamicModal .modal-content:has(.course-outline-modal) {
  width: min(92vw, 860px) !important;
  max-width: 860px !important;
  max-height: min(86vh, 760px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 20px 30px !important;
  border-radius: 4px !important;
  border: 1px solid #999 !important;
  background: #fff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

#dynamicModal .modal-content:has(.course-outline-modal) .modal-title {
  flex: 0 0 auto !important;
  color: #333 !important;
  border-bottom: 2px solid #5d7b9d !important;
  margin: 0 0 15px 0 !important;
  padding-bottom: 10px !important;
  font-size: 20px !important;
  font-weight: bold !important;
}

#dynamicModal .modal-content:has(.course-outline-modal) #modalBody {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 0 15px 0 !important;
  color: #444 !important;
}

#dynamicModal .modal-content:has(.course-outline-modal) #modalFooter {
  flex: 0 0 auto !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.course-outline-modal {
  height: 100%;
  max-height: calc(86vh - 118px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
  color: #444;
  line-height: 1.6;
  background: #fff;
}

.course-outline-fixed-header {
  flex: 0 0 auto;
  padding: 0 0 12px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid #d8dee6;
  background: #fff;
}

.course-outline-title {
  margin: 0 0 7px 0 !important;
  color: #222 !important;
  font-size: 19px !important;
  font-weight: bold !important;
  line-height: 1.45 !important;
}

.course-outline-term {
  display: block !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #666 !important;
  font-size: 13px !important;
  font-weight: normal !important;
}

.course-outline-scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 8px 2px 0;
}

.course-outline-scroll-area::-webkit-scrollbar {
  width: 5px;
}

.course-outline-scroll-area::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.course-outline-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
}

.course-outline-scroll-area::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.32);
}

.course-outline-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.course-outline-section {
  margin: 0 !important;
  padding: 13px 14px !important;
  border-radius: 4px !important;
  background: #fafafa !important;
  border: 1px solid #d8dee6 !important;
}

.course-outline-section-title {
  margin: 0 0 7px 0 !important;
  color: #006699 !important;
  font-size: 14px !important;
  font-weight: bold !important;
  line-height: 1.4 !important;
}

.course-outline-section-content {
  color: #444 !important;
  font-size: 14px !important;
  line-height: 1.75 !important;
  word-break: break-word !important;
}

.course-outline-fixed-note {
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 10px 0 0 0;
  border-top: 1px solid #d8dee6;
  background: #fff;
  color: #777;
  font-size: 12px;
  line-height: 1.65;
}

@media (max-width: 760px) {
  #dynamicModal .modal-content:has(.course-outline-modal) {
    width: calc(100vw - 24px) !important;
    max-width: none !important;
    max-height: 88vh !important;
    padding: 18px 16px !important;
    border-radius: 4px !important;
  }

  #dynamicModal .modal-content:has(.course-outline-modal) .modal-title {
    font-size: 18px !important;
    margin-bottom: 12px !important;
  }

  .course-outline-modal {
    max-height: calc(88vh - 105px);
  }

  .course-outline-title {
    font-size: 17px !important;
  }

  .course-outline-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .course-outline-section {
    padding: 12px !important;
  }

  .course-outline-section-content {
    font-size: 13px !important;
  }
}

#dynamicModal .modal-content:has(.course-outline-modal) {
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#dynamicModal .modal-content:has(.course-outline-modal) #modalBody {
  min-height: 0 !important;
  overflow: hidden !important;
  margin-bottom: 12px !important;
}

.course-outline-modal {
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.course-outline-fixed-header {
  padding-bottom: 10px !important;
  margin-bottom: 10px !important;
}

.course-outline-title {
  margin-bottom: 0 !important;
}

.course-outline-scroll-area {
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.course-outline-fixed-note {
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
  margin-top: 12px !important;
  padding: 10px 0 3px 0 !important;
  min-height: auto !important;
  overflow: visible !important;
  white-space: normal !important;
  word-break: break-word !important;
  line-height: 1.65 !important;
}

#dynamicModal .modal-content:has(.course-outline-modal) #modalFooter {
  flex: 0 0 auto !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

@media (min-width: 761px) {
  #dynamicModal .modal-content:has(.course-outline-modal) {
    max-height: calc(100vh - 56px) !important;
  }
}

.floating-widgets {
  align-items: center !important;
}

.scroll-nav-group,
.scroll-nav-group.show {
  width: 52px !important;
  align-items: center !important;
}

.scroll-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
}

@media (max-width: 768px) {
  .scroll-nav-group,
  .scroll-nav-group.show {
    width: 48px !important;
    align-items: center !important;
  }

  .scroll-btn {
    width: 42px !important;
    height: 42px !important;
  }
}

#dynamicModal .modal-content:has(.course-outline-modal) {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#dynamicModal .modal-content:has(.course-outline-modal) #modalBody {
  display: flex !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

#dynamicModal .modal-content:has(.course-outline-modal) #modalFooter {
  flex: 0 0 auto !important;
}

.course-outline-modal {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: hidden !important;
}

.course-outline-fixed-header,
.course-outline-fixed-note {
  flex: 0 0 auto !important;
}

.course-outline-scroll-area {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  touch-action: pan-y !important;
}

@media (max-width: 760px) {
  #dynamicModal.modal-overlay {
    align-items: center !important;
    padding: 12px !important;
    box-sizing: border-box !important;
  }

  #dynamicModal .modal-content:has(.course-outline-modal) {
    width: 100% !important;
    max-width: none !important;
    height: calc(100dvh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    padding: 16px 14px !important;
    box-sizing: border-box !important;
  }

  #dynamicModal .modal-content:has(.course-outline-modal) .modal-title {
    flex: 0 0 auto !important;
    margin-bottom: 10px !important;
  }

  #dynamicModal .modal-content:has(.course-outline-modal) #modalBody {
    margin-bottom: 10px !important;
  }

  .course-outline-fixed-header {
    padding-bottom: 10px !important;
    margin-bottom: 10px !important;
  }

  .course-outline-scroll-area {
    padding-right: 6px !important;
  }

  .course-outline-fixed-note {
    margin-top: 10px !important;
    padding-top: 9px !important;
    line-height: 1.6 !important;
  }
}

@media (max-width: 760px) {
  #dynamicModal .modal-content:has(.course-outline-modal) .modal-title {
    font-size: 20px !important;
  }

  .course-outline-title {
    font-size: 20px !important;
    line-height: 1.45 !important;
  }
}

/* Course insight shared modal: outline + fail-rate statistics */
.course-insight-modal {
  color: #333 !important;
}

.course-insight-fixed-header {
  padding-bottom: 8px !important;
  margin-bottom: 10px !important;
}

.course-insight-subtitle {
  color: #666;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.course-insight-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #d8dee6;
  padding-bottom: 8px;
}

.course-insight-tab {
  appearance: none;
  border: 1px solid #b8c2cc;
  background: #fff;
  color: #333;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.course-insight-tab:hover {
  background: #f2f6fa;
  border-color: #5d7b9d;
}

.course-insight-tab.active {
  background: #006699;
  border-color: #006699;
  color: #fff;
}

.course-insight-panel {
  display: none;
}

.course-insight-panel.active {
  display: block;
}

.course-insight-empty,
.course-insight-loading,
.course-outline-placeholder {
  padding: 16px 14px;
  border: 1px solid #d8dee6;
  background: #fafafa;
  border-radius: 4px;
  color: #555;
  font-size: 14px;
  line-height: 1.8;
}

.course-insight-empty span {
  display: block;
  color: #777;
  font-size: 13px;
  margin-top: 5px;
}

.course-insight-empty.danger {
  border-color: #f5c2c7;
  background: #fff5f5;
  color: #b42318;
  font-weight: 700;
}

.fail-stats-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fail-semester-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.fail-semester-tab {
  appearance: none;
  border: 1px solid #b8c2cc;
  background: #fff;
  color: #333;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.fail-semester-tab:hover {
  background: #f2f6fa;
  border-color: #006699;
}

.fail-semester-tab.active {
  background: #5d7b9d;
  border-color: #5d7b9d;
  color: #fff;
}

.fail-semester-panel {
  display: none;
}

.fail-semester-panel.active {
  display: block;
}

.fail-stat-overview {
  display: grid;
  grid-template-columns: minmax(190px, 260px) 1fr;
  gap: 12px;
  align-items: stretch;
}

.fail-stat-chart-card,
.fail-stat-summary-card,
.fail-match-card,
.fail-trend-box {
  border: 1px solid #d8dee6;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.fail-stat-chart-card {
  padding: 13px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.fail-stat-pie {
  --fail-rate: 0;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background:
    conic-gradient(#c0392b calc(var(--fail-rate) * 1%), #d9e6f2 0);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.fail-stat-pie-inner {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.fail-stat-pie-inner strong {
  color: #b42318;
  font-size: 20px;
  line-height: 1.1;
}

.fail-stat-pie-inner span {
  color: #666;
  font-size: 11px;
  font-weight: 700;
  margin-top: 3px;
}

.fail-stat-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #555;
  font-size: 12.5px;
}

.fail-stat-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
}

.fail-stat-dot.fail {
  background: #c0392b;
}

.fail-stat-dot.pass {
  background: #d9e6f2;
  border: 1px solid #b8c2cc;
}

.fail-stat-summary-card {
  padding: 13px 14px;
}

.fail-stat-semester-title {
  color: #006699;
  font-size: 16px;
  font-weight: 900;
  padding-bottom: 8px;
  border-bottom: 1px solid #d8dee6;
  margin-bottom: 10px;
}

.fail-multiple-notice {
  margin: 0 0 10px 0;
  padding: 8px 10px;
  border: 1px solid #f0c36d;
  background: #fff8e5;
  color: #8a5a00;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
}

.fail-stat-number-grid,
.fail-match-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.fail-stat-number-grid div,
.fail-match-grid div {
  padding: 10px 8px;
  background: #f7f9fb;
  border: 1px solid #e3e8ee;
  border-radius: 4px;
  text-align: center;
}

.fail-stat-number-grid b,
.fail-match-grid b {
  display: block;
  color: #222;
  font-size: 18px;
  line-height: 1.2;
}

.fail-stat-number-grid span,
.fail-match-grid span {
  display: block;
  color: #666;
  font-size: 12px;
  margin-top: 4px;
}

.fail-match-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.fail-match-card {
  padding: 12px 13px;
}

.fail-match-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding-bottom: 8px;
  border-bottom: 1px solid #e3e8ee;
}

.fail-match-code {
  color: #006699;
  font-size: 12px;
  font-weight: 900;
}

.fail-match-name {
  color: #222;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
}

.fail-match-rate {
  color: #b42318;
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

.fail-match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: #666;
  font-size: 12.5px;
  margin: 8px 0 10px 0;
}

.fail-trend-box {
  padding: 12px 12px 10px 12px;
}

.fail-trend-title {
  color: #006699;
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 8px;
}

.fail-trend-bars {
  display: flex;
  align-items: end;
  gap: 8px;
  min-height: 112px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.fail-trend-bar-wrap {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: #555;
  cursor: pointer;
}

.fail-trend-value {
  font-size: 11px;
  font-weight: 800;
  color: #b42318;
}

.fail-trend-bar {
  width: 22px;
  min-height: 8px;
  border-radius: 4px 4px 0 0;
  background: #5d7b9d;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.fail-trend-semester {
  font-size: 11px;
  font-weight: 700;
  color: #666;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .course-insight-tabs,
  .fail-semester-tabs {
    gap: 6px;
  }

  .course-insight-tab,
  .fail-semester-tab {
    flex: 1 1 auto;
    padding: 7px 8px;
    font-size: 13px;
  }

  .fail-stat-overview {
    grid-template-columns: 1fr;
  }

  .fail-stat-pie {
    width: 118px;
    height: 118px;
  }

  .fail-stat-pie-inner {
    width: 78px;
    height: 78px;
  }

  .fail-stat-pie-inner strong {
    font-size: 18px;
  }

  .fail-stat-number-grid,
  .fail-match-grid {
    grid-template-columns: 1fr;
  }

  .fail-match-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .fail-match-rate {
    font-size: 17px;
  }
}

/* Fail stats / course outline refinement 2026-07-11 */
.course-insight-fixed-header {
  border-bottom: 0 !important;
}

.course-insight-note {
  display: none !important;
}

.course-insight-note.active {
  display: block !important;
}

.course-insight-loading {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.course-insight-spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid #cfd8e3;
  border-top-color: #006699;
  border-radius: 50%;
  box-sizing: border-box;
  animation: course-insight-spin 0.8s linear infinite;
}

@keyframes course-insight-spin {
  to {
    transform: rotate(360deg);
  }
}

.fail-stat-dot {
  width: 10px !important;
  height: 10px !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

/* Course insight RWD + fail-stats UX refinement 2026-07-11 PM */
.fail-stat-card-eyebrow {
  width: 100%;
  color: #006699;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  line-height: 1.35;
  margin-bottom: 2px;
}

.fail-stat-semester-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 10px;
}

.fail-stat-semester-title small {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.fail-match-list-title {
  color: #006699;
  font-size: 14px;
  font-weight: 900;
  margin: 2px 0 -2px 0;
}

.fail-trend-scroll-wrap {
  position: relative;
}

.fail-trend-arrow {
  display: none;
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 28px;
  height: 42px;
  transform: translateY(-50%);
  border: 1px solid rgba(93, 123, 157, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #006699;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.12);
}

.fail-trend-arrow-left {
  left: 2px;
}

.fail-trend-arrow-right {
  right: 2px;
}

.fail-trend-arrow:hover {
  background: #f2f6fa;
}

.fail-trend-bars {
  scrollbar-width: thin;
}

@media (max-width: 760px) {
  .course-insight-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
  }

  .course-insight-tab {
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    text-align: center !important;
  }

  .fail-semester-tabs {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 7px !important;
    align-items: stretch !important;
  }

  .fail-semester-tab {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    text-align: center !important;
  }

  .fail-trend-scroll-wrap {
    margin-left: -2px;
    margin-right: -2px;
  }

  .fail-trend-bars {
    padding-left: 4px;
    padding-right: 4px;
    scroll-behavior: smooth;
  }

  .fail-trend-scroll-wrap.can-scroll-left .fail-trend-arrow-left,
  .fail-trend-scroll-wrap.can-scroll-right .fail-trend-arrow-right {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .fail-trend-scroll-wrap.can-scroll-left::before,
  .fail-trend-scroll-wrap.can-scroll-right::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    width: 34px;
    pointer-events: none;
  }

  .fail-trend-scroll-wrap.can-scroll-left::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.98), rgba(255,255,255,0));
  }

  .fail-trend-scroll-wrap.can-scroll-right::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,0.98), rgba(255,255,255,0));
  }

  .fail-stat-semester-title {
    display: block;
  }

  .fail-stat-semester-title small {
    display: block;
    margin-top: 4px;
  }
}

/* Fail stats overview card redesign: remove right-side empty-card look */
.fail-stat-overview {
  display: block !important;
}

.fail-stat-overview-card {
  border: 1px solid #d8dee6;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 13px 14px;
}

.fail-stat-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #d8dee6;
}

.fail-stat-overview-head .fail-stat-semester-title {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  color: #006699;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
}

.fail-stat-scope-text {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.fail-stat-overview-body {
  display: grid;
  grid-template-columns: minmax(190px, 235px) 1fr;
  gap: 16px;
  align-items: center;
}

.fail-stat-overview-card .fail-stat-chart-card,
.fail-stat-overview-card .fail-stat-summary-card {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.fail-stat-overview-card .fail-stat-chart-card {
  padding: 0 !important;
  min-height: 0 !important;
}

.fail-stat-overview-card .fail-stat-summary-card {
  padding: 0 !important;
}

.fail-stat-overview-card .fail-multiple-notice {
  margin-top: 0;
}

@media (max-width: 760px) {
  .fail-stat-overview-card {
    padding: 12px 12px;
  }

  .fail-stat-overview-body {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .fail-stat-scope-text {
    font-size: 12px;
  }
}

/* Pass-rate wording and mobile modal refinement 2026-07-12 */
.fail-stat-pie {
  --pass-rate: 0;
  background: conic-gradient(#2f9e44 calc(var(--pass-rate) * 1%), #c0392b 0) !important;
}

.fail-stat-pie-inner strong,
.fail-match-rate,
.fail-trend-value {
  color: #2f9e44 !important;
}

.fail-stat-dot.pass {
  background: #2f9e44 !important;
  border: 1px solid #2f9e44 !important;
}

.fail-stat-dot.fail {
  background: #c0392b !important;
  border: 1px solid #c0392b !important;
}

.fail-trend-bar {
  background: #4f8f5c !important;
}

.fail-stat-number-grid,
.fail-match-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.fail-trend-arrow {
  padding: 0 !important;
  line-height: 1 !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

@media (max-width: 760px) {
  #dynamicModal .modal-content:has(.course-insight-modal) {
    height: auto !important;
    max-height: calc(100dvh - 24px) !important;
  }

  #dynamicModal .modal-content:has(.course-insight-modal) #modalBody {
    flex: 0 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .course-insight-modal {
    flex: 0 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .course-insight-scroll-area {
    flex: 0 1 auto !important;
    max-height: calc(100dvh - 330px) !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }

  .fail-stat-number-grid,
  .fail-match-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}


/* Course insight UX refinements 2026-07-13 */
.course-insight-tabs {
  padding-bottom: 10px !important;
  margin-bottom: 10px !important;
}

@media (min-width: 761px) {
  #dynamicModal.modal-overlay:has(.course-insight-modal) {
    padding: 48px 24px !important;
    box-sizing: border-box !important;
    align-items: center !important;
  }

  #dynamicModal .modal-content:has(.course-insight-modal) {
    width: min(86vw, 920px) !important;
    max-height: calc(100dvh - 96px) !important;
    height: auto !important;
    padding: 20px 24px !important;
    box-sizing: border-box !important;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  #dynamicModal.modal-overlay:has(.course-insight-modal) {
    padding-top: 64px !important;
    padding-bottom: 64px !important;
  }

  #dynamicModal .modal-content:has(.course-insight-modal) {
    width: min(88vw, 860px) !important;
    max-height: calc(100dvh - 128px) !important;
  }
}

.fail-trend-arrow {
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.fail-trend-arrow-icon {
  display: block;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  box-sizing: border-box;
}

.fail-trend-arrow-left .fail-trend-arrow-icon {
  transform: rotate(225deg);
  margin-left: 3px;
}

.fail-trend-arrow-right .fail-trend-arrow-icon {
  transform: rotate(45deg);
  margin-right: 3px;
}

.fail-trend-stack {
  width: 24px;
  height: 82px;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
  background: #f2f4f7;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.fail-trend-segment {
  display: block;
  width: 100%;
  flex: 0 0 auto;
}

.fail-trend-segment.pass {
  background: #2f9e44;
}

.fail-trend-segment.fail {
  background: #c0392b;
}

.fail-trend-bar {
  display: none !important;
}

.fail-stat-number-grid span,
.fail-match-grid span {
  word-break: keep-all;
}

@media (max-width: 760px) {
  .course-insight-tabs {
    padding-bottom: 10px !important;
    margin-bottom: 10px !important;
  }
}

/* Course insight tab divider spacing fix 2026-07-13 */
.course-insight-fixed-header {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.course-insight-tabs {
  padding-bottom: 12px !important;
  margin-bottom: 12px !important;
}

.course-insight-scroll-area {
  padding-top: 0 !important;
}

.fail-multiple-notice.fail-notice-warning {
  border-color: #f0c36d !important;
  background: #fff8e5 !important;
  color: #8a5a00 !important;
}

.fail-multiple-notice.fail-notice-danger {
  border-color: #f3b3ad !important;
  background: #fff1f0 !important;
  color: #a32018 !important;
}

.tour-tooltip.tour-tooltip-feature {
  border: 2px solid #006699;
  background: linear-gradient(180deg, #ffffff 0%, #f3fbff 100%);
  box-shadow: 0 12px 34px rgba(0, 71, 105, 0.28);
}

.tour-tooltip.tour-tooltip-feature .tour-progress-pill {
  background: #006699;
  color: #ffffff;
}

.tour-tooltip.tour-tooltip-feature .tour-text strong {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e5f5fb;
  color: #006699;
  font-size: 13px;
  font-weight: 900;
}

.tour-tooltip.tour-tooltip-feature .tour-text {
  color: #1f2937;
  line-height: 1.7;
}

.fail-multiple-notice.fail-notice-danger {
  margin: 10px 0 10px 0 !important;
  padding: 12px 12px !important;
  line-height: 1.6 !important;
}

.tour-tooltip.tour-tooltip-feature {
  border: 0 !important;
  background: #ffffff !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
}

.tour-tooltip.tour-tooltip-feature .tour-progress-pill {
  background-color: #eef5f9 !important;
  color: #006699 !important;
}

.tour-tooltip.tour-tooltip-feature .tour-text {
  color: #333 !important;
  line-height: 1.6 !important;
}

.tour-tooltip.tour-tooltip-feature .tour-text strong {
  display: inline-flex !important;
  align-items: center !important;
  margin-bottom: 8px !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  background: #e5f5fb !important;
  color: #006699 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

@media (max-width: 760px) {
  #dynamicModal.modal-overlay:has(.course-insight-modal) {
    padding-top: 28px !important;
    padding-bottom: 28px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box !important;
    align-items: center !important;
  }

  #dynamicModal .modal-content:has(.course-insight-modal) {
    width: calc(100vw - 24px) !important;
    height: auto !important;
    max-height: calc(100dvh - 56px) !important;
    box-sizing: border-box !important;
  }

  .course-insight-scroll-area {
    max-height: calc(100dvh - 360px) !important;
  }
}

@media (max-width: 430px) {
  #dynamicModal.modal-overlay:has(.course-insight-modal) {
    padding-top: 34px !important;
    padding-bottom: 34px !important;
  }

  #dynamicModal .modal-content:has(.course-insight-modal) {
    max-height: calc(100dvh - 68px) !important;
  }

  .course-insight-scroll-area {
    max-height: calc(100dvh - 374px) !important;
  }
}

.tour-tooltip.tour-tooltip-on-target {
  z-index: 10003 !important;
}

.schedule-share-action-row {
  margin-top: 14px;
  text-align: center;
}

.schedule-share-btn {
  width: 150px;
  min-width: 150px;
  background-color: #006699;
  border: 1px solid #006699;
  color: #ffffff;
  border-radius: 6px;
  padding: 5px;
  font-size: 16px;
  font-family: "Microsoft JhengHei", Arial, sans-serif;
  font-weight: 700;
  cursor: pointer;
  -webkit-appearance: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.schedule-share-btn:hover,
.schedule-share-btn:focus-visible {
  background-color: #00557f !important;
  border-color: #00557f !important;
  color: #ffffff !important;
  outline: none;
}

.schedule-share-copy-success {
  color: #374151;
  line-height: 1.7;
  text-align: center;
  padding: 2px 4px 0;
}

.schedule-share-copy-success-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #006699;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  box-shadow: 0 8px 20px rgba(0, 102, 153, 0.12);
}

.schedule-share-copy-success-icon svg {
  width: 26px;
  height: 26px;
}

.schedule-share-copy-success-main {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.schedule-share-copy-success-text {
  font-size: 14px;
  color: #4b5563;
}

.schedule-share-loaded-message {
  color: #374151;
  line-height: 1.7;
}

.schedule-share-loaded-intro {
  margin-bottom: 12px;
}

.schedule-share-loaded-list {
  margin: 0;
  padding-left: 0;
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  counter-reset: schedule-share-loaded;
}

.schedule-share-loaded-list li {
  counter-increment: schedule-share-loaded;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
  margin-bottom: 6px;
}

.schedule-share-loaded-list li::before {
  content: counter(schedule-share-loaded) '.';
  color: #006699;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.schedule-share-loaded-item-content {
  min-width: 0;
}

.schedule-share-loaded-list b {
  color: #006699;
  margin-right: 6px;
}

.schedule-share-missing {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff1f2;
  color: #be123c;
  font-size: 13px;
  line-height: 1.6;
}

.schedule-share-url-text {
  display: block;
  word-break: break-all;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .schedule-share-action-row {
    margin-top: 14px;
  }

  .schedule-share-btn {
    width: 150px;
    min-width: 150px;
    font-size: 16px;
  }
}


.schedule-main-action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
  margin-top: 16px;
  width: 100%;
}

.schedule-action-btn {
  flex: 1 1 0;
  max-width: 150px;
  min-width: 0;
  height: 36px;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 16px;
  font-family: "Microsoft JhengHei", Arial, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.schedule-action-btn-share,
.schedule-action-btn-download {
  background-color: #006699;
  border: 1px solid #006699;
  color: #ffffff;
}

.schedule-action-btn-share:hover,
.schedule-action-btn-share:focus-visible,
.schedule-action-btn-download:hover,
.schedule-action-btn-download:focus-visible {
  background-color: #00557f !important;
  border-color: #00557f !important;
  color: #ffffff !important;
  outline: none;
}

.schedule-action-btn-back {
  background-color: #888888;
  border: 1px solid #888888;
  color: #ffffff;
}

.schedule-action-btn-back:hover,
.schedule-action-btn-back:focus-visible {
  background-color: #6f6f6f !important;
  border-color: #6f6f6f !important;
  color: #ffffff !important;
  outline: none;
}

.schedule-share-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1000010;
  transform: translate(-50%, 16px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(360px, calc(100vw - 32px));
  padding: 12px 15px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 102, 153, 0.18);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(0, 102, 153, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.schedule-share-toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.schedule-share-toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #006699;
  color: #ffffff;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 8px 18px rgba(0, 102, 153, 0.24);
}

.schedule-share-toast-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: #0f172a;
  text-align: left;
}

.schedule-share-toast-text b {
  font-size: 14px;
  line-height: 1.35;
}

.schedule-share-toast-text small {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

@media (max-width: 480px) {
  .schedule-main-action-row {
    gap: 7px;
  }

  .schedule-action-btn {
    max-width: none;
    height: 34px;
    padding: 5px 6px;
    font-size: 14px;
  }

  .schedule-share-toast {
    bottom: 18px;
  }
}

.schedule-actions .schedule-top-back-btn {
  flex: 0 0 150px;
  width: 150px;
}

@media (max-width: 480px) {
  .schedule-actions .schedule-top-back-btn {
    flex: 0 0 calc((100% - 14px) / 3);
    width: calc((100% - 14px) / 3);
    max-width: none;
  }
}

.schedule-share-toast {
  bottom: 48px;
}

.schedule-share-toast-icon {
  box-shadow: none !important;
}

.schedule-share-toast-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

@media (max-width: 480px) {
  .schedule-share-toast {
    bottom: 34px;
  }
}
@media screen and (max-width: 768px) {
  #GVOpencourse:has(#openCourseHeader th:nth-child(10):last-child) th:nth-child(4),
  #GVOpencourse:has(#openCourseHeader th:nth-child(10):last-child) td:nth-child(4),
  #GVOpencourse:has(#openCourseHeader th:nth-child(12):last-child) th:nth-child(4),
  #GVOpencourse:has(#openCourseHeader th:nth-child(12):last-child) td:nth-child(4),
  #GVOpencourse:has(#openCourseHeader th:nth-child(11):last-child) th:nth-child(5),
  #GVOpencourse:has(#openCourseHeader th:nth-child(11):last-child) td:nth-child(5),
  #GVOpencourse:has(#openCourseHeader th:nth-child(13):last-child) th:nth-child(5),
  #GVOpencourse:has(#openCourseHeader th:nth-child(13):last-child) td:nth-child(5) {
    width: 54px !important;
    max-width: 54px !important;
    min-width: 0 !important;
    white-space: normal !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
  }
}


.course-promo-ad-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.56);
  z-index: 99950;
}

.course-promo-ad-overlay.show {
  display: flex;
}

.course-promo-ad-panel {
  position: relative;
  width: min(92vw, 560px);
  max-width: 560px;
  max-height: calc(100dvh - 48px);
}

.course-promo-ad-link {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.course-promo-ad-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 48px);
  object-fit: contain;
}

.course-promo-ad-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: #111827;
  font-size: 28px;
  font-weight: 700;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  -webkit-appearance: none;
}

.course-promo-ad-close:hover {
  background: #f3f4f6;
}

.course-promo-ad-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #111827;
  font-size: 0;
  font-weight: 700;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
  -webkit-appearance: none;
}

.course-promo-ad-nav-icon {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.course-promo-ad-prev {
  left: -18px;
}

.course-promo-ad-next {
  right: -18px;
}

.course-promo-ad-nav:hover {
  background: rgba(255, 255, 255, 0.9);
}

@media screen and (max-width: 768px) {
  .course-promo-ad-overlay {
    padding: 14px;
  }

  .course-promo-ad-panel {
    width: min(94vw, 440px);
    max-height: calc(100dvh - 28px);
  }

  .course-promo-ad-link {
    border-radius: 14px;
  }

  .course-promo-ad-image {
    max-height: calc(100dvh - 28px);
  }

  .course-promo-ad-close {
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    font-size: 25px;
    line-height: 28px;
  }

  .course-promo-ad-nav {
    width: 32px;
    height: 42px;
    background: rgba(255, 255, 255, 0.52);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  }

  .course-promo-ad-nav:hover {
    background: rgba(255, 255, 255, 0.78);
  }

  .course-promo-ad-nav-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  .course-promo-ad-prev {
    left: 8px;
  }

  .course-promo-ad-next {
    right: 8px;
  }
}

@media screen and (min-width: 1200px) {
  .course-promo-ad-panel {
    width: min(72vh, 600px);
    max-width: 600px;
  }
}

/* 新版選課頁介面（依學校新版頁面樣式，保留模擬系統功能） */
#coursePage.course-ui-new {
  --npust-primary: #1f6feb;
  --npust-danger: #d9534f;
  --bg-color: #f4f7f6;
  --border-color: #cccccc;
  --text-dark: #333333;
  color: var(--text-dark);
  line-height: 1.15;
  font-size: 14px;
  padding: 10px 15px 260px 15px;
  min-height: calc(100vh - 16px);
  box-sizing: border-box;
}

#coursePage.course-ui-new *,
#coursePage.course-ui-new *::before,
#coursePage.course-ui-new *::after {
  box-sizing: border-box;
}

#coursePage.course-ui-new .course-new-container {
  max-width: 1200px;
  margin: 0 auto;
}

#coursePage.course-ui-new .course-new-sys-title {
  text-align: center;
  color: var(--text-dark);
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 12px;
  text-shadow: 1px 1px 0px #fff;
  user-select: none;
}

#coursePage.course-ui-new .card {
  background: #ffffff;
  border-radius: 6px;
  padding: 12px 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 12px;
}

#coursePage.course-ui-new .info-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--npust-primary);
}

#coursePage.course-ui-new .info-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-weight: bold;
  color: var(--text-dark);
}

#coursePage.course-ui-new .info-group span {
  color: #666;
  font-weight: normal;
  margin-right: 4px;
}

#coursePage.course-ui-new .course-new-action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#coursePage.course-ui-new .filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background-color: #eef3f8;
}

#coursePage.course-ui-new .filter-item {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

#coursePage.course-ui-new .filter-item select {
  padding: 4px 6px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.9rem;
  margin-left: 4px;
  max-width: 100%;
  background-color: #fff;
}

#coursePage.course-ui-new .category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

#coursePage.course-ui-new .btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  background-color: #e0e0e0;
  color: #333;
  line-height: 1.15;
  width: auto;
}

#coursePage.course-ui-new .btn:hover {
  background-color: var(--npust-primary);
  color: white;
}

#coursePage.course-ui-new .btn-primary {
  background-color: var(--npust-primary);
  color: white;
}

#coursePage.course-ui-new .btn-primary:hover {
  background-color: #1558c0;
}

#coursePage.course-ui-new .btn-danger {
  background-color: var(--npust-danger);
  color: white;
}

#coursePage.course-ui-new .btn-danger:hover {
  background-color: #c9302c;
}

#coursePage.course-ui-new .button5 {
  background-color: white;
  color: black;
  border: 1px solid #555555;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.2s;
}

#coursePage.course-ui-new .button5:hover {
  background-color: #555555;
  color: white;
}

#coursePage.course-ui-new .section-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--npust-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

#coursePage.course-ui-new .course-new-selected-title {
  color: #990000;
}

#coursePage.course-ui-new .course-new-credit-label {
  margin-left: auto;
  font-size: 0.95rem;
  color: #333;
  font-weight: normal;
}

#coursePage.course-ui-new .course-new-credit-number {
  color: #D9534F;
  font-weight: bold;
}

#coursePage.course-ui-new .course-new-title-action {
  margin: 0 0 8px 0;
}

#coursePage.course-ui-new .course-new-name-cell {
  text-align: left;
  word-break: break-word;
  overflow-wrap: anywhere;
}

#coursePage.course-ui-new .course-new-col-name {
  width: auto;
}

#coursePage.course-ui-new .table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

#coursePage.course-ui-new .modern-grid {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  text-align: center;
}

#coursePage.course-ui-new .modern-grid th {
  background-color: #006699;
  color: white;
  padding: 6px 4px;
  font-weight: bold;
  white-space: nowrap;
}

#coursePage.course-ui-new .modern-grid.red-header th {
  background-color: #990000;
}

#coursePage.course-ui-new .modern-grid td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: #000066;
  overflow-wrap: break-word;
  word-break: break-word;
}

#coursePage.course-ui-new .modern-grid tr:hover td {
  background-color: inherit;
}

#coursePage.course-ui-new .course-row,
#coursePage.course-ui-new .course-row:hover {
  background-color: white;
  transition: none;
}

#coursePage.course-ui-new .modern-grid select {
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 0.85rem;
  background-color: #fff;
}

#coursePage.course-ui-new .course-new-searchbar {
  margin: 0 0 10px 0;
  display: flex;
  gap: 8px;
  align-items: stretch;
  position: relative;
}

#coursePage.course-ui-new .course-new-tool-card {
  padding-bottom: 10px;
}

#coursePage.course-ui-new .course-new-special-note {
  display: none;
  color: #555;
  font-size: 0.92rem;
  line-height: 1.6;
  margin-top: 8px;
}

#coursePage.course-ui-new .course-new-below-table-action {
  margin-top: 8px;
  margin-bottom: 4px;
}

#coursePage.course-ui-new .course-new-submit-wrap {
  text-align: center;
  margin-top: 15px;
}

#coursePage.course-ui-new .course-new-submit-btn {
  font-size: 1.1rem;
  padding: 8px 30px;
  margin-bottom: 0;
}

#coursePage.course-ui-new .site-footer {
  left: -8px;
  right: -8px;
}


#coursePage.course-ui-new .user-class-filter-btn {
  min-height: 38px;
  width: auto;
  margin: 0;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
}

#coursePage.course-ui-new .user-class-filter-btn:hover {
  background: #f0f0f0;
  border-color: #bbb;
  color: #333;
}

@media (max-width: 768px) {
  #coursePage.course-ui-new .info-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  #coursePage.course-ui-new .info-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  #coursePage.course-ui-new .btn {
    width: 100%;
    margin-top: 4px;
  }

  #coursePage.course-ui-new .category-tabs .btn {
    flex: 1;
    min-width: 45%;
  }

  #coursePage.course-ui-new .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  #coursePage.course-ui-new .filter-item {
    justify-content: space-between;
  }

  #coursePage.course-ui-new .course-new-action-group,
  #coursePage.course-ui-new .course-new-searchbar {
    width: 100%;
  }

  #coursePage.course-ui-new .user-class-filter-btn {
    width: auto;
    margin-top: 0;
  }

  #coursePage.course-ui-new .course-new-submit-btn {
    width: auto;
  }
}

/* Course UI toggle floating button */
.course-ui-toggle-icon {
  min-width: 96px;
  height: 52px;
  padding: 0 12px;
  border: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.13);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: #475569;
  position: relative;
}

.course-ui-toggle-icon-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.course-ui-toggle-text {
  display: inline-block;
  letter-spacing: 0.02em;
}

.course-ui-toggle-icon svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  flex: 0 0 auto;
}

.course-ui-toggle-icon:hover,
.course-ui-toggle-icon:focus-visible {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
  filter: saturate(1.05);
  outline: none;
}

.course-ui-toggle-icon::after {
  content: none;
}

@media (max-width: 768px) {
  .course-ui-toggle-icon {
    min-width: 88px;
    height: 48px;
    padding: 0 10px;
    border-radius: 15px;
    font-size: 12px;
  }

  .course-ui-toggle-icon svg {
    width: 18px;
    height: 18px;
  }
}

/* Course insight subtitle */
.course-insight-subtitle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}


/* 無流水號課程：沿用正式選課頁表格的藍色系與細框按鈕，保持簡潔。 */
.placeholder-course-hint {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 7px;
  padding: 2px 6px;
  max-width: 100%;
  border: 1px solid #99b9c9;
  border-radius: 3px;
  background: #ffffff;
  color: #006699;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
}
.course-outline-link:hover .placeholder-course-hint,
.course-outline-link:focus-visible .placeholder-course-hint {
  border-color: #006699;
  background: #f0f8ff;
  color: #005580;
}
