/* ==========================================================================
   都更開發管理系統 — 設計系統 (Design System)
   風格：Modern Architectural Editorial（現代建築編輯風）
   由公開網站到內部後台，共用同一套語彙：溫潤紙感底、深建築石墨藍為主色、
   精緻古銅金為點綴。單一、克制、專業時尚。
   此檔在 Bootstrap 5.3 之後載入，透過覆寫 Bootstrap 變數與元件，
   讓既有頁面自動套用新風格；同時補齊後台原本缺失的版面樣式。
   ========================================================================== */

/* ---------- 1. 設計 Tokens ---------- */
:root {
  /* 表面 / 底色 */
  --paper:        #f6f4ef;   /* 溫潤象牙紙感底 */
  --surface:      #ffffff;
  --surface-2:    #fbfaf7;
  --surface-sink: #efece4;

  /* 文字 */
  --ink:          #14181f;   /* 近黑石墨 */
  --ink-soft:     #3b4453;
  --muted:        #6b7382;
  --muted-2:      #98a0ad;

  /* 線條 */
  --line:         #e7e2d8;   /* 暖色髮絲線 */
  --line-strong:  #d8d2c5;

  /* 品牌主色：深建築石墨藍 */
  --brand:        #1d2b3a;
  --brand-700:    #17222e;
  --brand-600:    #26384b;
  --brand-500:    #35506b;
  --brand-tint:   #eef1f4;

  /* 點綴：精緻古銅金 */
  --accent:       #b0863f;
  --accent-600:   #99722f;
  --accent-tint:  #f2e9d8;

  /* 語意色 */
  --success:      #2f7d5b;
  --success-tint: #e4f1ea;
  --info:         #2f6f8f;
  --info-tint:    #e2eef4;
  --warning:      #b7842b;
  --warning-tint: #f6ecd6;
  --danger:       #b0413a;
  --danger-tint:  #f6e3e1;

  /* 造型 */
  --radius:       14px;
  --radius-sm:    10px;
  --radius-lg:    22px;
  --shadow-sm:    0 1px 2px rgba(20,24,31,.05), 0 1px 3px rgba(20,24,31,.04);
  --shadow:       0 6px 20px -8px rgba(20,24,31,.14), 0 2px 6px rgba(20,24,31,.05);
  --shadow-lg:    0 24px 60px -20px rgba(20,24,31,.28);

  --font-display: "Sora", "Noto Sans TC", system-ui, sans-serif;
  --font-body:    "Noto Sans TC", "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Bootstrap 變數覆寫 —— 讓 btn-primary / text-primary / bg-primary 全站換色 */
  --bs-primary:        #1d2b3a;
  --bs-primary-rgb:    29, 43, 58;
  --bs-link-color:     #26384b;
  --bs-link-color-rgb: 38, 56, 75;
  --bs-link-hover-color: #b0863f;
  --bs-border-color:   #e7e2d8;
  --bs-body-color:     #14181f;
  --bs-body-bg:        #f6f4ef;
  --bs-font-sans-serif: "Noto Sans TC", "Sora", system-ui, sans-serif;
}

/* ---------- 2. 基礎 ---------- */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: .005em;
}

body.bg-light { background-color: var(--paper) !important; }

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5,
.navbar-brand, .display-1, .display-2, .display-3, .display-4, .display-5 {
  font-family: var(--font-display);
  letter-spacing: -.015em;
  color: var(--ink);
}
h1, .h1, .display-4, .display-5 { font-weight: 700; }
h2, .h2 { font-weight: 700; }
h3, .h3 { font-weight: 600; }

.lead { color: var(--ink-soft); font-weight: 400; }
.text-muted { color: var(--muted) !important; }

a { text-decoration: none; }
a:hover { text-decoration: none; }

::selection { background: var(--accent-tint); color: var(--ink); }

hr { border-color: var(--line); opacity: 1; }

/* 精緻眉標（可選用）*/
.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .72rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- 3. 按鈕 ---------- */
.btn {
  --bs-btn-font-family: var(--font-display);
  font-weight: 600;
  border-radius: 999px;
  padding: .62rem 1.5rem;
  letter-spacing: .01em;
  transition: transform .18s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn-lg { padding: .85rem 2rem; font-size: 1.02rem; }
.btn-sm { padding: .4rem 1rem; }

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-600);
  --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-active-bg: var(--brand-700);
  --bs-btn-active-border-color: var(--brand-700);
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
  box-shadow: 0 8px 20px -10px rgba(29,43,58,.7);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -10px rgba(29,43,58,.75); }

/* 古銅金強調按鈕：對既有 btn-warning / accent 場景升級 */
.btn-accent, .btn-warning {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--accent-600);
  --bs-btn-hover-border-color: var(--accent-600);
  --bs-btn-active-bg: var(--accent-600);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(176,134,63,.7);
}
.btn-warning:hover { transform: translateY(-1px); }

.btn-outline-primary {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-hover-color: #fff;
}
.btn-outline-light {
  --bs-btn-border-color: rgba(255,255,255,.55);
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-color: var(--brand);
  --bs-btn-hover-border-color: #fff;
  backdrop-filter: blur(2px);
}
.btn-secondary {
  --bs-btn-bg: var(--surface);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-color: var(--ink-soft);
  --bs-btn-hover-bg: var(--surface-sink);
  --bs-btn-hover-border-color: var(--line-strong);
  --bs-btn-hover-color: var(--ink);
}

/* ---------- 4. 導覽列（公開站）---------- */
.navbar {
  padding-top: .9rem;
  padding-bottom: .9rem;
  background-color: rgba(255,255,255,.82) !important;
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: none !important;
}
.navbar-brand {
  font-weight: 700;
  letter-spacing: -.02em;
  font-size: 1.28rem;
  color: var(--ink);
}
.navbar-brand .text-primary, .navbar-brand i { color: var(--accent) !important; }
.navbar .nav-link {
  font-weight: 500;
  color: var(--ink-soft) !important;
  padding: .5rem .95rem !important;
  position: relative;
}
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--ink) !important; }
.navbar .nav-link.active::after {
  content: ""; position: absolute; left: .95rem; right: .95rem; bottom: .1rem;
  height: 2px; border-radius: 2px; background: var(--accent);
}
.navbar .btn-primary { padding: .5rem 1.35rem; }

/* ---------- 5. 卡片 ---------- */
.card {
  --bs-card-border-color: var(--line);
  --bs-card-bg: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
  overflow: hidden;
}
.card.shadow, .card.shadow-sm { box-shadow: var(--shadow) !important; }
.card:hover { box-shadow: var(--shadow); }
.card-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  padding: 1rem 1.25rem;
}
.card-header.bg-warning { background: var(--accent) !important; color:#fff !important; }
.card-header.bg-primary { background: var(--brand) !important; color:#fff !important; }
.card-header .text-primary { color: var(--ink) !important; }
.card-body { padding: 1.35rem 1.5rem; }
.card.border-warning { border-color: var(--accent) !important; }
.card.border-primary { border-color: var(--brand) !important; }
.card.border-success { border-color: var(--success) !important; }
.card.border-info    { border-color: var(--info) !important; }

/* 統計卡（後台 SB-Admin 風升級）*/
.border-left-primary { border-left: 4px solid var(--brand) !important; }
.border-left-success { border-left: 4px solid var(--success) !important; }
.border-left-info    { border-left: 4px solid var(--info) !important; }
.border-left-warning { border-left: 4px solid var(--accent) !important; }
.card.border-left-primary .text-primary,
.text-primary { color: var(--brand) !important; }
.card.border-left-success .text-success, .text-success { color: var(--success) !important; }
.card.border-left-info .text-info, .text-info { color: var(--info) !important; }
.card.border-left-warning .text-warning, .text-warning { color: var(--accent) !important; }

/* ---------- 6. 表單 ---------- */
.form-label { font-weight: 600; color: var(--ink-soft); font-size: .92rem; margin-bottom: .4rem; }
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  padding: .62rem .85rem;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.form-control::placeholder { color: var(--muted-2); }
.form-control:focus, .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 .2rem rgba(53,80,107,.18);
}
.input-group-text { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }

/* ---------- 7. 表格 ---------- */
.table {
  --bs-table-bg: transparent;
  border-color: var(--line);
  margin-bottom: 0;
}
.table > thead {
  --bs-table-bg: var(--surface-2);
}
.table > thead th {
  font-family: var(--font-display);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line-strong);
  padding: .85rem 1rem;
  white-space: nowrap;
}
.table > tbody td { padding: .8rem 1rem; vertical-align: middle; border-color: var(--line); color: var(--ink-soft); }
.table > tbody tr { transition: background-color .15s ease; }
.table-hover > tbody > tr:hover > * { background-color: var(--brand-tint); }
.table-responsive { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }

/* ---------- 8. 徽章 ---------- */
.badge {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .02em;
  padding: .4em .75em;
  border-radius: 999px;
}
.badge.bg-primary { background: var(--brand) !important; }
.badge.bg-success { background: var(--success) !important; }
.badge.bg-info    { background: var(--info) !important; }
.badge.bg-warning { background: var(--accent) !important; color:#fff !important; }
.badge.bg-danger  { background: var(--danger) !important; }
.badge.bg-secondary { background: var(--surface-sink) !important; color: var(--ink-soft) !important; }
.badge.bg-primary-subtle { background: var(--accent-tint) !important; }
.text-primary-emphasis { color: var(--accent-600) !important; }

/* ---------- 9. 進度條 ---------- */
.progress {
  height: .7rem;
  background: var(--surface-sink);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar { font-size: .68rem; font-weight: 600; }
.progress-bar.bg-success { background: linear-gradient(90deg, var(--success), #3a9c72) !important; }
.progress-bar.bg-info { background: linear-gradient(90deg, var(--info), #3f88ab) !important; }
.progress-bar.bg-primary { background: linear-gradient(90deg, var(--brand), var(--brand-500)) !important; }

/* ---------- 10. 提示訊息 ---------- */
.alert { border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 500; }
.alert-success { background: var(--success-tint); color: #205c42; border-color: #c3e2d3; }
.alert-danger  { background: var(--danger-tint); color: #8a2f29; border-color: #eccbc8; }
.alert-warning { background: var(--warning-tint); color: #7c5a16; border-color: #ecd7a6; }
.alert-info    { background: var(--info-tint); color: #245066; border-color: #c4dde8; }

/* ---------- 11. 公開站：Hero / 區塊 / 頁尾 ---------- */
.hero-section, .page-banner {
  background-color: var(--brand);
  background-blend-mode: multiply;
  position: relative;
}
.hero-section { padding: 8.5rem 0 !important; }
.hero-section h1, .page-banner h1 { color:#fff; letter-spacing: -.02em; }
.hero-section .lead, .page-banner .lead { color: rgba(255,255,255,.86); }

.section { padding: 6rem 0; }
.section-title { position: relative; }

.feature-icon {
  color: var(--accent) !important;
  display: inline-flex;
  width: 74px; height: 74px;
  align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  font-size: 2rem !important;
}

.announcement-item {
  border-left: 3px solid var(--accent) !important;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem !important;
  box-shadow: var(--shadow-sm);
}
.bg-light { background-color: var(--surface-sink) !important; }

footer.bg-dark { background: var(--brand-700) !important; }
footer.bg-dark h5 { font-family: var(--font-display); font-weight: 600; }
footer.bg-dark a:hover { color: var(--accent) !important; }

/* 服務項目圖片 */
main img.rounded.shadow, .img-fluid.rounded { border-radius: var(--radius-lg) !important; box-shadow: var(--shadow-lg) !important; }

/* ---------- 12. 登入頁 ---------- */
.login-wrapper, .login-container { box-shadow: var(--shadow-lg) !important; }
.login-wrapper { border-radius: var(--radius-lg); }
.login-info, .info-panel {
  background: linear-gradient(155deg, var(--brand) 0%, var(--brand-700) 60%, #101923 100%) !important;
  position: relative;
}
.login-info, .info-panel { position: relative; }
.login-info::after, .info-panel::after {
  content:""; position:absolute; inset:0; pointer-events:none; z-index:0;
  background:
    radial-gradient(circle at 88% 8%, rgba(176,134,63,.28), transparent 40%);
}
.login-info > *, .info-panel > * { position: relative; z-index: 1; }
.login-info h1, .info-panel h1 { font-family: var(--font-display); letter-spacing: -.02em; color: #fff; }
.login-info .bi, .info-panel .bi { color: var(--accent) !important; }

/* ==========================================================================
   13. 後台版面（原本樣式檔缺失，此處補齊）
   —— 側邊欄 + 主內容 shell（partials/sidebar.php 使用）
   ========================================================================== */
.dashboard-container { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 268px;
  flex: 0 0 268px;
  background: linear-gradient(185deg, var(--brand) 0%, var(--brand-700) 100%);
  color: #cfd6df;
  padding: 1.6rem 1.1rem 1.1rem;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  padding: .2rem .3rem 1.2rem .6rem;
  margin-bottom: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.sidebar-title .brand-link { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-title .bi { color: var(--accent); }
/* 桌機：收合/展開（縮放）鈕 */
.rail-toggle {
  display: none;
  background: transparent; border: 0; color: var(--muted-2);
  width: 32px; height: 32px; border-radius: 8px; flex: 0 0 auto;
  align-items: center; justify-content: center; cursor: pointer;
  transition: color .15s ease, background-color .15s ease, transform .2s ease;
}
.rail-toggle:hover { color: #fff; background: rgba(255,255,255,.08); }
@media (min-width: 992px) { .rail-toggle { display: inline-flex; } }

/* 手機頂列與遮罩（桌機隱藏） */
.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }
/* 側邊欄：目前組織 / 切換 */
.sidebar .org-box {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: .7rem .8rem .8rem;
  margin-bottom: 1rem;
}
.sidebar .org-label { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); margin-bottom: .4rem; }
.sidebar .org-current { color: #fff; font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: .45rem; }
.sidebar .org-current .bi { color: var(--accent); }
.sidebar .org-switch-form .form-select {
  background-color: rgba(0,0,0,.25);
  color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  font-weight: 600;
  font-size: .9rem;
}
.sidebar .org-switch-form .form-select option { color: #14181f; }
.sidebar .org-add { display: inline-flex; align-items: center; gap: .35rem; margin-top: .55rem; font-size: .82rem; color: var(--accent); }
.sidebar .org-add:hover { color: #fff; }

.sidebar .sidebar-nav { flex: 1 1 auto; }
.sidebar ul { margin: 0; padding: 0; }
.sidebar .nav-sec { margin-bottom: .1rem; }
.sidebar .nav-sec-h {
  display: flex; align-items: center; width: 100%;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted-2); font-weight: 700;
  padding: .75rem .8rem .3rem; background: transparent; border: 0; text-align: left;
}
.sidebar .nav-sec-toggle { cursor: pointer; }
.sidebar .nav-sec-toggle:hover { color: #d7dee7; }
.sidebar .nav-sec-toggle .caret { margin-left: auto; font-size: .8rem; transition: transform .18s ease; }
.sidebar .nav-sec.collapsed .nav-sec-body { display: none; }
.sidebar .nav-sec.collapsed .nav-sec-toggle .caret { transform: rotate(-90deg); }
.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #c3cbd6 !important;
  padding: .5rem .8rem;
  border-radius: 10px;
  font-size: .93rem;
  font-weight: 500;
  margin-bottom: .06rem;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
  border-left: 2px solid transparent;
}
.sidebar .nav-link .bi { font-size: 1.06rem; width: 1.3rem; text-align: center; color: var(--muted-2); transition: color .16s ease; }
.sidebar .nav-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff !important;
}
.sidebar .nav-link:hover .bi { color: var(--accent); }
.sidebar .nav-link.active {
  background: rgba(176,134,63,.16);
  color: #fff !important;
  border-left-color: var(--accent);
}
.sidebar .nav-link.active .bi { color: var(--accent); }

.sidebar .user-info {
  margin-top: auto;
  padding: 1rem .8rem .3rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .85rem;
}
.sidebar .user-info p { margin: 0 0 .35rem; color: #aeb7c3; display: flex; align-items: center; gap: .5rem; }
.sidebar .user-info .bi { color: var(--accent); }
.sidebar .logout-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: .6rem;
  padding: .5rem .95rem;
  width: 100%;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff !important;
  font-weight: 600;
  font-size: .9rem;
  transition: background-color .16s ease;
}
.sidebar .logout-btn:hover { background: var(--accent); }

.main-content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 2.4rem 2.6rem;
  background: var(--paper);
}
.main-content > .container-fluid { padding: 0; }

/* 後台頁尾 */
.footer.bg-white { background: var(--surface) !important; border-top: 1px solid var(--line) !important; }

/* SB-Admin 相容工具類（Bootstrap5 未內建者）*/
.text-gray-800 { color: var(--ink) !important; }
.text-gray-300 { color: var(--muted-2) !important; }
.text-xs { font-size: .72rem !important; letter-spacing: .05em; }
.font-weight-bold { font-weight: 700 !important; }
.no-gutters { --bs-gutter-x: 0; --bs-gutter-y: 0; }
.no-gutters > * { padding-right: 0; padding-left: 0; }
.mr-2 { margin-right: .5rem !important; }
.h5.mb-0.font-weight-bold { font-family: var(--font-display); }

/* 各專案進度概覽 —— 百分比移到標題列，進度條為乾淨細軌 */
.proj-row { padding: 1.15rem 0 1.35rem; border-bottom: 1px solid var(--line); }
.proj-row:first-child { padding-top: .25rem; }
.proj-row:last-child { border-bottom: 0; padding-bottom: .25rem; }
.proj-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.proj-name {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  letter-spacing: -.01em;
}
.proj-metric { margin-top: .85rem; }
.proj-metric:first-of-type { margin-top: 0; }
.proj-metric .metric-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .4rem;
}
.metric-label { font-size: .9rem; font-weight: 600; color: var(--ink-soft); display: inline-flex; align-items: center; gap: .4rem; }
.metric-label .bi { color: var(--muted-2); font-size: .95rem; }
.metric-value { font-size: .86rem; color: var(--muted); white-space: nowrap; }
.metric-value .metric-pct {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
  margin-left: .5rem;
  font-variant-numeric: tabular-nums;
}
.proj-metric .progress { height: .5rem; }

@media (max-width: 575.98px) {
  .metric-value { font-size: .8rem; }
  .proj-metric .metric-head { flex-wrap: wrap; gap: .15rem .6rem; }
}

/* 模態框 */
.modal-content { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--line); }
.modal-title { font-family: var(--font-display); font-weight: 600; }
.list-group-item { border-color: var(--line); }

/* ---------- 14. 響應式：後台側邊欄 ---------- */

/* 桌機：收合成「圖示軌」（縮放） */
@media (min-width: 992px) {
  .dashboard-container.rail .sidebar { width: 76px; flex-basis: 76px; padding-left: .55rem; padding-right: .55rem; }
  .dashboard-container.rail .sidebar .nav-label,
  .dashboard-container.rail .sidebar .nav-sec-h,
  .dashboard-container.rail .sidebar .org-box,
  .dashboard-container.rail .sidebar .user-info p,
  .dashboard-container.rail .sidebar .nav-link .badge { display: none; }
  /* 收合成圖示軌時，所有分區都展開以顯示圖示 */
  .dashboard-container.rail .sidebar .nav-sec.collapsed .nav-sec-body { display: block; }
  .dashboard-container.rail .sidebar .nav-link { justify-content: center; gap: 0; padding-left: .4rem; padding-right: .4rem; }
  .dashboard-container.rail .sidebar .nav-link .bi { width: auto; }
  .dashboard-container.rail .sidebar-title { justify-content: center; padding-right: .6rem; }
  .dashboard-container.rail .rail-toggle .bi { transform: rotate(180deg); }
  .dashboard-container.rail .sidebar .user-info { text-align: center; }
  .dashboard-container.rail .sidebar .logout-btn { padding: .5rem 0; }
}

/* 手機（≤991.98px）：側邊欄改為可滑出的抽屜 */
@media (max-width: 991.98px) {
  .mobile-topbar {
    display: flex; align-items: center; gap: .5rem;
    position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 1040;
    background: var(--brand-700); color: #fff; padding: 0 .7rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .mtb-btn {
    background: transparent; border: 0; color: #fff; font-size: 1.55rem;
    width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
    border-radius: 9px; flex: 0 0 auto;
  }
  .mtb-btn:active { background: rgba(255,255,255,.14); }
  .mtb-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; }
  .mtb-brand .bi { color: var(--accent); margin-right: .3rem; }

  .dashboard-container { flex-direction: column; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 82%; max-width: 300px;
    flex-basis: auto;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 1050; overflow-y: auto;
  }
  .dashboard-container.menu-open .sidebar { transform: translateX(0); box-shadow: 0 0 44px rgba(0,0,0,.45); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1045; }
  .dashboard-container.menu-open .sidebar-backdrop { display: block; }
  .sidebar .nav-link { border-left: none; border-radius: 10px; }
  .rail-toggle { display: none !important; }  /* 手機不使用縮放鈕 */
  .main-content { padding: calc(56px + 1.25rem) 1.15rem 1.5rem; }
}

@media (max-width: 767.98px) {
  .hero-section { padding: 5.5rem 0 !important; }
  .section { padding: 3.5rem 0; }
}
