/* ===== CSS 變數 ===== */
:root {
  --sidebar-width: 220px;
  --content-padding: 20px;
  --content-padding-mobile: 20px;
  --transition-speed: 0.3s;

  /* Z-index 規範 */
  --z-sidebar: 1000;
  --z-header: 1100;
  --z-toggle: 1200;
  --z-modal: 2000;
  --z-lightbox: 9000;
}

/* 全域 box-sizing（確保 padding 包含在 width 內） */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 基本样式 */
html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: Roboto, sans-serif;
  overflow-x: hidden;
  max-width: 100vw;
}
  
  /* 整體容器 */
.container {
  /* width: calc(100vw - 220px); 
  margin-left: 220px;          */
  display: flex;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 左側側欄 *//*header.html*/
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: #2e2e2e;      /* 黑色背景 */
    display: flex;
    flex-direction: column;      /* 直向排列 */
    align-items: center;
    padding-top: 20px;
    box-sizing: border-box;
    z-index: var(--z-sidebar);

    transition: transform var(--transition-speed) ease;
    transform: translateX(0);
}

.sidebar.closed {
  transform: translateX(-100%);
}

/* 手機版 sidebar 開啟狀態 */
.sidebar.open {
  transform: translateX(0);
}
/* logo 圓形 */
.sidebar .circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 30px;
}
.sidebar .circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 導覽連結 */
.sidebar .nav-link {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 10px 20px;
    width: 100%;
    text-align: center;
    transition: background 0.3s;
}
.sidebar .nav-link:hover {
    background-color: #333;
    border-radius: 6px;
}
.menu-toggle {
    display: block;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: var(--z-toggle);
    font-size: 28px;
    cursor: pointer;
    color: #000000;
    transition: color var(--transition-speed) ease, left var(--transition-speed) ease;
  }
  .menu-toggle.active {
    color: #ffffff;
  }
/* 主內容區域 */
/* .main {
    margin-left: 220px;
    padding: 30px;
} */
 .main {
    width: 100%;
    padding: 30px;
  }

/* ===== 標準 Main Content（響應式） ===== */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
    min-height: 100vh;
    padding: var(--content-padding);
    box-sizing: border-box;
    overflow-x: hidden;
    background-color: #fff; /* 白色背景讓 padding 可見 */
    transition: margin-left var(--transition-speed) ease,
                width var(--transition-speed) ease;
}

/* Sidebar 收合時，main content 展開 */
body.sidebar-collapsed .main-content {
    margin-left: 0;
    width: 100%;
}


  /*對buttom 預設值做修改*/
  .button {
    appearance: none;
    text-rendering: auto;
    color: buttontext;
    letter-spacing: normal;
    word-spacing: normal;
    line-height: normal;
    text-transform: none;
    text-indent: 0px;
    text-shadow: none;
    display: inline-block;
    text-align: center;
    align-items: flex-start;
    cursor: pointer;
    box-sizing: border-box;
    background-color: transparent; /* Remove background color */
    margin: 0em;
    padding-block: 1px;
    padding-inline: 6px;
    border: none; /* Remove border */
  }
  button:hover,
  button:focus,
  button:active {
    background-color: transparent;
    box-shadow: none;
    outline: none;
  }
  
  /* title -> trademark comparison */
  .logo-icon {
    width: 48px;
    height: 48px;
    vertical-align: middle;
    margin-right: 8px;
  }
  .title {
    color: #000000;
    font-size: 30px;
    font-weight: 400;
    background-color: transparent; /* Remove background color */
    border: none; /* Remove border */
  }
  
  .section-title {
    color: #000000;
    font-size: 30px;
    font-weight: 700; /* 加粗 */
    text-align: center;
    width: 100%; /* 占满容器宽度 */
    margin-bottom: 20px;
  }
  
  .section-subtitle , .no-features-message {
    color: #000000;
    font-size: 20px;
    font-weight: 300;
    text-align: center;
    width: 100%; /* 占满容器宽度 */
    margin-bottom: 25px;
  }
  
  .feature-selection-container {
    display: flex;
    justify-content: center; /* 在图片之间添加空间 */
    gap: 5px; /* 控制图片之间的距离 */
  }
  
  .feature-selection-item {
    font-size: 25px;
    margin: 10px; /* 调整元素之间的距离 */
  }
  
  .result-gallery {
    display: flex; /* 让图片并排 */
    justify-content: center; /* 在图片之间添加空间 */
    gap: 5px; /* 控制图片之间的距离 */
  }
  
  .feature-images {
    color: #000000;
    font-size: 25px;
    font-weight: 800;
    text-align: left;
    margin: 0;
    margin-bottom: 20px;
  }
  
  /*buttom*/
  .result-description {
    color: #000000;
    font-size: 25px;
    font-weight: 800;
    width: 400px;
    text-align: center;
    margin: 0;
    margin-bottom: 20px;
    background-color: transparent; /* Remove background color */
    border: none; /* Remove border */
  }
  .result-description:hover{
    color: blue;
    background-color: white;
  }
  
  .feature-result-description{
    color: #000000;
    font-size: 25px;
    font-weight: 800;
    width: 400px;
    text-align: center;
    margin: 0;
    margin-bottom: 20px;
  }
  .feature-images-description {
    color: #000000;
    font-size: 25px;
    font-weight: 800;
    width: auto;
    text-align: center;
    margin: 0;
    margin-bottom: 20px;
  }
  
  
  .result-value {
    color: #000000;
    font-size: 25px;
    font-weight: 400;
    width: 400px;
    text-align: center;
    margin: 0;
  }
  
  .result-change {
    color: #000000;
    font-size: 20px;
    font-weight: 400;
    text-align: left;
    margin: 0;
  }
  
  .image-description {
    color: #000000;
    font-size: 20px;
    font-weight: 400;
    text-align: left;
    margin: 0;
  }

  
  /* 内容 */
  .content {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
  }
  
  .section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: auto;
  }
  
  .upload-container {
    width: 1000px;
    height: 300px;
    border: 2px solid black;
    margin: 30px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-radius:5px;
  }
  
  .image-upload {
    border: 2px solid black;
    padding: 20px;
    text-align: center;
    height: 150px;
    border-radius:5px;
    /* margin-left: 220px; */
  }
  .upload-image-box{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    margin: 10px;
    overflow: hidden; /* 確保圖片不會超出框框 */
  }
  
  .upload-image-box img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 保持圖片比例並完整顯示 */
  }
  .image-box {
    border: 2px solid black;
    padding: 20px;
    text-align: center;
    width: 250px;
    height: 150px;
    border-radius:5px;
    overflow: hidden; /* 確保圖片不會超出框框 */
  }
  
  .image-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .image-info {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明背景，便於閱讀文字 */
    color: white;
    padding: 3px 5px;
    font-size: 12px;
    border-radius: 3px;
}
.process-time {
  display: block;
  text-align: center;
  font-size: 18px;
  margin-top: 20px; /* 與上方內容的距離 */
  color: #333; /* 文字顏色 */
}
  
  /*一開始上傳照片的按鈕 ＆ 局部比對上傳按鈕*/
  .upload-button {
    padding: 6px 12px;
    border: 1px solid black;
    background-color: white;
    cursor: pointer;
    border-radius:5px;
    cursor: pointer; 
    transition: background-color 0.3s ease; /*過度效果*/
  }
  .submitImage-button , .feature-upload-button{
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 300px;
    height: 45px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    margin: 10px auto; /* auto 水平置中 */
    background-color: #ccc; /* 添加背景色 */
    color: rgb(0, 0, 0); /* 改变文字颜色 */
    cursor: pointer; /* 当鼠标移至按钮上时，改变鼠标指针 */
    transition: background-color 0.3s ease; /* 添加过渡效果 */
  }
  .submitImage-button:hover:not(:disabled) {
    /* background-color: #45a049;  */
    background-color: #323131; 
  }
  .submitImage-button:disabled {
    background-color: #d3d3d3; /* 禁用時的背景顏色 */
    color: #a0a0a0;            /* 禁用時的文字顏色 */
    border: 1px solid #a0a0a0; /* 禁用時的邊框顏色 */
    cursor: not-allowed;       /* 禁用時的鼠標圖示 */
    opacity: 0.8;              /* 禁用時的透明度 */
    box-shadow: none;          /* 去除陰影效果 */
    text-shadow: none;         /* 去除文字陰影 */
    transition: none;          /* 禁用狀態下無過渡效果 */
  }

  /*滑鼠移上去時改變背景顏色*/
  .upload-button:hover ,.feature-upload-button:hover, .submitImage-button:hover {
    background-color: #323131; 
  }
  
  .feature-upload-button-container {
    display: flex; /* 使用 flexbox 进行布局 */
    align-items: center; /* 垂直居中按钮 */
    justify-content: center; /* 水平居中按钮 */
  }
  
  .divider {
    width: 100%;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 20px 0;
  }
  
  .feature-divider {
    border-left: 1px solid #000; /* 添加一個黑色的垂直分隔線 */
    margin: 0 10px; /* 添加一些間距，使得分隔線不會貼近內容 */
  }
  
  .image-gallery {
    display: flex;
    justify-content: space-around;
    width: 100%;
  }
  
  .image-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
  }
  
  .image-caption {
    font-size: 14px;
    color: #999999;
  }
  
  .comparison-result {
    display: flex;
    flex-direction: column; /* 让结果项目垂直排列 */
    width: 100%;
    gap: 10px; /* 在结果项目之间添加间隙 */
  }
  
  .result-item {
    width: 100%; /* 设置每个项目的宽度并减去间隙 */
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 25%; /*按比例分配空間 按比例縮小 每個項目佔據寬度趴數*/

    padding: 20px;
    border: 1px solid #000000; /* 添加边线并设置颜色 */
    border-radius: 6px; /* 添加边框圆角 */
  }
  
  .result-items-row {
    display: flex;
    justify-content: center; /* 水平居中 */
    gap: 20px; 
    width: 100%; 
    margin: 0 auto; 
    margin-bottom: 40px;
    flex-wrap: wrap; 
    /* justify-content: space-between;  */
  }
  
  .result-container {
    justify-content: space-between;
    margin-bottom: 20px;
    margin-right: 50px;
    margin-left: 50px;
    gap: 40px;
  }
  
  .feature-selection-row1, .feature-selection-row2 {
    display: flex;
    justify-content: center; /* 水平居中 */
    flex-direction: row;
    gap: 20px; /* 在結果項目之間添加20像素的間隙 */
    width: 100%; /* 占滿容器寬度 */
    margin: 0 auto; /* 自動設置左右外邊距 */
  }
  
  .feature-selection-item {
    width: 200px; /* 設置框框的寬度 */
    height: 200px; /* 設置框框的高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #000; /* 可選，設置邊框 */
    overflow: hidden;
  }
  
  .feature-selection-item img {
    width: 100%; /* 讓圖片寬度填滿框框 */
    height: 100%; /* 讓圖片高度填滿框框 */
    object-fit: contain; /* 確保圖片不會變形 */
  }
  
  .feature-selection-item input[type="checkbox"] {
    display: none; /* 隱藏複選框 */
  }
  
  .feature-selection-item label {
    cursor: pointer; /* 設置滑鼠指針樣式 */
    width: 100%; /* 確保標籤寬度填滿框框 */
    height: 100%; /* 確保標籤高度填滿框框 */
  }
  
  .feature-selection-item input[type="checkbox"]:checked + label img {
    border: 2px solid #007BFF; /* 當選中時更改邊框顏色 */
  }
  
  .partial-image-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    
  }
  
  .footer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px 0;
  }

  .footer-text {
    text-align: center;
  }
  /* ===== RWD 響應式設計 ===== */

  /* 平板以上 (桌面版) */
  @media (min-width: 769px) {
    .sidebar {
      transform: translateX(0);
    }
  }

  /* 平板以下 (手機版) */
  @media (max-width: 768px) {
    /* Sidebar 預設隱藏 */
    .sidebar {
      transform: translateX(-100%);
    }

    /* Sidebar 開啟時 */
    .sidebar.open {
      transform: translateX(0);
    }

    /* Main content 佔滿寬度 */
    .main-content {
      margin-left: 0;
      width: 100%;
      max-width: 100vw; /* 覆蓋桌面版的 max-width 限制 */
      padding: var(--content-padding-mobile);
      background-color: #fff; /* 確保手機版也有白色背景 */
      box-sizing: border-box;
      overflow-x: hidden;
    }

    /* 漢堡選單始終顯示並保持黑色 */
    .menu-toggle {
      display: block;
      color: #000;
    }
    .menu-toggle.active {
      color: #fff;
    }

    .content, .section {
      width: 100%;
      max-width: 100%; /* 確保不超出父容器 */
      box-sizing: border-box;
      font-size: 0.9em;
    }

    /* 隱藏導航欄，添加漢堡菜單按鈕 */
    .nav {
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: 100%;
        align-items: center;
    }
    .nav a {
      color: #000000;
      font-size: 0.9em;
      text-decoration: none;
      font-weight: 450;
    }

    .nav.show {
        display: flex;
    }

    .nav-link {
        color: #fff;
        text-decoration: none;
        font-size: 16px;
        padding: 8px 0;
        width: 100%;
        text-align: center;
        transition: background 0.3s;
    }
    .upload-container {
        width: 95vw;
        justify-content: center;
        margin-left: 0 !important;
    }
    .upload-button {
        font-size: 1.2em;
        width: 100%;
    }
    .image-box {
      width: 160px;
      height: 160px;
      margin: 0;
    }
    .comparison-result {
      flex-direction: column;
      align-items: center;
    }

    .result-item {
      width: 100%;
    }
    .feature-selection-row1, .feature-selection-row2 {
        flex-direction: column;
    }
    .textarea-container {
        flex-direction: column;
    }

    .container,
    .main {
      margin-left: 0;
      width: 100vw;
    }

    .image-upload {
      margin-left: 0;
    }

    /* Section title 手機版不需 margin-left */
    .section-title {
      margin-left: 0 !important;
      width: 100% !important;
    }

    /* Footer 手機版置中 */
    .footer-text {
      margin-left: 0 !important;
    }
  }
  
