﻿/* =========================================================================
   public/assets/css/hub.css — 大廳（Hub）外殼樣式
   範圍：頂部導覽、功能下拉面板、使用者選單、手機底部分頁列與面板、
         首頁（重要公告橫幅、問候條＋系統提示、公告）。
   不含：HubUI 彈窗、載入遮罩、公告詳情彈窗（仍在 global.css）。
   前綴：hub-。大廳為宿主頁面，不與子模組同時定義同名類別。
   目錄：1 變數 / 2 頂部導覽 / 3 功能面板 / 4 使用者選單 / 5 首頁版面 /
         6 問候條 / 7 重要公告橫幅 / 8 公告 / 9 系統提示 / 10 手機底部列與面板 / 11 動畫 / 12 手機版
   ========================================================================= */

/* 1. 變數 */
:root {
  --hub-bg: #ffffff;
  --hub-surface-2: #f8fafc;
  --hub-line: #e2e8f0;
  --hub-line-strong: #cbd5e1;
  --hub-fg: #0f172a;
  --hub-fg-2: #475569;
  --hub-fg-3: #64748b;
  --hub-accent: #0284c7;
  --hub-accent-soft: #f0f9ff;
  --hub-accent-line: #bae6fd;
  --hub-ok: #047857;
  --hub-ok-soft: #ecfdf5;
  --hub-ok-line: #a7f3d0;
  --hub-warn: #b45309;
  --hub-warn-soft: #fffbeb;
  --hub-warn-line: #fde68a;
  --hub-danger: #be123c;
  --hub-danger-soft: #fff1f2;
  --hub-danger-line: #fecdd3;
  --hub-font: "Plus Jakarta Sans", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hub-serif: "Plus Jakarta Sans", "Noto Serif TC", "Source Han Serif TC", "Songti TC", serif;
}

.hub-i {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hub-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hub-danger);
  color: #ffffff;
  font: 700 11px var(--hub-font);
}

.hub-badge[hidden] {
  display: none;
}

/* 2. 頂部導覽 */
.hub-top {
  position: relative;
  flex-shrink: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hub-line);
  font-family: var(--hub-font);
}

.hub-brand {
  display: flex;
  align-items: center;
  margin-right: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.hub-brand-img {
  display: none;
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.hub-brand-fallback {
  font: 700 26px var(--hub-serif);
  color: var(--hub-accent);
}

.hub-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.hub-nav.initial-hidden {
  visibility: hidden;
}

.hub-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--hub-fg-2);
  font: 600 14px var(--hub-font);
  white-space: nowrap;
  cursor: pointer;
}

.hub-nav-btn:hover {
  background: var(--hub-surface-2);
  color: var(--hub-fg);
}

.hub-nav-btn.active,
.hub-nav-btn[aria-expanded="true"] {
  background: var(--hub-accent-soft);
  color: var(--hub-accent);
}

.hub-top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 鍵盤焦點外框（focus-visible） */

.hub-nav-btn:focus-visible,
.hub-brand:focus-visible,
.hub-user-btn:focus-visible,
.hub-mega-item:focus-visible,
.hub-menu button:focus-visible,
.hub-tab:focus-visible,
.hub-tile:focus-visible,
.hub-tab-ann:focus-visible,
.hub-ann-item:focus-visible,
.hub-feature:focus-visible,
.hub-notice button:focus-visible {
  outline: 2px solid var(--hub-accent);
  outline-offset: 2px;
}

/* 3. 功能下拉面板（桌面）：依分組列出全部有權限的功能 */
.hub-mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: #ffffff;
  border-bottom: 1px solid var(--hub-line);
  box-shadow: 0 18px 30px -18px rgba(15, 23, 42, 0.25);
}

.hub-mega[hidden] {
  display: none;
}

.hub-mega-in {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 28px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px 24px;
}

.hub-mega-title {
  padding: 0 10px 6px;
  font: 700 11px var(--hub-serif);
  letter-spacing: 0.18em;
  color: var(--hub-fg-3);
}

.hub-mega-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--hub-fg-2);
  font: 500 14px var(--hub-font);
  text-align: left;
  cursor: pointer;
}

.hub-mega-item:hover {
  background: var(--hub-surface-2);
  color: var(--hub-fg);
}

.hub-mega-item.active {
  color: var(--hub-accent);
  font-weight: 700;
  background: var(--hub-accent-soft);
}

.hub-mega-item .hub-badge {
  margin-left: auto;
}

/* 4. 使用者選單 */
.hub-user {
  position: relative;
}

.hub-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 4px 12px 4px 6px;
  border: 1px solid var(--hub-line-strong);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hub-user-btn:hover {
  background: var(--hub-surface-2);
}

.hub-user-btn.active {
  border-color: var(--hub-accent);
}

.hub-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font: 600 13px var(--hub-serif);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 1px 3px rgba(2, 132, 199, 0.2);
  flex-shrink: 0;
  user-select: none;
}

.hub-user-meta {
  line-height: 1.25;
}

.hub-user-meta b {
  display: block;
  font: 700 13px var(--hub-serif);
  color: var(--hub-fg);
}

.hub-user-meta span {
  font-size: 11px;
  color: var(--hub-fg-3);
}

.hub-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  min-width: 220px;
  padding: 4px;
  border: 1px solid var(--hub-line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 28px -8px rgba(15, 23, 42, 0.18);
}

.hub-menu[hidden] {
  display: none;
}

.hub-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: 500 14px var(--hub-font);
  color: var(--hub-fg);
  text-align: left;
  cursor: pointer;
}

.hub-menu button:hover {
  background: var(--hub-surface-2);
}

.hub-menu hr {
  margin: 4px 0;
  border: 0;
  border-top: 1px solid var(--hub-line);
}

.hub-menu .hub-danger {
  color: var(--hub-danger);
}

/* 5. 首頁版面 */
.hub-home {
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #ffffff;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 28px;
  font-family: var(--hub-font);
  color: var(--hub-fg);
}

.hub-home-in {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

/* 6. 問候條：左側問候，右側為系統提示（沒有提示資料時只剩問候，整條單欄） */
.hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--hub-line);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.hub-hero.has-alerts {
  grid-template-columns: minmax(0, 1fr) minmax(0, 640px);
}

.hub-hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 20px 28px;
}

.hub-hero-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hub-hero h1 {
  margin: 0;
  font: 700 24px/1.3 var(--hub-serif);
  letter-spacing: 0.03em;
  color: #0f172a;
}

.hub-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.hub-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  animation: hubPillBreathe 2.4s ease-in-out infinite;
}

@keyframes hubPillBreathe {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.hub-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 13px;
}

.hub-hero-sep {
  color: #cbd5e1;
  font-weight: 600;
}

.hub-hero-sub {
  color: #475569;
  font-weight: 500;
  letter-spacing: 0.03em;
}



.hub-hero-alerts {
  background: var(--hub-accent-soft);
  border-left: 1px solid var(--hub-accent-line);
}

.hub-hero-alerts[hidden] {
  display: none;
}

/* 7. 重要公告橫幅：未讀的重要／資安／置頂公告固定在首頁最上方 */
.hub-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid var(--hub-warn-line);
  border-radius: 10px;
  background: var(--hub-warn-soft);
  animation: hubDrop 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hub-notice[hidden] {
  display: none;
}

.hub-notice.is-sec {
  border-color: var(--hub-danger-line);
  background: var(--hub-danger-soft);
}

.hub-notice-ic {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: var(--hub-warn);
}

.hub-notice.is-sec .hub-notice-ic {
  color: var(--hub-danger);
}

.hub-notice-ic::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0;
  animation: hubPing 2.4s ease-out infinite;
}

.hub-notice-t {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.hub-notice-k {
  flex: none;
  font: 700 12px var(--hub-serif);
  letter-spacing: 0.2em;
  color: var(--hub-warn);
}

.hub-notice.is-sec .hub-notice-k {
  color: var(--hub-danger);
}

.hub-notice-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 15px var(--hub-serif);
  letter-spacing: 0.02em;
}

.hub-notice-more {
  flex: none;
  font-size: 12px;
  color: var(--hub-fg-3);
}

.hub-notice button {
  flex: none;
  min-height: 32px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--hub-accent);
  font: 600 13px var(--hub-font);
  cursor: pointer;
}

/* 8. 公告：精選一則、日期欄、底線分頁、摘要 */
.hub-ann {
  border: 1px solid var(--hub-line);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.hub-ann-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px 0;
}

.hub-ann-head h2 {
  margin: 0;
  font: 700 20px var(--hub-serif);
  letter-spacing: 0.06em;
}

.hub-ann-count {
  font: 12px ui-monospace, Consolas, monospace;
  color: var(--hub-fg-3);
}

.hub-icon-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hub-line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--hub-fg-2);
  cursor: pointer;
}

.hub-icon-btn:hover {
  background: var(--hub-surface-2);
}

.hub-tabs {
  position: relative;
  display: flex;
  gap: 22px;
  margin-top: 6px;
  padding: 6px 24px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--hub-line);
  scrollbar-width: none;
}

.hub-tabs::-webkit-scrollbar {
  display: none;
}

.hub-tab-ann {
  flex: none;
  min-height: 40px;
  padding: 0 2px;
  border: 0;
  background: none;
  font: 600 14px var(--hub-serif);
  letter-spacing: 0.06em;
  color: var(--hub-fg-3);
  cursor: pointer;
  transition: color 0.2s ease;
}

.hub-tab-ann:hover {
  color: var(--hub-fg);
}

.hub-tab-ann.active {
  color: var(--hub-accent);
}

.hub-tab-ink {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--hub-accent);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), width 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hub-feature {
  display: block;
  width: 100%;
  padding: 26px 24px;
  border: 0;
  border-bottom: 1px solid var(--hub-line);
  background: linear-gradient(90deg, var(--hub-accent-soft), #ffffff 70%);
  text-align: left;
  cursor: pointer;
  animation: hubRise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hub-feature-kick {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 12px var(--hub-serif);
  letter-spacing: 0.2em;
  color: var(--hub-accent);
}

.hub-feature-kick::after {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--hub-accent);
  transform-origin: left;
  animation: hubDrawX 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both;
}

.hub-feature h3 {
  margin: 10px 0 8px;
  max-width: 34ch;
  font: 700 24px/1.45 var(--hub-serif);
  letter-spacing: 0.03em;
  color: var(--hub-fg);
  text-wrap: balance;
  transition: color 0.2s ease;
}

.hub-feature:hover h3 {
  color: var(--hub-accent);
}

.hub-feature p {
  margin: 0;
  max-width: 62ch;
  font: 14px/1.9 var(--hub-serif);
  color: var(--hub-fg-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hub-feature-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  color: var(--hub-fg-3);
}

.hub-feature-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  color: var(--hub-accent);
  font: 600 13px var(--hub-font);
}

.hub-feature-more svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.hub-feature:hover .hub-feature-more svg {
  transform: translateX(4px);
}

.hub-ann-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hub-ann-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 4px 18px;
  width: 100%;
  padding: 16px 24px;
  border: 0;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  animation: hubRise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s) forwards;
  transition: background 0.2s ease;
}

.hub-ann-list li + li .hub-ann-item {
  border-top: 1px solid var(--hub-line);
}

.hub-ann-item:hover {
  background: var(--hub-surface-2);
}

.hub-ann-date {
  text-align: center;
  line-height: 1;
}

.hub-ann-date b {
  display: block;
  font: 700 30px/1 var(--hub-serif);
  color: var(--hub-fg);
  font-variant-numeric: tabular-nums;
}

.hub-ann-date span {
  display: block;
  margin-top: 6px;
  font: 12px var(--hub-serif);
  letter-spacing: 0.12em;
  color: var(--hub-fg-3);
}

.hub-ann-main {
  min-width: 0;
}

.hub-ann-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 16px var(--hub-serif);
  letter-spacing: 0.03em;
  color: var(--hub-fg);
  transition: color 0.2s ease;
}

.hub-ann-item:hover .hub-ann-title {
  color: var(--hub-accent);
}

.hub-ann-title .t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hub-accent);
}

.hub-ann-ex {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 13px var(--hub-serif);
  color: var(--hub-fg-3);
}

.hub-ann-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 14px;
  font-size: 12px;
  color: var(--hub-fg-3);
}

.hub-cat {
  font: 600 12px var(--hub-serif);
  letter-spacing: 0.1em;
  color: var(--hub-accent);
}

.hub-cat.is-warn {
  color: var(--hub-warn);
}

.hub-cat.is-sec {
  color: var(--hub-danger);
}

.hub-pin {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--hub-warn);
  font-weight: 600;
}

.hub-pin svg {
  width: 13px;
  height: 13px;
}

.hub-arrow {
  color: var(--hub-line-strong);
  transition: transform 0.2s ease, color 0.2s ease;
}

.hub-arrow svg {
  width: 18px;
  height: 18px;
}

.hub-ann-item:hover .hub-arrow {
  transform: translateX(4px);
  color: var(--hub-accent);
}

.hub-empty {
  margin: 20px 24px;
  padding: 18px;
  border: 1px dashed var(--hub-line-strong);
  border-radius: 10px;
  color: var(--hub-fg-3);
  text-align: center;
}

/* 9. 系統提示（問候條右側）：小環形進度＋橫向逐項，每項為「圖示／標題／數量／前往」 */
.hub-pulse {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.hub-pulse-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px 0;
}

.hub-ring {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
}

.hub-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.hub-ring circle {
  fill: none;
  stroke-width: 9;
}

.hub-ring .track {
  stroke: #ffffff;
}

.hub-ring .bar {
  stroke: var(--hub-accent);
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s;
}

.hub-ring.all-done .bar {
  stroke: var(--hub-ok);
}

.hub-ring-t {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 11px var(--hub-serif);
}

.hub-pulse-cap b {
  font: 700 15px var(--hub-serif);
  letter-spacing: 0.08em;
}

.hub-pulse-cap span {
  margin-left: 8px;
  font-size: 12px;
  color: var(--hub-fg-2);
}

.hub-pulse-list {
  list-style: none;
  margin: 0;
  padding: 8px 8px 12px;
  display: grid;
  grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
}

.hub-pulse-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 0 10px;
  padding: 8px 14px;
  opacity: 0;
  animation: hubRise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s) forwards;
}

.hub-pulse-row + .hub-pulse-row {
  border-left: 1px solid var(--hub-accent-line);
}

.hub-mark {
  position: relative;
  grid-row: span 3;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.hub-mark.is-todo {
  background: var(--hub-warn-soft);
  border: 1px solid var(--hub-warn-line);
  color: var(--hub-warn);
}

.hub-mark.is-todo::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--hub-warn);
  opacity: 0;
  animation: hubPing 2.4s ease-out infinite;
}

.hub-mark.is-ok {
  background: var(--hub-ok-soft);
  border: 1px solid var(--hub-ok-line);
  color: var(--hub-ok);
}

.hub-mark svg {
  width: 16px;
  height: 16px;
}

.hub-mark.is-ok path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: hubDraw 0.7s ease 0.5s forwards;
}

.hub-pulse-b h3 {
  margin: 0;
  font: 700 13px var(--hub-serif);
  letter-spacing: 0.04em;
  color: var(--hub-fg);
}

.hub-pulse-b p {
  display: none;
}

.hub-pulse-n {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  line-height: 1.2;
}

.hub-pulse-n b {
  font: 700 22px/1.1 var(--hub-serif);
  color: var(--hub-warn);
  font-variant-numeric: tabular-nums;
}

.hub-pulse-n span {
  font-size: 12px;
  color: var(--hub-fg-3);
}

.hub-pulse-n .is-done {
  font: 700 13px var(--hub-serif);
  letter-spacing: 0.1em;
  color: var(--hub-ok);
}

.hub-pulse-go {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--hub-accent);
  font: 600 12px var(--hub-font);
  cursor: pointer;
}

.hub-pulse-go svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.hub-pulse-go:hover svg {
  transform: translateX(3px);
}

/* 10. 手機底部分頁列與面板 */
.hub-tabbar {
  display: none;
  flex-shrink: 0;
}

.hub-sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  align-items: flex-end;
  background: rgba(15, 23, 42, 0.45);
}

.hub-sheet-mask.show {
  display: flex;
}

.hub-sheet {
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  padding: 8px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  border-radius: 16px 16px 0 0;
  background: #ffffff;
  font-family: var(--hub-font);
  animation: hubUp 0.22s ease both;
  overscroll-behavior: contain;
}

/* 下拉關閉：拖曳中即時跟手（由 hub/nav.js 設定 transform），放開後回彈或關閉 */
.hub-sheet.is-dragging {
  animation: none;
  transition: none;
}

.hub-sheet.is-snap {
  transition: transform 0.18s ease;
}

.hub-sheet-grab {
  width: 40px;
  height: 4px;
  margin: 6px auto 14px;
  border-radius: 2px;
  background: var(--hub-line-strong);
}

.hub-sheet h3 {
  margin: 0 0 12px;
  font: 700 17px var(--hub-serif);
  letter-spacing: 0.04em;
  color: var(--hub-fg);
}

.hub-sheet-sub {
  margin: -6px 0 14px;
  color: var(--hub-fg-3);
}

.hub-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

/* 功能磚：圖示在左、文字在右（橫向），一列三個 */
.hub-tile {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding: 8px;
  border: 1px solid var(--hub-line);
  border-radius: 10px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.hub-tile b {
  min-width: 0;
  font: 700 13px/1.25 var(--hub-serif);
  letter-spacing: 0.02em;
  color: var(--hub-fg);
}

.hub-tile.active {
  border-color: var(--hub-accent-line);
  background: var(--hub-accent-soft);
}

.hub-tile .hub-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
}

.hub-tile-ico {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hub-accent-line);
  background: var(--hub-accent-soft);
  color: var(--hub-accent);
}

.hub-sheet-group + .hub-sheet-group {
  margin-top: 18px;
}

/* 11. 動畫：僅載入時播放一次（呼吸圓點除外）；系統設定「減少動態效果」時全部關閉 */
@keyframes hubRise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes hubDrop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@keyframes hubPing {
  0% { transform: scale(1); opacity: 0.55; }
  70%, 100% { transform: scale(1.7); opacity: 0; }
}

@keyframes hubDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes hubDrawX {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes hubUp {
  from { transform: translateY(24px); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-home *,
  .hub-sheet,
  .hub-notice {
    animation: none !important;
    transition: none !important;
  }

  .hub-pulse-row,
  .hub-ann-item {
    opacity: 1;
  }

  .hub-mark.is-ok path {
    stroke-dashoffset: 0;
  }
}

/* 12. 手機版：精簡頂部、底部分頁列；問候條單欄，今日提示改為一項一整列的直式清單 */
@media (max-width: 1100px) {
  .hub-hero.has-alerts {
    grid-template-columns: minmax(0, 1fr);
  }

  

.hub-hero-alerts {
    border-left: 0;
    border-top: 1px solid var(--hub-accent-line);
  }
}

@media (max-width: 860px) {
  .hub-top {
    padding: 0 16px;
    min-height: 56px;
  }

  .hub-clock-capsule,
  .hub-clock,
  .hub-user,
  .hub-nav,
  .hub-mega {
    display: none !important;
  }

  .hub-brand {
    margin-right: 0;
  }

  .hub-brand-img {
    height: 30px;
  }

  .hub-home {
    padding: 16px;
  }

  .hub-hero-text {
    padding: 14px 16px 16px;
  }

  .hub-hero h1 {
    font-size: 20px;
  }

  .hub-hero h1 small {
    display: block;
    margin: 2px 0 0;
  }

  .hub-notice {
    padding: 8px 10px;
    gap: 8px;
  }

  /* 手機：橫幅只顯示公告類型 (重要／資安／置頂) 與「立即查看」，不顯示標題內容 */
  .hub-notice-title {
    display: none;
  }

  .hub-notice-t {
    align-items: center;
    gap: 8px;
  }

  .hub-notice-k {
    font-size: 14px;
    letter-spacing: 0.08em;
  }

  .hub-notice-more {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hub-notice button {
    padding: 0 4px;
    font-size: 14px;
    white-space: nowrap;
  }

  /* 手機：問候條精簡——連線狀態放在姓名右側，不顯示日期與今日出勤時間；問候與今日提示上下堆疊（單欄） */
  .hub-hero-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .hub-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin-top: 4px;
    font-size: 12px;
  }

  .hub-hero-meta .hub-pill {
    padding: 2px 8px;
    font-size: 11px;
  }

  .hub-pulse-head {
    padding: 10px 14px 0;
  }

  /* 今日提示：一項一整列，左圖示＋標題／數量，右側為「前往」，整列填滿不留白 */
  .hub-pulse-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px 12px;
  }

  .hub-pulse-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--hub-accent-line);
    border-radius: 10px;
    background: #ffffff;
  }

  .hub-pulse-row .hub-pulse-go {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    margin-top: 0;
  }

  .hub-pulse-row + .hub-pulse-row {
    border-left: 1px solid var(--hub-accent-line);
  }

  .hub-ann-head {
    padding: 16px 16px 0;
  }

  .hub-tabs {
    padding: 4px 16px 0;
    gap: 18px;
  }

  .hub-feature {
    padding: 20px 16px;
  }

  .hub-feature h3 {
    font-size: 19px;
  }

  .hub-ann-item {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 14px 16px;
    gap: 4px 12px;
  }

  .hub-ann-item .hub-arrow {
    display: none;
  }

  .hub-ann-date b {
    font-size: 24px;
  }

  .hub-ann-ex {
    display: none;
  }

  .hub-tabbar {
    display: flex;
    position: relative;
    z-index: 5;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--hub-line);
    background: rgba(255, 255, 255, 0.96);
  }

  /* 中間圓形首頁鈕：凸出導覽列，內放公司 α 圖示 */
  .hub-tab-home {
    position: relative;
  }

  .hub-tab-home-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-top: -26px;
    border: 3px solid var(--hub-line);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 14px -6px rgba(15, 23, 42, 0.35);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  .hub-tab-home-ring img {
    width: 30px;
    height: auto;
    object-fit: contain;
  }

  .hub-tab-home.active .hub-tab-home-ring {
    border-color: var(--hub-accent);
    box-shadow: 0 6px 14px -6px rgba(2, 132, 199, 0.55);
  }

  .hub-tab[hidden] {
    display: none;
  }

  /* 左側快捷格的待辦徽章：貼在圖示右上角 */
  .hub-tab[data-slot] {
    position: relative;
  }

  .hub-tab[data-slot] .hub-badge {
    position: absolute;
    top: 4px;
    left: calc(50% + 6px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
  }

  .hub-tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px;
    border: 0;
    background: transparent;
    color: var(--hub-fg-3);
    font: 600 11px var(--hub-font);
    cursor: pointer;
  }

  .hub-tab.active {
    color: var(--hub-accent);
  }
}

/* =========================================================================
   管理模組共用外框與頁首 (Hub Page Frame)
   用法：模組根容器加 .hub-page；頁首 <header class="hub-page-head"> 內含
         .hub-page-title-wrap > .hub-page-title (可含 .hub-page-dot 連線點) + .hub-page-rule，
         右側操作區 .hub-page-actions。寬度、外距、標題字級一律在此統一，模組不得自行覆寫。
   連線點離線時由模組 JS 加上 .is-offline。
   ========================================================================= */
.hub-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 16px 56px;
  box-sizing: border-box;
}

.hub-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hub-page-title-wrap { display: flex; flex-direction: column; }

.hub-page-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Plus Jakarta Sans", "Noto Serif TC", "Source Han Serif TC", "Songti TC", serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.04em;
  color: #0f172a;
}

.hub-page-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0284c7;
  box-shadow: 0 0 0 3px #bae6fd;
  display: inline-block;
  flex-shrink: 0;
}
.hub-page-dot.is-offline { background: #be123c; box-shadow: 0 0 0 3px #fecdd3; }

.hub-page-rule {
  display: block;
  width: 32px;
  height: 2px;
  margin-top: 8px;
  border-radius: 2px;
  background: #0284c7;
}

.hub-page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media (max-width: 860px) {
  .hub-page { padding: 16px 12px 48px; }
  .hub-page-title { font-size: 22px; }
  /* 手機：標題在左、操作按鈕靠右同列（放不下時自動換行並靠右） */
  .hub-page-head { align-items: center; gap: 10px 12px; }
  /* 手機隱藏標題下短線，標題與按鈕才會在同一水平線上（桌面保留） */
  .hub-page-rule { display: none; }
  .hub-page-title-wrap { min-width: 0; }
  .hub-page-actions { margin-left: auto; justify-content: flex-end; }
}

/* ═════════════════════════════════════════════════════════════
   13. 資料庫安全清理共用彈窗 (HubPurge，hub/purge.js)
   風格：紅色危險色＋三步驟時間軸；所有「刪除資料庫資料」功能共用，類名一律 hub-purge- 前綴
   ═════════════════════════════════════════════════════════════ */
.hub-purge-mask {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  font-family: var(--hub-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--hub-fg);
}

.hub-purge-mask.is-open { display: flex; }
.hub-purge-mask [hidden] { display: none !important; }

.hub-purge {
  --hp-danger: #dc2626;
  --hp-danger-soft: #fef2f2;
  --hp-danger-line: #fecaca;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25);
  animation: hub-purge-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hub-purge-pop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.hub-purge-i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
}

.hub-purge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--hub-line);
  background: #ffffff;
}

.hub-purge-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--hub-serif);
  font-size: 17px;
  font-weight: 700;
  min-width: 0;
}

.hub-purge-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--hp-danger-line);
  border-radius: 10px;
  background: var(--hp-danger-soft);
  color: var(--hp-danger);
}

.hub-purge-icon .hub-purge-i { width: 17px; height: 17px; }

.hub-purge-chip {
  padding: 2px 9px;
  border: 1px solid var(--hub-line);
  border-radius: 999px;
  background: var(--hub-surface-2);
  color: var(--hub-fg-3);
  font-family: var(--hub-font);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.hub-purge-close {
  display: flex;
  padding: 4px;
  border: none;
  background: none;
  color: var(--hub-fg-3);
  cursor: pointer;
}

.hub-purge-close:hover { color: var(--hub-fg); }

.hub-purge-body {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #ffffff;
}

.hub-purge-guard {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px 22px;
  border-bottom: 1px solid var(--hub-line);
  background: var(--hub-surface-2);
  color: var(--hub-fg-3);
  font-size: 12.5px;
  line-height: 1.7;
}

.hub-purge-guard .hub-purge-i { margin-top: 3px; color: var(--hub-accent); }
.hub-purge-guard strong { color: var(--hub-fg); font-family: var(--hub-serif); }

.hub-purge-steps {
  list-style: none;
  margin: 0;
  padding: 22px 22px 8px;
  display: flex;
  flex-direction: column;
}

.hub-purge-step {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 24px;
}

.hub-purge-step::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: 4px;
  width: 1px;
  background: var(--hub-line);
}

.hub-purge-step:last-child { padding-bottom: 14px; }
.hub-purge-step:last-child::before { display: none; }

.hub-purge-no {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--hub-line-strong);
  border-radius: 50%;
  background: #ffffff;
  color: var(--hub-fg-2);
  font-family: var(--hub-serif);
  font-size: 13px;
  font-weight: 700;
}

.hub-purge-step-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

.hub-purge-step-title {
  margin-top: 3px;
  font-family: var(--hub-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--hub-fg);
  line-height: 1.5;
}

.hub-purge-step-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hub-purge-step-row .hub-purge-step-title { margin-top: 0; }
.hub-purge-confirm-hint strong { color: var(--hp-danger); }
.hub-purge-sublabel { font-size: 12px; font-weight: 600; color: var(--hub-fg-3); }
.hub-purge-pwd-lbl { display: block; margin-top: 12px; }
.hub-purge-pwd-lbl[hidden], .hub-purge-input[hidden] { display: none; }
.hub-purge-pwd-input { margin-top: 6px; }
.hub-purge-field { display: flex; flex-direction: column; gap: 6px; }

.hub-purge-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  padding: 3px;
  border: 1px solid var(--hub-line);
  border-radius: 999px;
  background: var(--hub-surface-2);
  box-sizing: border-box;
}

.hub-purge-seg-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--hub-fg-3);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.hub-purge-seg-item input { display: none; }
.hub-purge-seg-item:hover { color: var(--hub-fg); }
.hub-purge-seg-item.is-active {
  background: #ffffff;
  color: #075985;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.hub-purge-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--hub-line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--hub-fg);
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
}

.hub-purge-input:focus {
  border-color: var(--hub-accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.hub-purge-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid var(--hub-line);
  border-left: 3px solid var(--hp-danger);
  border-radius: 4px 14px 14px 4px;
  background: #ffffff;
}

.hub-purge-figure { display: flex; align-items: baseline; gap: 6px; }

.hub-purge-number {
  font-family: var(--hub-serif);
  font-size: 38px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--hub-fg);
  letter-spacing: -0.01em;
}

.hub-purge-unit { font-size: 13px; font-weight: 600; color: var(--hub-fg-3); }
.hub-purge-result.is-text { border-left-color: var(--hub-line-strong); }
.hub-purge-result.is-text .hub-purge-number { font-size: 16px; font-weight: 700; color: var(--hub-fg-3); }
.hub-purge-result.is-text .hub-purge-unit { display: none; }
.hub-purge-result.is-error .hub-purge-number { color: var(--hp-danger); }
.hub-purge-meta { font-size: 12px; color: var(--hub-fg-3); line-height: 1.6; }
.hub-purge-meta:empty { display: none; }

.hub-purge-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--hub-line);
  background: #ffffff;
}

.hub-purge-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hub-purge-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.hub-purge-btn--danger { background: var(--hp-danger); color: #ffffff; font-weight: 700; }
.hub-purge-btn--danger:hover:not(:disabled) { background: #b91c1c; }
.hub-purge-btn--cancel { background: #64748b; color: #ffffff; }
.hub-purge-btn--cancel:hover:not(:disabled) { background: #475569; }
.hub-purge-btn--ghost { background: #ffffff; border-color: var(--hub-line); color: var(--hub-fg-2); }
.hub-purge-btn--ghost:hover:not(:disabled) { background: #f1f5f9; border-color: var(--hub-line-strong); }
.hub-purge-btn--sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }

@media (max-width: 820px) {
  .hub-purge { max-width: none; }
  .hub-purge-steps { padding: 18px 16px 4px; }
  .hub-purge-guard { padding: 10px 16px; }
  .hub-purge-step { gap: 12px; }
  .hub-purge-number { font-size: 32px; }
  .hub-purge-foot { flex-direction: column; padding: 12px 16px; }
  .hub-purge-foot .hub-purge-btn { width: 100%; height: 42px; }
}

/* ═════════════════════════════════════════════════════════════
   14. 匯出／入帳／欄位偏好彈窗共用版型 (hub-xp-*)
   來源：原 DailyReportManage .drm-xp-* 與 OvertimeManage .otm-xp-* 逐字相同的 67 條規則。
   用法：外殼 .hub-xp（可加模組自有類名做色彩／寬度差異），內容 .hub-xp-head／-body／-guard／-steps／-step／-result／-foot／-btn／-cols…
   差異變數：--xp-accent*（強調色，模組可覆寫）、--xp-danger（錯誤文字色，DRM 覆寫為 #be123c）。
   圖示一律用 .hub-svg-icon（面板內筆畫 1.8，與舊 .xx-xp-i 一致）。
   ═════════════════════════════════════════════════════════════ */
.hub-xp {
  --xp-accent: #0284c7;
  --xp-accent-soft: #f0f9ff;
  --xp-accent-line: #bae6fd;
  --xp-brand: #0284c7;
  --xp-brand-soft: #f0f9ff;
  --xp-line: #e2e8f0;
  --xp-line-strong: #cbd5e1;
  --xp-fg: #0f172a;
  --xp-fg-2: #475569;
  --xp-fg-3: #64748b;
  --xp-surface-2: #f8fafc;
  --xp-btn: #068fd6;
  --xp-btn-hover: #0581c2;
  --xp-cancel: #64748b;
  --xp-cancel-hover: #475569;
  --xp-danger: #dc2626;
  --xp-font: "Plus Jakarta Sans", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --xp-serif: "Plus Jakarta Sans", "Noto Serif TC", "Source Han Serif TC", serif;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25);
  font-family: var(--xp-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--xp-fg);
}
.hub-xp .hub-svg-icon { stroke-width: 1.8; }
.hub-xp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--xp-line); }
.hub-xp-title { display: flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--xp-serif); font-size: 17px; font-weight: 700; }
.hub-xp-icon { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--xp-accent-line); border-radius: 10px; background: var(--xp-accent-soft); color: var(--xp-accent); }
.hub-xp-icon .hub-svg-icon { width: 17px; height: 17px; }
.hub-xp-close { display: flex; padding: 4px; border: none; background: none; color: var(--xp-fg-3); cursor: pointer; }
.hub-xp-close:hover { color: var(--xp-fg); }
.hub-xp-body { display: flex; flex-direction: column; overflow-y: auto; }
.hub-xp-guard { margin: 0; display: flex; gap: 8px; align-items: flex-start; padding: 12px 22px; border-bottom: 1px solid var(--xp-line); background: var(--xp-surface-2); color: var(--xp-fg-3); font-size: 12.5px; line-height: 1.7; }
.hub-xp-guard .hub-svg-icon { margin-top: 3px; color: var(--xp-brand); }
.hub-xp-guard strong { color: var(--xp-fg); font-family: var(--xp-serif); }
.hub-xp-steps { list-style: none; margin: 0; padding: 22px 22px 8px; display: flex; flex-direction: column; }
.hub-xp-step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding-bottom: 24px; }
.hub-xp-step::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 4px; width: 1px; background: var(--xp-line); }
.hub-xp-step:last-child { padding-bottom: 14px; }
.hub-xp-step:last-child::before { display: none; }
.hub-xp-no { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--xp-line-strong); border-radius: 50%; background: #ffffff; color: var(--xp-fg-2); font-family: var(--xp-serif); font-size: 13px; font-weight: 700; }
.hub-xp-step-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.hub-xp-step-title { margin-top: 3px; font-family: var(--xp-serif); font-size: 15px; font-weight: 700; color: var(--xp-fg); line-height: 1.5; }
.hub-xp-step-title strong { color: var(--xp-accent); }
.hub-xp .hub-xp-summary { width: 100%; border-collapse: collapse; font-size: 13px; border: 1px solid var(--xp-line); border-radius: 10px; overflow: hidden; }
.hub-xp .hub-xp-summary th { width: 84px; padding: 7px 12px; text-align: left; font-weight: 600; color: var(--xp-fg-3); background: var(--xp-surface-2); border-bottom: 1px solid var(--xp-line); white-space: nowrap; }
.hub-xp .hub-xp-summary td { padding: 7px 12px; color: var(--xp-fg); border-bottom: 1px solid var(--xp-line); }
.hub-xp .hub-xp-summary tr:last-child th,
.hub-xp .hub-xp-summary tr:last-child td { border-bottom: 0; }
.hub-xp-result { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border: 1px solid var(--xp-line); border-left: 3px solid var(--xp-accent); border-radius: 4px 14px 14px 4px; background: #ffffff; }
.hub-xp-figure { display: flex; align-items: baseline; gap: 6px; }
.hub-xp-number { font-family: var(--xp-serif); font-size: 38px; font-weight: 800; line-height: 1.15; color: var(--xp-fg); letter-spacing: -0.01em; }
.hub-xp-unit { font-size: 13px; font-weight: 600; color: var(--xp-fg-3); }
.hub-xp-meta { font-size: 12px; color: var(--xp-fg-3); line-height: 1.6; }
.hub-xp-result.is-text { border-left-color: var(--xp-line-strong); font-size: 16px; font-weight: 700; color: var(--xp-fg-3); }
.hub-xp-result.is-error { color: var(--xp-danger); }
.hub-xp-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--xp-line); }
.hub-xp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: all 0.15s ease; }
.hub-xp-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.hub-xp-btn--primary { background: var(--xp-btn); color: #ffffff; font-weight: 700; }
.hub-xp-btn--primary:hover:not(:disabled) { background: var(--xp-btn-hover); }
.hub-xp-btn--cancel { background: var(--xp-cancel); color: #ffffff; }
.hub-xp-btn--cancel:hover:not(:disabled) { background: var(--xp-cancel-hover); }
@media (max-width: 820px) {
  .hub-xp { max-width: none; }
  .hub-xp-steps { padding: 18px 16px 4px; }
  .hub-xp-guard { padding: 10px 16px; }
  .hub-xp-step { gap: 12px; }
  .hub-xp-number { font-size: 32px; }
  .hub-xp-foot { flex-direction: column; padding: 12px 16px; }
  .hub-xp-foot .hub-xp-btn { width: 100%; height: 42px; }
}

.hub-xp-btn--ghost { background: #ffffff; border-color: var(--xp-line); color: var(--xp-fg-2); }
.hub-xp-btn--ghost:hover:not(:disabled) { background: #f1f5f9; border-color: var(--xp-line-strong); }
.hub-xp-btn--sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.hub-xp--cols { max-width: 520px; }
.hub-xp-cols-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 22px 10px; }
.hub-xp-cols { display: flex; flex-direction: column; padding: 0 22px 16px; max-height: 46vh; overflow-y: auto; }
.hub-xp-col { display: flex; align-items: center; gap: 12px; padding: 7px 4px; border-bottom: 1px solid var(--xp-line); }
.hub-xp-col:last-child { border-bottom: 0; }
.hub-xp-col-seq { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1.5px solid var(--xp-line-strong); border-radius: 50%; font-family: var(--xp-serif); font-size: 12px; font-weight: 700; color: var(--xp-fg-2); }
.hub-xp-col-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.hub-xp-col-check { width: 16px; height: 16px; margin: 0; accent-color: var(--xp-brand); cursor: pointer; }
.hub-xp-col-name { font-size: 14px; font-weight: 600; color: var(--xp-fg); }
.hub-xp-col.is-off .hub-xp-col-name { color: var(--xp-fg-3); font-weight: 500; text-decoration: line-through; }
.hub-xp-col.is-off .hub-xp-col-seq { opacity: 0.5; }
.hub-xp-col-move { display: inline-flex; gap: 4px; flex-shrink: 0; }
.hub-xp-col-btn { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--xp-line); border-radius: 8px; background: #ffffff; color: var(--xp-fg-2); cursor: pointer; transition: all 0.15s; }
.hub-xp-col-btn:hover:not(:disabled) { border-color: var(--xp-brand); color: var(--xp-brand); background: var(--xp-brand-soft); }
.hub-xp-col-btn:disabled { opacity: 0.35; cursor: not-allowed; }
@media (max-width: 820px) {
  .hub-xp-cols-bar { padding: 12px 16px 8px; }
  .hub-xp-cols { padding: 0 16px 14px; }
  .hub-xp-cols-bar .hub-xp-btn { width: auto; height: 30px; }
}


/* ═════════════════════════════════════════════════════════════
   15. 頁首「資料管理」下拉選單共用版型 (hub-dd-*)
   來源：原 DailyReportManage .drm-dropdown-* 與 OvertimeManage .otm-dropdown-*（頁首「管理」按鈕最終生效的外觀，與人員管理一致）。
   結構：.hub-dd（wrapper，開啟時加 .is-open）> .hub-dd-btn（含 .hub-dd-arrow）＋ .hub-dd-menu > .hub-dd-item（.hub-dd-item__icon／__title）／.hub-dd-divider／.hub-dd-item--danger
   ═════════════════════════════════════════════════════════════ */
.hub-dd { position: relative; display: inline-block; }
.hub-dd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font: 600 14px/1.6 "Plus Jakarta Sans", "Noto Serif TC", "Source Han Serif TC", "Songti TC", serif;
  letter-spacing: 0;
  box-shadow: none;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.hub-dd-btn:hover { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; }
.hub-dd-btn svg:not(.hub-dd-arrow) { width: 18px; height: 18px; }
.hub-dd .hub-dd-arrow { width: 18px; height: 18px; margin: 0; opacity: 1; transition: transform 0.2s ease; }
.hub-dd.is-open .hub-dd-arrow { transform: rotate(180deg); }
.hub-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  min-width: 0;
  max-width: calc(100vw - 24px);
  padding: 6px;
  gap: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 16px 28px -16px rgba(15, 23, 42, 0.35);
  display: none;
  flex-direction: column;
  z-index: 1050;
  animation: hubDdFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.hub-dd.is-open .hub-dd-menu { display: flex; }
@keyframes hubDdFadeIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.hub-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font: 500 14px/1.6 "Plus Jakarta Sans", "Noto Serif TC", "Source Han Serif TC", "Songti TC", serif;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.hub-dd-item:hover { background: #f8fafc; color: #0f172a; }
.hub-dd-item__icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; border: 0; background: transparent; color: inherit; }
.hub-dd-item__icon svg { width: 18px; height: 18px; }
.hub-dd-item__title { font: 500 14px/1.6 "Plus Jakarta Sans", "Noto Serif TC", "Source Han Serif TC", "Songti TC", serif; color: inherit; white-space: nowrap; }
.hub-dd-divider { height: 1px; margin: 4px 0; background: #e2e8f0; }
.hub-dd-item--danger,
.hub-dd-item--danger .hub-dd-item__title { color: #dc2626; }
.hub-dd-item--danger:hover { background: #fef2f2; color: #b91c1c; }
