/*—— 自訂字體 ——*/
@font-face {
  font-family: "GenSenRounded2TW-R";
  src: url("../font/GenSenRounded2TW-R.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "GenSenRounded2TW-L";
  src: url("../font/GenSenRounded2TW-L.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

html {
  font-size: 16px;
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url("../images/圖片\ 1.png") no-repeat center center fixed;
  background-size: cover;
  font-family: "SweiXDPearlCJKtc-DemiLight", sans-serif;
}

@media (min-width: 1440px) {
  html {
    font-size: 18px;
  }
}

@media (max-width: 1200px) {
  html {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
}

/* 全局和版面 */
body {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 1rem;
  letter-spacing: 6px;
  overflow-x: hidden;
  overflow-y: auto;
}

.scene {
  position: relative;
  display: none;
  flex-direction: column;
  align-items: center;
  width: 900px;
  max-width: 90%;
  padding: 20px;
  min-height: 500px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 72px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  text-align: center;
  transition: transform .05s ease-in-out;
  z-index: 1;
}

.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-box-shadow:
  inset -7px -5.25px 2px -6.5px rgba(255, 255, 255), 
  inset 7px 5.25px 2px -6.5px rgb(255, 255, 255),
  inset -2.25px -8px 2px -6.75px rgb(255, 255, 255), 
  inset 2.25px 8px 2px -6.75px rgb(255, 255, 255),
  4px 8px 32px 0px rgba(110, 110, 110, 0.25);
  box-shadow:
  inset -7px -5.25px 2px -6.5px rgba(255, 255, 255), 
  inset 7px 5.25px 2px -6.5px rgb(255, 255, 255),
  inset -2.25px -8px 2px -6.75px rgb(255, 255, 255), 
  inset 2.25px 8px 2px -6.75px rgb(255, 255, 255),
  4px 8px 32px 0px rgba(110, 110, 110, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: -1;
  border-radius: 72px;
}

.scene.active {
  display: flex;
  z-index: 1;
}

.scene.active .entertain-grid,
.scene.active .diet-grid, 
.scene.active .food-grid,
.scene.active .transport-grid,
.scene.active .entertain-card,
.scene.active .home-card,
.scene.active .travel-card,
.scene.active .daily-card,
.scene.active .waste-container,
.scene.active .template-wrapper{
  animation: slideIn 0.5s ease forwards;
  z-index: 1;
}

.slideContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0.5rem;
  overflow-y: visible;
  overflow-x: hidden;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0%);
    opacity: 1;
  }
}

h1 {
  font-size: 1.5rem;
  color: #6c808f;
  font-family: "GenSenRounded2TW-R", sans-serif;
  font-weight: 400;
  letter-spacing: 10px;
  text-shadow: #7f7f7f40 2pt 2pt 3pt;
  margin: 0.5rem 0;
}

/* 切換開關 */
.chapter-bar {
  display: none;
  position: relative;
  width: fit-content;
  height: fit-content;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 0.4rem;;
  margin-top: 0.25rem;
  border-radius: 32px;
  justify-content: space-around;
  align-items: center;
  filter: drop-shadow(-8px -10px 46px #00000010);
  -webkit-backdrop-filter:brightness(1.05) blur(2px) url(#displacementFilter);;
  backdrop-filter:brightness(1.05) blur(2px) url(#displacementFilter);;
  z-index: 0;
}

.chapter-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-box-shadow:
  inset -8.5px -2.25px 0 -7px rgb(255, 255, 255), 
  inset 8.5px 2.25px 0 -7px rgb(255, 255, 255),
  inset -2.75px -8.5px 0 -7.25px rgb(255, 255, 255), 
  inset 2.75px 8.5px 0 -7.25px rgb(255, 255, 255),
  2px 2px 12px 4px rgba(110, 110, 110, 0.15);
  box-shadow:
  inset -8.75px -4.5px 0 -7px rgb(255, 255, 255), 
  inset 8.75px 4.5px 0 -7px rgb(255, 255, 255),
  inset -2.75px -8.5px 0 -7.25px rgb(255, 255, 255), 
  inset 2.75px 8.5px 0 -7.25px rgb(255, 255, 255),
  2px 2px 12px 4px rgba(110, 110, 110, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 0;
  border-radius: 32px;
}

.chapter-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #6D808F;
  text-decoration: none;
  scale: 0.95;
  padding: 0.15rem 1.5rem;
  transition: background-color 0.3s ease;
  border-radius: 96px;
  text-wrap: nowrap;
  z-index: 999;
}

.chapter-button.active {
  background-color: rgba(255, 255, 255, 0.35);
  border: solid 1.5px #dddddd80;
}


.chapter-button:hover {
  background-color: rgba(255, 255, 255, 0.5);;
  cursor: pointer;
}

.chapter-icon {
  font-size: 1rem;
  line-height: 1;
}

.chapter-label {
  font-size: 0.6rem;
  margin-top: 2px;
}

@media (min-width: 901px) {
  .chapter-bar.show {
    display: flex;
  }
}

/* 碳排圓環 */
.carbon-ring-container {
  position: fixed;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-content: center;
  text-align: center;
}
.carbon-ring {
  width: 200px;
  height: 200px;
}

.carbon-ring svg {
  transform: rotate(-112.5deg); /* 把缺角轉到左邊中間 (360 - 45)/2 */
}

.carbon-ring .text {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #333;
  line-height: 1.3;
}

/* 跳轉橫槓 */

.page-indicator {
  display: flex;
  justify-content: center;
  align-items: baseline;
  width: 100%;
  margin: 1rem 0 1.5rem 0;
}

.bar-container {
  display: flex;
  align-items: center;
  width: 60%;
  gap: 1rem;
}

@media (max-width: 768px) {
  h1 {
    margin: 0.5rem 0 1.25rem ;
  }
  .page-indicator {
    display: none;
  }

  .bar-container {
    width: 80%;
  }
}

.bar-hit-area {
  display: flex;
  flex: 1;
  padding: 12px;
  margin: -12px; /* 抵銷外推影響布局 */
  cursor: pointer;
}

.bar-hit-area:hover .bar {
  background-color: #b5c1c6;
  box-shadow: 1pt 1pt 4pt #7f7f7f60, -2pt -2pt 3pt #ffffff55;
}

.bar {
  flex: 1;
  height: 5px;
  background-color: #e4ecf1;
  transition: background-color 0.3s;
  cursor: pointer;
}

.bar.active {
  background-color: #b5c1c6;
  box-shadow: 1pt 1pt 4pt #7f7f7f60, -2pt -2pt 3pt #ffffff55;
}

/* 換頁按鈕 */

.nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #b5c1c6;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  backdrop-filter: blur(4px);
  z-index: 1000;
  user-select: none;
}

.nav-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-box-shadow:
  inset -0.185rem -0.235rem 0.315rem -0.295rem rgba(255, 255, 255), 
  inset 0.185rem 0.25rem 0.315rem -0.295rem rgba(255, 255, 255),
  -0.06rem -0.03rem 0 0 rgba(255, 255, 255), 
  0.03rem 0.03rem 0 0 rgba(255, 255, 255);
  box-shadow:
  inset -0.285rem -0.235rem 0.1rem -0.295rem rgba(255, 255, 255), 
  inset 0.285rem 0.235rem 0.1rem -0.295rem rgba(255, 255, 255),
  -0.03rem -0.025rem 0 0 rgba(255, 255, 255), 
  0.025rem 0.025rem 0 0 rgba(255, 255, 255),
  4px 16px 48px 8px rgba(110, 110, 110, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: -1;
  border-radius: 50%;
}

.nav-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center,#ffffff, #eff3f910);
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: 50%;
  z-index: -1;
}

.nav-btn:hover::after {
  opacity: 1;
}

.prev-btn {
  left: -100px;
}
.next-btn {
  right: -100px;
}

@media (max-width: 1200px) {
  .nav-btn {
    scale: 0.9;
  }
  .prev-btn {
    left: 8px;
  }
  .next-btn {
    right: 8px;
  }
}

@media (max-width: 900px) {
  .nav-btn {
    scale: 0.8;
  }
  .prev-btn {
    left: 4px;
  }
  .next-btn {
    right: 4px;
  }
}

@media (max-width: 600px) {
  .nav-btn {
    scale: 0.5;
  }
  .prev-btn {
    left: -12px;
  }
  .next-btn {
    right: -12px;
  }
}

/* 切換開關 */

@keyframes switchOn {
  0% {
    transform: translateX(0px);
  }
  20% {
    transform: translateX(10px);
  }
  40% {
    transform: translateX(20px);
  }
  60% {
    transform: translateX(21px);
  }
  80% {
    transform: translateX(19px);
  }
  100% {
    transform: translateX(20px);
    box-shadow: #ffffff 0;
  }
}

@keyframes switchOff {
  0% {
    transform: translateX(20px);
  }
  20% {
    transform: translateX(10px);
  }
  40% {
    transform: translateX(0px);
  }
  60% {
    transform: translateX(-1px);
  }
  80% {
    transform: translateX(1px);
  }
  100% {
    transform: translateX(0px);
  }
}

.toggle-switch {
  position: relative;
  min-width: 40px;
  min-height: 20px;
  margin: 2px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #eff3f9;
  border: none;
  box-shadow: 2pt 2.5pt 3pt #6d808f50 inset;
  border-radius: 10px;
  transition: 0.75s;
}

.toggle-switch .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: -4pt -4pt 5pt #ffffff46, 5pt 5pt 10pt #c3cadb76;
}

.toggle-switch input:checked + .slider {
  background: #d0d2d6;
}

.toggle-switch input:checked + .slider:before {
  animation: switchOn .5s linear forwards;
}

.toggle-switch input:not(:checked) + .slider:before {
  animation: switchOff 0.5s linear forwards;
}


/* input 框樣式 */
.custom-number-input input[type="number"],
.modal-body .input-group input[type="number"],
.toggle-card input[type="number"],
.fashion-box input[type="number"] {
  padding: 4px 8px;
  background: #fff;
  color: #4a4a4a;
  text-align: center;
  min-width: 40px;
  max-width: 80px;
  height: 24px;
  border: 0.25pt solid #b5c1c623;
  border-radius: 16px;
  box-shadow: inset 1pt 1pt 4pt #6d808f70;
  outline: none;
}

.custom-number-input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.custom-number-input input[type="number"]::-webkit-inner-spin-button,
.custom-number-input input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.custom-number-input button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  border-radius: 100%;
  background: rgba(255, 255, 255);
  box-shadow: -4pt -4pt 5pt #ffffff46, 5pt 5pt 10pt #c3cadb76;
  width: 20px;
  height: 20px;
  padding: 12px;
  font-size: 1rem;
  color: #b5c1c6;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s;
}

.custom-number-input button:hover {
  background-color: #ddd;
}

.custom-number-input .btn-decrement {
  position: relative;
  font-size: 1.5rem;
}

.custom-number-input .btn-decrement .decrement {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Info 按鈕 */
.info-btn {
  position: absolute;
  bottom: 48px;
  right: 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(236, 240, 245, 1) 100%
  );
  -webkit-box-shadow:
  inset -0.185rem -0.235rem 0.315rem -0.295rem rgba(255, 255, 255), 
  inset 0.185rem 0.25rem 0.315rem -0.295rem rgba(255, 255, 255),
  -0.06rem -0.03rem 0 0 rgba(255, 255, 255), 
  0.03rem 0.03rem 0 0 rgba(255, 255, 255);
  box-shadow:
  inset -0.285rem -0.235rem 0.1rem -0.295rem rgba(255, 255, 255), 
  inset 0.285rem 0.235rem 0.1rem -0.295rem rgba(255, 255, 255),
  -0.03rem -0.025rem 0 0 rgba(255, 255, 255), 
  0.025rem 0.025rem 0 0 rgba(255, 255, 255),
  4px 8px 16px 0 rgba(110, 110, 110, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  z-index: 10;
}

.info-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Modal */
.modal {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  bottom: 24px;
  right: -8px;
  transform: translate(-50%, -50%);
  width: fit-content;
  height: 16px;
  -webkit-box-shadow:
  inset -0.185rem -0.235rem 0.315rem -0.295rem rgba(255, 255, 255), 
  inset 0.185rem 0.25rem 0.315rem -0.295rem rgba(255, 255, 255),
  -0.06rem -0.03rem 0 0 rgba(255, 255, 255), 
  0.03rem 0.03rem 0 0 rgba(255, 255, 255);
  box-shadow:
  inset -0.285rem -0.235rem 0.1rem -0.295rem rgba(255, 255, 255), 
  inset 0.285rem 0.235rem 0.1rem -0.295rem rgba(255, 255, 255),
  -0.03rem -0.05rem 0 0 rgba(255, 255, 255), 
  0.125rem 0.05rem 0 0 rgba(255, 255, 255),
  4px 8px 16px 0 rgba(110, 110, 110, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 0.75rem;
  z-index: 1000;
}
.modal-close {
  position: absolute;
  top: 0;
  right: 4px;
  color: #aaa;
  cursor: pointer;
  user-select: none;
}
.modal-close:hover {
  color: #333;
}

/* Modal 內容排版 */
.modal-body {
  font-size: 0.75rem;
  flex: 1;
  overflow-y: auto;
  white-space: nowrap;
}
