/* ===== 基礎排版 ===== */

html,
body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  font-size: 1.2rem;
  font-family: "Chocolate Classical Sans", sans-serif;
  background-color: #fffdf1;
  display: flex;
  /* 讓下面兩行生效 */
  flex-direction: column;
  /* 垂直排版：header -> section -> … */
  align-items: center;
  /* 水平置中所有直屬子元素 */
}

/* ===== 背景圖 ===== */
.bg-image,
.bg-b {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  border-radius: 15px;
  box-shadow:
    inset 1px 2px 1px rgba(200, 200, 256, 0.6),
    /* 上亮 */
    inset -1px -2px 1px rgba(0, 0, 20, 0.2),
    /* 下暗 */
    2px 2px 5px rgba(0, 0, 0, 0.4);
}

.bg-image {
  width: 100%;
  height: auto;
  z-index: -1;
}

.bg-b {
  width: auto;
  height: auto;
  z-index: -2;
}

/* ===== Header ===== */
header {
  width: 80%;
  margin: 30px;
  max-width: 1500px;
  padding: 20px;
  backdrop-filter: blur(5px);
  border-radius: 15px;
  background-color: rgba(22, 88, 188, 0.66);
  box-shadow:
    inset 1px 2px 1px rgba(200, 200, 256, 0.6),
    /* 上亮 */
    inset -1px -2px 1px rgba(0, 0, 20, 0.2),
    /* 下暗 */
    2px 2px 5px rgba(0, 0, 0, 0.4);
}

header img {
  width: 100px;
  height: 100px;
  margin-right: 20px;
  transition: all 0.3s ease;
}

h1 {
  margin: 0;
  color: #fff;
  font-size: 2rem;
  font-weight: 500;
}

/* ===== 內容區塊 ===== */
section {
  margin: 30px;
  width: 80%;
  max-width: 1500px;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(5px);
  border-radius: 15px;
  box-shadow:
    inset 1px 2px 1px rgba(200, 200, 256, 0.6),
    /* 上亮 */
    inset -1px -2px 1px rgba(0, 0, 20, 0.2),
    /* 下暗 */
    2px 2px 5px rgba(0, 0, 0, 0.4);
}

/* ===== 導覽 ===== */
nav {
  text-align: center;
}

nav a {
  margin: 0 10px;
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  font-size: 1.2rem;
}

/* ===== Footer ===== */
footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* 修正：start -> flex-start */
  width: 80%;
  height: auto;
  margin: 30px;
  max-width: 1500px;
  padding: 20px;
  backdrop-filter: blur(5px);
  border-radius: 15px;
  background-color: rgba(22, 88, 188, 0.66);
  box-shadow:
    inset 1px 2px 1px rgba(200, 200, 256, 0.6),
    inset -1px -2px 1px rgba(0, 0, 20, 0.2),
    2px 2px 5px rgba(0, 0, 0, 0.4);
}

footer p img {
  height: auto;
  /* 你原本的高度 */
  width: 30%;
  /* 隨高度等比計算寬度 */
  max-width: 100%;
  /* 小螢幕時別超出容器 */
  flex: 0 0 auto;
  /* 關閉 flex 收縮、拉伸 */
  object-fit: contain;
  /* 保持比例，避免變形 */
  aspect-ratio: auto;
  /* 明示按原圖比例 */
  display: block;
  /* 避免行內布局帶來的怪異間距 */
}

/* ===== 按鈕 / 輸入 ===== */
a {
  color: blue;
}

button a {
  color: white;
}

button {
  border: none;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 1.2rem;
  font-weight: 400;
  width: auto;
  height: 2.8rem;
  display: inline-block;
  margin: 5px;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  color: #fff;
  background-color: rgba(22, 88, 188, 0.66);
  box-shadow:
    inset 1px 2px 1px rgba(200, 200, 256, 0.6),
    inset -1px -2px 1px rgba(0, 0, 20, 0.2),
    2px 2px 5px rgba(0, 0, 0, 0.4);
}

button:hover {
  background-color: rgba(22, 88, 188, 0.4);
  box-shadow: none;
}

button a:link,
button a:visited {
  color: #fff;
  text-decoration: none;
}

.numberInput {
  border: none;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 1.2rem;
  font-weight: 400;
  height: 2rem;
  width: 7.5rem;
  display: inline-block;
  margin: 5px;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  color: #000;
  background-color: rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 1px 2px 1px rgba(200, 200, 256, 0.6),
    inset -1px -2px 1px rgba(0, 0, 20, 0.2),
    2px 2px 5px rgba(0, 0, 0, 0.4);
}

#fiatCode {
  border: none;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 1.2rem;
  font-weight: 400;
  height: 2.8rem;
  width: auto;
  display: inline-block;
  margin: 5px;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  color: #000;
  background-color: rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 1px 2px 1px rgba(200, 200, 256, 0.6),
    inset -1px -2px 1px rgba(0, 0, 20, 0.2),
    2px 2px 5px rgba(0, 0, 0, 0.4);
}

/* ===== 小螢幕調整 ===== */
@media (max-width: 1024px) {
  header {
    flex-direction: column;
    align-items: center;
    padding: 15px;
  }

  header img {
    width: 75px;
    height: auto;
    margin-right: 10px;
  }

  nav {
    margin-top: 10px;
  }

  nav a {
    font-size: 16px;
    margin: 0 10px;
  }

  section {
    padding: 15px;
    margin: 15px 10px;
  }
}