body {
    font-family: 'Arial', sans-serif;
    margin: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f8ff; /* 淺藍色背景 */
}
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 800px;
}
h1 {
    color: #33a072; /* 深綠色標題 */
}
#displayArea {
    border: 2px dashed #40a092;
    padding: 20px;
    margin: 20px 0;
    min-height: 100px;
    width: 100%;
    text-align: center;
    font-size: 1.5em;
    background-color: #fff; /* 白色背景 */
    border-radius: 15px; /* 圓角邊框 */
    transition: opacity 0.5s ease-in-out; /* 淡入淡出動畫 */
     position: relative; /* Add this line */
       display: none; /* 設定預設隱藏 */
}

#displayArea.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30vh;
    border: none;
    border-radius: 0;
    background-color: rgba(255, 255, 255, 0.9);

}
#settings {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}
#settings > * {
    margin: 5px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
}

#settingsArea {
    margin-top: 20px;
     width: 100%;
      border: 2px solid #d6e9c6;
    padding: 10px;
    background-color: #f8fff8;
    border-radius: 15px; /* 圓角邊框 */
        display: flex;
    flex-direction: column;
}
#settingsArea h2 {
      color: #33a072;
}

#databaseList, #addDatabaseForm {
    margin-top: 20px;
    width: 100%;
    border: 2px solid #d6e9c6;
    padding: 10px;
    background-color: #f8fff8;
    border-radius: 15px; /* 圓角邊框 */
}

#databaseList h2, #addDatabaseForm h2 {
    color: #33a072;
}

#databaseList ul, #addDatabaseForm ul {
    padding: 0;
    list-style: none;
    display: grid; /* 設定為 grid 佈局 */
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* 自動調整列數，最小寬度 120px */
    gap: 10px; /* 設定網格間距 */
}

#databaseList li, #addDatabaseForm li {
    padding: 10px;
    border: 1px solid #eee;
    text-align: center;
    border-radius: 8px;
     transition: background-color 0.2s ease;
}

#databaseList li:hover, #addDatabaseForm li:hover {
    background-color: #e0f2f1;
}



.icon {
    font-size: 1.5em;
    margin-right: 5px;
}

#speedButtons {
    display: flex;
    gap: 5px; /* 讓按鈕間有些間距 */
        justify-content: flex-end; /* 水平靠右對齊 */
    margin-top: 10px; /* 加上邊距 */
}

.speed-btn {
     padding: 10px;
     border: 1px solid #eee;
    text-align: center;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    cursor: pointer;
    background-color: #d3d3d3;
     color: #555;
    flex: 1;
}

.speed-btn:hover {
    background-color: #e0e0e0;
}

.speed-btn.active {
    background-color: #5cb85c; /* 預設綠色 */
    color: white;
}


#orderButtons {
    display: flex;
    gap: 5px; /* 讓按鈕間有些間距 */
      margin-top: 10px; /* 加上邊距 */
       width: 100%;
}

.order-btn {
     padding: 10px;
     border: 1px solid #eee;
    text-align: center;
    border-radius: 8px;
    transition: background-color 0.2s ease;
        cursor: pointer;
    background-color: #f0f0f0;
    color: #555;
        flex: 1;
}

.order-btn:hover {
      background-color: #e0e0e0;
}

.order-btn.active {
    background-color: #5bc0de; /* 淺藍色 */
    color: white;
}
#randomDbButton {
      padding: 10px;
     border: 1px solid #eee;
    text-align: center;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    cursor: pointer;
      background-color: #f0ad4e;
       color: white;
           margin-bottom: 10px;

}
 #randomDbButton:hover {
       background-color: #eea236;
}
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 1); /* 半透明黑色 */
    z-index: 999;
    display: none; /* 預設隱藏 */
}

#loopButtons {
    display: flex;
    gap: 5px; /* 讓按鈕間有些間距 */
      margin-top: 10px; /* 加上邊距 */
       width: 100%;
}

.loop-btn {
     padding: 10px;
     border: 1px solid #eee;
    text-align: center;
    border-radius: 8px;
    transition: background-color 0.2s ease;
        cursor: pointer;
    background-color: #f0f0f0;
    color: #555;
        flex: 1;
}

.loop-btn:hover {
      background-color: #e0e0e0;
}

.loop-btn.active {
    background-color: #428bca; /* 深藍色 */
    color: white;
}

@media (min-width: 600px) {
    .container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
    }
    #displayArea {
        width: 70%;
        margin: 20px;
    }
    #settings {
        flex-direction: column;
        width: 25%;
        margin: 20px;
    }
       #speedButtons {
            justify-content: flex-start; /* 水平靠左對齊 */
            margin-top: 0;
               width: 100%;
        }
        #orderButtons {
           margin-top: 0;
              width: 100%;
        }
         #loopButtons {
            justify-content: flex-start; /* 水平靠左對齊 */
            margin-top: 0;
               width: 100%;
        }
    #databaseList, #addDatabaseForm, #settingsArea {
        width: 90%;
    }
}