/* =====================================================================
 * elder.css － 後台介面樣式（獨立版，不再使用舊版型 styles.css / custom.css）
 * 長者友善、手機優先、配色取自 Logo
 *
 *   主色 藍   #1E5BB8   深藍 #17468F   淺藍底 #E8F0FB   （企業色；導覽、一般按鈕、選取）
 *   綠   #2A7F6B   深綠 #20685A   淺綠底 #E7F5F0           （只用在「儲存」與「提醒」）
 *   點綴 星星黃 #F2C230   蜜蜂藍 #5CCBEF                    （代言人的帽子星星與小蜜蜂；只當裝飾）
 *   刪除 紅  #BF1D2C   深紅 #A3141F   淺紅底 #FBEAEC
 *   文字 #1F2A3D  次要文字 #4F5B70  框線 #BFCFE6 / #D9E3F2  背景 #F3F6FB
 *   形狀：葉片圓角（左上與右下大、另兩角小），呼應操作手冊的風格
 *
 * 字級原則：內文 1.1875rem(19px)，任何文字最小 1.0625rem(17px)，標題 1.5rem(24px) 以上
 * 字級全部用 rem：頂部的 A−／A＋ 按鈕調整 html 字級，全站文字一起放大縮小
 * ===================================================================== */

/* 不載入網路字型：中文字型檔動輒數 MB，改用各裝置內建的黑體，開啟更快 */

/* ---------- 重設 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: #F3F6FB; color: #1F2A3D;
  font-family: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  font-size: 1.1875rem; line-height: 1.6;
}
h1, h2, h3, h4, h5, h6, p, ul, ol, blockquote, figure { margin: 0 0 16px; }
h1 { font-size: 1.875rem; } h2 { font-size: 1.625rem; } h3 { font-size: 1.4375rem; }
h4 { font-size: 1.3125rem; } h5, h6 { font-size: 1.25rem; }
ul, ol { padding-left: 1.4em; }
img { max-width: 100%; height: auto; border: 0; }
a { color: #17468F; text-underline-offset: 3px; }
a:hover { color: #10336B; }
:focus-visible { outline: 3px solid #1E5BB8; outline-offset: 2px; }
hr { border: none; border-top: 1px solid #D9E3F2; margin: 24px 0; }

/* 所有文字最小 17px：涵蓋舊程式中的 <small>、<font size>、font12px 之類 */
small, sub, sup, font, .text-small { font-size: 1.0625rem !important; }
.font18px { font-size: 1.25rem !important; }
font[size="1"], font[size="2"], font[size="3"] { font-size: 1.1875rem !important; }

/* 舊版型的工具 class */
.clear { clear: both; height: 0; overflow: hidden; }
.text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; }
.alignright { float: right; } .aligncenter { display: block; margin: 0 auto; }
.text_white { color: inherit; }
.divider_space { height: 8px; }
.img-demo { border-radius: 12px; border: 1px solid #D9E3F2; }
.icon_btn, img[src*="icon_btn"] { width: 32px; height: 32px; }

/* ---------- 頂部列 ---------- */
.elder-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  min-height: 72px; padding: 0 16px; padding-top: env(safe-area-inset-top, 0px);
  background: #FFFFFF; border-bottom: 1px solid #D9E3F2;
}
.elder-brand {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 12px;
  color: #1F2A3D; text-decoration: none; font-size: 1.3125rem; font-weight: 700;
}
.elder-brand:hover { color: #1F2A3D; }
.elder-brand img { width: 40px; height: 40px; flex-shrink: 0; }
.elder-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elder-btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 14px; border: 2px solid #BFCFE6; border-radius: 12px; background: #FFFFFF;
  color: #1F2A3D; font-size: 1.125rem; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.elder-btn-outline:hover { border-color: #1E5BB8; color: #1F2A3D; }
.elder-flash {
  margin: 12px 16px 0; padding: 14px 16px; border-radius: 12px;
  background: #FFF7E0; border: 2px solid #E0B43A; color: #5C4300; font-size: 1.1875rem;
}

/* 舊頂部區塊：只剩管理者的特殊按鈕 */
.header { padding: 0 16px; }
.header .header_right { text-align: right; padding: 8px 0 0; }
.header .header_right:empty, .header.elder-empty-header { display: none; }

/* ---------- 電腦版功能選單（原本的快速選單） ---------- */
.head_bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px;
  padding: 0 20px; background: #FFFFFF; border-bottom: 1px solid #D9E3F2; font-size: 1.125rem;
}
.head_bar > img { display: none; }
.head_bar .head_label { display: none; }
.head_bar #Nametxt { margin-left: auto; color: #4F5B70; font-size: 1.0625rem; }
.head_bar ul.dropdown { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.head_bar ul.dropdown li { position: relative; list-style: none; }
.head_bar ul.dropdown > li > a, .head_bar ul.dropdown > li > span > a {
  display: flex; align-items: center; min-height: 56px; padding: 0 14px;
  color: #1F2A3D; font-weight: 500; text-decoration: none;
}
.head_bar ul.dropdown > li:hover > a, .head_bar ul.dropdown > li:hover > span > a { color: #1E5BB8; }
.head_bar ul.dropdown ul {
  display: none; position: absolute; top: 100%; left: 0; z-index: 100;
  min-width: 260px; margin: 0; padding: 8px 0; list-style: none;
  background: #FFFFFF; border: 1px solid #D9E3F2; border-radius: 12px; box-shadow: 0 8px 24px rgba(31, 42, 61, 0.12);
}
.head_bar ul.dropdown ul ul { top: -9px; left: 100%; }
.head_bar ul.dropdown li:hover > ul, .head_bar ul.dropdown li:focus-within > ul { display: block; }
.head_bar ul.dropdown ul a { display: block; padding: 10px 18px; color: #1F2A3D; text-decoration: none; font-size: 1.125rem; }
.head_bar ul.dropdown ul a:hover { background: #E8F0FB; color: #17468F; }
.head_bar ul.dropdown li p { display: inline-flex; gap: 10px; align-items: center; margin: 0; padding: 0 6px; min-height: 56px; vertical-align: middle; }
.head_bar ul.dropdown > li:has(> p) { display: flex; align-items: center; }
.head_bar ul.dropdown > li > p { display: inline-flex; }
.head_bar ul.dropdown li p img { width: 28px; height: 28px; }

/* ---------- 底部選單（手機才顯示） ---------- */
.elder-bottomnav { display: none; }

/* ---------- 主要版面 ---------- */
.middle { padding: 24px 0 48px; }
.container_24 { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.middle .container_24 { display: flex; gap: 24px; align-items: flex-start; }
.middle .container_24 > .clear { display: none; }
.sidebar { flex: 0 0 260px; width: 260px; }
.sidebar #logo, .search_box { display: none; }        /* Logo 已移到頂部列；搜尋框原本就沒有作用 */
.sidebar:not(.elder-has-content) { display: none; }   /* elder.js 判斷側欄沒有內容時隱藏 */
.content { flex: 1 1 auto; min-width: 0; }
.grid_1, .grid_10 { margin: 0 0 24px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }

/* 側欄選單 */
.box { background: #FFFFFF; border: 1px solid #D9E3F2; border-radius: 16px; padding: 16px; margin: 0 0 16px; }
.box h3 { font-size: 1.3125rem; margin: 0 0 10px; }
ul.tf_menu_gray { list-style: none; margin: 0; padding: 0; }
ul.tf_menu_gray li { list-style: none; }
ul.tf_menu_gray a { display: block; padding: 10px 8px; border-radius: 10px; color: #1F2A3D; text-decoration: none; font-size: 1.125rem; }
ul.tf_menu_gray a:hover { background: #E8F0FB; color: #17468F; }
ul.tf_menu_gray ul { padding-left: 14px; }

/* ---------- 頁面標題列 ---------- */
h2.icon_option {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 20px; font-size: 1.625rem; line-height: 1.3; font-weight: 400;
}
h2.icon_option strong { flex: 1 1 100%; font-weight: 700; }
h2.icon_option strong em { font-style: normal; font-weight: 500; color: #4F5B70; font-size: 1.3125rem; margin-left: 10px; }
h2.icon_option b { font-size: 1.1875rem; color: #4F5B70; font-weight: 500; }
h2.icon_option select { width: auto; }

h3.border { padding: 16px; background: #FFFFFF; border-radius: 16px; border: 1px solid #D9E3F2; font-size: 1.3125rem; }
h6.box_red, h6.box_blue, h6.box_yellow, h6.box_black, h6.box_green {
  margin: 0 0 12px; font-size: 1.3125rem; font-weight: 700; color: #1F2A3D;
  display: flex; align-items: center; gap: 10px;
}
h6.box_red::before, h6.box_blue::before, h6.box_yellow::before, h6.box_black::before, h6.box_green::before {
  content: ""; width: 6px; height: 24px; border-radius: 3px; background: #1E5BB8;
}
h6.box_red::before { background: #BF1D2C; }

/* 儲存狀態提示 */
.warrning_box, .check_box {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 10px 16px;
  border-radius: 12px; font-size: 1.1875rem; font-weight: 700;
}
.warrning_box { background: #FFF7E0; border: 2px solid #E0B43A; color: #5C4300; }
.check_box { background: #E8F0FB; border: 2px solid #1E5BB8; color: #17468F; }
a.wrong_box, a.success_box, a.note_box { text-decoration: none; font-size: 1.1875rem; }

/* ---------- 按鈕 ---------- */
a.button_link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px; margin: 2px 0;
  border: 2px solid #1E5BB8; border-radius: 12px; background: #FFFFFF;
  color: #17468F; font-size: 1.125rem; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap;
}
a.button_link:hover { background: #E8F0FB; color: #17468F; }
a.button_link span { display: inline; }
a.button_link.btn_green, a.button_link.btn_cyan { background: #1E5BB8; color: #FFFFFF; }
a.button_link.btn_green:hover, a.button_link.btn_cyan:hover { background: #17468F; color: #FFFFFF; }
a.button_link.btn_red { border-color: #BF1D2C; color: #A3141F; }
a.button_link.btn_red:hover { background: #FBEAEC; }
a.button_link.btn_gray, a.button_link.btn_silver { border-color: #BFCFE6; color: #1F2A3D; }
a.button_link.btn_orange, a.button_link.btn_yellow { border-color: #1E5BB8; color: #17468F; }

input[type="submit"], input[type="reset"], input[type="button"], button,
input.btn-submit, input.btn-submit-long, input.btn-login, input.btn-logout, input.btn-search {
  -webkit-appearance: none; appearance: none;
  min-height: 52px; padding: 0 22px; border: none; border-radius: 12px;
  background: #1E5BB8; color: #FFFFFF; font-family: inherit; font-size: 1.1875rem; font-weight: 700; cursor: pointer;
}
input[type="submit"]:hover, input[type="button"]:hover, button:hover { background: #17468F; }
input[type="reset"] { background: #FFFFFF; color: #1F2A3D; border: 2px solid #BFCFE6; }
input[type="reset"]:hover { background: #F3F6FB; }
input[type="image"] { width: 44px; height: 44px; min-width: 44px; padding: 6px; object-fit: contain; vertical-align: middle; }
button[disabled], input[disabled] { opacity: 0.5; cursor: not-allowed; }

a.elder-btn, button.elder-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border: none; border-radius: 12px;
  background: #1E5BB8; color: #FFFFFF; font-size: 1.1875rem; font-weight: 700; text-decoration: none;
}
a.elder-btn:hover, button.elder-btn:hover { background: #17468F; color: #FFFFFF; }
.elder-btn-block { display: flex !important; width: 100%; min-height: 60px; font-size: 1.3125rem !important; }
a.elder-btn-danger, button.elder-btn-danger { background: #FFFFFF; color: #A3141F; border: 2px solid #BF1D2C; }
a.elder-btn-danger:hover, button.elder-btn-danger:hover { background: #FBEAEC; color: #A3141F; }

/* ---------- 表單 ---------- */
input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], input[type="url"], input[type="search"], input:not([type]), select, textarea {
  max-width: 100%; min-height: 52px; padding: 10px 14px;
  border: 2px solid #7D8BA3; border-radius: 12px; background: #FFFFFF;
  color: #1F2A3D; font-family: inherit; font-size: 1.1875rem; line-height: 1.5;
}
input[type="file"] { max-width: 100%; font-size: 1.125rem; padding: 8px 0; }
textarea { width: 100%; min-height: 140px; resize: vertical; }
select { padding-right: 36px; }
input:focus, select:focus, textarea:focus { border-color: #1E5BB8; outline: 3px solid #E8F0FB; }
input[type="radio"], input[type="checkbox"] { width: 26px; height: 26px; margin: 0 6px 0 0; vertical-align: middle; accent-color: #1E5BB8; }
label { cursor: pointer; }
.radio-word { font-size: 1.1875rem; }
::placeholder { color: #6B7890; opacity: 1; }

/* ---------- 表格（外層由 elder.js 包上可左右滑動的容器） ---------- */
table { border-collapse: collapse; font-size: 1.125rem; }
table.table-edit { width: 100%; min-width: 100%; border-collapse: separate; border-spacing: 0; background: #FFFFFF; }
table.table-edit th {
  padding: 14px 12px; background: #E8F0FB; color: #1F2A3D; font-size: 1.125rem; font-weight: 700;
  text-align: left; white-space: nowrap; border-bottom: 1px solid #BFCFE6;
}
table.table-edit td { padding: 12px; border-bottom: 1px solid #E7EDF7; vertical-align: middle; font-size: 1.125rem; white-space: nowrap; }
/* 長文字欄位（elder.js 自動判斷）才換行，避免日期、電話被切成好幾行 */
table.table-edit td.elder-wrap { white-space: normal; min-width: 260px; max-width: 420px; }
table.table-edit td:has(textarea) { white-space: normal; }
table.table-edit tr:last-child td { border-bottom: none; }
table.table-edit tr:hover td { background: #F7F9FD; }
/* 資料表格內的輸入框：電腦上縮放填滿欄寬，手機上保留最小寬度（改用左右滑動） */
table.table-edit td input[type="text"], table.table-edit td input:not([type]), table.table-edit td select { width: 100%; min-width: 120px; }
table.table-edit td select { min-width: 80px; }
table.table-edit td textarea { width: 100%; min-width: 220px; min-height: 96px; }
table.table-edit td.grid_t-s, table.table-edit th.grid_t-s { min-width: 0; text-align: center; }

/* 表單表格（欄位名稱＋輸入框，沒有表頭列）：欄位填滿寬度，不會撐破畫面 */
table.elder-form-table { width: 100%; table-layout: auto; border: 1px solid #D9E3F2; border-radius: 16px; overflow: hidden; margin: 0 0 24px; }
table.elder-form-table td { white-space: normal; }
table.elder-form-table td.text-right, table.elder-form-table td[nowrap] { width: 1%; white-space: nowrap; color: #1F2A3D; font-weight: 500; }
table.elder-form-table input[type="text"], table.elder-form-table input[type="password"], table.elder-form-table input[type="email"],
table.elder-form-table input:not([type]), table.elder-form-table select, table.elder-form-table textarea { width: 100%; min-width: 0; }
table.elder-form-table h6 { margin: 8px 0 0; }

/* CKEditor 不可超出畫面 */
span.cke_skin_kama, span[id^="cke_"], table.cke_editor, .cke_contents { max-width: 100% !important; }
table.cke_editor { width: 100% !important; }
.cke_contents iframe { width: 100% !important; }

/* 可左右滑動容器 */
.elder-scroll { position: relative; margin: 0 0 24px; }
.elder-scroll-inner {
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  background: #FFFFFF; border: 1px solid #D9E3F2; border-radius: 16px;
  scrollbar-width: thin; scrollbar-color: #5CCBEF transparent;
}
.elder-scroll-inner:focus-visible { outline: 3px solid #1E5BB8; outline-offset: 2px; }
.elder-scroll-inner::-webkit-scrollbar { height: 10px; }
.elder-scroll-inner::-webkit-scrollbar-thumb { background: #5CCBEF; border-radius: 5px; }
.elder-scroll-inner > table { margin: 0; border: none; }

/* 左右邊緣漸層：表示那一側還有內容 */
.elder-scroll::before, .elder-scroll::after {
  content: ""; position: absolute; top: 1px; bottom: 1px; width: 36px; z-index: 2;
  pointer-events: none; opacity: 0; transition: opacity 0.25s;
}
.elder-scroll::before { left: 1px; border-radius: 16px 0 0 16px; background: linear-gradient(to right, rgba(31, 42, 61, 0.16), rgba(31, 42, 61, 0)); }
.elder-scroll::after { right: 1px; border-radius: 0 16px 16px 0; background: linear-gradient(to left, rgba(31, 42, 61, 0.16), rgba(31, 42, 61, 0)); }
.elder-scroll.can-left::before, .elder-scroll.can-right::after { opacity: 1; }

/* 滑動提示：手指左右滑的動畫，使用者滑動過一次就消失 */
.elder-swipe-hint {
  position: absolute; z-index: 3; left: 50%; top: 14px; transform: translateX(-50%);
  display: none; align-items: center; gap: 10px; padding: 10px 18px;
  border-radius: 28px; background: rgba(23, 70, 143, 0.94); color: #FFFFFF;
  font-size: 1.125rem; font-weight: 700; white-space: nowrap; pointer-events: none;
  box-shadow: 0 6px 18px rgba(23, 70, 143, 0.3);
}
.elder-scroll.has-overflow:not(.was-scrolled) .elder-swipe-hint { display: inline-flex; animation: elder-hint-in 0.4s ease-out; }
.elder-swipe-hint .elder-hand { display: inline-block; animation: elder-swipe 1.6s ease-in-out infinite; }
.elder-swipe-hint .elder-arrow { opacity: 0.85; }

/* 右側常駐箭頭：滑到最右邊前持續提示 */
.elder-edge-arrow {
  position: absolute; z-index: 3; right: 8px; top: 50%; margin-top: -22px;
  width: 44px; height: 44px; border-radius: 22px; background: #1E5BB8; color: #FFFFFF;
  display: none; align-items: center; justify-content: center; pointer-events: none;
  box-shadow: 0 4px 12px rgba(23, 70, 143, 0.35);
}
.elder-scroll.can-right.was-scrolled .elder-edge-arrow { display: flex; animation: elder-nudge 1.4s ease-in-out infinite; }

@keyframes elder-swipe {
  0%, 100% { transform: translateX(-14px) rotate(-8deg); }
  50% { transform: translateX(14px) rotate(8deg); }
}
@keyframes elder-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}
@keyframes elder-hint-in {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .elder-swipe-hint .elder-hand, .elder-scroll.can-right.was-scrolled .elder-edge-arrow, .elder-swipe-hint { animation: none !important; }
}

/* ---------- 頁尾 ---------- */
.footer { padding: 16px 0 40px; }
.footer .botmenu { text-align: left; }
.footer .botmenu .grid_1 { display: flex; flex-wrap: wrap; gap: 10px; }
.footer h6.button_option { margin: 0; }
.footer h6.button_option a {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px;
  border: 2px solid #BFCFE6; border-radius: 12px; background: #FFFFFF;
  color: #1F2A3D; font-size: 1.125rem; font-weight: 500; text-decoration: none;
}
.footer h6.button_option a:hover { border-color: #1E5BB8; color: #17468F; }
.footer .footer_logo { display: none; }
.footer .copyright { margin: 16px 0 0; font-size: 1.0625rem; color: #4F5B70; text-align: center; }

/* Spry 分頁面板（頁面、產品編輯） */
.TabbedPanelsTabGroup { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.TabbedPanelsTab { min-height: 48px; padding: 10px 16px; border: 2px solid #BFCFE6; border-radius: 12px; background: #FFFFFF; font-size: 1.125rem; cursor: pointer; list-style: none; }
.TabbedPanelsTabSelected { border-color: #1E5BB8; background: #E8F0FB; color: #17468F; font-weight: 700; }

/* =====================================================================
 * 共用元件（首頁、留言卡片）
 * ===================================================================== */
.elder-page-title { margin: 0 0 16px; font-size: 1.625rem; font-weight: 700; color: #1F2A3D; }

.elder-alert {
  display: flex; align-items: center; gap: 14px; margin: 0 0 16px;
  padding: 14px 16px; background: #FFFFFF; border: 2px solid #BF1D2C; border-radius: 16px;
  color: #1F2A3D !important; text-decoration: none;
}
.elder-alert-icon {
  width: 48px; height: 48px; border-radius: 24px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: #FBEAEC; color: #BF1D2C;
}
.elder-alert-text { flex: 1 1 auto; display: flex; flex-direction: column; }
.elder-alert-text strong { font-size: 1.25rem; }
.elder-alert-text span { font-size: 1.0625rem; color: #4F5B70; }
.elder-alert .elder-chevron { color: #BF1D2C; }

.elder-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.elder-tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  min-height: 116px; box-sizing: border-box; padding: 16px;
  background: #FFFFFF; border: 1px solid #D9E3F2; border-radius: 16px;
  color: #1F2A3D !important; text-decoration: none;
}
.elder-tile:hover { border-color: #1E5BB8; box-shadow: 0 2px 10px rgba(30, 91, 184, 0.12); }
.elder-tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.elder-tile-icon {
  width: 48px; height: 48px; border-radius: 24px;
  display: flex; align-items: center; justify-content: center; background: #E8F0FB; color: #1E5BB8;
}
.elder-tile-label { font-size: 1.3125rem; font-weight: 700; }
.elder-badge {
  display: inline-block; padding: 2px 10px; border-radius: 14px;
  background: #BF1D2C; color: #FFFFFF; font-size: 1rem; font-weight: 700; font-style: normal; white-space: nowrap;
}

.elder-tabs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  max-width: 520px; margin: 0 0 16px; padding: 4px; background: #E2EAF6; border-radius: 14px;
}
.elder-tabs a {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 11px;
  color: #4F5B70 !important; font-size: 1.1875rem; font-weight: 500; text-decoration: none;
}
.elder-tabs a.is-active { background: #FFFFFF; color: #1F2A3D !important; font-weight: 700; }

.elder-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.elder-card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  background: #FFFFFF; border: 1px solid #D9E3F2; border-radius: 16px;
}
.elder-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.elder-card-name { display: block; font-size: 1.3125rem; font-weight: 700; }
.elder-card-meta { display: block; font-size: 1.0625rem; color: #4F5B70; }
.elder-card-body { margin: 0; font-size: 1.1875rem; line-height: 1.6; word-break: break-word; }
.elder-card-actions { display: flex; gap: 10px; margin-top: auto; }
.elder-card-actions .elder-btn { flex: 1 1 auto; min-height: 56px; font-size: 1.25rem !important; }
.elder-card-actions .elder-btn-danger { flex: 0 0 auto; width: auto !important; padding: 0 16px; white-space: nowrap; }

.elder-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px;
  font-size: 1.0625rem; font-weight: 700; white-space: nowrap;
}
.elder-status::before { content: ""; width: 10px; height: 10px; border-radius: 5px; background: currentColor; }
.elder-status-todo { background: #FBEAEC; color: #A3141F; }
.elder-status-done { background: #E8F0FB; color: #17468F; }

.elder-empty { padding: 32px 16px; text-align: center; font-size: 1.25rem; color: #4F5B70; background: #FFFFFF; border-radius: 16px; }

.elder-panel { padding: 16px; background: #FFFFFF; border: 1px solid #D9E3F2; border-radius: 16px; margin: 0 0 16px; }
.elder-quote { padding: 14px; border-radius: 12px; background: #F3F6FB; font-size: 1.25rem; line-height: 1.65; word-break: break-word; }
.elder-info-list { margin: 0; padding: 0; list-style: none; font-size: 1.125rem; color: #4F5B70; }
.elder-info-list li { padding: 4px 0; }
.elder-field-label { display: block; margin: 0 0 8px; font-size: 1.3125rem; font-weight: 700; }
.elder-hint { margin: 8px 0 0; font-size: 1.0625rem; color: #4F5B70; }
.elder-actionbar { margin-top: 16px; }

/* =====================================================================
 * 手機（760px 以下）
 * ===================================================================== */
@media (max-width: 760px) {
  body { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 1.6875rem; } h2 { font-size: 1.5rem; }

  .head_bar { display: none; }               /* 改用底部選單 */
  .footer .botmenu { display: none; }

  .elder-bottomnav {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(80px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #FFFFFF; border-top: 1px solid #D9E3F2;
  }
  .elder-bottomnav a {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    border-top: 4px solid transparent; color: #4F5B70; font-size: 1.0625rem; font-weight: 500; text-decoration: none;
  }
  .elder-bottomnav a.is-active { border-top-color: #1E5BB8; color: #1E5BB8; font-weight: 700; }
  .elder-dot {
    position: absolute; top: 6px; left: 50%; margin-left: 8px;
    min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
    background: #BF1D2C; color: #FFFFFF; font-size: 0.9375rem; font-weight: 700; font-style: normal; line-height: 24px; text-align: center;
  }

  .middle { padding: 16px 0 24px; }
  .container_24 { padding: 0 16px; }
  .middle .container_24 { display: block; }
  .sidebar { display: none !important; }

  h2.icon_option { font-size: 1.5rem; }
  h2.icon_option strong em { display: block; margin: 4px 0 0; font-size: 1.1875rem; }
  h2.icon_option a.button_link { flex: 1 1 auto; }

  .elder-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .elder-tile { min-height: 108px; padding: 14px; }
  .elder-cards { grid-template-columns: 1fr; }
  .elder-tabs { max-width: none; }

  /* 表格以外的欄位一律全寬，不會撐破畫面 */
  .content input[type="text"], .content input[type="password"], .content input[type="email"],
  .content input[type="tel"], .content input[type="number"], .content input:not([type]), .content select, .content textarea { width: 100%; }
  .content input[type="submit"], .content input.btn-submit, .content input.btn-submit-long { width: 100%; margin: 6px 0; }
  .elder-scroll-inner input[type="submit"] { width: auto; }

  /* 表單表格：欄位名稱在上、輸入框在下 */
  table.elder-form-table, table.elder-form-table tbody, table.elder-form-table tr, table.elder-form-table td { display: block; width: 100% !important; }
  table.elder-form-table tr { padding: 12px 14px; border-bottom: 1px solid #E7EDF7; }
  table.elder-form-table tr:last-child { border-bottom: none; }
  table.elder-form-table td { padding: 4px 0; border: none; text-align: left !important; }
  table.elder-form-table td.text-right, table.elder-form-table td[nowrap] { width: 100% !important; white-space: normal; font-weight: 700; }
  table.elder-form-table td:empty { display: none; }

  /* 圖片與影片不可超出畫面 */
  .content img, .content iframe, .content video { max-width: 100%; height: auto; }
  .content iframe { aspect-ratio: 16 / 9; height: auto; }
}

/* 列印 */
@media print {
  .elder-topbar, .elder-bottomnav, .head_bar, .footer, .elder-swipe-hint, .elder-edge-arrow { display: none !important; }
  body { padding: 0; background: #FFFFFF; font-size: 14pt; }
  .elder-scroll-inner { overflow: visible; border: none; }
}


/* =====================================================================
 * 配色強化：金色點綴、綠色儲存、分類標籤（參考提供的樣式）
 * ===================================================================== */
.elder-topbar { border-bottom: 5px solid #5CCBEF; }
.elder-brand { font-weight: 900; }
h1, h2, h3, .elder-page-title, h2.icon_option strong { font-weight: 900; }
.elder-page-title, h2.icon_option strong { color: #16203A; }

/* 區塊標題：深色底金字標籤 */
h6.box_red, h6.box_blue, h6.box_yellow, h6.box_black, h6.box_green {
  display: inline-flex; padding: 8px 15px; border-radius: 8px; background: #17468F; color: #5CCBEF; font-weight: 900; font-size: 1.25rem;
}
h6.box_red::before, h6.box_blue::before, h6.box_yellow::before, h6.box_black::before, h6.box_green::before { display: none; }
h6.box_red { color: #FFB3B8; }

/* 儲存／送出：穩重的綠色 */
input[type="submit"], input.btn-submit, input.btn-submit-long { background: #1E5BB8; font-weight: 900; }
input[type="submit"]:hover, input.btn-submit:hover, input.btn-submit-long:hover { background: #17468F; }
form button[type="submit"].elder-btn { background: #1E5BB8; }
form button[type="submit"].elder-btn:hover { background: #17468F; }
.check_box { background: #E8F0FB; border-color: #1E5BB8; color: #17468F; }

/* 次要按鈕：金色 */
a.button_link.btn_orange, a.button_link.btn_yellow, a.button_link.btn_silver { border-color: #5CCBEF; color: #1E5BB8; }
a.button_link.btn_orange:hover, a.button_link.btn_yellow:hover, a.button_link.btn_silver:hover { background: #1E5BB8; border-color: #1E5BB8; color: #FFFFFF; }
a.button_link, a.elder-btn, button, input[type="submit"] { font-weight: 900; }

/* 卡片、表格外框：暖灰粗框 */
.elder-card, .elder-tile, .elder-panel, table.elder-form-table, .elder-scroll-inner { border: 2px solid #BFCFE6; border-radius: 15px; }
table.table-edit th { background: #E7F5F0; border-bottom: 2px solid #5CCBEF; }

/* 首頁方塊：圖示底色輪替，避免單調 */
.elder-tile:nth-child(4n+1) .elder-tile-icon { background: #E8F0FB; color: #1E5BB8; }
.elder-tile:nth-child(4n+2) .elder-tile-icon { background: #E7F5F0; color: #1E5BB8; }
.elder-tile:nth-child(4n+3) .elder-tile-icon { background: #FFF1E0; color: #8A4B00; }
.elder-tile:nth-child(4n+4) .elder-tile-icon { background: #F3ECF6; color: #6B3F86; }
.elder-tile:hover { border-color: #5CCBEF; box-shadow: 0 4px 14px rgba(92, 203, 239, 0.18); }
.elder-tile-label { font-weight: 900; }

/* 分頁（還沒回覆／全部） */
.elder-tabs a.is-active { color: #1E5BB8; box-shadow: inset 0 -4px 0 #5CCBEF; }

/* 底部選單：金色指示線 */
@media (max-width: 760px) {
  .elder-bottomnav { border-top: 2px solid #D9E3F2; }
  .elder-bottomnav a.is-active { border-top-color: #5CCBEF; color: #1E5BB8; font-weight: 900; }
}

/* 內嵌圖示與圖示按鈕（取代舊的 png 圖示） */
.elder-ico { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; color: #1E5BB8; }
.elder-ico svg { display: block; }
.head_bar > .elder-ico { display: none; }
.elder-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 0 12px; border: 2px solid #BFCFE6; border-radius: 10px;
  background: #FFFFFF !important; color: #1E5BB8 !important; font-size: 1.0625rem; font-weight: 900; cursor: pointer;
}
.elder-icon-btn:hover { border-color: #1E5BB8; background: #E8F0FB !important; }
.elder-icon-btn-danger { color: #A3141F !important; border-color: #E8B4B9; }
.elder-icon-btn-danger:hover { border-color: #BF1D2C; background: #FBEAEC !important; }
.elder-icon-btn span:empty { display: none; }
button[type="submit"].elder-icon-btn:not(.elder-icon-btn-danger) { color: #1E5BB8 !important; border-color: #A9C4EC; }
button[type="submit"].elder-icon-btn:not(.elder-icon-btn-danger):hover { background: #E8F0FB !important; border-color: #1E5BB8; }

/* 語言切換（取代國旗圖檔） */
.elder-lang {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 18px;
  border: 2px solid #5CCBEF; color: #1E5BB8; font-size: 1.0625rem; font-weight: 900; background: #FFFFFF;
}
a:hover > .elder-lang { background: #1E5BB8; border-color: #1E5BB8; color: #FFFFFF; }

/* 找不到的圖片：elder.js 會換成這個佔位圖 */
img.elder-img-missing { background: #E7F5F0; border: 2px dashed #BFCFE6; border-radius: 12px; object-fit: contain; min-width: 48px; min-height: 48px; }
.elder-login form button[type="submit"].elder-btn { background: #1E5BB8; }
.elder-login form button[type="submit"].elder-btn:hover { background: #17468F; }


/* =====================================================================
 * 智慧小幫手（AI 風格）與魔法元素
 * ===================================================================== */
html { font-size: 100%; transition: font-size 0.2s ease; }

/* 頂部金藍流光線 */
.elder-topbar { border-bottom: none; }
.elder-topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 5px;
  background: linear-gradient(90deg, #5CCBEF, #F2C230, #1E5BB8, #F2C230, #5CCBEF);
  background-size: 300% 100%; animation: elder-flow 10s linear infinite;
}

/* 字級按鈕 */
.elder-fontsize { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.elder-font-btn {
  display: inline-flex; align-items: baseline; justify-content: center; gap: 1px;
  min-width: 48px; min-height: 48px; padding: 0 8px; border: 2px solid #BFCFE6 !important; border-radius: 12px;
  background: #FFFFFF !important; color: #1F2A3D !important; font-size: 1.125rem; font-weight: 900; line-height: 1; cursor: pointer;
}
.elder-font-btn-lg { font-size: 1.375rem; }
.elder-font-btn span { font-size: 0.8em; color: #1E5BB8; }
.elder-font-btn:hover { border-color: #5CCBEF !important; background: #E7F5F0 !important; }
.elder-font-btn[disabled] { opacity: 0.35; }
.elder-font-level { min-width: 3.2em; text-align: center; font-size: 1rem; font-weight: 700; color: #1E5BB8; }

/* 智慧卡片：流動的漸層外框 */
.elder-ai-card {
  position: relative; margin: 0 0 20px; padding: 18px; border-radius: 18px;
  border: 2px solid transparent;
  background:
    linear-gradient(#FFFFFF, #FFFFFF) padding-box,
    linear-gradient(120deg, #5CCBEF, #1E5BB8, #F2C230, #5CCBEF) border-box;
  background-size: 100% 100%, 300% 300%;
  animation: elder-aurora 9s ease infinite;
  box-shadow: 0 6px 22px rgba(30, 91, 184, 0.10);
}
/* 閃爍的星光 */
.elder-ai-card::before, .elder-ai-card::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  background: #5CCBEF;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: elder-twinkle 2.8s ease-in-out infinite;
}
.elder-ai-card::before { top: 12px; right: 18px; }
.elder-ai-card::after { bottom: 14px; right: 46px; width: 9px; height: 9px; background: #F2C230; animation-delay: 1.3s; }

.elder-ai-hero {
  background:
    radial-gradient(circle at 92% 8%, rgba(242, 194, 48, 0.35), transparent 40%),
    radial-gradient(circle at 8% 100%, rgba(30, 91, 184, 0.12), transparent 45%),
    linear-gradient(#FFFFFF, #FFFFFF) padding-box,
    linear-gradient(120deg, #5CCBEF, #1E5BB8, #F2C230, #5CCBEF) border-box;
  background-size: 100% 100%, 100% 100%, 100% 100%, 300% 300%;
}
.elder-ai-head { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; padding-right: 40px; }
.elder-ai-head > div > strong { display: block; font-size: 1.3125rem; font-weight: 900; color: #16203A; }
.elder-ai-head > div > span { display: block; font-size: 1.0625rem; color: #4F5B70; }
.elder-ai-title { font-size: 1.625rem !important; }
.elder-ai-badge {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: #FFE680;
  background: radial-gradient(circle at 30% 25%, #3B7DDD, #1E5BB8 55%, #123F80);
  box-shadow: 0 0 0 4px rgba(92, 203, 239, 0.18); animation: elder-glow 3s ease-in-out infinite;
}
.elder-ai-badge-lg { width: 58px; height: 58px; }
.elder-ai-badge svg { stroke-width: 2.2; }

.elder-ai-list { display: grid; gap: 10px; }
.elder-ai-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: #F3F6FB; border: 2px solid #D9E3F2; color: #1F2A3D; text-decoration: none;
}
a.elder-ai-item:hover { border-color: #5CCBEF; background: #FFFFFF; color: #1F2A3D; }
.elder-ai-item-todo { border-color: #E8B4B9; background: #FFF8F8; }
.elder-ai-item-icon { flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #FFFFFF; color: #1E5BB8; border: 2px solid #D9E3F2; }
.elder-ai-item-todo .elder-ai-item-icon { color: #BF1D2C; border-color: #E8B4B9; }
.elder-ai-item-text { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.elder-ai-item-text strong { font-size: 1.25rem; font-weight: 900; }
.elder-ai-item-text span { font-size: 1.0625rem; color: #4F5B70; }
.elder-ai-go { flex-shrink: 0; font-size: 1.125rem; font-weight: 900; color: #1E5BB8; white-space: nowrap; }

.elder-section-title { margin: 8px 0 14px; font-size: 1.375rem; font-weight: 900; color: #1F2A3D; }

/* 分類標籤 */
.elder-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.elder-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 2px 14px; border-radius: 18px;
  font-size: 1.0625rem; font-weight: 700; border: 2px solid transparent; white-space: nowrap;
}
.elder-chip b { font-weight: 900; }
.elder-chip-sm { min-height: 30px; padding: 1px 10px; font-size: 1rem; }
.elder-tone-gold   { background: #E7F5F0; color: #1E5BB8; border-color: #9FD3C2; }
.elder-tone-blue   { background: #E8F0FB; color: #17468F; border-color: #BED3F0; }
.elder-tone-green  { background: #E8F0FB; color: #17468F; border-color: #B9CDEB; }
.elder-tone-purple { background: #F3ECF6; color: #5E3678; border-color: #DCC9E6; }
.elder-tone-red    { background: #FBEAEC; color: #A3141F; border-color: #EFC0C5; }
.elder-tone-teal   { background: #E3F3F1; color: #1F625B; border-color: #B7DCD7; }
.elder-tone-gray   { background: #EEF2F8; color: #4F5B70; border-color: #D5DEEC; }

.elder-card-todo { border-color: #E8B4B9 !important; }
.elder-card-meta svg { vertical-align: -3px; }

/* 建議回覆 */
.elder-suggest-list { display: grid; gap: 10px; }
.elder-suggest {
  display: flex !important; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%;
  padding: 14px 16px !important; min-height: 0 !important; text-align: left;
  border: 2px solid #D9E3F2 !important; border-radius: 14px !important; background: #FFFFFF !important;
  color: #1F2A3D !important; font-weight: 400 !important; cursor: pointer;
}
.elder-suggest:hover { border-color: #5CCBEF !important; box-shadow: 0 4px 14px rgba(92, 203, 239, 0.2); }
.elder-suggest-text { font-size: 1.125rem; line-height: 1.6; color: #1F2A3D; }
.elder-suggest-use { align-self: flex-end; font-size: 1.0625rem; font-weight: 900; color: #1E5BB8; }
.elder-suggest.is-used { border-color: #1E5BB8 !important; background: #EEF4FC !important; }
.elder-suggest.is-used .elder-suggest-use::after { content: " ✓ 已放入"; color: #1E5BB8; }
textarea.elder-filled { animation: elder-filled 1.2s ease; }

/* 分頁 */
.elder-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 20px 0 0; }
.elder-pager > :first-child { justify-self: start; } .elder-pager > :last-child { justify-self: end; }
.elder-pager-info { font-size: 1.125rem; font-weight: 700; color: #4F5B70; }
.elder-empty svg { color: #5CCBEF; }

@keyframes elder-flow { from { background-position: 0% 0; } to { background-position: 300% 0; } }
@keyframes elder-aurora { 0%, 100% { background-position: 0 0, 0% 50%; } 50% { background-position: 0 0, 100% 50%; } }
@keyframes elder-twinkle { 0%, 100% { opacity: 0.2; transform: scale(0.6) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes elder-glow { 0%, 100% { box-shadow: 0 0 0 4px rgba(92, 203, 239, 0.18); } 50% { box-shadow: 0 0 0 8px rgba(242, 194, 48, 0.16); } }
@keyframes elder-filled { 0% { box-shadow: 0 0 0 0 rgba(92, 203, 239, 0.6); } 100% { box-shadow: 0 0 0 14px rgba(92, 203, 239, 0); } }

@media (max-width: 760px) {
  .elder-topbar { gap: 8px; padding: 0 10px; }
  .elder-brand { font-size: 1.125rem; gap: 8px; }
  .elder-brand img { width: 34px; height: 34px; }
  .elder-font-level { display: none; }
  .elder-font-btn { min-width: 44px; min-height: 44px; }
  .elder-logout { padding: 0 10px; }
  .elder-ai-head { padding-right: 24px; }
  .elder-ai-item { flex-wrap: wrap; }
  .elder-ai-go { width: 100%; text-align: right; }
}
@media (max-width: 360px) { .elder-logout span { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .elder-topbar::after, .elder-ai-card, .elder-ai-card::before, .elder-ai-card::after, .elder-ai-badge, textarea.elder-filled { animation: none !important; }
}


/* =====================================================================
 * 表格優化：更緊湊、易讀，電腦版不需要左右滑動
 * ===================================================================== */
table.table-edit th { padding: 10px 8px; line-height: 1.35; }
table.table-edit td { padding: 8px 8px; line-height: 1.45; }
table.table-edit tr:nth-child(even) > td { background: #F7F9FD; }
table.table-edit th:first-child, table.table-edit td:first-child { padding-left: 14px; }
table.table-edit th:last-child, table.table-edit td:last-child { padding-right: 14px; }
table.table-edit td .elder-icon-btn { padding: 0 10px; }
table.table-edit tr:hover > td { background: #E7F5F0; }
table.table-edit td.elder-num, table.table-edit th.elder-num { text-align: right; font-variant-numeric: tabular-nums; }
table.table-edit td.elder-action { text-align: center; white-space: nowrap; }
table.table-edit td img { border-radius: 8px; vertical-align: middle; }
table.table-edit td img.img-demo { width: 72px; height: 72px; object-fit: cover; }

/* 分頁連結表格（第一頁／上一頁…） */
table.elder-pager-table { border: none; margin: 12px 0; }
table.elder-pager-table tr { display: flex; flex-wrap: wrap; gap: 8px; }
table.elder-pager-table td { padding: 0; border: none; background: none !important; }
table.elder-pager-table a {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px;
  border: 2px solid #BFCFE6; border-radius: 12px; background: #FFFFFF; color: #1E5BB8; font-weight: 700; text-decoration: none;
}
table.elder-pager-table a:hover { border-color: #1E5BB8; background: #E8F0FB; }

@media (min-width: 761px) {
  /* 電腦版：允許換行、輸入框可縮小，盡量在一個畫面內放下 */
  table.table-edit td { white-space: normal; overflow-wrap: anywhere; }
  table.table-edit td.elder-nowrap { white-space: nowrap; overflow-wrap: normal; }
  table.table-edit td.elder-wrap { min-width: 0; max-width: none; }
  table.table-edit td input[type="text"], table.table-edit td input:not([type]), table.table-edit td select { min-width: 4.5em; }
  table.table-edit td textarea { min-width: 8em; }

  /* 欄位太多仍放不下時：每一列變成一張緊湊卡片（elder.js 自動判斷） */
  .elder-scroll.is-cards .elder-scroll-inner { overflow: visible; background: transparent; border: none; }
  .elder-scroll.is-cards::before, .elder-scroll.is-cards::after,
  .elder-scroll.is-cards .elder-swipe-hint, .elder-scroll.is-cards .elder-edge-arrow { display: none !important; }
  table.elder-table-cards, table.elder-table-cards > tbody { display: block; width: 100%; background: transparent; }
  table.elder-table-cards tr.elder-head-row { display: none; }
  table.elder-table-cards tr {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0 16px; align-items: start;
    margin: 0 0 8px; padding: 10px 14px; background: #FFFFFF; border: 2px solid #D9E3F2; border-radius: 14px;
    content-visibility: auto; contain-intrinsic-size: auto 180px;    /* 畫面外的卡片延後繪製，長列表更順 */
  }
  table.elder-table-cards tr:hover { border-color: #5CCBEF; }
  table.elder-table-cards tr > td, table.elder-table-cards tr > td:first-child, table.elder-table-cards tr > td:last-child { display: block; padding: 3px 0; border: none; background: none !important; text-align: left !important; white-space: normal; }
  table.elder-table-cards td[data-label]::before {
    content: attr(data-label); display: block; margin: 0 0 1px; font-size: 1.0625rem; font-weight: 700; color: #1E5BB8;
  }
  table.elder-table-cards td.elder-wide { grid-column: 1 / -1; }
  table.elder-table-cards td.elder-action { display: flex; align-items: flex-end; align-self: end; }
  table.elder-table-cards td.elder-action::before { display: none !important; }
  table.elder-table-cards td input, table.elder-table-cards td select, table.elder-table-cards td textarea { min-width: 0 !important; width: 100%; }
  table.elder-table-cards td img.img-demo { width: 64px; height: 64px; }
  table.elder-table-cards td:empty { display: none; }
}


/* =====================================================================
 * 操作手冊風格：葉片圓角、薄荷綠頂條、葉片標記
 * ===================================================================== */
.elder-topbar { box-shadow: inset 0 4px 0 #5CCBEF; padding-top: 4px; }
.elder-card, .elder-tile, .elder-panel, .elder-ai-card, .elder-ai-item, table.elder-form-table,
.elder-scroll-inner, .elder-empty, .box, .elder-suggest { border-radius: 14px 4px 14px 4px !important; }
.elder-ai-card { border-radius: 22px 6px 22px 6px !important; }
a.button_link, a.elder-btn, button.elder-btn, input[type="submit"], input[type="reset"], .elder-icon-btn,
.elder-btn-outline, .elder-tabs a, .elder-font-btn, table.elder-pager-table a { border-radius: 12px 4px 12px 4px !important; }
.elder-tabs { border-radius: 14px 4px 14px 4px; }
.elder-tile-icon, .elder-ai-item-icon { border-radius: 14px 4px 14px 4px; }

/* 標題前的葉片標記 */
h2.icon_option strong, .elder-page-title, .elder-section-title, .pro-group-title { display: flex; align-items: center; gap: 12px; }
h2.icon_option strong::before, .elder-page-title::before, .elder-section-title::before, .pro-group-title::before {
  content: ""; flex: none; width: 14px; height: 26px; border-radius: 12px 3px 12px 3px;
  background: linear-gradient(160deg, #F2C230, #5CCBEF);
}
h2.icon_option strong em { margin-left: 0; }

/* 區塊標題標籤改為深綠底白字 */
h6.box_red, h6.box_blue, h6.box_yellow, h6.box_black, h6.box_green { color: #FFFFFF; border-radius: 12px 4px 12px 4px; }
h6.box_red { background: #A3141F; color: #FFFFFF; }

/* 主要按鈕：深綠；次要按鈕：白底綠框 */
a.button_link { border-color: #1E5BB8; color: #17468F; }
a.button_link:hover { background: #E8F0FB; }
a.button_link.btn_orange, a.button_link.btn_yellow, a.button_link.btn_silver { border-color: #F2C230; color: #1E5BB8; }
a.button_link.btn_orange:hover, a.button_link.btn_yellow:hover, a.button_link.btn_silver:hover { background: #E7F5F0; border-color: #1E5BB8; color: #1E5BB8; }

/* =====================================================================
 * 產品列表（pro_overview.php）
 * ===================================================================== */
.pro-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.pro-filter a {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 16px; border-radius: 12px 4px 12px 4px;
  border: 2px solid #D9E3F2; background: #FFFFFF; color: #1F2A3D; font-weight: 700; text-decoration: none;
}
.pro-filter a:hover { border-color: #5CCBEF; color: #17468F; }
.pro-filter a.is-active { background: #1E5BB8; border-color: #1E5BB8; color: #FFFFFF; }

.pro-group { margin: 0 0 26px; }
.pro-group-title { margin: 0 0 10px; font-size: 1.375rem; font-weight: 900; color: #1F2A3D; }
.pro-rows { background: #FFFFFF; border: 2px solid #D9E3F2; border-radius: 14px 4px 14px 4px; overflow: hidden; }

/* 欄位寬度（表頭與每一列共用） */
.pro-head, .pro-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.pro-c-thumb { flex: 0 0 64px; }
.pro-c-main  { flex: 1 1 14rem; min-width: 0; }
.pro-c-num   { flex: 0 0 7rem; }
.pro-c-rank  { flex: 0 0 5.5rem; }
.pro-c-act   { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }

.pro-head {
  margin: 0; padding-top: 8px; padding-bottom: 8px; border-radius: 14px 4px 0 0;
  background: #E8F0FB; color: #17468F; font-size: 1.0625rem; font-weight: 700;
  border: 2px solid #D9E3F2; border-bottom: none;
}
.pro-head + .pro-rows { border-radius: 0 0 14px 4px; }
.pro-head .pro-c-act { justify-content: flex-end; min-width: 22rem; }
.pro-row { margin: 0; border-top: 1px solid #E7EDF7; }
.pro-row:first-child { border-top: none; }
.pro-row:nth-child(even) { background: #F7F9FD; }
.pro-row:hover { background: #EEF4FC; }
.pro-row:target { box-shadow: inset 4px 0 0 #5CCBEF; background: #EEF4FC; }
.pro-row.is-offline .pro-thumb img { opacity: 0.55; filter: grayscale(0.6); }

.pro-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }  /* 電腦版用表頭，欄位名稱只給讀屏軟體 */
.pro-row input[type="text"], .pro-row select { width: 100%; min-width: 0; min-height: 46px; padding: 6px 10px; }
.pro-c-num input { text-align: right; font-variant-numeric: tabular-nums; }
.pro-thumb { display: block; width: 64px; height: 64px; border-radius: 12px 4px 12px 4px; overflow: hidden; background: #E7F5F0; }
.pro-thumb img { display: block; width: 64px; height: 64px; object-fit: cover; }
.pro-noimg { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: #5CCBEF; }

.pro-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pro-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 10px 3px 10px 3px;
  background: #EEF2F8; color: #4F5B70; font-size: 1.0625rem; font-weight: 700; text-decoration: none; line-height: 1.6;
}
a.pro-tag:hover { background: #E8F0FB; color: #17468F; }
.pro-tag-on { background: #E8F0FB; color: #17468F; }
.pro-tag-off { background: #F2F2F2; color: #6E6E6E; }
.pro-tag-hot { background: #FFF1E0; color: #8A4B00; }

.pro-save { min-height: 46px !important; padding: 0 16px !important; }
.pro-c-act .elder-icon-btn { min-height: 46px; }

/* 中等寬度：操作按鈕只留圖示，名稱欄位更寬 */


/* 手機：每個產品一張卡片，不需要左右滑動 */
@media (max-width: 760px) {
  .pro-head { display: none; }
  .pro-rows { background: transparent; border: none; overflow: visible; }
  .pro-row {
    flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 12px; padding: 14px;
    background: #FFFFFF !important; border: 2px solid #D9E3F2; border-radius: 14px 4px 14px 4px;
  }
  .pro-row:first-child { border-top: 2px solid #D9E3F2; }
  .pro-c-thumb { align-self: flex-start; }
  .pro-c-main { flex: 1 1 calc(100% - 80px); }
  .pro-c-num, .pro-c-rank { flex: 1 1 28%; }
  .pro-c-act { flex: 1 1 100%; justify-content: stretch; }
  .pro-c-act .pro-save { flex: 1 1 100%; min-height: 54px !important; font-size: 1.25rem !important; }
  .pro-c-act .elder-icon-btn { flex: 1 1 0; }
  .pro-label { position: static; width: auto; height: auto; clip: auto; display: block; margin: 0 0 4px; font-size: 1.0625rem; font-weight: 700; color: #1E5BB8; }
}

/* 表格中的分組列（只有一格、跨整列，例如類別名稱） */
table.table-edit tr.elder-group-row > td, table.table-edit tr.elder-group-row > th { background: #E8F0FB !important; text-align: left; }
@media (min-width: 761px) {
  table.elder-table-cards tr.elder-group-row { display: block; padding: 6px 0; background: transparent; border: none; }
  table.elder-table-cards tr.elder-group-row > * { background: transparent !important; }
}
a.elder-icon-btn, a.elder-icon-btn:hover, a.elder-btn, a.elder-btn:hover { text-decoration: none; }

/* =====================================================================
 * 學與玩科技：藍色企業色＋綠色（儲存／提醒）＋代言人與小蜜蜂
 * ===================================================================== */

/* ---- 綠色：儲存 ---- */
input[type="submit"], input.btn-submit, input.btn-submit-long, .pro-save,
form button[type="submit"].elder-btn:not(.elder-login-btn) { background: #2A7F6B !important; color: #FFFFFF !important; }
input[type="submit"]:hover, input.btn-submit:hover, input.btn-submit-long:hover, .pro-save:hover,
form button[type="submit"].elder-btn:not(.elder-login-btn):hover { background: #20685A !important; }
.elder-login form button[type="submit"].elder-btn { background: #1E5BB8 !important; }
.elder-login form button[type="submit"].elder-btn:hover { background: #17468F !important; }
button[type="submit"].elder-icon-btn:not(.elder-icon-btn-danger) { color: #2A7F6B !important; border-color: #9FD3C2; }

/* ---- 綠色：提醒 ---- */
.elder-flash { background: #E7F5F0; border-color: #2A7F6B; color: #174F45; display: flex; align-items: center; gap: 10px; }
.check_box { background: #E7F5F0; border-color: #2A7F6B; color: #20685A; }
.elder-badge, .elder-dot { background: #2A7F6B; }
.elder-alert { border-color: #2A7F6B; }
.elder-alert-icon { background: #E7F5F0; color: #2A7F6B; }
.elder-alert .elder-chevron { color: #2A7F6B; }
.elder-ai-item-todo { border-color: #9FD3C2; background: #F1FAF6; }
.elder-ai-item-todo .elder-ai-item-icon { color: #2A7F6B; border-color: #9FD3C2; }
.elder-ai-item-todo .elder-ai-go { color: #20685A; }
.elder-status-todo { background: #E7F5F0; color: #20685A; }
.elder-card-todo { border-color: #9FD3C2 !important; }
.elder-tabs .elder-badge { background: #2A7F6B; }

/* ---- 魔法棒點綴（彩色版，作為裝飾背景圖；每隔幾秒輕輕揮一下） ---- */
.elder-wand-mark, .elder-page-title::before, h2.icon_option strong::before, .elder-section-title::before, .pro-group-title::before {
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M7 35 25 17' stroke='%231F3B73' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M12.5 29.5l3 3' stroke='%23FFFFFF' stroke-width='2.4' stroke-linecap='round' transform='rotate(0)'/%3E%3Cpath d='M27 4.5l2.3 4.9 5.3.7-3.9 3.7.9 5.3-4.6-2.6-4.7 2.5 1-5.3-3.8-3.7 5.3-.7z' fill='%23F2C230' stroke='%23C99700' stroke-width='1.2' stroke-linejoin='round'/%3E%3Cpath d='M36 21v5M33.5 23.5h5' stroke='%235CCBEF' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M18 5v4M16 7h4' stroke='%235CCBEF' stroke-width='1.8' stroke-linecap='round'/%3E%3Ccircle cx='35' cy='13' r='1.4' fill='%23F2C230'/%3E%3C/svg%3E") center / contain no-repeat !important;
}
.elder-page-title::before, h2.icon_option strong::before, .elder-section-title::before, .pro-group-title::before {
  width: 30px !important; height: 30px !important; border-radius: 0 !important;
  transform-origin: 20% 85%; animation: elder-wand-wave 3.6s ease-in-out infinite;
}
.elder-wand-mark { display: inline-block; flex: none; width: 30px; height: 30px; vertical-align: middle; transform-origin: 20% 85%; animation: elder-wand-wave 3.6s ease-in-out infinite; }

/* 智慧卡片的徽章改為藍底白蜜蜂 */
.elder-ai-badge { color: #FFE680; }

/* ---- 代言人：首頁小幫手 ---- */
.elder-mascot-hero { display: flex; gap: 18px; align-items: stretch; padding: 18px 18px 18px 8px; }
.elder-mascot {
  position: relative; flex: 0 0 150px; align-self: flex-end; padding: 0 !important; min-height: 0 !important;
  background: none !important; border: none !important; cursor: pointer; border-radius: 50% !important;
}
.elder-mascot img { display: block; width: 150px; height: auto; transform-origin: 50% 90%; animation: elder-float 4.5s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(30, 91, 184, 0.18)); }
.elder-mascot:hover img { animation-duration: 2.2s; }
.elder-mascot.is-waving img { animation: elder-wave 0.9s ease-in-out; }
.elder-mascot-tag {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); white-space: nowrap;
  padding: 2px 10px; border-radius: 10px 3px 10px 3px; background: #1E5BB8; color: #FFFFFF; font-size: 1rem; font-weight: 700;
}
.elder-mascot-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.elder-bubble {
  position: relative; padding: 14px 18px; border-radius: 18px 18px 18px 4px; background: #E8F0FB; color: #1F2A3D;
  font-size: 1.25rem; font-weight: 700; line-height: 1.55; min-height: 3.2em; transition: background 0.3s;
}
.elder-bubble::before {
  content: ""; position: absolute; left: -10px; bottom: 12px; border: 10px solid transparent; border-right-color: #E8F0FB; border-left: 0;
}
.elder-bubble small { display: block; margin-top: 2px; font-size: 1.0625rem; font-weight: 500; color: #4F5B70; }
.elder-bubble.is-new { animation: elder-pop 0.45s ease-out; }
.elder-mascot-hint { font-size: 1.0625rem; color: #4F5B70; }
.elder-mascot-hint b { color: #1E5BB8; }

/* 今日進度星星 */
.elder-progress { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.125rem; font-weight: 700; color: #1F2A3D; }
.elder-stars { display: inline-flex; gap: 3px; }
.elder-stars svg { width: 26px; height: 26px; }
.elder-stars .on { color: #E0A800; }
.elder-stars .on svg { fill: #F2C230; }
.elder-stars .off { color: #BFCFE6; }

/* 在卡片裡飛來飛去的小蜜蜂 */
.elder-flybee {
  position: absolute; top: -18px; right: 70px; width: 40px; height: 34px; pointer-events: none; z-index: 2;
  animation: elder-fly 9s ease-in-out infinite;
}
.elder-flybee.elder-bee-mark { width: 40px; height: 34px; }

/* 點小幫手時噴出的星星 */
.elder-burst { position: fixed; z-index: 200; width: 22px; height: 22px; pointer-events: none; color: #F2C230; }
.elder-burst svg { width: 100%; height: 100%; fill: currentColor; }

@keyframes elder-float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-8px) rotate(-1.5deg); } }
@keyframes elder-wave { 0% { transform: rotate(0); } 25% { transform: rotate(-6deg) scale(1.04); } 50% { transform: rotate(5deg) scale(1.06); } 75% { transform: rotate(-3deg); } 100% { transform: rotate(0); } }
@keyframes elder-pop { 0% { transform: scale(0.94); opacity: 0.4; } 70% { transform: scale(1.02); opacity: 1; } 100% { transform: scale(1); } }
@keyframes elder-wand-wave { 0%, 70%, 100% { transform: rotate(0deg); } 78% { transform: rotate(-14deg); } 86% { transform: rotate(10deg); } 93% { transform: rotate(-5deg); } }
@keyframes elder-fly {
  0% { transform: translate(0, 0) rotate(-6deg); } 25% { transform: translate(-120px, 18px) rotate(6deg); }
  50% { transform: translate(-60px, -6px) scaleX(-1); } 75% { transform: translate(20px, 22px) rotate(-4deg); } 100% { transform: translate(0, 0) rotate(-6deg); }
}

/* ---- 分頁 ---- */
.elder-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 20px 0 8px; }
.elder-pager-side { display: flex; flex-wrap: wrap; gap: 8px; }
.elder-pager-side:last-child { justify-content: flex-end; }
.elder-pager-info { text-align: center; font-size: 1.1875rem; font-weight: 900; color: #1F2A3D; }
.elder-pager-info small { display: block; font-size: 1.0625rem !important; font-weight: 500; color: #4F5B70; }

/* ---- 登入頁代言人 ---- */
.elder-login-mascot { display: block; width: 140px; height: auto; margin: 0 auto; animation: elder-float 4.5s ease-in-out infinite; }

@media (max-width: 760px) {
  .elder-mascot-hero { flex-direction: column; align-items: center; padding: 16px; }
  .elder-mascot { align-self: center; flex-basis: auto; }
  .elder-mascot img { width: 120px; }
  .elder-bubble { border-radius: 18px; }
  .elder-bubble::before { left: 50%; top: -10px; bottom: auto; margin-left: -10px; border: 10px solid transparent; border-bottom-color: #E8F0FB; border-top: 0; }
  .elder-pager { grid-template-columns: 1fr; text-align: center; }
  .elder-pager-side, .elder-pager-side:last-child { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .elder-mascot img, .elder-wand-mark, .elder-page-title::before, h2.icon_option strong::before, .elder-section-title::before, .pro-group-title::before, .elder-login-mascot { animation: none !important; }
}


/* =====================================================================
 * 產品列表：緊湊格線版（取代先前的彈性排版）
 *   一般：圖片｜名稱（至少 12 個字寬）｜價格欄｜排序｜操作 —— 一列一個產品
 *   緊湊（elder.js 偵測放不下）：操作按鈕移到名稱下方第二行
 *   窄螢幕／手機：每個產品一張卡片
 * ===================================================================== */
.pro-head, .pro-row { display: grid; align-items: center; column-gap: 10px; row-gap: 6px; }
.pro-c-thumb, .pro-c-main, .pro-c-num, .pro-c-rank, .pro-c-act { flex: none; min-width: 0; }
.pro-head .pro-c-act { min-width: 0; text-align: right; }
.pro-head .pro-c-num { text-align: right; padding-right: 10px; }
.pro-n0 .pro-head, .pro-n0 .pro-row { grid-template-columns: 64px minmax(12rem, 1fr) 5.5rem 16.5rem; }
.pro-n1 .pro-head, .pro-n1 .pro-row { grid-template-columns: 64px minmax(12rem, 1fr) minmax(5rem, 6.5rem) 5.5rem 16.5rem; }
.pro-n2 .pro-head, .pro-n2 .pro-row { grid-template-columns: 64px minmax(12rem, 1fr) repeat(2, minmax(5rem, 6.5rem)) 5.5rem 16.5rem; }
.pro-n3 .pro-head, .pro-n3 .pro-row { grid-template-columns: 64px minmax(12rem, 1fr) repeat(3, minmax(5rem, 6.5rem)) 5.5rem 16.5rem; }
.pro-row { padding: 8px 14px; }
.pro-head { padding: 8px 14px; }
.pro-meta { margin-top: 4px; }
/* 一般排版：儲存有文字，其他三個只放圖示（滑鼠移上去有說明）；緊湊／卡片模式再顯示文字 */
.pro-c-act { flex-wrap: nowrap; justify-content: flex-end; }
.pro-c-act .elder-icon-btn { width: 46px; min-width: 46px; padding: 0 !important; }
.pro-c-act .elder-icon-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pro-group.is-compact .pro-c-act { flex-wrap: wrap; }
.pro-group.is-compact .pro-c-act .elder-icon-btn, .pro-group.is-stacked .pro-c-act .elder-icon-btn { width: auto; padding: 0 12px !important; }
.pro-group.is-compact .pro-c-act .elder-icon-btn span, .pro-group.is-stacked .pro-c-act .elder-icon-btn span { position: static; width: auto; height: auto; clip: auto; }
@media (max-width: 760px) {
  .pro-c-act { flex-wrap: wrap; }
  .pro-c-act .elder-icon-btn { width: auto; padding: 0 12px !important; }
  .pro-c-act .elder-icon-btn span { position: static; width: auto; height: auto; clip: auto; }
}

@media (min-width: 761px) {
  .pro-group.is-compact .pro-head .pro-c-act { display: none; }
  .pro-n0.is-compact .pro-head, .pro-n0.is-compact .pro-row { grid-template-columns: 64px minmax(9rem, 1fr) 5rem; }
  .pro-n1.is-compact .pro-head, .pro-n1.is-compact .pro-row { grid-template-columns: 64px minmax(9rem, 1fr) minmax(4.5rem, 6rem) 5rem; }
  .pro-n2.is-compact .pro-head, .pro-n2.is-compact .pro-row { grid-template-columns: 64px minmax(9rem, 1fr) repeat(2, minmax(4.5rem, 6rem)) 5rem; }
  .pro-n3.is-compact .pro-head, .pro-n3.is-compact .pro-row { grid-template-columns: 64px minmax(9rem, 1fr) repeat(3, minmax(4.5rem, 6rem)) 5rem; }
  .pro-group.is-compact .pro-row .pro-c-thumb { grid-row: span 2; align-self: start; }
  .pro-group.is-compact .pro-row .pro-c-act { grid-column: 2 / -1; justify-content: flex-start; }
}

/* 卡片模式：手機，或電腦上連緊湊版都放不下時 */
@media (max-width: 760px) {
  .pro-row { display: flex !important; }
}
.pro-group.is-stacked .pro-head { display: none; }
.pro-group.is-stacked .pro-rows { background: transparent; border: none; overflow: visible; }
.pro-group.is-stacked .pro-row {
  display: flex !important; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 12px; padding: 14px;
  background: #FFFFFF !important; border: 2px solid #D9E3F2; border-radius: 14px 4px 14px 4px;
}
.pro-group.is-stacked .pro-c-thumb { align-self: flex-start; }
.pro-group.is-stacked .pro-c-main { flex: 1 1 calc(100% - 80px); }
.pro-group.is-stacked .pro-c-num, .pro-group.is-stacked .pro-c-rank { flex: 1 1 28%; }
.pro-group.is-stacked .pro-c-act { flex: 1 1 100%; }
.pro-group.is-stacked .pro-c-act .pro-save { flex: 1 1 100%; }
.pro-group.is-stacked .pro-c-act .elder-icon-btn { flex: 1 1 0; }
.pro-group.is-stacked .pro-label { position: static; width: auto; height: auto; clip: auto; display: block; margin: 0 0 4px; font-size: 1.0625rem; font-weight: 700; color: #1E5BB8; }

/* 可放大的縮圖 */
button.pro-thumb { position: relative; padding: 0 !important; min-height: 0 !important; border: 2px solid #D9E3F2 !important; background: #E7F5F0 !important; cursor: zoom-in; }
button.pro-thumb:hover { border-color: #1E5BB8 !important; }
.pro-zoom-ico {
  position: absolute; right: 2px; bottom: 2px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(30, 91, 184, 0.92); color: #FFFFFF;
}
img.elder-zoomable { cursor: zoom-in; }

/* =====================================================================
 * 燈箱（點圖片放大）
 * ===================================================================== */
.elder-lightbox {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  padding: 72px 16px 24px; background: rgba(12, 26, 54, 0.88); opacity: 0; transition: opacity 0.2s ease;
}
.elder-lightbox.is-open { opacity: 1; }
.elder-lightbox figure { margin: 0; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.elder-lightbox img {
  display: block; max-width: min(92vw, 1100px); max-height: calc(100vh - 170px); width: auto; height: auto;
  border-radius: 14px 4px 14px 4px; background: #FFFFFF; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  transform: scale(0.96); transition: transform 0.2s ease;
}
.elder-lightbox.is-open img { transform: scale(1); }
.elder-lightbox figcaption { color: #FFFFFF; font-size: 1.25rem; font-weight: 700; text-align: center; }
.elder-lb-close {
  position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 6px;
  min-height: 52px; padding: 0 18px; border: none; border-radius: 12px 4px 12px 4px !important;
  background: #FFFFFF !important; color: #1F2A3D !important; font-size: 1.125rem; font-weight: 900; cursor: pointer;
}
.elder-lb-nav {
  position: absolute; top: 50%; margin-top: -30px; width: 60px; height: 60px; border: none; border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.92) !important; color: #1E5BB8 !important; font-size: 2rem; font-weight: 900; line-height: 1; cursor: pointer; padding: 0 !important;
}
.elder-lb-prev { left: 14px; } .elder-lb-next { right: 14px; }
.elder-lb-count { position: absolute; top: 24px; left: 18px; color: #FFFFFF; font-size: 1.125rem; font-weight: 700; }
body.elder-lb-lock { overflow: hidden; }

/* =====================================================================
 * 回到頁首按鈕（右下角）
 * ===================================================================== */
.elder-totop {
  position: fixed; right: 20px; bottom: 24px; z-index: 70;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  width: 62px; height: 62px; border-radius: 18px 6px 18px 6px;
  background: #1E5BB8; color: #FFFFFF !important; text-decoration: none; font-size: 0.9375rem; font-weight: 700;
  box-shadow: 0 8px 20px rgba(30, 91, 184, 0.35);
  opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}
.elder-totop span { font-size: 1rem; line-height: 1.1; }
.elder-totop.is-show { opacity: 1; visibility: visible; transform: translateY(0); }
.elder-totop:hover { background: #17468F; color: #FFFFFF !important; }
.elder-totop:focus-visible { outline: 3px solid #F2C230; outline-offset: 3px; }
@media (max-width: 760px) { .elder-totop { right: 14px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); width: 58px; height: 58px; } }
@media print { .elder-totop, .elder-lightbox { display: none !important; } }
.pro-save { white-space: nowrap; flex: none; }


/* =====================================================================
 * 第十一階段：回首頁、頁面列表、編輯頁（綠色標籤欄、固定儲存列）、千分位
 * ===================================================================== */

/* 回首頁按鈕（手機版用底部選單的「首頁」） */
.elder-home { gap: 6px; }
.elder-home.is-current { border-color: #1E5BB8; background: #E8F0FB; color: #17468F !important; }
@media (max-width: 760px) { .elder-home { display: none; } }

/* 今日進度說明 */
.elder-progress-note { font-weight: 500; color: #4F5B70; }
.elder-progress-note small { display: block; font-size: 1.0625rem !important; color: #6B7890; }

/* ---- 頁面列表（page_overview.php，沿用產品列表的排版） ---- */
.pg-group .pro-head, .pg-group .pro-row { grid-template-columns: var(--cols); }
@media (min-width: 761px) {
  .pg-group.is-compact .pro-head, .pg-group.is-compact .pro-row { grid-template-columns: var(--cols-compact); }
  .pg-group.is-compact .pro-row .pro-c-act { grid-column: 1 / -1; justify-content: flex-start; }
}
.pro-c-nav, .pro-c-mail, .pro-c-time { min-width: 0; }
.pro-c-mail { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.pro-c-time { font-variant-numeric: tabular-nums; color: #4F5B70; }
.pro-head .pro-c-time { color: inherit; }
.elder-check { display: inline-flex; align-items: center; gap: 4px; font-size: 1.0625rem; font-weight: 700; white-space: nowrap; }
.elder-check input { width: 24px; height: 24px; margin: 0; }
.pro-row .pro-c-nav select { width: 100%; }
@media (max-width: 760px) {
  .pro-c-nav { flex: 1 1 100%; }
  .pro-c-mail { flex: 1 1 100%; }
  .pro-c-time { flex: 1 1 28%; }
}
.pro-group.is-stacked .pro-c-nav, .pro-group.is-stacked .pro-c-mail { flex: 1 1 100%; }
.pro-group.is-stacked .pro-c-time { flex: 1 1 28%; }

/* ---- 編輯頁的表單表格：左側欄位名稱改為淺綠底（取代原本的黃色） ---- */
table.elder-form-table th, table.elder-form-table td { background: #FFFFFF; color: #1F2A3D; font-weight: 400; text-align: left; white-space: normal; border-bottom: 1px solid #E7EDF7; }
table.elder-form-table tr > :first-child.text-right,
table.elder-form-table tr > :first-child[nowrap] {
  width: 1%; white-space: nowrap; background: #E7F5F0; color: #174F45; font-weight: 700; text-align: right; border-right: 2px solid #9FD3C2;
}
table.elder-form-table tr:hover > * { background: inherit; }
table.elder-form-table p { margin: 0 0 10px; }
table.elder-form-table .img-demo { width: 120px; height: 120px; object-fit: cover; margin: 4px 8px 4px 0; vertical-align: top; }
td.elder-field-cell > .elder-field-row, th.elder-field-cell > .elder-field-row, p.elder-field-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.elder-field-row > input[type="text"], .elder-field-row > input:not([type]) { flex: 1 1 18rem; width: auto !important; min-width: 0; }
.elder-field-row > input[type="file"] { flex: 1 1 100%; }
.elder-field-row > label, .elder-field-row > span { white-space: nowrap; }

/* 尚未儲存／儲存完成：都用綠色系提醒 */
.warrning_box { background: #E7F5F0; border: 2px dashed #2A7F6B; color: #174F45; }

/* ---- 固定在畫面底部的儲存列（編輯頁） ---- */
.elder-savebar {
  position: sticky; bottom: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 16px -4px 0; padding: 12px 14px; background: rgba(255, 255, 255, 0.97);
  border: 2px solid #D9E3F2; border-radius: 14px 4px 14px 4px; box-shadow: 0 -6px 18px rgba(31, 42, 61, 0.08);
}
.elder-savebar input[type="submit"] { min-width: 9rem; min-height: 54px; font-size: 1.25rem !important; margin: 0 !important; width: auto !important; }
.elder-savebar-hint { margin-left: auto; font-size: 1.0625rem; color: #4F5B70; }
@media (max-width: 760px) {
  .elder-savebar { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); margin: 16px 0 0; }
  .elder-savebar input[type="submit"] { flex: 1 1 100%; }
  .elder-savebar-hint { display: none; }
}

/* 金額欄位 */
input.elder-money { text-align: right; font-variant-numeric: tabular-nums; }

/* 手機版列表：放在最後，確保覆蓋上面的格線設定 */
@media (max-width: 760px) {
  .pro-head { display: none !important; }
  .pro-rows { background: transparent; border: none; overflow: visible; }
  .pro-row {
    display: flex !important; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 12px; padding: 14px;
    background: #FFFFFF !important; border: 2px solid #D9E3F2 !important; border-radius: 14px 4px 14px 4px;
  }
  .pro-c-thumb { flex: 0 0 64px; align-self: flex-start; }
  .pro-c-main { flex: 1 1 calc(100% - 80px); }
  .pg-group .pro-c-main, .pro-c-nav, .pro-c-mail { flex: 1 1 100%; }
  .pro-c-num, .pro-c-rank, .pro-c-time { flex: 1 1 28%; }
  .pro-c-act { flex: 1 1 100% !important; flex-wrap: wrap !important; justify-content: stretch; }
  .pro-c-act .pro-save { flex: 1 1 100%; }
  .pro-c-act .elder-icon-btn { flex: 1 1 0; width: auto !important; }
  .pro-label { position: static !important; width: auto !important; height: auto !important; clip: auto !important; display: block; margin: 0 0 4px; font-size: 1.0625rem; font-weight: 700; color: #1E5BB8; }
}

/* 舊版的類別清單（頁面、產品列表下方）改為按鈕列 */
.other_posts { margin: 16px 0; }
.other_posts ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.other_posts li { list-style: none; }
.other_posts li:empty { display: none; }
.other_posts a {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 16px; border-radius: 12px 4px 12px 4px;
  border: 2px solid #D9E3F2; background: #FFFFFF; color: #1F2A3D; font-weight: 700; text-decoration: none;
}
.other_posts a:hover { border-color: #1E5BB8; color: #17468F; }

/* =====================================================================
 * 第十二階段：訂單篩選／搜尋／排序、頁面列表快速跳轉
 * ===================================================================== */
.of-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 12px; margin: 0 0 16px; }
.of-stat {
  padding: 14px 18px; background: #FFFFFF; border: 2px solid #D9E3F2; border-radius: 14px 4px 14px 4px;
  display: flex; flex-direction: column; gap: 2px;
}
.of-stat span { font-size: 1.0625rem; color: #4F5B70; font-weight: 700; }
.of-stat strong { font-size: 1.5rem; font-weight: 900; color: #17468F; font-variant-numeric: tabular-nums; }
.of-stat-todo { border-color: #9FD3C2; background: #F1FAF6; }
.of-stat-todo strong { color: #20685A; }

.of-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 720px; }

.of-filter {
  display: grid; grid-template-columns: minmax(16rem, 2fr) repeat(4, minmax(9rem, 1fr)) auto; gap: 12px; align-items: end;
  margin: 0 0 14px; padding: 16px; background: #FFFFFF; border: 2px solid #D9E3F2; border-radius: 14px 4px 14px 4px;
}
.of-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.of-field label { font-size: 1.0625rem; font-weight: 700; color: #17468F; }
.of-field input, .of-field select { width: 100% !important; min-height: 50px; }
.of-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.of-actions .elder-btn { min-height: 50px; }
@media (max-width: 1180px) { .of-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); } .of-field-q { grid-column: 1 / -1; } .of-actions { grid-column: 1 / -1; } }
@media (max-width: 560px) { .of-filter { grid-template-columns: 1fr; } }

.of-result { margin: 0 0 10px; font-size: 1.125rem; color: #4F5B70; }
.of-result strong { color: #1F2A3D; font-size: 1.25rem; }
.of-id { font-size: 1.1875rem; font-weight: 900; color: #1E5BB8; font-variant-numeric: tabular-nums; text-decoration: none; }
.of-id:hover { text-decoration: underline; }
.of-sub { font-size: 1.0625rem; color: #4F5B70; margin-top: 2px; }
.of-c-cust, .of-c-amt, .of-c-pay, .of-c-ship { min-width: 0; }
.of-c-amt { text-align: right; font-variant-numeric: tabular-nums; font-size: 1.1875rem; }
.pro-head .of-c-amt { text-align: right; }
.of-group .pro-c-act .elder-btn { min-height: 46px; padding: 0 14px; }
.pro-tag-wait { background: #E7F5F0; color: #20685A; }

/* 頁面列表：上方快速跳到各分類 */
.pg-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.pg-jump a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 16px; border-radius: 12px 4px 12px 4px;
  border: 2px solid #D9E3F2; background: #FFFFFF; color: #1F2A3D; font-weight: 700; text-decoration: none;
}
.pg-jump a:hover { border-color: #1E5BB8; color: #17468F; }
.pg-jump a b { color: #6B7890; font-weight: 500; }
.pro-group { scroll-margin-top: 90px; }

@media (max-width: 760px) {
  .of-c-cust, .of-c-amt, .of-c-pay, .of-c-ship { flex: 1 1 45%; }
  .of-c-amt { text-align: left; }
  .of-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pro-group.is-stacked .of-c-cust, .pro-group.is-stacked .of-c-amt, .pro-group.is-stacked .of-c-pay, .pro-group.is-stacked .of-c-ship { flex: 1 1 45%; }
/* 搜尋不是儲存，維持藍色 */
.of-filter button[type="submit"].elder-btn { background: #1E5BB8 !important; }
.of-filter button[type="submit"].elder-btn:hover { background: #17468F !important; }
.of-c-amt { padding-right: 12px; }

/* =====================================================================
 * 列印訂單（order_print.php）：黑白、A4、清楚好讀
 * ===================================================================== */
body.op-print { background: #E9EDF3; color: #000000; padding: 0; }
.op-toolbar {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 20px; background: #FFFFFF; border-bottom: 1px solid #BFCFE6;
}
.op-toolbar span { color: #4F5B70; font-size: 1.0625rem; }
.op-doc {
  max-width: 210mm; margin: 24px auto; padding: 14mm 14mm 10mm; background: #FFFFFF; color: #000000;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12); font-size: 12pt; line-height: 1.5;
}
.op-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 8px; border-bottom: 3px solid #000000; }
.op-shop { display: flex; flex-direction: column; font-size: 10.5pt; }
.op-shop strong { font-size: 15pt; font-weight: 900; }
.op-title { margin: 0; font-size: 22pt; font-weight: 900; letter-spacing: 0.15em; color: #000000; }
.op-title::before { display: none !important; }
.op-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 12px 0 14px; border: 1px solid #000000; }
.op-meta > div { display: flex; gap: 10px; padding: 6px 10px; border-bottom: 1px solid #000000; border-right: 1px solid #000000; }
.op-meta > div:nth-child(2n) { border-right: none; }
.op-meta > div:last-child { border-bottom: none; }
.op-meta .op-meta-wide { grid-column: 1 / -1; border-right: none; }
.op-meta span { flex: none; width: 5.5em; font-weight: 700; }
.op-meta strong { font-weight: 700; word-break: break-all; }
.op-body .grid_10 { margin: 0 0 12px; }
.op-body table.table-edit { width: 100%; border-collapse: collapse !important; border: 1px solid #000000 !important; border-radius: 0 !important; background: #FFFFFF; font-size: 11pt; }
.op-body table.table-edit th, .op-body table.table-edit td {
  padding: 5px 8px !important; border: 1px solid #000000 !important; background: #FFFFFF !important; color: #000000 !important;
  font-size: 11pt !important; font-weight: 400; white-space: normal; height: auto !important;
}
.op-body table.table-edit tr:first-child th { font-weight: 700; border-bottom: 2px solid #000000 !important; }
.op-body table.table-edit th.text-right, .op-body table.table-edit td.text-right { text-align: right; }
.op-body table.table-edit em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }
.op-body table.table-edit tr:last-child th { font-size: 12pt !important; font-weight: 900; border-top: 2px solid #000000 !important; }
.op-body table.table-edit tr:hover > * { background: #FFFFFF !important; }
.op-body h6 { display: block !important; margin: 8px 0 4px !important; padding: 0 !important; background: none !important; color: #000000 !important; font-size: 12pt !important; }
.op-body img { display: none; }
.op-foot { margin-top: 10px; padding-top: 6px; border-top: 1px solid #000000; font-size: 9.5pt; text-align: right; }

@media (max-width: 760px) {
  .op-doc { margin: 0; padding: 16px; box-shadow: none; }
  .op-meta { grid-template-columns: 1fr; }
  .op-meta > div { border-right: none; }
  .op-body .grid_10 { overflow-x: auto; }
}
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  html { font-size: 100% !important; }
  body.op-print { background: #FFFFFF !important; }
  .op-toolbar { display: none !important; }
  .op-doc { max-width: none; margin: 0; padding: 0; box-shadow: none; }
  .op-print * { color: #000000 !important; background: transparent !important; box-shadow: none !important; text-shadow: none !important; }
  .op-body table { page-break-inside: auto; }
  .op-body tr { page-break-inside: avoid; }
  a[href]::after { content: none !important; }
}

/* 廣告列表 */
.slot-group .pro-head .pro-c-thumb, .slot-group .pro-row .pro-c-thumb { width: 7rem; }
.slot-thumb, button.slot-thumb { width: 7rem !important; height: 4.4rem !important; }
.slot-thumb img { width: 100% !important; height: 100% !important; object-fit: cover; }
.slot-c-url { min-width: 0; }
.slot-c-url input { width: 100%; }
@media (max-width: 760px) {
  .slot-group .pro-c-thumb { flex: 0 0 7rem; }
  .slot-group .pro-c-main { flex: 1 1 calc(100% - 8rem); }
  .slot-c-url { flex: 1 1 100%; }
}
.pro-group.is-stacked .slot-c-url { flex: 1 1 100%; }
.op-body th p, .op-body td p { margin: 0; }
.op-body table.table-edit tr:first-child th { vertical-align: middle; }

/* 網站設定：分段標題 */
table.elder-form-table tr.elder-section-row > th {
  padding: 18px 14px 8px !important; background: #F3F6FB !important; border-right: none !important; text-align: left !important;
  white-space: normal !important; width: auto !important;
}
table.elder-form-table tr.elder-section-row span { display: inline-flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 900; color: #17468F; }
table.elder-form-table tr.elder-section-row span::before {
  content: ""; width: 22px; height: 22px; flex: none; background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M7 35 25 17' stroke='%231F3B73' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M27 4.5l2.3 4.9 5.3.7-3.9 3.7.9 5.3-4.6-2.6-4.7 2.5 1-5.3-3.8-3.7 5.3-.7z' fill='%23F2C230' stroke='%23C99700' stroke-width='1.2'/%3E%3C/svg%3E") center / contain no-repeat;
}
table.elder-form-table tr.elder-section-row small { display: block; margin-top: 2px; font-size: 1.0625rem !important; font-weight: 500; color: #4F5B70; }
@media (max-width: 760px) { table.elder-form-table tr.elder-section-row > th { display: block; } }

/* 頁尾「快速前往」 */
.elder-quick { margin: 8px 0 0; padding: 16px 18px; background: #FFFFFF; border: 2px solid #D9E3F2; border-radius: 14px 4px 14px 4px; }
.elder-quick-title { display: block; margin: 0 0 10px; font-size: 1.0625rem; font-weight: 900; color: #4F5B70; }
.elder-quick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 8px; }
.elder-quick-list a span { white-space: nowrap; }
.elder-quick-list a {
  position: relative; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px;
  border: 2px solid #E2EAF6; border-radius: 12px 4px 12px 4px; background: #F7F9FD;
  color: #1F2A3D; font-weight: 700; text-decoration: none;
}
.elder-quick-list a svg { flex: none; color: #1E5BB8; }
.elder-quick-list a:hover { border-color: #1E5BB8; background: #E8F0FB; color: #17468F; }
.elder-quick-list a.is-current { background: #1E5BB8; border-color: #1E5BB8; color: #FFFFFF; }
.elder-quick-list a.is-current svg { color: #FFE680; }
.elder-quick-list .elder-badge { margin-left: auto; }
@media (max-width: 760px) { .elder-quick { display: none; } }

/* =====================================================================
 * 營運洞見（insight.php）
 * ===================================================================== */
.ins-range { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 520px; }
.ins-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 12px; margin: 0 0 18px; }
.ins-kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: #FFFFFF; border: 2px solid #D9E3F2; border-radius: 14px 4px 14px 4px; }
.ins-kpi > span:first-child { font-size: 1.0625rem; font-weight: 700; color: #4F5B70; }
.ins-kpi strong { font-size: 1.75rem; font-weight: 900; color: #17468F; font-variant-numeric: tabular-nums; }
.ins-kpi-todo { border-color: #9FD3C2; background: #F1FAF6; }
.ins-kpi-todo strong { color: #20685A; }
.ins-delta { font-size: 1.0625rem; color: #6B7890; font-weight: 700; }
.ins-delta.is-up { color: #20685A; }
.ins-delta.is-down { color: #A3141F; }

.ins-card { margin: 0 0 18px; padding: 18px; background: #FFFFFF; border: 2px solid #D9E3F2; border-radius: 14px 4px 14px 4px; }
.ins-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.375rem; font-weight: 900; color: #1F2A3D; }
.ins-card-title small { font-size: 1.0625rem !important; font-weight: 500; color: #6B7890; }
.ins-pill { display: inline-flex; align-items: center; padding: 2px 12px; border-radius: 10px 3px 10px 3px; font-size: 1.0625rem; font-weight: 900; white-space: nowrap; }
.ins-need { background: #FBEAEC; color: #A3141F; }
.ins-warn { background: #FFF1D6; color: #8A5300; }
.ins-info { background: #E7F5F0; color: #20685A; }
.ins-list { margin: 0; padding: 0; list-style: none; }
.ins-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid #E7EDF7; }
.ins-item:first-child { border-top: none; }
.ins-item .ins-pill { flex: none; min-width: 5em; justify-content: center; }
.ins-text { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.ins-text strong { font-size: 1.1875rem; }
.ins-text span { font-size: 1.0625rem; color: #4F5B70; }
.ins-item .elder-btn-outline { flex: none; }
.ins-empty { margin: 0; padding: 12px 0; color: #4F5B70; }

.ins-two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.ins-two .ins-card { margin: 0; }
.ins-table { width: 100%; border-collapse: collapse; font-size: 1.0625rem; }
.ins-table th { padding: 8px; text-align: left; color: #4F5B70; font-weight: 700; border-bottom: 2px solid #D9E3F2; background: none; }
.ins-table td { padding: 10px 8px; border-bottom: 1px solid #E7EDF7; vertical-align: top; }
.ins-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ins-rank { display: inline-flex; width: 1.6em; height: 1.6em; margin-right: 6px; align-items: center; justify-content: center; border-radius: 50%; background: #E8F0FB; color: #17468F; font-size: 0.95em; font-weight: 900; }
.ins-bar { display: block; height: 6px; margin-top: 6px; background: #EEF2F8; border-radius: 3px; overflow: hidden; }
.ins-bar i { display: block; height: 100%; background: #1E5BB8; border-radius: 3px; }
.ins-table tr:first-child .ins-bar i { background: #F2C230; }
.ins-note { margin: 10px 0 0; font-size: 1.0625rem; color: #6B7890; }
.ins-chart { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; height: 240px; padding: 8px 0 0; }
.ins-col { display: flex; flex-direction: column; align-items: center; height: 100%; gap: 6px; }
.ins-col-val { font-size: 1rem; font-weight: 700; color: #17468F; white-space: nowrap; }
.ins-col-bar { flex: 1 1 auto; width: 100%; max-width: 54px; display: flex; align-items: flex-end; background: #F3F6FB; border-radius: 10px 10px 4px 4px; }
.ins-col-bar i { display: block; width: 100%; background: linear-gradient(180deg, #3B7DDD, #1E5BB8); border-radius: 10px 10px 4px 4px; }
.ins-col:last-child .ins-col-bar i { background: linear-gradient(180deg, #F7D768, #F2C230); }
.ins-col-lab { font-size: 1.0625rem; font-weight: 700; color: #4F5B70; }
@media (max-width: 980px) { .ins-two { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .ins-item { flex-wrap: wrap; }
  .ins-item .elder-btn-outline { width: 100%; }
  .ins-chart { height: 200px; gap: 6px; }
  .ins-col-val { font-size: 0.9rem; }
}

/* 列表關鍵字篩選列 */
.elder-filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 14px;
  background: #FFFFFF; border: 2px solid #D9E3F2; border-radius: 14px 4px 14px 4px;
}
.elder-filterbar label { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; color: #17468F; white-space: nowrap; }
.elder-filterbar input[type="search"] { flex: 1 1 18rem; min-width: 0; min-height: 50px; }
.elder-filterbar select { flex: 0 0 auto; min-height: 50px; width: auto; }
.elder-filter-count { margin-left: auto; font-size: 1.0625rem; color: #4F5B70; white-space: nowrap; }
.elder-filter-count b { color: #1F2A3D; font-size: 1.1875rem; }
@media (max-width: 760px) { .elder-filterbar select { flex: 1 1 100%; width: 100% !important; } .elder-filter-count { margin-left: 0; } }

/* 常見問題 */
.faq-c-ans { min-width: 0; color: #4F5B70; }
.faq-q { font-weight: 900; color: #1F2A3D; text-decoration: none; font-size: 1.1875rem; }
.faq-q:hover { color: #1E5BB8; text-decoration: underline; }
.faq-a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 760px) { .faq-c-ans { flex: 1 1 100%; } .faq-group .pro-c-main { flex: 1 1 100%; } }
.pro-group.is-stacked .faq-c-ans { flex: 1 1 100%; }

/* =====================================================================
 * 語音輸入、AI 週報、直接問小幫手
 * ===================================================================== */
.elder-mic {
  display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 14px; margin: 6px 0 0;
  border: 2px solid #BED3F0 !important; border-radius: 12px 4px 12px 4px !important;
  background: #FFFFFF !important; color: #1E5BB8 !important; font-size: 1.0625rem; font-weight: 700; cursor: pointer;
}
.elder-mic:hover { background: #E8F0FB !important; }
.elder-mic.is-compact { margin: 0; flex: none; }
.elder-mic.is-listening { background: #FBEAEC !important; border-color: #BF1D2C !important; color: #A3141F !important; animation: elder-mic-pulse 1.2s ease-in-out infinite; }
.elder-mic-bar { display: flex; justify-content: flex-start; margin: 4px 0 8px; }
@keyframes elder-mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(191, 29, 44, 0.35); } 50% { box-shadow: 0 0 0 8px rgba(191, 29, 44, 0); } }
@media (prefers-reduced-motion: reduce) { .elder-mic.is-listening { animation: none; } }
@media (max-width: 760px) { .elder-mic.is-compact span { display: none; } }

.ins-ai { margin-bottom: 18px; }
.ins-ai-card { border-color: #BED3F0; background: linear-gradient(180deg, #F7FAFF, #FFFFFF 40%); }
.ins-ai-card .ins-card-title { gap: 10px; }
.ins-ai-text { font-size: 1.1875rem; line-height: 1.8; color: #1F2A3D; padding: 12px 14px; background: #FFFFFF; border: 1px solid #E2EAF6; border-radius: 12px 4px 12px 4px; }
.ins-ai-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.ins-ai-btn { background: #1E5BB8 !important; }
.ins-ai-btn:hover { background: #17468F !important; }
.ins-ai-btn[disabled] { background: #BFCFE6 !important; }
.ins-ai-hint { font-size: 1.0625rem; color: #6B7890; margin: 8px 0 0; }
.ins-ai-error { margin: 0 0 10px; padding: 10px 14px; border-radius: 12px 4px 12px 4px; background: #FFF1D6; color: #8A5300; font-weight: 700; }
.ins-qa { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.ins-q { align-self: flex-end; max-width: 90%; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: #1E5BB8; color: #FFFFFF; }
.ins-q b { display: none; }
.ins-a { max-width: 95%; padding: 12px 16px; border-radius: 16px 16px 16px 4px; background: #E8F0FB; color: #1F2A3D; line-height: 1.75; }
.ins-a b { display: block; color: #17468F; }
.ins-ask-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ins-ask-row input { flex: 1 1 14rem; min-width: 0; min-height: 52px; }
.ins-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ins-chip {
  min-height: 40px !important; padding: 0 12px !important; border: 2px solid #D9E3F2 !important; border-radius: 20px !important;
  background: #FFFFFF !important; color: #1F2A3D !important; font-size: 1.0625rem !important; font-weight: 500 !important; cursor: pointer;
}
.ins-chip:hover { border-color: #1E5BB8 !important; color: #17468F !important; }

/* =====================================================================
 * 第十六階段：左側選單、麵包屑（依「魔法師改版」設計稿）
 * ===================================================================== */
.elder-sidenav { display: none; }
.elder-crumb { display: none; }
@media (min-width: 761px) {
  body { padding-left: 264px; }
  .elder-sidenav {
    display: flex; flex-direction: column; gap: 6px;
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 55; width: 264px; box-sizing: border-box;
    padding: 16px 14px; overflow-y: auto; background: #FFFFFF; border-right: 1px solid #D9E3F2;
  }
  .elder-side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; margin-bottom: 4px; border-bottom: 1px solid #E7EDF7; color: #1F2A3D; text-decoration: none; }
  .elder-side-brand img { width: 38px; height: 38px; flex: none; }
  .elder-side-brand span { display: flex; flex-direction: column; min-width: 0; }
  .elder-side-brand strong { font-size: 1.1875rem; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .elder-side-brand small { font-size: 0.9375rem !important; color: #6B7890; }
  .elder-side-list { display: flex; flex-direction: column; gap: 4px; }
  .elder-side-list a {
    display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px;
    border-radius: 12px 4px 12px 4px; color: #1F2A3D; font-size: 1.125rem; font-weight: 700; text-decoration: none;
  }
  .elder-side-list a svg { flex: none; color: #1E5BB8; }
  .elder-side-list a span { flex: 1 1 auto; }
  .elder-side-list a:hover { background: #E8F0FB; color: #17468F; }
  .elder-side-list a.is-active { background: #1E5BB8; color: #FFFFFF; font-weight: 900; }
  .elder-side-list a.is-active svg { color: #FFE680; }
  .elder-side-badge { min-width: 26px; height: 26px; padding: 0 8px; box-sizing: border-box; border-radius: 13px; background: #2A7F6B; color: #FFFFFF; font-size: 0.9375rem; font-style: normal; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; }
  .elder-side-list a.is-active .elder-side-badge { background: #FFFFFF; color: #1E5BB8; }
  .elder-side-divider { height: 1px; margin: 6px 4px; background: #E7EDF7; }
  .elder-side-admin { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding: 10px; border-radius: 12px 4px 12px 4px; background: #F3F6FB; }
  .elder-side-admin span { font-size: 0.9375rem; font-weight: 900; color: #6B7890; }
  .elder-side-admin a { padding: 6px 4px; color: #17468F; font-size: 1rem; text-decoration: none; }
  .elder-side-help {
    margin-top: auto; padding: 14px; border-radius: 14px 4px 14px 4px; background: #E8F0FB;
    display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer;
  }
  .elder-side-help img { width: 72px; height: auto; }
  .elder-side-help strong { font-size: 1.0625rem; color: #17468F; }
  .elder-side-help span { font-size: 1rem; color: #1F2A3D; line-height: 1.55; }

  /* 頂部列：左邊是位置提示，商店名稱已在左側選單 */
  .elder-topbar .elder-brand { display: none; }
  .elder-topbar .elder-home { display: none; }
  .elder-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; font-size: 1.0625rem; color: #4F5B70; }
  .elder-crumb a { color: #1E5BB8; font-weight: 700; text-decoration: none; }
  .elder-crumb a:hover { text-decoration: underline; }
  .elder-crumb b { color: #1F2A3D; font-weight: 900; }
  .head_bar { display: none !important; }       /* 舊的下拉選單已整合到左側選單 */
  .elder-lightbox { left: 0; }
}
@media print { body { padding-left: 0 !important; } .elder-sidenav { display: none !important; } }
body.op-print, body.elder-login { padding-left: 0 !important; }

/* 刪除後可以復原 */
.elder-flash-undo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.elder-undo-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 12px 4px 12px 4px;
  background: #1E5BB8; color: #FFFFFF !important; font-weight: 900; text-decoration: none;
}
.elder-undo-btn:hover { background: #17468F; }

/* 修改提醒 */
.pro-row.is-dirty { box-shadow: inset 5px 0 0 #2A7F6B; background: #F1FAF6 !important; }
.pro-row.is-dirty input[type="text"], .pro-row.is-dirty select { border-color: #2A7F6B; }
.elder-dirty-tag { background: #2A7F6B !important; color: #FFFFFF !important; }
.elder-dirty-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px 4px 12px 4px; background: #F3F6FB; color: #6B7890; font-size: 1.0625rem; font-weight: 700; }
.elder-dirty-status.is-on { background: #E7F5F0; color: #174F45; font-weight: 900; }
.elder-dirty-status i { width: 10px; height: 10px; border-radius: 5px; background: #2A7F6B; display: inline-block; }
.elder-savebar .elder-savebar-hint { display: none; }

/* 產品編輯分步驟 */
.elder-stepper {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 12px; scroll-margin-top: 90px;
  background: #FFFFFF; border: 2px solid #D9E3F2; border-radius: 14px 4px 14px 4px;
}
.elder-stepper button {
  flex: 1 1 170px; display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 6px 12px; text-align: left;
  border: 2px solid transparent !important; border-radius: 12px 4px 12px 4px !important; background: #FFFFFF !important; color: #4F5B70 !important; font-weight: 500; cursor: pointer;
}
.elder-stepper button:hover { background: #F3F6FB !important; }
.elder-step-no {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #BFCFE6; color: #6B7890; font-size: 1.125rem; font-weight: 900; background: #FFFFFF;
}
.elder-step-text { display: flex; flex-direction: column; min-width: 0; }
.elder-step-text b { font-size: 1.125rem; color: #1F2A3D; }
.elder-step-text small { font-size: 0.9375rem !important; color: #6B7890; }
.elder-stepper button.is-now { border-color: #BED3F0 !important; background: #E8F0FB !important; }
.elder-stepper button.is-now .elder-step-no { background: #1E5BB8; border-color: #1E5BB8; color: #FFFFFF; box-shadow: 0 0 0 4px #BED3F0; }
.elder-stepper button.is-done .elder-step-no { background: #2A7F6B; border-color: #2A7F6B; color: #FFFFFF; }
.elder-stepper .elder-step-all { flex: 0 0 auto; justify-content: center; color: #1E5BB8 !important; font-weight: 900; border-color: #D9E3F2 !important; }
.elder-stepper .elder-step-all.is-now { background: #1E5BB8 !important; color: #FFFFFF !important; }
.elder-step-prev, .elder-step-next { font-weight: 900; }
.elder-step-next { border-color: #1E5BB8 !important; color: #1E5BB8 !important; }
@media (max-width: 760px) { .elder-stepper button { flex: 1 1 45%; } .elder-step-text small { display: none; } }
.elder-savebar .elder-dirty-status { order: -2; margin-right: auto; }
.elder-savebar .elder-step-prev { order: 1; }
.elder-savebar .elder-step-next { order: 2; }
.elder-savebar input[type="submit"] { order: 3; }
@media (max-width: 760px) { .elder-savebar .elder-dirty-status { flex: 1 1 100%; } }

/* 標題列：左邊標題，右邊一個主要按鈕 */
h2.icon_option strong { flex: 1 1 auto !important; }
.elder-head-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-left: auto; }
.elder-head-link { font-size: 1.0625rem; font-weight: 700; color: #1E5BB8; text-decoration: none; white-space: nowrap; }
.elder-head-link:hover { text-decoration: underline; }
.elder-head-primary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 54px; padding: 0 22px; border-radius: 12px 4px 12px 4px;
  background: #1E5BB8; color: #FFFFFF !important; font-size: 1.1875rem; font-weight: 900; text-decoration: none; white-space: nowrap;
}
.elder-head-primary span { font-size: 1.5rem; line-height: 1; }
.elder-head-primary:hover { background: #17468F; }
@media (max-width: 760px) { .elder-head-actions { margin-left: 0; width: 100%; } .elder-head-primary { flex: 1 1 100%; justify-content: center; } }

/* =====================================================================
 * 列表每一列對齊：所有輸入框上緣對齊、表頭與內容同一條線
 * ===================================================================== */
@media (min-width: 761px) {
  .pro-row { align-items: start; }
  .pro-head { align-items: end; }
  .pro-row > .pro-c-thumb { align-self: start; }
  /* 純文字欄位（更新日期等）與輸入框同高，文字垂直置中 */
  .pro-row > .pro-c-time { min-height: 46px; display: flex; align-items: center; }
  .pro-row > .pro-c-mail { min-height: 46px; }
  /* 操作按鈕靠左排，與表頭「操作」同一條起始線 */
  .pro-row > .pro-c-act { justify-content: flex-start !important; align-self: start; }
  .pro-head > .pro-c-act { text-align: left !important; }
  /* 金額：表頭與輸入框都靠右，右緣對齊 */
  .pro-head > .pro-c-num { text-align: right; padding-right: 0 !important; }
  .pro-row > .pro-c-num input { text-align: right; }
  /* 訂單列表沒有輸入框，維持垂直置中 */
  .of-group .pro-row { align-items: center; }
  .of-group .pro-row > .pro-c-act { align-self: center; }
}
@media (min-width: 761px) { .pro-head > .pro-c-act { justify-content: flex-start !important; } }

/* 標題列的次要按鈕（管理產品類別／系列） */
.elder-head-secondary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 50px; padding: 0 16px; border-radius: 12px 4px 12px 4px;
  border: 2px solid #1E5BB8; background: #FFFFFF; color: #1E5BB8 !important; font-size: 1.0625rem; font-weight: 900; text-decoration: none; white-space: nowrap;
}
.elder-head-secondary:hover { background: #E8F0FB; }
@media (max-width: 760px) { .elder-head-secondary { flex: 1 1 45%; justify-content: center; } }

/* 產品搜尋 */
.pro-search .pro-search-btn { background: #1E5BB8 !important; min-height: 50px; }
.pro-search .pro-search-btn:hover { background: #17468F !important; }

/* =====================================================================
 * 展示帳號與教學手冊
 * ===================================================================== */
.elder-demo-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 18px;
  background: linear-gradient(90deg, #FFF6D9, #E8F0FB); border-bottom: 2px solid #F2C230; font-size: 1.0625rem; color: #1F2A3D;
}
.elder-demo-bar b { color: #8A5300; }
.elder-demo-bar a { margin-left: auto; font-weight: 900; color: #1E5BB8; text-decoration: none; white-space: nowrap; }
.elder-demo-login {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 14px 4px 14px 4px;
  background: #FFF6D9; border: 2px solid #F2C230; font-size: 1.125rem;
}
.elder-demo-login strong { font-size: 1.25rem; color: #1F2A3D; }
.elder-demo-login b { color: #17468F; font-size: 1.25rem; letter-spacing: 0.04em; }
.elder-demo-login small { color: #4F5B70; font-size: 1rem !important; }
.elder-demo-login .elder-btn { background: #1E5BB8 !important; }

.elder-manual-btn { gap: 6px; }
@media (max-width: 1100px) { .elder-manual-btn span { display: none; } }
@media (min-width: 761px) {
  .elder-side-manual {
    display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; margin-top: 8px;
    border: 2px solid #BED3F0; border-radius: 12px 4px 12px 4px; background: #FFFFFF; color: #1E5BB8; font-weight: 900; text-decoration: none;
  }
  .elder-side-manual:hover { background: #E8F0FB; }
}

.man-hero { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px; margin: 0 0 18px; padding: 20px 22px; border-radius: 22px 6px 22px 6px; background: linear-gradient(120deg, #FFFFFF, #EEF4FD 60%, #FFF6D9); border: 2px solid #BED3F0; }
.man-hero img { width: 120px; height: auto; flex: none; }
.man-hero > div { flex: 1 1 320px; }
.man-hero p { margin: 4px 0 12px; font-size: 1.1875rem; line-height: 1.7; }
.man-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.man-actions .elder-btn { background: #1E5BB8 !important; }
.man-note { color: #8A5300; font-weight: 700; }
.man-toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 8px; margin: 0 0 22px; }
.man-toc a { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; border: 2px solid #D9E3F2; border-radius: 12px 4px 12px 4px; background: #FFFFFF; color: #1F2A3D; font-weight: 700; text-decoration: none; }
.man-toc a:hover { border-color: #1E5BB8; color: #17468F; }
.man-toc svg { color: #1E5BB8; flex: none; }
.man-no { display: inline-flex; width: 30px; height: 30px; flex: none; align-items: center; justify-content: center; border-radius: 50%; background: #E8F0FB; color: #17468F; font-weight: 900; font-size: 1rem; }
.man-chapter { margin: 0 0 18px; padding: 22px; border-radius: 14px 4px 14px 4px; background: #FFFFFF; border: 2px solid #D9E3F2; scroll-margin-top: 90px; }
.man-chapter:target { border-color: #1E5BB8; box-shadow: 0 0 0 4px #E8F0FB; }
.man-chapter h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 1.5rem; font-weight: 900; }
.man-chapter h2 .man-no { width: 36px; height: 36px; background: #1E5BB8; color: #FFFFFF; font-size: 1.125rem; }
.man-summary { margin: 0 0 14px; font-size: 1.125rem; color: #4F5B70; }
.man-steps { margin: 0; padding: 0; list-style: none; counter-reset: man; display: flex; flex-direction: column; gap: 12px; }
.man-steps li { position: relative; padding: 2px 0 2px 54px; counter-increment: man; display: flex; flex-direction: column; gap: 2px; min-height: 40px; }
.man-steps li::before {
  content: counter(man); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 14px 4px 14px 4px;
  background: #E8F0FB; color: #17468F; font-weight: 900; font-size: 1.125rem; display: flex; align-items: center; justify-content: center;
}
.man-steps b { font-size: 1.1875rem; }
.man-steps span { font-size: 1.125rem; line-height: 1.7; color: #1F2A3D; }
.man-tip { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 12px 4px 12px 4px; background: #E7F5F0; color: #174F45; }
.man-tip p { margin: 0 0 4px; font-size: 1.0625rem; }
@media print {
  .elder-manual-page .man-toc, .elder-manual-page .man-actions, .elder-demo-bar { display: none !important; }
  .elder-manual-page .man-chapter { break-inside: avoid; border: 1px solid #999; }
  .elder-manual-page .man-hero { border: none; background: none; }
}
/* 搜尋按鈕是藍色（不是儲存的綠色）：選擇器權重要高過「表單送出鈕＝綠色」的規則 */
form.pro-search button[type="submit"].pro-search-btn, form.of-filter button[type="submit"].elder-btn { background: #1E5BB8 !important; }
form.pro-search button[type="submit"].pro-search-btn:hover, form.of-filter button[type="submit"].elder-btn:hover { background: #17468F !important; }

/* =====================================================================
 * 調整順序模式、新增產品先選類別
 * ===================================================================== */
.pro-group-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; }
.pro-group-bar .pro-group-title { margin: 0; }
.pro-reorder-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px;
  border: 2px solid #D9E3F2 !important; border-radius: 12px 4px 12px 4px !important; background: #FFFFFF !important;
  color: #1E5BB8 !important; font-size: 1.0625rem; font-weight: 900; text-decoration: none; cursor: pointer;
}
.pro-reorder-btn:hover { border-color: #1E5BB8 !important; background: #E8F0FB !important; }

.elder-reorder-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; padding: 12px 14px;
  border-radius: 14px 4px 14px 4px; background: #FFF6D9; border: 2px solid #F2C230;
}
.elder-reorder-hint { flex: 1 1 100%; font-size: 1.0625rem; font-weight: 700; color: #1F2A3D; }
.elder-reorder-quick { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 1rem; color: #4F5B70; }
.elder-reorder-quick button {
  min-height: 40px !important; padding: 0 12px !important; border: 2px solid #D9E3F2 !important; border-radius: 20px !important;
  background: #FFFFFF !important; color: #1F2A3D !important; font-size: 1rem !important; font-weight: 700; cursor: pointer;
}
.elder-reorder-actions { margin-left: auto; display: inline-flex; gap: 8px; }
.elder-reorder-save { background: #2A7F6B !important; }

.elder-move { display: none; }
.is-reordering .pro-head { display: none !important; }
.is-reordering .pro-reorder-btn { display: none; }
.is-reordering .pro-row {
  display: flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: 12px; cursor: grab;
  margin: 0 !important; padding: 8px 12px !important; border-top: 1px solid #E7EDF7;
}
.is-reordering .pro-row > :not(.elder-move):not(.pro-c-thumb):not(.pro-c-main) { display: none !important; }
.is-reordering .pro-row .pro-c-main { flex: 1 1 auto; }
.is-reordering .pro-row .pro-c-main input { pointer-events: none; background: #F7F9FD; border-color: #D9E3F2; }
.is-reordering .pro-row .pro-meta { display: none; }
.is-reordering .elder-move { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.elder-move-handle { color: #7D8BA3; font-size: 1.25rem; letter-spacing: -3px; padding: 0 4px; }
.elder-move-no { min-width: 2em; text-align: center; font-size: 1.125rem; font-weight: 900; color: #17468F; font-variant-numeric: tabular-nums; }
.elder-move button {
  width: 44px; height: 44px; padding: 0 !important; border: 2px solid #D9E3F2 !important; border-radius: 12px 4px 12px 4px !important;
  background: #FFFFFF !important; color: #1E5BB8 !important; font-size: 1.25rem; font-weight: 900; cursor: pointer;
}
.elder-move button:hover { border-color: #1E5BB8 !important; background: #E8F0FB !important; }
.is-reordering .pro-row.is-dragging { opacity: 0.45; }
.is-reordering .pro-row.is-moved { background: #FFF6D9 !important; transition: background 0.6s; }
@media (max-width: 760px) {
  .is-reordering .pro-row { flex-wrap: wrap !important; }
  .is-reordering .pro-row .pro-c-thumb { display: none !important; }
  .elder-reorder-actions { margin-left: 0; width: 100%; }
  .elder-reorder-actions button { flex: 1 1 0; }
}

.elder-pick-cat { margin: 0 0 16px; padding: 22px; border-radius: 14px 4px 14px 4px; background: #FFFFFF; border: 2px solid #BED3F0; }
.elder-pick-cat h2 { margin: 0 0 4px; font-size: 1.5rem; font-weight: 900; }
.elder-pick-cat p { margin: 0 0 14px; color: #4F5B70; font-size: 1.125rem; }
.elder-pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 10px; }
.elder-pick-list a {
  display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 0 14px; text-align: center;
  border: 2px solid #D9E3F2; border-radius: 14px 4px 14px 4px; background: #F7F9FD; color: #1F2A3D; font-size: 1.1875rem; font-weight: 900; text-decoration: none;
}
.elder-pick-list a:hover { border-color: #1E5BB8; background: #E8F0FB; color: #17468F; }
.elder-step-text small { white-space: nowrap; }

/* =====================================================================
 * 第二十二階段：訂單明細頁整理、單選大按鈕、留言搜尋、技術支援
 * ===================================================================== */
form.cm-search button[type="submit"].pro-search-btn { background: #1E5BB8 !important; }
form.cm-search button[type="submit"].pro-search-btn:hover { background: #17468F !important; }
.cm-search select { min-height: 50px; }

/* 單選按鈕：整個選項都可以點，選到的用藍底標示 */
.elder-choice {
  display: inline-flex; align-items: center; gap: 6px; min-height: 46px; margin: 3px 6px 3px 0; padding: 0 14px 0 10px;
  border: 2px solid #D9E3F2; border-radius: 12px 4px 12px 4px; background: #FFFFFF; cursor: pointer; font-weight: 700; white-space: nowrap;
}
.elder-choice:hover { border-color: #1E5BB8; }
.elder-choice input[type="radio"] { width: 22px; height: 22px; margin: 0; accent-color: #1E5BB8; }
.elder-choice:has(input:checked) { border-color: #1E5BB8; background: #E8F0FB; color: #17468F; }

/* 技術支援（左側選單） */
@media (min-width: 761px) {
  .elder-side-support {
    display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 12px 4px 12px 4px;
    background: #F1FAF6; border: 2px solid #B5DCCB; color: #174F45; font-size: 0.9375rem; text-decoration: none; line-height: 1.4;
  }
  .elder-side-support b { color: #06A050; }
  .elder-side-support:hover { border-color: #06C755; }
}
.elder-side-support { display: none; }
@media (min-width: 761px) { .elder-side-support { display: flex; } }
.elder-line-dot { flex: none; padding: 2px 6px; border-radius: 6px; background: #06C755; color: #FFFFFF; font-size: 0.75rem; font-weight: 900; letter-spacing: 0.02em; }
.man-support { border-color: #06C755 !important; color: #06803A !important; }

/* ---- 訂單明細頁（order_inner.php） ---- */
.oi-page .sidebar { display: none !important; }
.oi-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin: 0 0 18px; padding: 18px 20px;
  border-radius: 14px 4px 14px 4px; background: #FFFFFF; border: 2px solid #D9E3F2;
}
.oi-sum-main { flex: 1 1 260px; display: flex; flex-direction: column; min-width: 0; }
.oi-sum-label { font-size: 0.9375rem; font-weight: 700; color: #6B7890; }
.oi-sum-id { font-size: 1.5rem; font-weight: 900; color: #1F2A3D; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.oi-sum-sub { font-size: 1rem; color: #4F5B70; }
.oi-sum-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.oi-sum-item strong { font-size: 1.5rem; font-weight: 900; color: #17468F; font-variant-numeric: tabular-nums; }
.oi-sum-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.oi-sum-actions .elder-btn { background: #1E5BB8 !important; }
.oi-page .grid_10 { margin-bottom: 18px !important; }
.oi-page blockquote.box_black { display: none; }

/* 區塊標題：原本紅、綠、黃、藍的大色塊，統一成清楚的標題文字 */
.oi-page h6.box_red, .oi-page h6.box_green, .oi-page h6.box_yellow, .oi-page h6.box_blue, .oi-page h6.box_blue2 {
  display: flex !important; align-items: center; gap: 8px; margin: 0 0 8px !important; padding: 0 !important;
  background: none !important; color: #1F2A3D !important; font-size: 1.25rem !important; font-weight: 900; border-radius: 0 !important;
}
.oi-page h6.box_red::before, .oi-page h6.box_green::before, .oi-page h6.box_yellow::before, .oi-page h6.box_blue::before, .oi-page h6.box_blue2::before {
  content: ""; width: 6px; height: 22px; border-radius: 3px; background: #1E5BB8;
}
/* 表格裡的紅色小標（例如發票「另外寄送」）改成標籤 */
.oi-page td h6.box_red { display: inline-flex !important; padding: 2px 12px !important; border-radius: 10px 3px 10px 3px !important; background: #FFF1D6 !important; color: #8A5300 !important; font-size: 1.0625rem !important; }
.oi-page td h6.box_red::before { display: none; }

/* 商品明細：數量欄位與「修改」並排、金額靠右不斜體 */
.oi-page form#form3, .oi-page form[name="form3"] { display: flex; align-items: center; gap: 6px; margin: 0; }
.oi-page form[name="form3"] span { display: flex; align-items: center; gap: 6px; }
.oi-page form[name="form3"] input[type="text"] { width: 5rem !important; min-width: 0; text-align: center; }
.oi-page form[name="form3"] input[type="submit"] { min-height: 44px !important; padding: 0 12px !important; font-size: 1rem !important; }
.oi-page table.table-edit em { font-style: normal; font-variant-numeric: tabular-nums; }
.oi-page table.table-edit td { padding-top: 8px !important; padding-bottom: 8px !important; }
/* 小計／運費／總金額：白底、右對齊，總金額加大 */
.oi-page table.table-edit tr > th[colspan], .oi-page table.table-edit tr:not(:first-child) > th { background: #FFFFFF !important; }
.oi-page table.table-edit tr:last-child > th { font-size: 1.25rem; font-weight: 900; color: #17468F; border-top: 2px solid #D9E3F2; }
.oi-page #oi-status { scroll-margin-top: 90px; }
@media (max-width: 760px) {
  .oi-sum-actions { margin-left: 0; width: 100%; }
  .oi-sum-actions a { flex: 1 1 0; justify-content: center; }
}

/* 會員管理 */
.mb-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 640px; }
.mb-c-acc, .mb-c-tel, .mb-c-addr { min-width: 0; overflow-wrap: anywhere; }
.mb-c-tel a { font-variant-numeric: tabular-nums; }
.mb-tag-block { background: #FBEAEC !important; color: #A3141F !important; }
.mb-export { margin-left: 4px; }
.mb-group .pro-row > .mb-c-acc, .mb-group .pro-row > .mb-c-tel, .mb-group .pro-row > .mb-c-addr { min-height: 0; }
.mb-group .pro-row { align-items: center !important; }
@media (max-width: 760px) {
  .mb-c-acc, .mb-c-addr { flex: 1 1 100%; }
  .mb-c-tel { flex: 1 1 45%; }
  .mb-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.pro-group.is-stacked .mb-c-acc, .pro-group.is-stacked .mb-c-addr { flex: 1 1 100%; }

/* 教學手冊：還沒開通的功能 */
.man-locked { margin: 0 0 18px; padding: 22px; border-radius: 14px 4px 14px 4px; background: #F7F9FD; border: 2px dashed #BFCFE6; }
.man-locked h2 { margin: 0 0 4px; font-size: 1.375rem; font-weight: 900; color: #4F5B70; }
.man-locked p { margin: 0 0 14px; color: #4F5B70; font-size: 1.0625rem; }
.man-locked-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 10px; margin: 0 0 14px; }
.man-locked-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px 4px 12px 4px; background: #FFFFFF; border: 2px solid #E2EAF6; color: #6B7890; scroll-margin-top: 90px; }
.man-locked-item svg { flex: none; color: #7D8BA3; }
.man-locked-item b { display: block; color: #4F5B70; font-size: 1.125rem; }
.man-locked-item span { font-size: 1rem; }
@media print { .man-locked { display: none !important; } }

/* =====================================================================
 * 第二十九階段：左側選單自動收合（小螢幕更好操作）
 * ===================================================================== */
.elder-nav-toggle, .elder-nav-backdrop { display: none; }
@media (min-width: 761px) {
  .elder-nav-toggle {
    display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 48px; padding: 0 12px; margin-right: 6px;
    border: 2px solid #D9E3F2 !important; border-radius: 12px 4px 12px 4px !important; background: #FFFFFF !important;
    color: #1E5BB8 !important; font-size: 1rem; font-weight: 900; cursor: pointer;
  }
  .elder-nav-toggle:hover { border-color: #1E5BB8 !important; background: #E8F0FB !important; }
  .elder-sidenav { transition: width 0.2s ease; }
  body { transition: padding-left 0.2s ease; }

  /* ---- 收合：只剩圖示（76px 寬） ---- */
  html.elder-rail body { padding-left: 76px; }
  html.elder-rail .elder-sidenav { width: 76px; padding: 12px 10px; overflow-x: hidden; }
  html.elder-rail .elder-side-brand { justify-content: center; padding: 4px 0 12px; }
  html.elder-rail .elder-side-brand span,
  html.elder-rail .elder-side-list a span,
  html.elder-rail .elder-side-admin,
  html.elder-rail .elder-side-help,
  html.elder-rail .elder-side-support { display: none !important; }
  html.elder-rail .elder-side-list a { position: relative; justify-content: center; padding: 0; min-height: 52px; }
  html.elder-rail .elder-side-badge {
    position: absolute; top: 2px; right: 2px; min-width: 20px; height: 20px; padding: 0 5px; font-size: 0.75rem;
  }
  html.elder-rail .elder-side-manual { margin-top: auto; font-size: 0; gap: 0; padding: 0; min-height: 48px; }
  html.elder-rail .elder-side-manual svg { width: 24px; height: 24px; }
  html.elder-rail .elder-side-divider { margin: 6px 2px; }
  /* 收合時滑鼠移到圖示上，旁邊顯示功能名稱 */
  html.elder-rail:not(.elder-nav-open) .elder-side-list a:hover::after {
    content: attr(data-label); position: fixed; left: 80px; margin-top: 0; z-index: 70;
    padding: 6px 12px; border-radius: 10px 3px 10px 3px; background: #1F2A3D; color: #FFFFFF;
    font-size: 1rem; font-weight: 700; white-space: nowrap; pointer-events: none;
  }

  /* ---- 中等螢幕暫時展開：蓋在內容上面，不推擠畫面 ---- */
  html.elder-rail.elder-nav-open .elder-sidenav { width: 264px; padding: 16px 14px; box-shadow: 8px 0 30px rgba(31, 42, 61, 0.18); z-index: 80; }
  html.elder-rail.elder-nav-open .elder-side-brand { justify-content: flex-start; padding: 4px 6px 14px; }
  html.elder-rail.elder-nav-open .elder-side-brand span { display: flex !important; }
  html.elder-rail.elder-nav-open .elder-side-list a { justify-content: flex-start; padding: 0 14px; }
  html.elder-rail.elder-nav-open .elder-side-list a span { display: inline !important; }
  html.elder-rail.elder-nav-open .elder-side-badge { position: static; min-width: 26px; height: 26px; padding: 0 8px; font-size: 0.9375rem; }
  html.elder-rail.elder-nav-open .elder-side-admin { display: flex !important; }
  html.elder-rail.elder-nav-open .elder-side-manual { font-size: 1rem; gap: 6px; }
  html.elder-rail.elder-nav-open .elder-nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 75; background: rgba(12, 26, 54, 0.35);
  }
}
@media (min-width: 761px) and (max-width: 1100px) { .elder-nav-toggle-text { display: none; } }
@media (prefers-reduced-motion: reduce) { .elder-sidenav, body { transition: none !important; } }

/* ---- 舊版的頁面側欄（所有頁面）：1600px 以下移到內容上方，可收起 ---- */
.elder-fold-btn { display: none; }
@media (min-width: 761px) and (max-width: 1599px) {
  .middle .container_24 { flex-direction: column; align-items: stretch; }
  .middle .container_24 > .sidebar.elder-has-content { flex: none; width: auto; order: -1; }
  .middle .sidebar.elder-has-content { margin: 0 0 4px; padding: 0 !important; background: none !important; border: none !important; box-shadow: none !important; }
  .middle .sidebar.elder-has-content > :not(.elder-fold-btn) { display: none; }
  .middle .sidebar.elder-has-content.is-open > :not(.elder-fold-btn):not(#logo):not(.search_box) { display: block; }
  .elder-fold-btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px;
    border: 2px solid #D9E3F2 !important; border-radius: 12px 4px 12px 4px !important; background: #FFFFFF !important;
    color: #1E5BB8 !important; font-size: 1.0625rem; font-weight: 900; cursor: pointer;
  }
  .elder-fold-btn b { transition: transform 0.2s; }
  .sidebar.is-open .elder-fold-btn b { transform: rotate(180deg); }
  .sidebar.is-open .box, .sidebar.is-open .box_menu {
    margin-top: 10px; padding: 14px 16px; border-radius: 14px 4px 14px 4px; background: #FFFFFF; border: 2px solid #D9E3F2;
  }
  .sidebar.is-open h3 { display: none; }
  .sidebar.is-open ul { display: flex !important; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .sidebar.is-open ul ul { display: contents !important; }
  .sidebar.is-open li { list-style: none; display: contents; }
  .sidebar.is-open li a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 2px solid #E2EAF6;
    border-radius: 12px 4px 12px 4px; background: #F7F9FD; color: #1F2A3D; font-weight: 700; text-decoration: none;
  }
  .sidebar.is-open li a:hover { border-color: #1E5BB8; color: #17468F; }
}

/* 廣告列表不使用 ad- 開頭的名稱：瀏覽器的廣告阻擋外掛會把 ad- 開頭的區塊整個隱藏 */

/* =====================================================================
 * 第三十五階段：頁面列表排版（中等寬度改兩行，不再變成大卡片）
 *   第一行：頁面標題｜排序｜更新日期
 *   第二行：主選單｜儲存・編輯・刪除
 * ===================================================================== */
@media (min-width: 761px) {
  .pages-group.is-compact .pro-head,
  .pages-group.is-compact .pro-row { grid-template-columns: minmax(12rem, 1fr) 6rem 8rem !important; row-gap: 8px; }
  .pages-group.is-compact .pro-head .pro-c-nav,
  .pages-group.is-compact .pro-head .pro-c-mail,
  .pages-group.is-compact .pro-head .pro-c-act { display: none; }
  .pages-group.is-compact .pro-head .pro-c-main { grid-column: 1; }
  .pages-group.is-compact .pro-row > .pro-c-main { grid-column: 1; grid-row: 1; }
  .pages-group.is-compact .pro-row > .pro-c-rank { grid-column: 2; grid-row: 1; }
  .pages-group.is-compact .pro-row > .pro-c-time { grid-column: 3; grid-row: 1; }
  .pages-group.is-compact .pro-row > .pro-c-nav  { grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: 8px; }
  .pages-group.is-compact .pro-row > .pro-c-mail { grid-column: 1 / -1; grid-row: 3; }
  .pages-group.is-compact .pro-row > .pro-c-act  { grid-column: 2 / -1; grid-row: 2; justify-content: flex-end !important; flex-wrap: nowrap; }
  .pages-group.is-compact .pro-row > .pro-c-nav .pro-label { position: static; width: auto; height: auto; clip: auto; flex: none; font-size: 0.9375rem; font-weight: 700; color: #6B7890; }
  .pages-group.is-compact .pro-row > .pro-c-nav select { flex: 1 1 auto; min-width: 0; }
  .pages-group.is-compact .pro-c-act .elder-icon-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pages-group.is-compact .pro-c-act .elder-icon-btn { width: 46px !important; padding: 0 !important; flex: none; }
}

/* 卡片模式（很窄時）：各欄位合理排列，按鈕不再被擠壓 */
.pro-group.is-stacked .pro-row { row-gap: 10px; }
.pro-group.is-stacked .pro-label { font-size: 0.9375rem !important; margin-bottom: 2px !important; }
.pro-group.is-stacked .pro-c-act { flex-wrap: wrap !important; justify-content: flex-start !important; gap: 8px; }
.pro-group.is-stacked .pro-c-act .pro-save { flex: 1 1 10rem !important; }
.pro-group.is-stacked .pro-c-act .elder-icon-btn { flex: 0 0 auto !important; width: auto !important; min-width: 0 !important; padding: 0 14px !important; }
.pro-group.is-stacked .pro-c-act .elder-icon-btn span { position: static !important; width: auto !important; height: auto !important; clip: auto !important; }
.pro-group.is-stacked .pro-c-nav { flex: 1 1 14rem !important; }
.pro-group.is-stacked .pro-c-rank { flex: 0 0 7rem !important; }
.pro-group.is-stacked .pro-c-time { flex: 1 1 8rem !important; display: flex; flex-direction: column; justify-content: center; min-height: 46px; }
.pro-group.is-stacked .pro-c-main { flex: 1 1 100% !important; }
select.pg-nav-missing { border-color: #E2A64A !important; background: #FFF8EC !important; color: #8A5300; font-weight: 700; }
/* 手機與卡片模式：頁面標題放最上面，主選單放下面 */
@media (max-width: 760px) { .pages-group .pro-row > .pro-c-main { order: -1; } }
.pages-group.is-stacked .pro-row > .pro-c-main { order: -1; }
