*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft JhengHei", "微軟正黑體", "Noto Sans TC", "Noto Sans SC", Arial, sans-serif;
  font-size: 0.9rem;
  background: #f2f2f2;
  color: #333;
  line-height: 1.7;
}

/* ===== HEADER ===== */
#site-header {
  background: #c02f14;
  color: white;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
#header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 30px;
}
#header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
#header-left a {
  display: flex;
  align-items: center;
  line-height: 0;
}
#header-logo {
  height: 72px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
#header-title-block { flex: 1; }
#header-dept {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
}
#header-main-title {
  font-size: 1rem;
  line-height: 1.25rem;
  font-weight: 700;
}

/* ===== LANG DROPDOWN ===== */
#lang-wrapper { flex-shrink: 0; }
#lang-select {
  background: white;
  color: #333;
  border: 1px solid #ccc;
  padding: 6px 28px 6px 10px;
  border-radius: 3px;
  font-size: 0.8rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23333'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  min-width: 140px;
}
#lang-select:focus { outline: 2px solid #ffcc00; }

/* ===== MAIN CONTENT ===== */
#main-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 30px 20px 60px;
  font-size: 1.0625rem;
}
#page-heading {
  font-size: 1.25em;
  font-weight: bold;
  color: #c02f14;
  border-left: 5px solid #c02f14;
  padding: 8px 0 8px 14px;
  margin-bottom: 24px;
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

/* ===== QUIZ ===== */
#quiz-container {
  background: white;
  padding: 30px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 50px;
  border-top: 5px solid #c02f14;
}
#quiz-intro {
  position: relative;
  font-size: 0.9em;
  color: #555;
  line-height: 1.7;
  margin-bottom: 24px;
  padding: 14px 16px 30px 120px;
  background: #fdf6f5;
  border-left: 4px solid #c02f14;
  border-radius: 4px;
  min-height: 135px;
}
#quiz-intro-mascot {
  position: absolute;
  top: 14px;
  left: 20px;
  width: 80px;
  height: auto;
  margin: 0;
  display: block;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.12));
  animation: mascot-float 3s ease-in-out infinite;
  transform-origin: bottom center;
  float: none;
}
@keyframes mascot-float {
  0%   { transform: translateY(0px) rotate(0deg); }
  25%  { transform: translateY(-5px) rotate(1deg); }
  50%  { transform: translateY(-9px) rotate(0deg); }
  75%  { transform: translateY(-5px) rotate(-1deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}
/* Clear float after the paragraph */
#quiz-intro::after {
  content: none;
}
@media (prefers-reduced-motion: reduce) {
  #quiz-intro-mascot { animation: none; }
}
@media (max-width: 600px) {
  #quiz-intro {
    padding: 14px 14px 14px 92px;
    min-height: 90px;
  }
  #quiz-intro-mascot {
    top: 16px;
    left: 14px;
    width: 60px;
  }
}
#quiz-intro-subtitle {
  font-size: 1.15em;
  display: block;
  font-weight: bold;
  margin-bottom: 6px;
}
#quiz-intro a {
  color: #c0392b;
  text-decoration: underline;
}
.question {
  display: none;
  padding: 24px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fafafa;
  border-left: 4px solid #c02f14;
}
.question.active { display: block; }
.question h3 {
  margin-top: 0;
  color: #333;
  font-size: 1em;
  font-weight: bold;
  line-height: 1.6;
  margin-bottom: 18px;
}
.btn-yes, .btn-no {
  padding: 10px 28px;
  font-size: 1em;
  cursor: pointer;
  border: none;
  border-radius: 3px;
  font-weight: bold;
  margin: 6px 8px 6px 0;
  transition: all 0.2s;
}
.btn-yes { background: #c02f14; color: white; }
.btn-yes:hover { background: #a02510; }
.btn-no { background: white; color: #c02f14; border: 2px solid #c02f14; }
.btn-no:hover { background: #fdf2f0; }
.result-box {
  margin: 10px 0 0;
  padding: 16px 20px;
  background: #fff8e1;
  border: 1px solid #ffcc00;
  border-left: 4px solid #ffcc00;
  border-radius: 4px;
  font-size: 1em;
  color: #5d4037;
}

/* ===== SEPARATOR ===== */
.sections-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 40px 0 28px;
}
.sections-divider::before,
.sections-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: #ddd;
}
.sections-divider-label {
  font-size: 0.95em;
  font-weight: bold;
  color: #c02f14;
  white-space: nowrap;
  padding: 4px 12px;
  border: 2px solid #c02f14;
  border-radius: 20px;
}

/* ===== FSR SECTIONS ===== */
.ref-section {
  position: relative;
  background: white;
  border: 1px solid #ddd;
  border-top: 4px solid #c02f14;
  border-radius: 4px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.ref-section h2 {
  font-size: 1.1em;
  color: #c02f14;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  font-weight: bold;
  line-height: 1.5;
}
.ref-section.highlighted {
  background: white;
  border-color: #ffcc00;
  border-top-color: #ffcc00;
  border-width: 3px;
  box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.3);
}
.ref-remarks {
  margin-top: 16px;
  padding: 14px 16px;
  background: #fdf6f5;
  border-left: 4px solid #c02f14;
  border-radius: 4px;
}
.ref-remarks-title {
  font-size: 0.9em;
  font-weight: bold;
  color: #c02f14;
  margin-bottom: 2px;
}
.ref-remarks ul {
  margin: 0 0 0 18px;
  font-size: 0.9em;
  color: #444;
  line-height: 1.8;
}

/* ===== FSR LINK BUTTON ===== */
.fsr-link-row {
  margin-top: 18px;
  text-align: right;
}
.fsr-link-btn {
  display: inline-block;
  padding: 8px 18px;
  background: #c02f14;
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.2s;
}
.fsr-link-btn:hover { background: #a02510; }

/* ===== PIN OVERLAY ===== */
.ref-section-wrapper {
  position: relative;
  display: block;
}
.ref-section-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  margin-top: 4px;
}
.ref-img-container {
  position: relative;
  flex-shrink: 0;
  width: 100%;
}

.ref-img-container .ref-section-img {
  width: 100%;
  display: block;
}
.fsr-pin {
  position: absolute;
  width: 6%;
  height: 8%;
  cursor: pointer;
  transform: translate(-50%, -100%);
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
  min-width: 24px;
  min-height: 24px
}
.fsr-pin:hover, .fsr-pin:active {
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}
/*.fsr-pin:focus {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}*/
.fsr-pin:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 4px;
  border-radius: 4px;
}

/* ===== BACK TO FSR FLOATING BUTTON ===== */
#back-to-fsr-btn {
  position: fixed;
  bottom: 28px;
  right: 24px;
  background: #c02f14;
  color: white;
  border: none;
  border-radius: 30px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 999;
  transition: opacity 0.3s, background 0.2s;
  display: none;
}
#back-to-fsr-btn:hover { background: #a02510; }

/* ===== FSI CARDS ===== */
.fsi-card {
  position: relative;
  background: white;
  border: 1px solid #ddd;
  border-top: 4px solid #c02f14;
  border-radius: 4px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.fsi-card h3 {
  font-size: 1.1em;
  color: #c02f14;
  font-weight: bold;
  line-height: 1.5;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}
.fsi-card.highlighted {
  background: white;
  border-color: #ffcc00;
  border-top-color: #ffcc00;
  border-width: 3px;
  box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.3);
}
.fsi-card-body {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.fsi-card img {
  width: 140px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
  background: #f9f9f9;
  border: 1px solid #eee;
  padding: 6px;
}
.fsi-card-text { flex: 1; min-width: 0; }
.fsi-label {
  font-size: 1em;
  font-weight: bold;
  color: #c02f14;
  margin-top: 8px;
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}
.fsi-label:first-child { margin-top: 0; }
.fsi-desc { font-size: 0.9em; color: #444; line-height: 1.7; margin-bottom: 15px; }
.fsi-price { font-size: 0.9em; color: #444; line-height: 1.7; }

/* ===== FOOTER ===== */
#site-footer {
  background: #a02510;
  color: #ffffff;
  text-align: center;
  font-size: 0.8rem;
  padding: 16px 20px;
  margin-top: 40px;
  line-height: 1.8;
}
#site-footer a { color: #ffcc00; text-decoration: none; }
#site-footer a:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  #header-top { padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  #header-logo { height: 52px; }
  #header-dept { font-size: 1.2rem; line-height: 1.6rem; }
  #header-main-title { font-size: 0.875rem; }
  #main-content { padding: 20px 14px 40px; }
  #quiz-container { padding: 20px 16px; }
  .btn-yes, .btn-no { width: 100%; margin-right: 0; }
  #lang-select { min-width: 100px; }
  .fsi-card-body { flex-direction: column; }
  .fsi-card img { width: 100%; }
  .fsr-pin { width: 8%; height: 7%; }
  #back-to-fsr-btn { bottom: 16px; right: 14px; padding: 9px 14px; font-size: 0.8rem; z-index: 1000; }
}

/* ===== HIDDEN UNTIL QUIZ COMPLETE ===== */
#fsr-sections, #fsi-sections-wrapper {
  display: none;
}

.fsr-desc {
  font-size: 1rem;
  color: #555;
  margin: 0 0 20px 0;
  padding: 0 4px;
  line-height: 1.6;
}

#answer-tracker {
  position: fixed;
  bottom: 15px;
  left: 20px;
  width: 280px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 999;
  font-size: 0.85rem;
  display: none;
}

#answer-tracker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #c0392b;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px 10px 0 0;
  font-weight: bold;
}

#answer-tracker-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

#answer-tracker-body {
  padding: 10px 12px;
  max-height: 300px;
  overflow-y: auto;
}

#answer-tracker-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#answer-tracker-list li {
  padding: 5px 0;
  border-bottom: 1px solid #f0f0f0;
  line-height: 1.4;
}

#answer-tracker-list li:last-child {
  border-bottom: none;
}

.tracker-q {
  color: #595959;
  font-size: 0.8rem;
}

.tracker-a {
  font-weight: bold;
  color: #c0392b;
}

.tracker-a.yes { color: #27ae60; }
.tracker-a.no  { color: #c0392b; }

ul + .ref-remarks-title {
  margin-top: 18px;
}

.ref-remarks i {
  color: #c0392b;
  flex-shrink: 0;
}

/* ── Overlay backdrop ── */
#info-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 1100;
  justify-content: center;
  align-items: center;
  transition: background 0.25s ease;
}

#info-modal.active {
  display: flex;
  background: rgba(0, 0, 0, 0.5);
}

#info-modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 0;
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.92) translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#info-modal.active #info-modal-box {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ── Header bar with title + close button ── */
#info-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #c0392b;
  border-radius: 12px 12px 0 0;
  gap: 12px;
}

/* ── Modal title ── */
#info-modal-title {
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
  line-height: 1.4;
  margin: 0;
  padding: 0;
  flex: 1;
}

/* ── Close button ── */
#info-modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
}
#info-modal-close:hover {
  color: #fff;
}

/* ── Scrollable body ── */
#info-modal-body {
  padding: 20px;
  font-size: 1rem;
  line-height: 1.75;
  color: #333;
  overflow-y: auto;
}

#info-modal-body ol {
  padding-left: 18px;
  margin: 8px 0 0;
}

#info-modal-body li {
  margin-bottom: 6px;
}

/* ── Clickable remarks title link ── */
.remarks-info-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  cursor: pointer;
}
.remarks-info-link:hover {
  color: #c0392b;
}
.remarks-info-link i {
  color: #c0392b;
  flex-shrink: 0;
}

.ref-img-tip {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 0.9em;
  padding: 4px 10px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s;
  white-space: nowrap;
  z-index: 15;
}

/* ======= DESKTOP LAYOUT ======= */
@media (min-width: 1024px) {
  #main-content {
	max-width: 100%;
    padding-left: 40px;
    padding-right: 40px;
  }
  .ref-section-wrapper {
    display: flex;
    flex-direction: row;
    gap: 28px;
    align-items: flex-start;
  }
  .ref-img-container {
    width: 50%;
  }
  .ref-section-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
	margin-left: 10px;
  }
  .ref-section-right .ref-remarks {
    margin-top: 0;
  }
  .ref-remarks {
	  border-left: none;
	  border-top: 4px solid #c02f14;
	}
}

@media (min-width: 1280px) {
  #main-content {
    font-size: 1.125rem;
	padding-left: 60px;
    padding-right: 60px;
  }
}

.ref-remarks + .ref-remarks {
  margin-top: 20px;
  /*border-top: 2px solid #eee;*/
  padding-top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #c02f14;
  color: #fff;
  padding: 8px 12px;
  z-index: 9999;
  font-size: 1rem;
}
.skip-link:focus { top: 0; }

#pause-anim {
  display: inline-flex;       /* flex eliminates inline gaps entirely */
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
