/* PHZ 管理平台 —— 仿 tntmanage（UBold）登入版型
   主色 #6658dd；整頁靛紫底＋淡底紋，白卡片置中，頁尾淺色字。 */

:root {
  --phz-primary: #6658dd;
  --phz-primary-dark: #5546c9;
  --phz-text: #6c757d;
}

body {
  font-family: "Nunito", system-ui, -apple-system, "Microsoft JhengHei", sans-serif;
  color: #495057;
}

/* primary 按鈕／連結／表單焦點 改成 UBold 靛紫 */
.btn-primary {
  --bs-btn-bg: var(--phz-primary);
  --bs-btn-border-color: var(--phz-primary);
  --bs-btn-hover-bg: var(--phz-primary-dark);
  --bs-btn-hover-border-color: var(--phz-primary-dark);
  --bs-btn-active-bg: var(--phz-primary-dark);
  --bs-btn-active-border-color: var(--phz-primary-dark);
}
.form-check-input:checked {
  background-color: var(--phz-primary);
  border-color: var(--phz-primary);
}
.form-control:focus {
  border-color: var(--phz-primary);
  box-shadow: 0 0 0 .15rem rgba(102, 88, 221, .25);
}

/* === 登入頁 === */
.authentication-bg {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--phz-primary);
  /* 淡淡的圓點底紋（仿 bg-pattern） */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='20' cy='20' r='1.6' fill='%23ffffff' fill-opacity='0.09'/%3E%3C/svg%3E");
}
.account-pages {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  border: none;
  border-radius: .5rem;
  box-shadow: 0 .75rem 1.5rem rgba(18, 38, 63, .15);
}
.auth-logo {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--phz-primary);
}

/* 語言切換 */
.lang-switch { display: flex; gap: .4rem; justify-content: flex-end; list-style: none; margin: 0; padding: 0; }
.lang-switch a {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  padding: .15rem .4rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--phz-text);
  border: 1px solid #dee2e6;
  border-radius: .25rem;
}
.lang-switch a.active {
  color: #fff;
  background-color: var(--phz-primary);
  border-color: var(--phz-primary);
}

/* 頁尾（淺色字，浮在靛紫背景上） */
.footer-alt {
  flex-shrink: 0;
  text-align: center;
  padding: 1.2rem;
  color: rgba(255, 255, 255, .6);
  font-size: .8rem;
}

/* ===================================================================
   後台版型（內頁共用）：左側選單 + 頂欄 + 內容
   =================================================================== */
:root { --phz-sidebar-w: 240px; }

.app { min-height: 100vh; }

/* 左側選單 */
.app-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--phz-sidebar-w);
  background: #fff;
  border-right: 1px solid #e9ecef;
  display: flex; flex-direction: column;
  z-index: 1040;
  transition: transform .2s ease;
}
.app-sidebar .brand {
  height: 64px; display: flex; align-items: center; gap: .5rem;
  padding: 0 1.25rem; font-weight: 800; font-size: 1.15rem;
  color: var(--phz-primary); border-bottom: 1px solid #e9ecef;
}
.app-nav { padding: .75rem; overflow-y: auto; flex: 1; }
.app-nav .nav-section { padding: .75rem .75rem .25rem; font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; color: #adb5bd; }
.app-nav a.nav-link-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .75rem; border-radius: .375rem;
  color: #5b626b; font-weight: 600; font-size: .9rem;
}
.app-nav a.nav-link-item:hover { background: #f1f3fa; color: #323a46; }
.app-nav a.nav-link-item.active { background: var(--phz-primary); color: #fff; }
.app-nav .submenu a { padding-left: 2.4rem; font-weight: 500; font-size: .875rem; }
.app-nav .submenu a.active { background: rgba(102,88,221,.1); color: var(--phz-primary); }

/* 右側主區 */
.app-main { margin-left: var(--phz-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar {
  position: sticky; top: 0; z-index: 1030;
  height: 64px; background: #fff; border-bottom: 1px solid #e9ecef;
  display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem;
}
.app-content { flex: 1; padding: 1.5rem; }
.app-content .page-title { font-size: 1.25rem; font-weight: 700; color: #323a46; }

/* 手機版：選單收合 */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app.sidebar-open .app-sidebar { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .app.sidebar-open .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 1035;
  }
}

/* ===================================================================
   可搜尋下拉（站台選擇器）
   =================================================================== */
.search-select { position: relative; }
.search-select .ss-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: #fff; border: 1px solid #ced4da; border-radius: .375rem;
  padding: .45rem .75rem; cursor: pointer; font-size: .9rem;
}
.search-select .ss-toggle:focus, .search-select.open .ss-toggle {
  border-color: var(--phz-primary); box-shadow: 0 0 0 .15rem rgba(102,88,221,.25);
}
.search-select .ss-panel {
  display: none; position: absolute; z-index: 1050; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid #e9ecef; border-radius: .375rem;
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.12); overflow: hidden;
}
.search-select.open .ss-panel { display: block; }
.search-select .ss-search { padding: .5rem; border-bottom: 1px solid #f1f3fa; }
.search-select .ss-options { max-height: 240px; overflow-y: auto; }
.search-select .ss-option { padding: .5rem .75rem; cursor: pointer; font-size: .9rem; }
.search-select .ss-option:hover { background: #f1f3fa; }
.search-select .ss-option.selected { background: rgba(102,88,221,.1); color: var(--phz-primary); font-weight: 700; }
.search-select .ss-empty { padding: .75rem; color: #adb5bd; font-size: .85rem; text-align: center; }

/* ===================================================================
   懸浮項目清單
   =================================================================== */
.float-item {
  border: 1px solid #e9ecef; border-radius: .5rem; background: #fff;
  padding: .85rem; margin-bottom: .75rem;
}
.float-item.disabled { opacity: .55; }
.float-thumb {
  width: 52px; height: 52px; border-radius: .5rem; border: 1px dashed #ced4da;
  display: grid; place-items: center; overflow: hidden; background: #f8f9fa;
  cursor: pointer; flex-shrink: 0; color: #adb5bd;
}
.float-thumb img { width: 100%; height: 100%; object-fit: cover; }
.float-handle { cursor: default; color: #ced4da; }

/* 電腦版 / 手機版 樣式區塊 */
.version-box { border: 1px solid #eef0f4; border-radius: .5rem; padding: .6rem; background: #fbfcfe; }
.version-title { font-size: .8rem; font-weight: 700; color: #5b626b; margin-bottom: .4rem; display: flex; align-items: center; gap: .35rem; }

/* 即時預覽 */
.preview-frame {
  position: relative; height: 460px; border-radius: .75rem; overflow: hidden;
  background: linear-gradient(180deg, #eef1f7, #f8f9fb);
  border: 1px solid #e9ecef;
}
.preview-frame .browser-bar {
  height: 34px; background: #fff; border-bottom: 1px solid #e9ecef;
  display: flex; align-items: center; gap: 6px; padding: 0 12px;
}
.preview-frame .dot { width: 10px; height: 10px; border-radius: 50%; background: #dee2e6; }
.preview-stack { position: absolute; bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.preview-stack.pos-right { right: 16px; align-items: flex-end; }
.preview-stack.pos-left  { left: 16px; align-items: flex-start; }
.preview-btn {
  width: 48px; height: 48px; border-radius: 50%; background: var(--phz-primary); color: #fff;
  display: grid; place-items: center; box-shadow: 0 .35rem .75rem rgba(102,88,221,.4);
  overflow: hidden; font-size: 1.2rem;
}
.preview-btn img { width: 100%; height: 100%; object-fit: cover; }
