body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: #f4f7f6;
  margin: 0;
  padding: 0;
  text-align: center;
  display: flex; /* 使用 flexbox 讓內容和 footer 垂直排列 */
  flex-direction: column; /* 垂直方向排列 */
  min-height: 100vh; /* 確保 body 至少佔據整個視窗高度 */
}
/* 黑暗模式樣式 */
.dark-mode {
background-color: #121212; /* 深灰色背景 */
color: #F0F0F0; /* 柔和的淺灰色文字 */
}

/* 黑暗模式下為頂部導航添加背景色 */
.dark-mode .topnav {
background-color: #222222; /* 稍淺的深灰色導航欄背景 */
}

.dark-mode .topnav a {
color: #F0F0F0; /* 導航連結文字顏色 */
}

.dark-mode .topnav a:hover {
background-color: #555555; /* 導航連結 hover 背景色 */
color: #ffffff; /* 導航連結 hover 文字顏色 */
}

.dark-mode .topnav a.active {
background-color: #5A67D8; /* Active 狀態的強調色 (柔和藍紫色) */
color: white;
}

.dark-mode button {
background-color: #5A67D8; /* 柔和的藍紫色按鈕背景 */
color: #FFFFFF; /* 按鈕文字顏色 */
}

.dark-mode button:hover {
opacity: 0.8; /* 按鈕 hover 透明度 */
}

.dark-mode h3 {
color: #F0F0F0; /* 暗黑模式下標題顏色 */
}

.dark-mode h4 {
color: #000000; /* 暗黑模式下標題顏色 */
}

.dark-mode h5 {
color: #000000; /* 暗黑模式下標題顏色 */
}

.dark-mode h6 {
color: #000000; /* 暗黑模式下標題顏色 */
}

/* 移除 .dark-mode .loc，因為 .log-entry-card 將取代其功能 */
/* .dark-mode .loc {
color: white;
} */

.dark-mode .cancelbtn {
background-color: #f44336 !important; /* 強制設定取消按鈕在暗黑模式下背景為紅色 */
color: white !important; /* 同時確保文字顏色在紅色背景下清晰可見，可以設定為白色或其他淺色 */
}

h2 {
  text-align: center;
  color: #333;
}

A6 {
font-size: 18px;
}

h6 {
font-size: 16px;
}

/* 為頂部導航添加黑色背景色 */
.topnav {
  background-color: #333;
  overflow: hidden;
}

/* 設定導覽列中連結的樣式 */
.topnav a {
  float: left;
  display: block;
  color: #f2f2f2;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
}

/* 更改懸停時連結的顏色 */
.topnav a:hover {
  background-color: #ddd;
  color: black;
}

/* 新增一個活動類別來突出顯示目前頁面 */
.topnav a.active {
  background-color: #04AA6D;
  color: white;
}

/* 隱藏應在小屏幕上打開和關閉頂部導航的鏈接 */
.topnav .icon {
  display: none;
}

@media screen and (max-width: 600px) {
  .topnav a:not(:first-child) {display: none;}
  .topnav a.icon {
    float: right;
    display: block;
  }
}

@media screen and (max-width: 600px) {
  .topnav.responsive {position: relative;}
  .topnav.responsive .icon {
    position: absolute;
    right: 0;
    top: 0;
  }
  .topnav.responsive a {
    float: none;
    display: block;
    text-align: left;
  }
}

.container {
  padding: 20px;
  max-width: 400px;
  margin: 0 auto;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
  margin-top: 50px;
  width: 90%;
}

/* 統一登入輸入框的高度 */
.login-input {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 2px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 16px;
  height: 40px; /* 新增：固定高度 */
}

button {
  background-color: #04AA6D;
  color: white;
  padding: 14px 20px;
  margin: 8px 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  font-size: 16px;
}

button:hover {
  opacity: 0.8;
}

.cancelbtn {
  background-color: #f44336;
  width: auto;
  padding: 10px 18px;
  margin: 10px 0;
  border-radius: 4px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  padding-top: 60px;
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  border: 1px solid #888;
  width: 80%;
  -webkit-animation: animatezoom 0.6s;
  animation: animatezoom 0.6s;
  border-radius: 10px;
}

.close {
  position: absolute;
  right: 25px;
  top: 0;
  color: #000;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: red;
}

.password-message {
  text-align: center;
  font-size: 18px;
  color: #333;
}

.password-message button {
  width: 50%;
  margin: 10px auto;
}

@media (max-width: 600px) {
  .container {
      padding: 15px;
      width: 90%;
  }

  h2 {
      font-size: 18px;
  }

  button, .cancelbtn {
      font-size: 14px;
  }

  /* 確保手機版輸入框字體大小一致 */
  .login-input {
      font-size: 14px;
  }
}

/* 將 footer 的定位從 fixed 改為 relative，並使用 flexbox 讓它保持在底部 */
footer {
  background-color: #222;
  font-size: 14px;
  color: white;
  text-align: center;
  padding: 10px; /* 增加 padding 讓內容更舒適 */
  margin-top: auto; /* 讓 footer 推到頁面底部 */
  width: 100%;
  box-sizing: border-box; /* 確保 padding 不會增加寬度 */
}


#date {
  position: fixed;
  top: 50px;
  right: 5px;
  font-size: 1.2rem;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
@media (max-width: 600px) {
  #date {
      top: 50px;
      font-size: 0.8rem;
  }
}

#date2 {
  position: fixed;
  top: 10px;
  right: 5px;
  font-size: 1.2rem;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#clock {
  position: fixed;
  top: 85px;
  right: 5px;
  font-size: 1.2rem;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
@media (max-width: 600px) {
  #clock {
      top: 75px;
      font-size: 0.8rem;
  }
}

#clock2 {
  position: fixed;
  top: 45px;
  right: 5px;
  font-size: 1.2rem;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 移除 .con 樣式，因為將被 .log-section 和 .log-entry-card 取代 */
/* .con {
  display: inline-block;
  text-align: left;
  padding: 10px;
  margin-bottom: 20px;
} */

.copyBtn {
  background-color: #64c6ff;
  color: rgb(232, 233, 162);
  min-width: 80px; /* 設定最小寬度，避免太小 */
  max-width: 300px; /* 限制最大寬度，避免過長 */
  padding: 3px 10px;
  text-align: center;
  word-wrap: break-word;
  white-space: normal;
  font-size: 16px;
}

/* 切換開關容器 */
.toggle-container {
  position: fixed;   /* 固定定位，會依照視窗位置 */
  top: 120px;         /* 距離上方 90px */
  right: 15px;          /* 靠右顯示 */
  display: inline-block;
  width: 60px;
  height: 34px;
  cursor: pointer;
}
@media (max-width: 600px) {
  .toggle-container {
    top: 100px; 
  }
  }

/* 隱藏真正的 checkbox */
.toggle-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider 外框 */
.slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: background-color 0.4s;
  border-radius: 34px;
}

/* Slider 上的小圓球 */
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: #fff;
  transition: transform 0.4s;
  border-radius: 50%;
}

/* 當 checkbox 被勾選時改變背景顏色 */
input:checked + .slider {
  background-color: #4d4d4d;
}

/* 當勾選時移動小圓球 */
input:checked + .slider:before {
  transform: translateX(26px);
}

/* 太陽與月亮圖示樣式 */
.slider .icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  fill: #f39c12;
  transition: opacity 0.4s;
}

/* 太陽圖示置左 */
.slider .icon.sun {
  left: 6px;
  opacity: 1;
}

/* 勾選時隱藏太陽圖示 */
input:checked + .slider .icon.sun {
  opacity: 0;
}

/* 月亮圖示置右 */
.slider .icon.moon {
  right: 6px;
  opacity: 0;
  fill: #f1c40f;
}

/* 勾選時顯示月亮圖示 */
input:checked + .slider .icon.moon {
  opacity: 1;
}

/* 預設情況下隱藏手機內容 */
.mobile {
display: none;
}

/* 當螢幕寬度小於600px時，顯示手機內容，隱藏桌面內容 */
@media (max-width: 600px) {
.desktop {
    display: none;
}

.mobile {
    display: block;
}
}

/* 修復日誌整體容器樣式 */
.log-section {
  max-width: 800px; /* 增加最大寬度 */
  margin: 20px auto; /* 居中並增加上下間距 */
  padding: 0 10px; /* 左右內邊距 */
  text-align: left;
}

.log-section h4 {
  color: #333;
  font-size: 1.8em; /* 調整標題大小 */
  margin-bottom: 20px;
  border-bottom: 2px solid #eee; /* 添加底線 */
  padding-bottom: 10px;
  text-align: center; /* 標題居中 */
}

/* 暗黑模式下的修復日誌整體容器樣式 */
.dark-mode .log-section h4 {
  color: #F0F0F0;
  border-bottom-color: #444;
}

/* 單個日誌條目卡片樣式 */
.log-entry-card {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px; /* 卡片間距 */
  padding: 20px;
  text-align: left;
}

/* 暗黑模式下的單個日誌條目卡片樣式 */
.dark-mode .log-entry-card {
  background-color: #2a2a2a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.log-entry-card h4 {
  color: #333;
  font-size: 1.4em; /* 日期標題大小 */
  margin-bottom: 10px;
  display: flex; /* 讓日期和圖標對齊 */
  align-items: center;
  gap: 10px; /* 圖標和文字間距 */
  border-bottom: none; /* 移除日期標題的底線 */
  padding-bottom: 0;
}

.dark-mode .log-entry-card h4 {
  color: #F0F0F0;
}

.log-entry-card ul {
  list-style: none; /* 移除預設列表樣式 */
  padding: 0;
  margin: 0;
}

/* 自定義子項目符號 */
.log-entry-card ul li {
  margin-bottom: 8px;
  line-height: 1.6;
  color: #555;
  font-size: 1.1em; /* 調整內容字體大小 */
  position: relative; /* 用於 ::before 定位 */
  padding-left: 1.5em; /* 為自定義符號留出空間 */
}

.log-entry-card ul li::before {
  content: "\2022"; /* Unicode 圓點符號 */
  color: #28a745; /* 綠色 */
  font-size: 1.2em; /* 符號大小 */
  position: absolute;
  left: 0;
  top: 0.1em; /* 微調垂直位置 */
}

.dark-mode .log-entry-card ul li {
  color: #ccc;
}

/* 移除 .loc 相關樣式，因為已被 .log-entry-card 取代 */
/* .loc {
list-style: none;
padding: 0;
}
.loc > li {
font-weight: bold;
margin-top: 10px;
}
.loc ul {
margin: 5px 0 10px 20px;
padding: 0;
list-style-type: none;
}
.loc ul li {
font-weight: normal;
}

@media (max-width: 600px) {
.loc {
  font-size: 15px;
}
} */

.login-field {
margin: 4px 0; /* 減少外邊距，使字段更緊密 */
display: flex;
align-items: center; /* 垂直對齊標籤和輸入框 */
gap: 5px; /* 進一步減少標籤與輸入框之間的水平間距 */
}

.login-label h6 {
margin: 0; /* 移除 h6 標籤的默認外邊距 */
font-weight: bold; /* 保持粗體 */
flex-shrink: 0; /* 防止標籤被壓縮 */
font-size: 16px; /* 確保文字大小與輸入框匹配 */
}

/* login-input 已經在上面定義了，這裡不需要重複 */

.loading-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
justify-content: center;
align-items: center;
z-index: 1000;
}

.loading-content {
background: white; /* 預設亮色背景 */
padding: 20px;
border-radius: 8px;
text-align: center;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
align-items: center;
gap: 15px; /* 確保動畫和文字之間有間距 */
min-width: 200px;
}

.loader {
position: relative;
width: 2.5em;
height: 2.5em;
transform: rotate(165deg);
}

.loader:before, .loader:after {
content: "";
position: absolute;
top: 50%;
left: 50%;
display: block;
width: 0.5em;
height: 0.5em;
border-radius: 0.25em;
transform: translate(-50%, -50%);
}

.loader:before {
animation: before8 2s infinite;
}

.loader:after {
animation: after6 2s infinite;
}

@keyframes before8 {
0% {
    width: 0.5em;
    box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75), -1em 0.5em rgba(111, 202, 220, 0.75);
}

35% {
    width: 2.5em;
    box-shadow: 0 -0.5em rgba(225, 20, 98, 0.75), 0 0.5em rgba(111, 202, 220, 0.75);
}

70% {
    width: 0.5em;
    box-shadow: -1em -0.5em rgba(225, 20, 98, 0.75), 1em 0.5em rgba(111, 202, 220, 0.75);
}

100% {
    box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75), -1em 0.5em rgba(111, 202, 220, 0.75);
}
}

@keyframes after6 {
0% {
    height: 0.5em;
    box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75), -0.5em -1em rgba(233, 169, 32, 0.75);
}

35% {
    height: 2.5em;
    box-shadow: 0.5em 0 rgba(61, 184, 143, 0.75), -0.5em 0 rgba(233, 169, 32, 0.75);
}

70% {
    height: 0.5em;
    box-shadow: 0.5em -1em rgba(61, 184, 143, 0.75), -0.5em 1em rgba(233, 169, 32, 0.75);
}

100% {
    box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75), -0.5em -1em rgba(233, 169, 32, 0.75);
}
}

/* 暗黑模式下的載入動畫調整 */
.dark-mode .loading-content {
background: #222222; /* 暗黑模式下載入框背景 */
color: #F0F0F0; /* 文字顏色 */
}

.dark-mode .loading-overlay {
background: rgba(0, 0, 0, 0.7); /* 更深的背景遮罩 */
}

.password-container {
position: relative;
width: 100%;
}

/* 密碼輸入框的樣式，與 .login-input 共用高度設定 */
.password-container input {
width: 100%;
padding-right: 40px; /* 留空間給眼睛圖示 */
box-sizing: border-box;
}

.password-toggle {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
color: #666;
font-size: 16px;
}

/* 暗黑模式調整 */
.dark-mode .password-toggle {
color: #ccc; /* 暗黑模式下圖示顏色 */
}

/* 登入成功動畫 */

.checkbox-wrapper * {
-webkit-tap-highlight-color: transparent;
outline: none;
}

.checkbox-wrapper input[type="checkbox"] {
display: none;
}

.checkbox-wrapper label {
--size: 50px;
--shadow: calc(var(--size) * .07) calc(var(--size) * .1);
position: relative;
display: block;
width: var(--size);
height: var(--size);
margin: 0 auto;
background-color: #4158D0;
background-image: linear-gradient(43deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%);
border-radius: 50%;
box-shadow: 0 var(--shadow) #ffbeb8;
cursor: default;
overflow: hidden;
z-index: 1;
pointer-events: none; /* 禁止點擊 */
}

.checkbox-wrapper label:before {
content: "";
position: absolute;
top: 50%;
right: 0;
left: 0;
width: calc(var(--size) * .7);
height: calc(var(--size) * .7);
margin: 0 auto;
background-color: #fff;
transform: translateY(-50%);
border-radius: 50%;
box-shadow: inset 0 var(--shadow) #ffbeb8;
opacity: 0; /* 白色圓圈保持不可見 */
}

.checkbox-wrapper label:hover:before {
width: calc(var(--size) * .55);
height: calc(var(--size) * .55);
box-shadow: inset 0 var(--shadow) #ff9d96;
}

.checkbox-wrapper label:active {
transform: scale(0.9);
}

.checkbox-wrapper .tick_mark {
position: absolute;
top: -1px;
right: 0;
left: calc(var(--size) * -.05);
width: calc(var(--size) * .6);
height: calc(var(--size) * .6);
margin: 0 auto;
margin-left: calc(var(--size) * .14);
transform: rotateZ(-40deg);
z-index: 2;
}

.checkbox-wrapper .tick_mark:before {
content: "";
position: absolute;
background-color: #fff;
border-radius: 2px;
opacity: 0;
left: 0;
bottom: 0;
width: calc(var(--size) * .1);
height: calc(var(--size) * .3);
box-shadow: -2px 0 5px rgba(0, 0, 0, 0.23);
animation: showTickBefore 0.6s ease-in-out forwards;
animation-delay: 0s;
}

.checkbox-wrapper .tick_mark:after {
content: "";
position: absolute;
background-color: #fff;
border-radius: 2px;
opacity: 0;
left: 0;
bottom: 0;
width: 100%;
height: calc(var(--size) * .1);
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.23);
animation: showTickAfter 0.6s ease-in-out forwards;
animation-delay: 0.2s;
}

@keyframes showTickBefore {
from {
  transform: translateY(calc(var(--size) * -.68));
  opacity: 0;
}
to {
  transform: translate(0);
  opacity: 1;
}
}

@keyframes showTickAfter {
from {
  transform: translateX(calc(var(--size) * .78));
  opacity: 0;
}
to {
  transform: translate(0);
  opacity: 1;
}
}

/* 暗黑模式調整 */
.dark-mode .checkbox-wrapper label {
background-color: #5A67D8; /* 匹配暗黑模式按鈕顏色 */
background-image: linear-gradient(43deg, #5A67D8 0%, #C850C0 46%, #FFD983 100%); /* 更柔和的漸層 */
}

.dark-mode .checkbox-wrapper .tick_mark:before,
.dark-mode .checkbox-wrapper .tick_mark:after {
background-color: #F0F0F0; /* 匹配暗黑模式文字顏色 */
}

/* 調整 loading-content 樣式以確保勾選框動畫居中 */
.loading-content {
background: white;
padding: 20px;
border-radius: 8px;
text-align: center;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
align-items: center;
gap: 10px; /* 縮小間距以適應勾選框 */
min-width: 200px;
}

/* 手機端調整勾選框尺寸 */
@media (max-width: 600px) {
.checkbox-wrapper label {
  --size: 40px; /* 縮小勾選框尺寸 */
}
}
/*登入成功動畫結束*/

/* NEW tag styles */
.new-tag {
  background-color: #ff4d4d; /* Bright red for visibility */
  color: white;
  font-size: 0.7em;
  padding: 3px 8px;
  border-radius: 5px;
  margin-left: 10px;
  vertical-align: middle;
  animation: pulse 1.5s infinite alternate; /* Pulsing animation */
}

/* Dark mode for NEW tag */
.dark-mode .new-tag {
  background-color: #ff6b6b; /* Slightly lighter red for dark mode */
}

/* Pulse animation for NEW tag */
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}
