/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, "Noto Sans TC", sans-serif;
  background: #ffd6ea; /* 你可自由改色 */
  color: #222;
}

/* ===== Topbar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.brand {
  font-weight: 700;
  letter-spacing: 1px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  border-radius: 10px;
}
.icon-btn:active { transform: scale(0.98); }

.login-btn {
  border: 0;
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 999px;   /* 右上登入按鈕圓角 */
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(0,0,0,0.10);
  font-weight: 700;
}
.login-btn:active { transform: scale(0.99); }

/* ===== Sidebar (with transition) ===== */
.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  height: calc(100% - 56px);
  width: 240px;
  background: rgba(255, 255, 255, 0.55);
  border-right: 1px solid rgba(0,0,0,0.08);
  transform: translateX(-100%);     /* hidden */
  transition: transform 280ms ease; /* ★題目要求 transition 動態效果 */
  z-index: 15;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-nav {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-item {
  display: block;
  padding: 12px 12px;
  text-decoration: none;
  color: #222;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0,0,0,0.06);
}
.nav-item:hover { filter: brightness(0.98); }

/* ===== Content ===== */
.content {
  min-height: calc(100% - 56px);
  padding: 22px;
  transition: padding-left 280ms ease;
}

/* 桌機：側欄打開時，內容往右讓位 */
body.menu-open .content {
  padding-left: 260px;
}

.hero {
  max-width: 900px;
  margin: 30px auto 0;
  padding: 28px;
  border-radius: 18px;
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(0,0,0,0.06);
}

/* ===== Modal ===== */
.overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  z-index: 30;
}

.overlay.show {
  display: flex;
}

.modal {
  width: min(420px, calc(100% - 36px));
  background: rgba(255,255,255,0.92);
  border-radius: 16px; /* 登入帳號畫面圓角 */
  box-shadow: 0 18px 50px rgba(0,0,0,0.20);
  padding: 18px 18px 16px;
  position: relative;
  border: 1px solid rgba(0,0,0,0.08);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  cursor: pointer;
  border-radius: 10px;
  background: rgba(0,0,0,0.06);
  font-size: 20px;
  line-height: 34px;
}

.form { margin-top: 12px; display: grid; gap: 12px; }
.label { display: grid; gap: 8px; font-size: 14px; }
.input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.18);
  outline: none;
  background: #fff;
}
.input:focus { border-color: rgba(0,0,0,0.45); }

.hint-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-top: -2px;
}

.link-red {
  color: #d40000; /* 忘記密碼/註冊紅色 */
  text-decoration: none;
  font-weight: 700;
}
.link-red:hover { text-decoration: underline; }

.submit-btn {
  border: 0;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 999px; /* 登入按鈕圓角 */
  background: #333;
  color: #fff;
  font-weight: 800;
}

.tip {
  margin: 0;
  font-size: 12px;
  opacity: 0.7;
  text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  /* 小螢幕：不要把內容往右推 */
  body.menu-open .content {
    padding-left: 22px;
  }

  /* 小螢幕：側欄變成覆蓋式（仍然從左滑出） */
  .sidebar {
    width: 220px;
    background: rgba(255, 255, 255, 0.75);
  }

  .hero {
    margin-top: 18px;
    padding: 18px;
  }
}
