/* fhc_links 教學好站連結 — 前台樣式
 * 所有樣式都包在 .fhcl 之下並使用 fhcl- 前綴，避免與 XOOPS 佈景（Bootstrap 等）衝突。
 */
.fhcl {
  --fhcl-brand: #B4267A;
  --fhcl-brand-2: #ff91ce;
  --fhcl-brand-weak: #FFF2F8;
  --fhcl-bg: #f7f9fc;
  --fhcl-card: #fff;
  --fhcl-text: #111827;
  --fhcl-muted: #6b7280;
  --fhcl-line: #e5e7eb;
  --fhcl-ok: #059669;
  --fhcl-err: #dc2626;
  --fhcl-warn: #b45309;
  --fhcl-radius: 12px;
  color: var(--fhcl-text);
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  box-sizing: border-box;
}
.fhcl *, .fhcl *::before, .fhcl *::after { box-sizing: border-box; }
.fhcl a { color: inherit; }
.fhcl-wrap-page { max-width: 1180px; margin: 0 auto; padding: 8px 0 40px; }

/* ---------- 頁首 ---------- */
.fhcl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.fhcl-h1, .fhcl-head h1 { font-size: 28px; line-height: 1.3; margin: 0 0 6px; color: var(--fhcl-brand); font-weight: 800; }
.fhcl-sub { color: var(--fhcl-muted); font-size: 15px; max-width: 720px; }
.fhcl-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fhcl-codeform { display: flex; gap: 0; }
.fhcl-codeform input { width: 120px; padding: 7px 10px; border: 1px solid var(--fhcl-line); border-right: 0; border-radius: 8px 0 0 8px; font-size: 15px; text-transform: uppercase; letter-spacing: 1px; background: #fff; color: var(--fhcl-text); }
.fhcl-codeform .fhcl-btn { border-radius: 0 8px 8px 0; }

/* ---------- 按鈕 ---------- */
.fhcl-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid var(--fhcl-line); background: #fff; color: var(--fhcl-text) !important; border-radius: 8px;
  padding: 7px 14px; font-size: 15px; line-height: 1.4; cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.fhcl-btn:hover { background: #f9fafb; border-color: #d1d5db; }
.fhcl-btn.dark { background: var(--fhcl-brand); border-color: var(--fhcl-brand); color: #fff !important; }
.fhcl-btn.dark:hover { filter: brightness(.92); }
.fhcl-btn.danger { background: #fff1f2; border-color: #fecdd3; color: #9f1239 !important; }
.fhcl-btn.ghost { background: transparent; }
.fhcl-btn.small { padding: 4px 10px; font-size: 13px; }
.fhcl-btn.big { padding: 10px 22px; font-size: 16px; font-weight: 700; }
.fhcl-btn.block { display: flex; width: 100%; margin-bottom: 8px; justify-content: flex-start; white-space: normal; text-align: left; }
.fhcl-btn:disabled { opacity: .5; cursor: not-allowed; }
.fhcl-btn:focus-visible, .fhcl-icon:focus-visible, .fhcl-go:focus-visible, .fhcl-tab:focus-visible, .fhcl-chip:focus-visible { outline: 3px solid var(--fhcl-brand-2); outline-offset: 2px; }

.fhcl-icon { appearance: none; border: 1px solid var(--fhcl-line); background: #fff; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 16px; line-height: 1; color: var(--fhcl-muted); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.fhcl-icon:hover { background: var(--fhcl-brand-weak); color: var(--fhcl-brand); border-color: var(--fhcl-brand-2); }
.fhcl-icon.on { color: #e11d48; border-color: #fecdd3; background: #fff1f2; }
.fhcl-icon.danger:hover { color: var(--fhcl-err); background: #fff1f2; }
.fhcl-icon:disabled { opacity: .35; cursor: default; }
.fhcl-go { display: inline-block; background: var(--fhcl-brand); color: #fff !important; text-decoration: none !important; padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.fhcl-go:hover { filter: brightness(.92); }

/* ---------- 工具列 ---------- */
.fhcl-toolbar {
  display: grid; gap: 10px; grid-template-columns: minmax(160px, 2fr) repeat(3, minmax(110px, 1fr)) minmax(88px, .7fr); align-items: center;
  background: var(--fhcl-card); padding: 14px; border: 1px solid var(--fhcl-line); border-radius: 16px;
  position: sticky; top: 8px; z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.fhcl-input, .fhcl-toolbar input, .fhcl-toolbar select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--fhcl-line); border-radius: 8px; background: #fff; color: var(--fhcl-text);
  font-size: 15px; font-family: inherit; outline: none; height: auto; margin: 0; box-shadow: none;
}
.fhcl-input.inline { width: auto; display: inline-block; }
.fhcl-input:focus, .fhcl-toolbar input:focus, .fhcl-toolbar select:focus { border-color: var(--fhcl-brand-2); box-shadow: 0 0 0 3px var(--fhcl-brand-weak); }
.fhcl-toggles { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 4px; }
.fhcl-chip { appearance: none; border: 1px solid var(--fhcl-line); background: #fff; color: var(--fhcl-text); border-radius: 999px; padding: 5px 12px; font-size: 14px; cursor: pointer; }
.fhcl-chip.on { background: var(--fhcl-brand-weak); border-color: var(--fhcl-brand-2); color: var(--fhcl-brand); font-weight: 700; }
.fhcl-spacer { flex: 1 1 auto; }
.fhcl-count { color: var(--fhcl-muted); font-size: 14px; }
.fhcl-viewsw { display: inline-flex; border: 1px solid var(--fhcl-line); border-radius: 8px; overflow: hidden; }
.fhcl-viewsw button { appearance: none; border: 0; background: #fff; padding: 4px 10px; cursor: pointer; font-size: 16px; color: var(--fhcl-muted); }
.fhcl-viewsw button.on { background: var(--fhcl-brand-weak); color: var(--fhcl-brand); }

.fhcl-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.fhcl-tab { appearance: none; padding: 7px 14px; border: 1px solid var(--fhcl-line); border-radius: 999px; background: #fff; color: var(--fhcl-text); cursor: pointer; font-size: 15px; }
.fhcl-tab small { color: var(--fhcl-muted); font-size: 12px; margin-left: 2px; }
.fhcl-tab:hover { background: #f9fafb; }
.fhcl-tab.active { background: var(--fhcl-brand-weak); border-color: var(--fhcl-brand-2); color: var(--fhcl-brand); font-weight: 700; }
.fhcl-tab.zero { opacity: .45; }

/* ---------- 卡片 ---------- */
.fhcl-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.fhcl-card { position: relative; background: var(--fhcl-card); border: 1px solid var(--fhcl-line); border-radius: var(--fhcl-radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s, border-color .15s; }
.fhcl-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); border-color: #d1d5db; }
.fhcl-card.is-disabled { opacity: .7; filter: grayscale(60%); }
.fhcl-card.in-basket { border-color: var(--fhcl-brand-2); box-shadow: 0 0 0 2px var(--fhcl-brand-weak); }
.fhcl-thumb { display: flex; height: 150px; background: #eef2f7; align-items: center; justify-content: center; overflow: hidden; }
.fhcl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fhcl-thumb img.fhcl-img-contain, .fhcl-stepthumb img.fhcl-img-contain { object-fit: contain; padding: 24px; }
.fhcl-pick { position: absolute; top: 10px; right: 10px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; background: rgba(17,24,39,.55); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.fhcl-pick.on { background: var(--fhcl-brand); }
.fhcl-content { padding: 14px 16px 14px; display: flex; flex-direction: column; flex: 1 1 auto; }
.fhcl-name { font-size: 17px; font-weight: 700; margin: 0 0 6px; line-height: 1.4; }
.fhcl-name a { text-decoration: none; color: var(--fhcl-text); }
.fhcl-name a:hover { color: var(--fhcl-brand); }
.fhcl-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.fhcl-badge { font-size: 12px; color: var(--fhcl-brand); background: var(--fhcl-brand-weak); padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.fhcl-badge.type { color: #1e40af; background: #eff6ff; }
.fhcl-badge.star { color: #92400e; background: #fef3c7; }
.fhcl-badge.err { color: #9f1239; background: #ffe4e6; }
.fhcl-badge.warn { color: #9a3412; background: #ffedd5; }
.fhcl-desc { color: var(--fhcl-muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fhcl-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.fhcl-stage { font-size: 12px; padding: 0 7px; border: 1px solid var(--fhcl-line); border-radius: 6px; color: #374151; background: #f9fafb; white-space: nowrap; }
.fhcl-stage.key { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.fhcl-stage.cost { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.fhcl-tag { font-size: 12px; color: #2563eb; cursor: pointer; }
.fhcl-tag:hover { text-decoration: underline; }
.fhcl-note { margin-top: 8px; font-size: 14px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 4px 10px; }
.fhcl-note summary { cursor: pointer; color: #166534; font-weight: 600; }
.fhcl-note div { padding: 4px 0 4px; color: #14532d; }
.fhcl-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; }
.fhcl-url { color: var(--fhcl-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fhcl-acts { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.fhcl-empty { color: var(--fhcl-muted); text-align: center; padding: 40px; border: 1px dashed var(--fhcl-line); border-radius: 12px; background: #fff; }
.fhcl-empty.small { padding: 20px; font-size: 14px; }
.fhcl-muted { color: var(--fhcl-muted); font-size: 13px; }

/* 清單檢視 */
.fhcl-grid.view-list { grid-template-columns: 1fr; gap: 8px; }
.fhcl-grid.view-list .fhcl-card { flex-direction: row; }
.fhcl-grid.view-list .fhcl-card:hover { transform: none; }
.fhcl-grid.view-list .fhcl-thumb { width: 140px; height: auto; min-height: 96px; flex-shrink: 0; }
.fhcl-grid.view-list .fhcl-content { padding: 10px 56px 10px 14px; }
.fhcl-grid.view-list .fhcl-desc { -webkit-line-clamp: 2; }
.fhcl-grid.nothumb .fhcl-content { padding-right: 52px; }

/* 挑選籃 */
.fhcl-basket { display: none; }
.fhcl-basket.show { display: flex; position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 9000; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: #111827; color: #fff; padding: 10px 14px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100vw - 24px); }
.fhcl-basket .fhcl-btn { padding: 5px 12px; font-size: 14px; }
.fhcl-basket .fhcl-btn.ghost { color: #fff !important; border-color: #4b5563; }

/* ---------- Modal / 選單 / 提示 ---------- */
.fhcl-noscroll { overflow: hidden; }
.fhcl-modal-overlay { position: fixed; inset: 0; background: rgba(17,24,39,.6); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .15s; }
.fhcl-modal-overlay.show { opacity: 1; }
.fhcl-modal { position: relative; background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; padding: 22px; box-shadow: 0 20px 40px rgba(0,0,0,.2); }
.fhcl-modal-overlay.big .fhcl-modal { max-width: 760px; }
.fhcl-modal:fullscreen { max-width: none; max-height: none; border-radius: 0; display: flex; align-items: center; justify-content: center; }
.fhcl-modal-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--fhcl-muted); z-index: 2; }
.fhcl-h3 { font-size: 19px; margin: 0 0 10px; color: var(--fhcl-brand); }
.fhcl-qrbox { text-align: center; }
.fhcl-qrbig { width: min(62vh, 100%); max-width: 520px; margin: 0 auto; }
.fhcl-modal:fullscreen .fhcl-qrbig { width: min(75vh, 90vw); max-width: none; }
.fhcl-qrbig svg { width: 100%; height: auto; display: block; }
.fhcl-qrtitle { font-size: 24px; font-weight: 800; margin-top: 8px; }
.fhcl-qrsub { margin: 4px 0; }
.fhcl-qrurl { font-family: Consolas, monospace; font-size: 14px; color: #374151; word-break: break-all; margin: 6px 0; }
.fhcl-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.fhcl-row .fhcl-input { flex: 1 1 auto; }
.fhcl-wrap { flex-wrap: wrap; }
.fhcl-center { justify-content: center; }
.fhcl-right { justify-content: flex-end; }
.fhcl-radios { display: grid; gap: 6px; margin: 10px 0; }
.fhcl-radios label { cursor: pointer; }
.fhcl-menu { position: absolute; z-index: 10001; background: #fff; border: 1px solid var(--fhcl-line); border-radius: 10px; box-shadow: 0 10px 24px rgba(0,0,0,.12); padding: 6px; min-width: 210px; }
.fhcl-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--fhcl-text); }
.fhcl-menu button:hover { background: var(--fhcl-brand-weak); color: var(--fhcl-brand); }
.fhcl-toast { position: fixed; left: 50%; top: 20px; transform: translate(-50%, -30px); z-index: 10010; background: #111827; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 15px; opacity: 0; pointer-events: none; transition: all .2s; font-family: inherit; }
.fhcl-toast.show { opacity: 1; transform: translate(-50%, 0); }
.fhcl-toast.ok { background: #065f46; }
.fhcl-toast.err { background: #991b1b; }

/* ---------- 教學清單 ---------- */
.fhcl-sethead { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; background: #fff; border: 1px solid var(--fhcl-line); border-radius: 16px; padding: 20px; }
.fhcl-setinfo { flex: 1 1 360px; }
.fhcl-intro { margin: 6px 0 8px; font-size: 16px; }
.fhcl-codebox { text-align: center; border: 2px dashed var(--fhcl-brand-2); border-radius: 14px; padding: 10px 16px; background: var(--fhcl-brand-weak); cursor: pointer; }
.fhcl-codelabel { font-size: 13px; color: var(--fhcl-muted); }
.fhcl-code { font-family: Consolas, "Courier New", monospace; font-size: 30px; font-weight: 800; letter-spacing: 4px; color: var(--fhcl-brand); }
.fhcl-miniqr { width: 110px; margin: 4px auto 0; }
.fhcl-miniqr svg { width: 100%; height: auto; display: block; }
.fhcl-settools { margin: 14px 0; }
.fhcl-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fhcl-step { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--fhcl-line); border-radius: 14px; padding: 12px 14px; }
.fhcl-stepno { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--fhcl-brand); color: #fff; font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.fhcl-stepthumb { width: 110px; height: 70px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: #eef2f7; }
.fhcl-stepthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fhcl-stepbody { flex: 1 1 auto; min-width: 0; }
.fhcl-steptitle { font-weight: 700; font-size: 17px; }
.fhcl-steptask { background: #f0fdf4; border-left: 4px solid #22c55e; padding: 4px 10px; margin: 4px 0; border-radius: 4px; font-size: 15px; }
.fhcl-stepacts { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.fhcl-setlist { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 24px; }
.fhcl-setcard { background: #fff; border: 1px solid var(--fhcl-line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.fhcl-setcard h3 { margin: 0; font-size: 18px; }
.fhcl-setcard h3 a { text-decoration: none; color: var(--fhcl-text); }
.fhcl-setcard h3 a:hover { color: var(--fhcl-brand); }
.fhcl-setcard .fhcl-row { margin-top: auto; padding-top: 8px; }
.fhcl-pill { display: inline-block; font-family: Consolas, monospace; font-weight: 700; letter-spacing: 2px; color: var(--fhcl-brand); background: var(--fhcl-brand-weak); border-radius: 6px; padding: 0 8px; }
.fhcl-section-title { font-size: 20px; font-weight: 800; color: var(--fhcl-brand); margin: 18px 0 10px; }

/* 編輯器 */
.fhcl-ed { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.fhcl-ed-main, .fhcl-ed-lib { background: #fff; border: 1px solid var(--fhcl-line); border-radius: 16px; padding: 18px; }
.fhcl-ed-lib { position: sticky; top: 10px; }
.fhcl-ed-lib .fhcl-input { margin-bottom: 8px; }
.fhcl-ed-liblist { max-height: 62vh; overflow: auto; border-top: 1px solid var(--fhcl-line); }
.fhcl-ed-libitem { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
.fhcl-label { display: block; font-weight: 700; font-size: 14px; margin: 10px 0 4px; color: #374151; }
.fhcl-check { display: flex; gap: 6px; align-items: center; font-size: 14px; cursor: pointer; margin-top: 10px; }
.fhcl-ed-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--fhcl-line); border-radius: 12px; padding: 10px; margin-bottom: 8px; background: #fafafa; }
.fhcl-ed-no { width: 30px; height: 30px; border-radius: 50%; background: var(--fhcl-brand); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fhcl-ed-fields { flex: 1 1 auto; display: grid; gap: 6px; min-width: 0; }
.fhcl-ed-orig { font-size: 14px; font-weight: 600; }
.fhcl-ed-ops { display: flex; flex-direction: column; gap: 4px; }
.fhcl-ed-custom { margin-top: 14px; padding: 12px; border: 1px dashed var(--fhcl-line); border-radius: 12px; }
.fhcl-ed-save { margin-top: 18px; }

/* 推薦表單 */
.fhcl-form { background: #fff; border: 1px solid var(--fhcl-line); border-radius: 16px; padding: 20px; max-width: 860px; }
.fhcl-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.fhcl-form-grid .full { grid-column: 1 / -1; }
.fhcl-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.fhcl-checks label { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; cursor: pointer; }
.fhcl-msg { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; background: #fff; border: 1px solid var(--fhcl-line); border-left: 5px solid var(--fhcl-brand); }
.fhcl-msg.err { border-left-color: var(--fhcl-err); background: #fff7f7; }
.fhcl-msg.ok { border-left-color: var(--fhcl-ok); background: #f0fdf4; }

/* 輸入代碼頁 / 區塊 */
.fhcl-gobox { max-width: 460px; margin: 30px auto; text-align: center; background: #fff; border: 1px solid var(--fhcl-line); border-radius: 20px; padding: 30px 24px; }
.fhcl-gobox input { font-size: 34px; text-align: center; letter-spacing: 6px; text-transform: uppercase; font-family: Consolas, monospace; font-weight: 800; padding: 10px; }
.fhcl-block ul { list-style: none; margin: 0; padding: 0; }
.fhcl-block li { display: flex; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--fhcl-line); }
.fhcl-block li img { width: 18px; height: 18px; flex-shrink: 0; }
.fhcl-block li a { text-decoration: none; }
.fhcl-block li small { color: var(--fhcl-muted); margin-left: auto; }

@media (max-width: 960px) {
  .fhcl-toolbar { grid-template-columns: 1fr 1fr; position: static; }
  .fhcl-toolbar > :first-child { grid-column: 1 / -1; }
  .fhcl-ed { grid-template-columns: 1fr; }
  .fhcl-ed-lib { position: static; }
}
@media (max-width: 600px) {
  .fhcl-toolbar { grid-template-columns: 1fr; }
  .fhcl-h1, .fhcl-head h1 { font-size: 23px; }
  .fhcl-grid.view-list .fhcl-thumb { display: none; }
  .fhcl-form-grid { grid-template-columns: 1fr; }
  .fhcl-step { flex-wrap: wrap; }
  .fhcl-stepthumb { display: none; }
}
@media print {
  .fhcl-toolbar, .fhcl-toggles, .fhcl-tabs, .fhcl-actions, .fhcl-basket, .fhcl-pick, .fhcl-acts, .fhcl-settools { display: none !important; }
  .fhcl-card { break-inside: avoid; }
}

/* =====================================================================
 * 1.0.0 視覺化版面：搜尋列、分類磚、篩選標籤、圖示牆、清單、詳細資訊側欄
 * --c 為分類顏色（由資料提供，未設定時用色盤自動配色）
 * ===================================================================== */
.fhcl-searchbar { display: flex; gap: 8px; align-items: center; background: #fff; border: 2px solid var(--fhcl-line); border-radius: 16px; padding: 6px 8px 6px 14px; box-shadow: 0 4px 14px rgba(15,23,42,.05); position: sticky; top: 8px; z-index: 50; }
.fhcl-searchbar:focus-within { border-color: var(--fhcl-brand-2); }
.fhcl-search-ico { font-size: 18px; opacity: .6; }
.fhcl-searchbar input { flex: 1 1 auto; min-width: 0; border: 0; outline: none; font-size: 17px; padding: 8px 4px; background: transparent; color: var(--fhcl-text); box-shadow: none; height: auto; margin: 0; }
.fhcl-searchbar select { flex: 0 0 auto; width: auto; max-width: 140px; border: 1px solid var(--fhcl-line); border-radius: 10px; padding: 7px 8px; font-size: 14px; background: #f8fafc; color: var(--fhcl-text); height: auto; margin: 0; }

/* 分類磚 */
.fhcl-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 16px 0 12px; }
.fhcl-tile { --c: #64748b; appearance: none; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 104px; padding: 12px 8px 10px;
  border: 2px solid transparent; border-radius: 16px; cursor: pointer; text-align: center; color: var(--fhcl-text);
  background: color-mix(in srgb, var(--c) 10%, #fff); transition: transform .12s, box-shadow .12s, border-color .12s; }
.fhcl-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 25%, transparent); }
.fhcl-tile.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.fhcl-tile.zero { opacity: .4; }
.fhcl-tile-ico { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; background: var(--c); color: #fff; font-weight: 800; box-shadow: 0 3px 8px color-mix(in srgb, var(--c) 35%, transparent); }
.fhcl-tile-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.fhcl-tile-n { position: absolute; top: 6px; right: 8px; font-size: 12px; font-weight: 700; color: var(--c); }

/* 篩選標籤 */
.fhcl-filters { display: grid; gap: 6px; margin-bottom: 8px; }
.fhcl-frow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fhcl-flabel { font-size: 13px; font-weight: 700; color: var(--fhcl-muted); min-width: 92px; }
.fhcl-chip small { color: var(--fhcl-muted); font-size: 11px; }
.fhcl-chip.on small { color: inherit; }
.fhcl-chip.zero { opacity: .45; }
.fhcl-chip.clear { border-style: dashed; color: var(--fhcl-err); }
.fhcl-resultbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 0; }
.fhcl-viewsw button { display: inline-flex; gap: 4px; align-items: center; font-size: 14px; }
.fhcl-viewsw button span { font-size: 13px; }

/* 分類分區 */
.fhcl-sec { --c: #64748b; margin-bottom: 22px; }
.fhcl-sec-h { margin: 0 0 10px; font-size: 18px; border-bottom: 3px solid color-mix(in srgb, var(--c) 30%, transparent); }
.fhcl-sec-h button { appearance: none; border: 0; background: none; padding: 0 0 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 800; color: var(--fhcl-text); }
.fhcl-sec-h small { color: var(--c); font-size: 14px; }
.fhcl-sec-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--c); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }

/* 網站圖示（favicon 放在分類色的圓角方塊裡，載入失敗顯示第一個字） */
.fhcl-ico { --c: #64748b; flex-shrink: 0; width: 64px; height: 64px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  background: #fff; border: 2px solid color-mix(in srgb, var(--c) 35%, #fff); box-shadow: 0 4px 10px color-mix(in srgb, var(--c) 18%, transparent); }
.fhcl-ico img { width: 60%; height: 60%; object-fit: contain; display: block; }
.fhcl-ico .fhcl-letter, .fhcl-letter { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--c); color: #fff; font-size: 26px; font-weight: 800; }
.fhcl-ico[data-size=s] { width: 34px; height: 34px; border-radius: 10px; border-width: 1px; box-shadow: none; }
.fhcl-ico[data-size=s] .fhcl-letter { font-size: 15px; }

/* 圖示牆 */
.fhcl-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px 8px; }
.fhcl-app { position: relative; }
.fhcl-app-btn { appearance: none; width: 100%; border: 2px solid transparent; background: none; border-radius: 16px; padding: 10px 4px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--fhcl-text); transition: background .12s; }
.fhcl-app-btn:hover { background: #fff; box-shadow: 0 6px 18px rgba(15,23,42,.08); }
.fhcl-app-btn:hover .fhcl-ico { transform: scale(1.06); }
.fhcl-app-btn .fhcl-ico { transition: transform .12s; }
.fhcl-app-name { font-size: 13.5px; font-weight: 600; line-height: 1.35; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.fhcl-app-flags { font-size: 12px; min-height: 14px; letter-spacing: 1px; }
.fhcl-app.in-basket .fhcl-app-btn { border-color: var(--fhcl-brand-2); background: var(--fhcl-brand-weak); }
.fhcl-app.is-disabled { opacity: .5; filter: grayscale(70%); }
.fhcl-app-pick { position: absolute; top: 4px; right: 10px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: rgba(15,23,42,.45); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s; padding: 0; }
.fhcl-app:hover .fhcl-app-pick, .fhcl-app-pick:focus-visible, .fhcl-app-pick.on { opacity: 1; }
.fhcl-app-pick.on { background: var(--fhcl-brand); }
@media (hover: none) { .fhcl-app-pick { opacity: .85; } }

/* 卡片（加上分類色） */
.fhcl-card { border-top: 4px solid var(--c, var(--fhcl-line)); }
.fhcl-thumb { appearance: none; border: 0; padding: 0; width: 100%; cursor: pointer; }
.fhcl-name { display: flex; gap: 8px; align-items: center; }
.fhcl-name button { appearance: none; border: 0; background: none; padding: 0; font: inherit; font-weight: 700; text-align: left; cursor: pointer; color: var(--fhcl-text); }
.fhcl-name button:hover { color: var(--fhcl-brand); }
.fhcl-badge.cat { --c: #64748b; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }

/* 清單 */
.fhcl-rows { display: grid; gap: 6px; }
.fhcl-row-item { --c: #64748b; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--fhcl-line); border-left: 5px solid var(--c); border-radius: 12px; padding: 8px 10px; }
.fhcl-row-item.in-basket { background: var(--fhcl-brand-weak); }
.fhcl-row-item.is-disabled { opacity: .55; }
.fhcl-row-main { appearance: none; flex: 1 1 auto; min-width: 0; border: 0; background: none; text-align: left; cursor: pointer; padding: 0; font: inherit; color: var(--fhcl-text); }
.fhcl-row-main b { font-size: 15px; }
.fhcl-row-desc { display: block; color: var(--fhcl-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fhcl-row-stages { display: flex; gap: 3px; flex-wrap: wrap; max-width: 220px; }
.fhcl-pick.small { position: static; width: 26px; height: 26px; font-size: 14px; border-width: 1px; flex-shrink: 0; }

/* 詳細資訊側欄 */
.fhcl-drawer-wrap { position: fixed; inset: 0; z-index: 9500; pointer-events: none; }
.fhcl-drawer-wrap.show { pointer-events: auto; }
.fhcl-drawer-bg { position: absolute; inset: 0; background: rgba(15,23,42,.35); opacity: 0; transition: opacity .2s; }
.fhcl-drawer-wrap.show .fhcl-drawer-bg { opacity: 1; }
.fhcl-drawer { --c: #64748b; position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: #fff; box-shadow: -10px 0 30px rgba(15,23,42,.15); overflow-y: auto; transform: translateX(100%); transition: transform .22s ease-out; border-top: 6px solid var(--c); }
.fhcl-drawer-wrap.show .fhcl-drawer { transform: none; }
.fhcl-drawer-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #fff; border-bottom: 1px solid var(--fhcl-line); font-size: 13px; color: var(--fhcl-muted); }
.fhcl-drawer-top button { appearance: none; padding: 0; line-height: 1; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--fhcl-line); background: #fff; border-radius: 8px; width: 34px; height: 32px; font-size: 18px; cursor: pointer; color: var(--fhcl-text); }
.fhcl-drawer-top button:disabled { opacity: .3; cursor: default; }
.fhcl-drawer-top .x { margin-left: auto; }
.fhcl-drawer-shot { display: block; height: 210px; background: color-mix(in srgb, var(--c) 10%, #f1f5f9); overflow: hidden; }
.fhcl-drawer-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fhcl-drawer-shot img.fhcl-img-contain { object-fit: contain; padding: 40px; }
.fhcl-drawer-body { padding: 16px 18px 24px; display: grid; gap: 12px; }
.fhcl-drawer-title { display: flex; gap: 12px; align-items: center; }
.fhcl-drawer-title h3 { margin: 0; font-size: 21px; line-height: 1.35; color: var(--fhcl-text); }
.fhcl-drawer-desc { margin: 0; color: #374151; font-size: 15px; }
.fhcl-note.open { padding: 8px 12px; }
.fhcl-note.open b { color: #166534; }
.fhcl-go.big { display: block; text-align: center; font-size: 17px; padding: 12px; border-radius: 12px; }
.fhcl-drawer-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.fhcl-drawer-acts .fhcl-btn { font-size: 14px; padding: 6px 10px; }
.fhcl-drawer-acts .fhcl-btn.on { border-color: var(--fhcl-brand-2); background: var(--fhcl-brand-weak); color: var(--fhcl-brand) !important; }
.fhcl-drawer-qr { display: flex; gap: 12px; align-items: center; background: #f8fafc; border-radius: 12px; padding: 10px; font-size: 14px; }
.fhcl-drawer-qr svg { width: 104px; height: 104px; flex-shrink: 0; display: block; }

@media (max-width: 600px) {
  .fhcl-searchbar { flex-wrap: wrap; position: static; }
  .fhcl-searchbar input { flex-basis: calc(100% - 40px); }
  .fhcl-tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .fhcl-tile { min-height: 88px; padding: 10px 4px 8px; }
  .fhcl-tile-ico { width: 36px; height: 36px; font-size: 20px; }
  .fhcl-tile-name { font-size: 12.5px; }
  .fhcl-apps { grid-template-columns: repeat(4, 1fr); gap: 6px 2px; }
  .fhcl-ico { width: 52px; height: 52px; border-radius: 15px; }
  .fhcl-app-name { font-size: 12px; }
  .fhcl-flabel { min-width: 100%; }
  .fhcl-row-stages, .fhcl-row-item .fhcl-badge.cat { display: none; }
  .fhcl-drawer { top: auto; height: 88vh; width: 100vw; border-radius: 18px 18px 0 0; transform: translateY(100%); }
  .fhcl-viewsw button span { display: none; }
}
@media print {
  .fhcl-searchbar, .fhcl-tiles, .fhcl-filters, .fhcl-viewsw, .fhcl-app-pick { display: none !important; }
}
