/* 通用樣式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-gap: 20px;
    margin-bottom: 30px;
}

/* 設定 body 樣式 */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    padding: 20px;
}

/* 設定 header 樣式 */
header {
    background: none; /* 移除背景色 */
    padding: 20px;
}

/* 設定 nav 樣式 */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 設定 nav 中的連結樣式 */
nav a {
    color: #333; /* 更改字體顏色為深灰色 */
    text-decoration: none;
    padding: 8px;
    margin-right: 10px;
    font-size: 1.1rem;
    transition: background-color 0.3s ease; /* 添加過渡效果 */
}

/* 設定 nav 中最後一個連結的樣式 */
nav a:last-child {
    margin-right: 0;
}

/* 設定 nav 中連結滑過時的樣式 */
nav a:hover {
    background-color: #f0f0f0; /* 更新滑過時的背景顏色為淺灰色 */
    border-radius: 5px;
}

/* 設定 nav 中 logo 的樣式 */
nav .logo {
    color: #333; /* 更改字體顏色為深灰色 */
    font-size: 1.5rem;
    font-weight: bold;
}

/* 設定 section 樣式 */
section {
    margin-bottom: 30px;
}

/* 設定 container 樣式 */
.container {
    max-width: 700px;
    margin: 0 auto 30px; /* 添加 30px 的下邊距 */
    background-color: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.container p {
    margin-bottom: 20px;
    font-style: italic;

}


/* 設定 h1 和 h2 的樣式 */
h1, h2 {
    margin-bottom: 20px;
}

/* 設定 label 樣式 */
label {
    display: block;
    margin-bottom: 5px;
}

/* 設定 input[type="text"] 樣式 */
input[type="text"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 20px;
}

button {
  display: inline-block;
  background-image: linear-gradient(to right, #ff416c, #ff4b2b);
  color: #fff;
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  font-size: 1rem;
}

button:hover {
  background-image: linear-gradient(to right, #ff4b2b, #ff416c);
}

/* 設定 #result 樣式 */
#result {
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #ddd;
}

/* 設定 footer 樣式 */
footer {
    text-align: center;
    padding: 10px;
    background-color: #333;
    color: #fff;
    border-radius: 5px;
}

/* 設定 #scroll-to-top 樣式 */
#scroll-to-top {
position: fixed;
bottom: 20px;
right: 20px;
background-color: #333;
color: #fff;
padding: 8px 16px;
border: none;
cursor: pointer;
border-radius: 50%;
font-size: 1rem;
display: none;
}

/* 設定媒體查詢樣式 */
@media (max-width: 700px) {
h1, h2 {
        font-size: 1.5rem;
    }   

button {
        font-size: 0.8rem;
    }

nav {
        flex-direction: column;
        align-items: flex-start;
    }

nav a {
        margin-bottom: 10px;
    }
}
@media (min-width: 1100px) {
    #tools {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1099px) {
    #tools {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    #tools {
        grid-template-columns: 1fr;
    }
}


/* 設定 .loading-text 樣式 */
.loading-text {
    animation: loadingText 1.5s infinite;
}

/* 設定 .result-container 樣式 */
.result-container {
    margin-top: 20px;
}

/* 設定當結果區域變為活動狀態時添加的樣式 */
.active-result {
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* 設定 #intro 樣式 */
#intro {
    background: linear-gradient(135deg, #ff4e50 0%, #f9d423 100%);
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 30px;
}

/* 設定 #intro h1 和 h2 的樣式 */
#intro h1, #intro h2 {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 20px;

}

/* 設定 #intro p 的樣式 */
#intro p {
    font-size: 1.2rem;
    line-height: 1.5;
}

/* 設定動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 設定 #intro 內的標題和段落動畫效果 */
#intro h1,
#intro h2,
#intro p {
    animation: fadeIn 1.5s ease-out;
}

/* 設定 #intro 內的標題和段落動畫延遲 */
#intro h1 {
    animation-delay: 0.6s;
}
#intro h2 {
    animation-delay: 0.6s;
}

#intro p {
    animation-delay: 0.9s;
}