#test {
  border: 1px solid #000;
  border-style: dashed;
  border-width: thin;
}

:root {
  --bodycolor: #f0f3c8;
  --navcolor: #009f8c;
  --headercolor: #89a7b4;
  --asidecolor: #8ebdc6;
  --footercolor: #6aa994;
  --leftwight: 80%;
}

/* 管理端 
  --bodycolor: #af7ab3;
  --navcolor: #80558c;
  --leftupcolor: #e1c4e1;
  --leftcentercolor: #e1c4e1;
  --rightcolor: #bb69bb;
  --downcolor: #94548c;
  --leftwight: 75%;*/
html,
body {
  width: 100%;
  height: 100%;
  background-color: var(--bodycolor);
  /* background-image: url("../img/xmas.jpg"); */
  /* background-size: cover; */
  /* background-position: center; */
  /* background-attachment: fixed; */
}

body>nav {
  height: 40px;
  background-color: var(--navcolor);
  font-size: 1.2rem;
  color: #fff;
}

main {
  position: relative;
  height: calc(100% - 40px);
  /* height: 100%; */
}

section {
  width: var(--leftwight);
  height: 100%;
  float: left;
  display: flex;
  /* (先從上到下，再由左至右) */
  flex-direction: column;
}

header {
  color: #fff;
  background-color: var(--headercolor);
}

article {
  overflow-y: scroll;
  height: 100%;
  padding-top: 10px;
  padding-bottom: 75px;
}

article::-webkit-scrollbar {
  width: 5px;
  /* 設定寬度，讓它更易於點擊 */
}

article::-webkit-scrollbar-thumb {
  background-color: #dfdfdf;
  /* 滑塊顏色 */
  border-radius: 10px;
  /* 增加圓角 */
}

article::-webkit-scrollbar-thumb:hover {
  background-color: #707070;
  /* 懸停時顏色變深 */
}

aside {
  padding: 1px;
  height: 100%;
  background: var(--asidecolor);
  overflow-y: scroll;
  padding-bottom: 5px;
}

aside::-webkit-scrollbar {
  width: 5px;
  /* 設定寬度，讓它更易於點擊 */
}

aside::-webkit-scrollbar-thumb {
  background-color: #dfdfdf;
  /* 滑塊顏色 */
  border-radius: 10px;
  /* 增加圓角 */
}

aside::-webkit-scrollbar-thumb:hover {
  background-color: #707070;
  /* 懸停時顏色變深 */
}

footer {
  /* 定位與尺寸 */
  position: absolute;
  /* 絕對定位 */
  bottom: 10px;
  /* 距離底部 10 像素 */
  left: 50%;
  /* 距離左側 50% */
  transform: translateX(-50%);
  /* 水平居中 */
  width: fit-content;
  /* 寬度適應內容 */
  min-width: 50%;
  /* 最小寬度為父容器的 50% */
  max-width: 90%;
  /* 最大寬度為父容器的 90% */
  height: auto;
  /* 高度根據內容自動調整 */

  /* 彈性佈局 */
  display: flex;
  /* 啟用 Flexbox 佈局 */
  flex-wrap: wrap;
  /* 允許項目換行 */
  align-items: center;
  /* 垂直居中對齊每行的內容 */
  justify-content: left;
  /* 按鈕在每行中水平靠左對齊 */

  /* 視覺效果 */
  white-space: nowrap;
  /* 防止內容換行，直到 flex-wrap 起作用 */
  border-radius: 15px;
  /* 圓角半徑 */
  padding: 3px 0;
  /* 內邊距 */
  box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.2);
  /* 盒子陰影 */
  border: 1px solid rgba(255, 255, 255, 0.5);
  /* 邊框 */

  /* 特殊行為 */
  isolation: isolate;
  /* 創建新的堆疊上下文，用於隔離混合模式或確保特定渲染行為 */
  /* cursor: pointer; */
  /* 如果需要互動，可以取消註釋此行使鼠標懸停時顯示手型 */
}

footer::before {
  /* content: ''; */
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 30px;
  box-shadow:
    inset 0 0 3px -5px rgba(255, 255, 255, 0.5);
  background-color: rgba(255, 255, 255, 0.2);
}

footer::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 30px;
  backdrop-filter: blur(4px);
  filter: url(#glass-distortion);
  isolation: isolate;
  -webkit-backdrop-filter: blur(4px);
  -webkit-filter: url("#glass-distortion");
}

/* ---按鈕--- */
.tool-btn {
  /* 尺寸調整 - 稍微縮小 */
  width: 3.6rem;
  height: 3.2rem;
  padding: 0.4rem 0.2rem;
  font-size: 11px;

  /* 外觀設計 */
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: rgba(53, 94, 59, 0.92);
  color: #fff;

  /* 陰影與模糊效果 */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.6);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.15),
    0 1px 2px rgba(0, 0, 0, 0.1);

  /* 布局與過渡 */
  margin: 2px;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* 性能優化 */
  isolation: isolate;
  opacity: 0.96;
  position: relative;
}

.tool-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 10px;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.05) 50%,
      rgba(255, 255, 255, 0) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    inset 0 -1px 1px rgba(0, 0, 0, 0.1);
}

.tool-btn:hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.2),
    0 6px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.tool-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.tool-btn1 {
  background: rgba(53, 94, 59, 0.95);
}

.tool-btn2 {
  background-color: rgba(91, 59, 110, 0.95);
}

.tool-btn3 {
  background-color: rgba(32, 91, 128, 0.95);
}

.tool-btn4 {
  background-color: rgba(161, 77, 30, 0.95);
}

/* ---按鈕END--- */
/* 寬度小於1366套用 */
@media only screen and (max-width: 1366px) {
  .tool-btn {
    font-size: 11px;
    width: 3rem;
    height: 3rem;
    padding: 0.3rem 0.1rem;
    margin: 0;
  }

  table,
  table h4,
  table h5,
  table a {
    font-size: 12px;
  }
}

/* 寬度小於600套用 */
@media (max-width: 600px),
(max-height: 600px) {
  nav {
    height: unset;
  }

  section {
    width: 100%;
    height: unset;
  }

  article {
    overflow: scroll;
    height: unset;
  }

  aside {
    height: unset;
    clear: both;
  }

  footer {
    position: relative;
    bottom: -315px;
    /* height: unset; */
    clear: both;
  }

  .btngroup {
    display: none;
    position: fixed;
    top: 50px;
    width: 130px;
    background-color: rgba(0, 0, 0, 0.215);
    padding: 3px;
    margin: 5px;
  }

  .order_input {
    min-width: fit-content;
  }

  .order_input td,
  .order_input input {
    padding: 0;
    width: 6ch;
  }
}

/* 跑馬燈用 */
div#abgne_marquee {
  position: relative;
  overflow: hidden;
  /* 超出範圍的部份要隱藏 */
  height: 30px;
  background-color: rgb(194, 120, 120);

}

div#abgne_marquee ul,
div#abgne_marquee li {
  padding: 0;
  list-style: none;
}

div#abgne_marquee ul {
  padding: 0;
  list-style: none;
  position: absolute;
  font-size: 20px;
  color: floralwhite;
}

/* 跑馬燈用 */


/*讀取中*/

/* 讀取中 */
#overlay {
  z-index: 99;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  /*半透明的黑色背景*/
  display: none;
  /*初始時隱藏*/
}

.loading,
.loading>div {
  position: relative;
  box-sizing: border-box;
}

.loading {
  display: block;
  font-size: 0;
  color: #ffffff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
}

.loading.la-dark {
  color: #0000008c;
}

.loading>div {
  display: inline-block;
  float: none;
  background-color: currentColor;
  border: 0 solid currentColor;
}

/* .loading {
  width: 54px;
  height: 18px;
} */

.loading>div {
  width: 20px;
  height: 20px;
  margin: 5px;
  border-radius: 100%;
  animation: ball-pulse-sync 0.6s infinite ease-in-out;
}

.loading>div:nth-child(1) {
  animation-delay: -0.14s;
}

.loading>div:nth-child(2) {
  animation-delay: -0.07s;
}

.loading>div:nth-child(3) {
  animation-delay: 0s;
}

.loading.la-sm {
  width: 26px;
  height: 8px;
}

.loading.la-sm>div {
  width: 4px;
  height: 4px;
  margin: 2px;
}

.loading.la-2x {
  width: 108px;
  height: 36px;
}

.loading.la-2x>div {
  width: 20px;
  height: 20px;
  margin: 8px;
}

.loading.la-3x {
  width: 162px;
  height: 54px;
}

.loading.la-3x>div {
  width: 30px;
  height: 30px;
  margin: 12px;
}

@keyframes ball-pulse-sync {
  33% {
    transform: translateY(100%);
  }

  66% {
    transform: translateY(-100%);
  }

  100% {
    transform: translateY(0);
  }
}

.loadingtext {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 18px;
  text-align: center;
  letter-spacing: 2px;
}

/*讀取中*/


/**********************************************/

/* 移动端菜单样式 */
.navbar-toggler {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  padding: 0.5rem;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 40px;
  left: 0;
  width: 250px;
  background: var(--navcolor);
  padding: 1rem;
  z-index: 1000;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
}

.mobile-btn {
  display: flex;
  align-items: center;
  padding: 0.8rem;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-btn i {
  margin-right: 1rem;
  width: 20px;
  text-align: center;
}

.mobile-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* 响应式样式 */
@media (max-width: 768px) {
  .navbar-toggler {
    display: block;
  }

  .desktop-menu {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  footer {
    padding-bottom: 60px;
  }
}


/* 除厝程式碼 */
pre {
  background-color: #000000ef;
  border: 2px solid #15ff00ff;
  color: green;
  padding: 5px;
  max-width: 25%;
  font-size: 0.8rem;
  line-height: 1;
  position: fixed;
  top: 3px;
  left: 3px;
  max-height: 80%;
  overflow: auto;
  z-index: 100;
  /* background-color: #2a0000ef;
        border: 2px solid #ff0000ff;
        color: red; */
}

pre::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

/* 除厝程式碼END */



/* 即時訊息程式碼 */
/* ------------------------------------------------------------------- */
/* 核心容器設置 (取代 .chat-card) */
/* ------------------------------------------------------------------- */
.chat-card {
  /* 移除固定的 height: 500px; */
  height: 600px;
  /* 使用視窗高度比例 (例如 90%) 作為最大高度，實現自適應 */
  min-height: 330px;
  /* 設定最小高度，避免過小 */

  width: 100%;
  max-width: 450px;
  margin: 3px auto;
  /* 上下留白，並保持置中 */

  border: none;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  /* 增強陰影效果 */
  /* 使用更柔和的背景漸變 */
  background: linear-gradient(135deg, #ffffff 0%, #f7f7f7 100%);

  /* 啟用 Flexbox 垂直佈局，以便讓內容區自適應高度 */
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------------- */
/* 標題/狀態區 (取代 .card-header 角色) */
/* ------------------------------------------------------------------- */
/* HTML 中沒有 .card-header，因此我們針對 .d-flex.justify-content-between 進行美化 */
.chat-card .d-flex.justify-content-between.align-items-center.mb-2 {
  /* 使用 p-3 替代原有的 p-2 讓上下空間更充足 */
  padding: 10px 15px 5px 15px;
  border-bottom: 1px solid #eeeeee;
  /* 添加一條細分隔線 */
}

/* 讓您的標題 "尋框園" 更突出 */
.chat-card .chat-header-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #495057;
  /* 深灰色 */
  margin: 0;
  line-height: 1;
  /* 確保與 badge 對齊 */
}

/* 狀態標籤 (ws-status) 美化 */
.chat-card #ws-status {
  font-size: 0.8rem;
  padding: 0.3em 0.7em;
  border-radius: 10px;
  font-weight: normal;
  background-color: #6c757d !important;
  /* 預設為中性色 */
}

/* ------------------------------------------------------------------- */
/* 內容訊息區域 (取代 .chat-card-body 角色) */
/* ------------------------------------------------------------------- */
.chat-card .card-body {
  /* 關鍵：讓內容區佔據所有剩餘空間 */
  flex-grow: 1;
  padding: 0 15px;
  /* 移除垂直 padding，讓訊息列表貼邊 */
  overflow-y: hidden;
  /* 確保 .card-body 容器本身不滾動 */

  /* 覆寫 Bootstrap 的 p-2 類 */
  padding-top: 5px !important;
  padding-bottom: 5px !important;
}

/* 訊息列表容器 (ws-messages) - 負責滾動 */
.chat-card #ws-messages {
  flex-grow: 1;
  /* 佔滿 .card-body 內的剩餘空間 */
  overflow-y: auto;
  /* 啟用垂直滾動條 */
  padding-right: 5px;
  /* 為滾動條留出空間，避免內容被遮擋 */
  list-style: none;
  /* 移除列表標記 */
  padding-left: 0;
  margin-bottom: 0;
}

/* 訊息項目 (li) 基礎樣式 */
.chat-card #ws-messages li {
  padding: 5px 0;
  word-wrap: break-word;
  /* 防止長單詞溢出 */
  border-bottom: 1px dotted #e9ecef;
  /* 細微分割線 */
}

.chat-card .delete-message {
  color: #dc3545;
  margin-left: 5px;
  font-size: 12px;
  padding: 2px 6px;
  border: none;
  background: transparent;
}

.chat-card .user-name {
  text-decoration: underline;
  cursor: pointer;
  color: #007bff;
}

/* ------------------------------------------------------------------- */
/* 底部輸入區域 (card-footer) */
/* ------------------------------------------------------------------- */
.chat-card .card-footer {
  /* 底部有輕微陰影或不同的背景，讓它與內容區分隔 */
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;

  /* 增加 padding */
}

.chat-card .card-footer .form-control {
  border-radius: 20px 0 0 20px;
  /* 圓角輸入框 */
  border-color: #ced4da;
}

.chat-card .card-footer .btn {
  background-color: #007bff;
  /* 藍色傳送按鈕 */
  color: white;
  font-weight: 500;
  border-radius: 0 20px 20px 0;
  transition: background-color 0.2s;
}

.chat-card .card-footer .btn:hover {
  background-color: #0056b3;
}

/* 即時訊息程式碼END */