/* 為 Webkit 瀏覽器設置滾動條樣式 */
::-webkit-scrollbar {
  width: 9px; /* 滾動條的寬度 */
  height: 9px; /* 水平滾動條的高度 */
}

::-webkit-scrollbar-track {
  background-color: #f0f0f0; /* 滾動條的背景 */
  border-radius: 4px; /* 使滾動條的背景有圓角 */
}

::-webkit-scrollbar-thumb {
  background-color: #ccc; /* 滾動條的顏色 */
  border-radius: 4px; /* 使滾動條的滑塊有圓角 */
  border: 2px solid #fff; /* 滑塊周圍的邊框，與背景顏色匹配 */
}

::-webkit-scrollbar-thumb:hover {
  background-color: #999; /* 滑塊懸停時顏色 */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: PMingLiU;
  background: #fff;
}
ul, li {
  list-style-type: none;
}
.listicon {
  width: 12px;
  height: 12px;
  margin-right: 5px;
}
.logoutbt {
  display: flex;
  flex-direction: row;
  align-items: center;
}
/*li.uparrow {
  list-style-image: url("../pic/up-arrow_.svg");
}
li.downarrow {
  list-style-image: url("../pic/down-arrow_.svg");
}
li.rightarrow {
  list-style-image: url("../pic/right-arrow.svg");
}
ul.disc, li.disc {
  list-style-type: disc;
}*/
/* 手機版開關按鈕 */
.toggle-btn {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 100;
  background: #333;
  color: white;
  padding: 10px 12px;
  border: none;
  border-radius: 4px;
}

/* 主體 */
.container {
  display: flex;
  height: 100vh;
}

/* 側邊欄 */
.sidebar {
  width: 260px;
  background: #f9f9f9;
  /*color: white;*/
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
}

/* 可滾動區域 */
.sidebar-scroll {
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 120px; /* 預留底部空間給 user-info */
}

/* 小分類 */
.category {
  /*margin-bottom: 20px;*/
}

.cat-title {
  font-size: 18px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 5px;
  cursor: pointer;
}

.cat-items {
  margin-top: 10px;
  margin-left: 10px;
  /*display: none;  /* 初始為隱藏 */
}

.cat-items a {
  text-decoration: none;
  display: block;
  padding: 8px;
  border-radius: 4px;
  background: #f9f9f9;
  margin-bottom: 5px;
  color: black;
}

.cat-items .leftBt:hover {
  background: #555;
  color: white;
}
.cat-items .leftBt {
  text-decoration: none;
  display: block;
  padding: 8px;
  border-radius: 4px;
  background: #f9f9f9;
  margin-bottom: 5px;
  color: black;
}

.cat-items .leftBt:hover {
  background: #555;
  color: white;
}
.leftBt {
  cursor: pointer;
}
.leftBt.focus, .historyBlock.focus {
  background-color: #222;
  color: #999;
}

.historyBlock {
  cursor: pointer;
}
/* 使用者資訊 */
.user-info {
  display: flex;
  align-items: center;
  position: absolute;
  bottom: 0px;
  left: 0px;
  right: 0px;
  text-align: center;
  padding: 10px;
  background: #f9f9f9;
  justify-content: space-between;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 15px;
  cursor: pointer;
  position: relative;
}

/* 懸浮選單 */
.userInfo {
  border: solid;
  border-radius: 50%; 
  border-color: dimgray;
  margin-top: 3px;
  width: 40px;
  height: 40px;
  background-image: url("../pic/user.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
.userInfo:hover {
  cursor: pointer;
  background-image: url("../pic/userhover.png");
}
.dropdownMenu {
  display: none;
  position: absolute;
  background-color: #f1f1f1;
  min-width: 160px;
  box-shadow: 1px 8px 16px 1px rgba(0,0,0,0.2);
  z-index: 1;
  border-width: thin;
  border-radius: 8px;
  top: -20px;
  left: 15px;
}
.dropdownMenu div {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  border-radius: 8px;
}
.dropdownMenu div:hover {
  background-color: #ddd;
}
.userInfo:hover .dropdownMenu {display: block;}

/*按鈕*/
.button {
  text-align: center;
  cursor: pointer;
  border-style: outset;
}
.button:hover {
  border-style: inset;
}
.button:disabled {
  cursor: not-allowed;
}

.updatebt {
  border-radius: 5px;
}
/*textarea*/
textarea.quanset {
  resize: none;
}
/* 內容區 */
.rightContent {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: white;
}

.homebt {
  display:flex; 
  flex-direction:row; 
  float:left;
  padding: 2px 10px;
  cursor: pointer;
  /*color: #ddd;*/
  font-size: large;
}
.homebtIcon {
  width: 20px;
  margin-right: 5px;
}

.dropContent {
  /*display: none;*/
  position: absolute;
  background-color: #f1f1f1;
  /*min-width: 400px;*/
  width: max-content;
  box-shadow: 1px 8px 16px 1px rgba(0,0,0,0.2);
  z-index: 10;
  border-width: thin;
  border-radius: 8px;
  top: 0;
  right: 60px;
}
.dropContent div {
  color: black;
  padding: 2px 5px;
  text-decoration: none;
  display: block;
  border-radius: 8px;
}
.dropbt {
  background: #0000;
  /*color: #fff;*/
  width: 70px;
  border-radius: 8px;
  cursor: pointer;
}
.dropbt:hover {
  background: #000;
  color: #fff;
  width: 70px;
}
tr.highlight {
  /*border-color: bisque;*/
  background-color: #aaa;
}
td.btCol {
  position: relative;
}
td>a {
  text-decoration: none;
  color: #222;
  margin-left: 5px;
}
.editbt {
  min-width: 40px;
  cursor: pointer;
}

.orderTable {
  width: 100%;
  margin-top: 25px;
  margin-left: 0%;
  text-align: center;
}

.hid, .hide, .hide2 {
  display: none;
}
.kwContent {
  width: 100%;
}
.half {
  width: 50%;
}
.col {
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  flex-direction: row;
}
.flexCenter {
  display: flex;
  justify-content: center;
  align-content: center;
}
.flexCenterV {
  display: flex;
  justify-content: center;
  align-items: center;
}
/* Order */
form#insert input:not([type="button"]),form#insert select {
  background: #0000;
  border-radius: 10px;
  padding: 5px;
  border-color: #ccc;
  margin: 3px;
}
input[type="button"] {
  cursor: pointer;
}
input:disabled {
  cursor: not-allowed;
}
form#insert input[type="button"] {
  padding: 5px;
  border: solid;
  border-radius: 15px;
  font-size: medium;
  border-style: outset;
  border-color: dimgray;
  background: #fffa;
}
form#insert input[type="button"]:hover {
  border-style: inset;
  color: #eee;
  background: #999;
}
form#insert option {
  background: #F9F9F9;
}

/* 響應式 - 手機版 */
@media (max-width: 768px) {
  .toggle-btn {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    transition: 0.3s;
    z-index: 99;
  }

  .sidebar.active {
    left: 0;
  }

  .content {
    margin-left: 0;
  }

  .half {
    width: 100%;
  }
  table#kwtable {
    font-size: 12px; 
    width: 100%;
    table-layout: auto;
    box-sizing: border-box;
  }
  th, td {
    padding: 6px;
  }
  th {
    white-space: nowrap;
  }
  .dropContent {
    right:5px;
    max-width: calc(100vw - 80px); 
    overflow: auto;
  }
  .kwContent {
    box-sizing: border-box;
    overflow-x: auto;
    padding: 0; /* 移除可能的padding */
  }
  .kwContent.flexCenter {
    display: block; /* 改為 block */
    width: 100%;
  }
}