:root {
  --fg: #1a1a1a;
  --muted: #555;
  --line: #d6d9de;
  --bg: #ffffff;
  --soft: #f3f5f8;
  --brand: #1d4ed8;
  --brand-dark: #1e3a8a;
  --ok: #047857;
  --warn: #b45309;
  --bad: #b91c1c;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 18px;
  line-height: 1.75;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
a { color: var(--brand); }
h1 { font-size: 1.75rem; line-height: 1.35; margin: 1.2rem 0 .5rem; }
h2 { font-size: 1.35rem; line-height: 1.4; margin: 2rem 0 .75rem; }
.lead { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 1rem; margin: .5rem 0; }

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { padding-top: 12px; padding-bottom: 12px; }
.site-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; color: var(--fg); text-decoration: none; }
.site-logo img { width: 28px; height: 28px; flex: 0 0 28px; display: block; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* 頁首分類選單：按下後從右邊滑出的白底抽屜，佔畫面寬 3/4（桌機上限 480px），後面的頁面壓暗；先列「熱門」與各分類，點了才展開底下的工具 */
.cat-nav ul { list-style: none; margin: 0; padding: 0; }
.cat-nav a { text-decoration: none; font-weight: 600; }
.cat-nav a[aria-current="page"] { color: var(--fg); }
.cat-menu > summary { list-style: none; cursor: pointer; padding: 8px 14px; border: 2px solid var(--brand); border-radius: 10px; color: var(--brand); font-weight: 600; }
.cat-menu > summary::-webkit-details-marker { display: none; }
.cat-menu > summary::after { content: " ☰"; }
.cat-panel { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1000; background: rgba(0,0,0,.45); animation: cat-fade .25s ease-out; }
.cat-panel-in { position: absolute; top: 0; right: 0; bottom: 0; width: min(75vw, 480px); overflow-y: auto; overscroll-behavior: contain; padding: 56px 16px 40px; background: #fff; border-left: 1px solid var(--line); box-shadow: -6px 0 24px rgba(0,0,0,.18); animation: cat-slide .28s cubic-bezier(.2,.8,.2,1); }
@keyframes cat-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cat-slide { from { transform: translateX(100%); } to { transform: none; } }
.cat-menu.cat-closing .cat-panel { animation: cat-fade .2s ease-in reverse forwards; }
.cat-menu.cat-closing .cat-panel-in { animation: cat-slide .2s ease-in reverse forwards; }
@media (prefers-reduced-motion: reduce) { .cat-panel, .cat-panel-in, .cat-menu.cat-closing .cat-panel, .cat-menu.cat-closing .cat-panel-in { animation: none; } }
.cat-close { position: absolute; top: 6px; right: 8px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--fg); font: inherit; font-size: 1.9rem; line-height: 1; cursor: pointer; }
.cat-close:hover { background: var(--soft); }
.cat-group { border-bottom: 1px solid var(--line); }
.cat-group:first-of-type, .cat-link { border-top: 1px solid var(--line); }
.cat-link + .cat-group { border-top: 0; }
.cat-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 12px 4px; list-style: none; cursor: pointer; color: var(--fg); font-size: 1.05rem; font-weight: 700; line-height: 1.45; }
.cat-title::-webkit-details-marker { display: none; }
summary.cat-title::after { content: "+"; flex: 0 0 auto; color: var(--muted); font-weight: 400; }
.cat-group[open] > .cat-title { color: var(--brand); }
.cat-group[open] > .cat-title::after { content: "−"; }
.cat-link { cursor: auto; }
.cat-link a { flex: 1; color: var(--fg); font-weight: 700; }
.cat-link a[aria-current="page"] { color: var(--brand); }
.cat-group ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 6px; padding: 0 0 12px; }
html:not([lang^="zh"]) .cat-group ul { grid-template-columns: 1fr; }
.cat-group li a { display: block; padding: 8px; border-radius: 8px; font-size: 1rem; line-height: 1.45; }
.cat-group li a:hover, .cat-group li a[aria-current="page"] { background: #eff4ff; }
.cat-group li.cat-all { grid-column: 1 / -1; }
html.cat-open { overflow: hidden; }
@media (min-width: 640px) {
  .cat-panel-in { padding: 60px 24px 40px; }
  .cat-group ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* 頁首站內搜尋（inc/header.php 的 form.site-search；邏輯在 assets/js/site-search.js）：桌機在 logo 與「工具分類」之間，手機自成第二列滿寬 */
.header-row { flex-wrap: wrap; row-gap: 10px; }
.site-search { position: relative; flex: 0 1 260px; min-width: 0; margin: 0; }
.site-search input[type=search] { display: block; width: 100%; min-height: 42px; margin: 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--fg); font: inherit; font-size: 1rem; line-height: 1.4; -webkit-appearance: none; appearance: none; }
.site-search input[type=search]:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.site-search-list { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: 340px; max-width: calc(100vw - 32px); max-height: 60vh; overflow-y: auto; list-style: none; margin: 0; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.site-search-list[hidden] { display: none; }
.site-search-list li { margin: 0; }
.site-search-list li a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--fg); line-height: 1.4; }
.site-search-list li a strong { display: block; font-size: 1rem; color: var(--brand); }
.site-search-list li a span { display: block; font-size: .85rem; color: var(--muted); }
.site-search-list li.is-active a, .site-search-list li a:hover { background: #eff4ff; }
.site-search-more, .site-search-empty { padding: 8px 10px; font-size: .9rem; color: var(--muted); line-height: 1.5; }
.site-search-empty a { display: inline; padding: 0; margin-left: .25em; text-decoration: underline; color: var(--brand); font-weight: 600; }
.site-search-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 759px) {
  .header-row .site-logo { flex: 1 1 0; min-width: 0; } /* 很窄的螢幕讓站名折行，「工具分類」才留在右側，面板不會被擠出畫面 */
  .site-search { order: 3; flex: 1 1 100%; }
  .site-search-list { width: 100%; max-width: none; }
}
@media print { .site-search { display: none !important; } }
/* 麵包屑 */
.breadcrumb { margin: .75rem 0 0; font-size: .95rem; color: var(--muted); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 .4rem; }
.breadcrumb li + li::before { content: "›"; margin-right: .4rem; }
.breadcrumb a { color: var(--brand); }
.breadcrumb [aria-current="page"] { color: var(--fg); }
.breadcrumb + h1 { margin-top: .4rem; }
/* 分類入口卡片 */
.cat-grid { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat-grid a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--fg); height: 100%; }
.cat-grid a:hover { border-color: var(--brand); }
.cat-grid strong { display: block; color: var(--brand); line-height: 1.5; }
.cat-grid span { color: var(--muted); font-size: .95rem; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.cat-cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 1rem 0; }
.cat-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.cat-card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.cat-card h3 a { color: var(--brand); text-decoration: none; }
.cat-card ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cat-card li a { display: inline-block; padding: 5px 0; }
.cat-card-all { font-weight: 600; font-size: .95rem; }
@media (min-width: 640px) { .cat-cards { grid-template-columns: repeat(3, 1fr); } }
h3 { font-size: 1.15rem; line-height: 1.4; margin: 1.5rem 0 .25rem; }
h3 a { color: var(--fg); text-decoration: none; }
.other-tools { margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); background: var(--soft); font-size: .95rem; color: var(--muted); }
.site-footer .wrap { padding-top: 16px; padding-bottom: 24px; }
[hidden] { display: none !important; } /* 讓 hidden 屬性蓋過 .btn 等元件的 display */
.foot-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin-bottom: 14px; align-items: start; }
.foot-cat { display: block; padding: 8px 0; color: var(--fg); font-weight: 600; text-decoration: none; }
.foot-cat:hover { color: var(--brand); }
.foot-cat .foot-count { color: var(--muted); font-weight: 400; }
.foot-cat[open] { grid-column: 1 / -1; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; } /* 展開的分類佔整列，工具橫向排開 */
.foot-cats ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 16px; }
.foot-cats li a { display: inline-block; padding: 5px 0; }
.foot-cats .foot-all { font-weight: 600; }
.foot-disclaimer { margin: .5rem 0; font-size: .9rem; }
.foot-info { display: flex; flex-wrap: wrap; gap: 6px 1rem; margin: .5rem 0; }
@media (min-width: 640px) { .foot-cats { grid-template-columns: repeat(4, 1fr); } }

.tool-list { list-style: none; padding: 0; margin: 1.5rem 0; }
.tool-list a { display: block; padding: 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--fg); }
.tool-list a:hover { border-color: var(--brand); }
.tool-list strong { display: block; font-size: 1.2rem; color: var(--brand); }
.tool-list span { color: var(--muted); font-size: 1rem; }

.value-note { background: #fff4d6; border: 1px solid #f5c451; border-left: 6px solid #e69a00; color: #5c3b00; padding: 12px 16px; border-radius: 8px; font-size: 1.05rem; line-height: 1.7; margin: 14px 0; } /* 命理頁「免費完整內容＋字數」色塊 */
.privacy-note { background: #ecfdf5; border-left: 4px solid var(--ok); padding: 10px 14px; border-radius: 6px; font-size: 1rem; }

.tool { border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px 16px; margin: 1.25rem 0; background: #fff; }
.step { padding-top: 8px; }
.step + .step { border-top: 1px dashed var(--line); margin-top: 12px; }
.step-title { font-size: 1.15rem; margin: .75rem 0 .5rem; display: flex; align-items: center; gap: 8px; }
.step-title span { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; align-items: center; justify-content: center; font-size: .95rem; }

.size-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.size-opt { cursor: pointer; }
.size-opt input { position: absolute; opacity: 0; pointer-events: none; }
.size-opt span { display: block; border: 2px solid var(--line); border-radius: 10px; padding: 8px 6px; text-align: center; line-height: 1.35; }
.size-opt strong { display: block; font-size: 1rem; }
.size-opt small { color: var(--muted); font-size: .85rem; }
.size-opt input:checked + span { border-color: var(--brand); background: #eff4ff; }
.size-opt input:focus-visible + span { outline: 3px solid #93b4ff; }

.pick-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 18px; border-radius: 10px;
  border: 2px solid var(--brand); background: #fff; color: var(--brand);
  font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: .95rem; }
.btn[disabled] { opacity: .5; cursor: default; }
.pick-buttons .btn { flex: 1 1 200px; }
.cam { margin: 10px 0; }
.cam video { display: block; width: 100%; max-height: 70vh; background: #000; border-radius: 10px; transform: scaleX(-1); /* 前鏡頭預覽照鏡子方向，拍下來的照片是正向 */ }

.status { min-height: 1.5em; margin: .25rem 0; font-size: 1rem; }
.status.error { color: var(--bad); font-weight: 600; }

.stage-wrap { display: flex; justify-content: center; margin: 8px 0; }
.stage { position: relative; width: min(100%, 320px); touch-action: none; user-select: none; box-shadow: 0 0 0 1px var(--line); background: #fff; }
.stage canvas { display: block; width: 100%; height: auto; }
.stage .guides { position: absolute; inset: 0; height: 100%; cursor: grab; }
.measure { text-align: center; font-weight: 600; margin: .25rem 0; }
.measure.ok { color: var(--ok); }
.measure.bad { color: var(--bad); }
.controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 8px 0; }
.controls input[type=range] { flex: 1 1 140px; max-width: 260px; }

.results { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.results figure { margin: 0; text-align: center; }
.results img { width: 100%; height: auto; border: 1px solid var(--line); background: #fff; }
.results figcaption { font-size: .9rem; color: var(--muted); margin: 4px 0 8px; }
.results .btn { width: 100%; }

.ad-slot { margin: 1.5rem 0; }
/* 廣告卡（inc/site.php ad_card，內容在 inc/ad-cards.php）：預留高度避免版面跳動；與上下操作區保持距離 */
.ad-card { margin: 24px auto; min-height: 90px; text-align: center; overflow: hidden; }
.ad-card-label { display: block; font-size: .75rem; color: var(--muted); line-height: 1.4; }
.ad-card-after-tool, .ad-card-between-tools { margin-top: 40px; }
/* 「主程式後」廣告的尺寸：手機出 300x250（極窄螢幕 250x250），桌機出 728x90；固定尺寸所以不會撐開或跳動 */
.ad-after-tool { display: inline-block; width: 300px; height: 250px; }
@media (max-width: 331px) { .ad-after-tool { width: 250px; } }
@media (min-width: 800px) { .ad-after-tool { width: 728px; height: 90px; } }
.ad-card-before-tool.ad-card-wide-gap { margin-bottom: 150px; }
.ad-card-after-tool.ad-card-wide-gap, .ad-card-between-tools.ad-card-wide-gap { margin-top: 150px; }
.ad-card-header { margin: 0; min-height: 60px; width: 468px; flex: 0 0 468px; }
.ad-card-square { min-height: 250px; }
.ad-card.ad-card-in-result { min-height: 280px; margin: 32px auto; clear: both; }
.ad-card-preview.ad-card-in-result { height: 280px; max-width: none; }
.ad-card-in-result:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; } /* AdSense 沒填到廣告時收起整張卡 */
.ad-card-pair { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.ad-card-pair .ad-card-label { flex: 0 0 100%; }
.ad-card-pair .ad-card-box { flex: 0 0 300px; min-height: 250px; }
.ad-card-billboard { max-width: 970px; min-height: 250px; margin: 24px auto; padding: 0 16px; }
.ad-card-before-other-tools { margin-top: 2.5rem; }
@media (max-width: 679px) { .ad-card-pair .ad-card-box + .ad-card-box { display: none; } .ad-card-billboard { min-height: 100px; } }
.ad-card-preview { display: flex; align-items: center; justify-content: center; border: 2px dashed #d97706; background: #fef3c7; color: #92400e; font-size: .9rem; height: 90px; width: 100%; max-width: 728px; }
.ad-card-header.ad-card-preview { height: 60px; }
@media (max-width: 759px) { .ad-card { min-height: 100px; } .ad-card-header, .ad-card-header.ad-card-preview { display: none; } }
.ad-card-preview.ad-card-square, .ad-card-preview.ad-card-pair { height: auto; max-width: none; border: 0; background: none; }
.ad-card-preview .ad-card-box { display: flex; align-items: center; justify-content: center; width: 300px; height: 250px; border: 2px dashed #d97706; background: #fef3c7; }
.ad-card-preview.ad-card-horizontal .ad-card-box, .ad-card-preview.ad-card-billboard .ad-card-box { width: auto; height: auto; border: 0; background: none; }
.ad-card-preview.ad-card-billboard { height: 250px; max-width: 970px; }
@media (max-width: 679px) { .ad-card-preview.ad-card-billboard { height: 100px; } }
.embed-main .ad-card { display: none !important; }
@media print { .ad-card, .ad-slot, ins.adsbygoogle, .google-auto-placed, [id^="google_ads_"], iframe[id^="aswift_"] { display: none !important; } } /* 列印時不印廣告（文件範本頁會列印）；後四個是 AdSense 自動廣告（底部錨定、側邊欄、自動插入），行內樣式蓋不過的由 track.js 的 beforeprint 補 */

.content table { border-collapse: collapse; width: 100%; font-size: 1rem; }
.content th, .content td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.content th { background: var(--soft); }
.table-scroll { overflow-x: auto; }
.rules li { margin-bottom: .5rem; }
.faq details { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: .5rem 0 0; }
.sources { font-size: .95rem; }

@media (max-width: 480px) {
  body { font-size: 17px; }
  h1 { font-size: 1.5rem; }
  .size-options { grid-template-columns: 1fr; }
  .size-opt span { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; text-align: left; }
  .results { grid-template-columns: 1fr; }
}

/* QR Code 產生器 */
.qr-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0; }
.qr-tabs button { min-height: 48px; padding: 0 4px; border: 2px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; color: var(--fg); }
.qr-tabs button[aria-selected="true"] { border-color: var(--brand); background: #eff4ff; color: var(--brand); }
.qr-field { display: block; margin: 10px 0; font-weight: 600; font-size: 1rem; }
.qr-field input[type=text], .qr-field input[type=url], .qr-field input[type=number], .qr-field textarea, .qr-field select {
  display: block; width: 100%; margin-top: 4px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; background: #fff; color: var(--fg);
}
.qr-field textarea { min-height: 96px; resize: vertical; }
.qr-check { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 1rem; }
.qr-check input { width: 22px; height: 22px; }
.qr-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.qr-opts input[type=color] { display: block; width: 100%; height: 44px; margin-top: 4px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qr-preview { display: flex; justify-content: center; margin: 12px 0; }
.qr-preview canvas { width: min(100%, 240px); height: auto; aspect-ratio: 1; border: 1px solid var(--line); background: #fff; }
.qr-preview canvas.empty { background: var(--soft); }
.qr-warn { color: var(--warn); font-size: 1rem; margin: .5rem 0; }
.qr-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.qr-dl .btn { width: 100%; }
@media (max-width: 480px) {
  .qr-tabs button { font-size: .9rem; }
  .qr-dl { grid-template-columns: 1fr; }
}

.qr-promise { background: #ecfdf5; border: 2px solid var(--ok); border-radius: 12px; padding: 12px 16px; margin: 1rem 0; }
.qr-promise strong { display: block; font-size: 1.15rem; color: var(--ok); }
.qr-promise p { margin: .35rem 0 0; font-size: 1rem; }

/* 勞工試算（資遣費／特休／加班費） */
.calc fieldset { border: 0; padding: 0; margin: 10px 0; min-width: 0; }
.calc legend { font-weight: 600; font-size: 1rem; padding: 0; margin-bottom: 4px; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.calc-grid > * { min-width: 0; }
.calc .qr-field input[type=date] { display: block; width: 100%; margin-top: 4px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; background: #fff; color: var(--fg); }
.calc-radios label { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; padding: 10px 12px; margin: 6px 0; border: 2px solid var(--line); border-radius: 10px; font-size: 1rem; cursor: pointer; }
.calc-radios label:has(input:checked) { border-color: var(--brand); background: #eff4ff; }
.calc-radios input { width: 20px; height: 20px; margin: 0; flex: none; }
.calc-radios small { flex-basis: 100%; padding-left: 28px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.calc-radios-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.calc-radios-inline legend { grid-column: 1 / -1; }
.calc-go { width: 100%; }
.calc-result { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 12px; }
.calc-result h3 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
.total-box { background: #eff4ff; border: 2px solid var(--brand); border-radius: 12px; padding: 12px 16px; text-align: center; }
.total-box span { display: block; font-size: 1rem; color: var(--muted); }
.total-box strong { display: block; font-size: 1.9rem; line-height: 1.3; color: var(--brand-dark); }
.calc-sub { margin: .5rem 0; font-size: 1rem; }
.calc-table { border-collapse: collapse; width: 100%; font-size: 1rem; margin: 12px 0; }
.calc-table th, .calc-table td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.calc-table th { background: var(--soft); font-weight: 600; }
.calc-table tbody th { width: 34%; }
.calc-table small { color: var(--muted); font-size: .88rem; }
.calc-table tr.on td { background: #fff7e6; font-weight: 600; }
.calc-notes { font-size: 1rem; padding-left: 1.2em; }
.calc-notes li { margin-bottom: .4rem; }
.calc-legal { font-size: 1rem; margin: .75rem 0 .25rem; }
.disclaimer { color: var(--muted); font-size: .9rem; margin: .25rem 0 0; }
.formula { background: var(--soft); border-radius: 8px; padding: 8px 12px; font-size: 1rem; overflow-wrap: anywhere; }
.ot-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 10px 0; background: var(--soft); }
.ot-row-head { display: flex; justify-content: space-between; align-items: center; font-size: 1rem; }
.ot-del { border: 0; background: none; color: var(--bad); font: inherit; font-size: .95rem; cursor: pointer; padding: 6px 4px; min-height: 40px; }
@media (max-width: 480px) {
  .calc-grid { grid-template-columns: 1fr; }
  .total-box strong { font-size: 1.6rem; }
  .calc-table th, .calc-table td { padding: 6px; font-size: .95rem; }
}
#ot-lines td:nth-child(2), #ot-lines td:nth-child(4), #ot-result thead th { white-space: nowrap; }

/* ── 分享鈕（footer.php／share.js） ── */
.share-box { margin-top: 2rem; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.share-title { margin: 0 0 8px; font-weight: 600; }
/* 圖示分享鈕：樣式比照 vege.club 的 kenny-light-share */
.share-set { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-label { font-size: .95rem; color: var(--muted); margin-right: 2px; }
.share-box .share-label { display: none; }
.share-ico { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 9px; border: 0; border-radius: 7px; color: #fff; cursor: pointer; box-sizing: border-box; }
.share-ico svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.share-ico.share-fb { background: #1877f2; }
.share-ico.share-line { background: #06c755; }
.share-ico.share-x { background: #000; }
.share-ico.share-wa { background: #25d366; }
.share-ico.share-ig { background: radial-gradient(circle at 31% 107%, #fdf497 0, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.share-copy { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: 7px; color: #fff; font: inherit; font-size: .95rem; cursor: pointer; background: linear-gradient(135deg, #06b6d4, #6366f1 58%, #8b5cf6); box-shadow: 0 2px 6px rgba(79, 70, 229, .24); }
.share-copy svg { width: 18px; height: 18px; fill: currentColor; }
.share-native { height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: inherit; font: inherit; font-size: .95rem; cursor: pointer; }
.share-native[hidden] { display: none; }
.share-ico:hover, .share-copy:hover { filter: brightness(.92); }
.share-native:hover { background: var(--soft); }
.share-ico:focus-visible, .share-copy:focus-visible, .share-native:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
.share-status { margin: 6px 0 0; color: var(--ok); font-size: .95rem; min-height: 0; overflow-wrap: anywhere; }
.share-status:empty { display: none; }
.share-hint { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.share-set .share-status { flex-basis: 100%; margin: 0; }
.share-top { margin: 16px 0 24px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.embed-cta { margin: -12px 0 24px; }
.embed-cta-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 7px; background: #dc2626; color: #fff; font-size: .95rem; font-weight: 600; text-decoration: none; box-shadow: 0 2px 6px rgba(220, 38, 38, .28); }
.embed-cta-btn svg { width: 18px; height: 18px; fill: currentColor; flex: 0 0 18px; }
.embed-cta-btn:hover { filter: brightness(.92); }
.embed-cta-btn:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
/* App 內建瀏覽器提示（assets/js/inapp-browser.js） */
.inapp-note { margin: 0 0 16px; padding: 12px 14px; border: 2px solid #f59e0b; border-radius: 10px; background: #fffbeb; }
.inapp-note p { margin: 0 0 8px; }
.inapp-note-text { font-weight: 600; }
.inapp-note-row { display: flex; flex-wrap: wrap; gap: 8px; }
.inapp-note-open { background: #dc2626; border-color: #dc2626; color: #fff; }
.inapp-note-status { color: var(--ok); font-size: .95rem; }
.inapp-note-status:empty { display: none; }
@media print { .inapp-note { display: none !important; } }
.tool-note { margin: 0 0 10px; color: var(--muted); font-size: .9rem; }
.tool-note-hi { padding: 10px 14px; background: #fef3c7; border-left: 6px solid #d97706; border-radius: 6px; color: #111827; font-size: 1rem; font-weight: 700; line-height: 1.6; }
.tool-note-in { margin: 12px 0; }
.tool-note-after { margin: -6px 0 16px; }
@media print { .share-top, .share-box, .tool-note, .embed-cta, .other-tools { display: none !important; } }

/* ── 嵌入碼（工具頁「把這個工具放到你的網站」） ── */
.embed-box { margin-top: 1rem; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
.embed-box > summary { cursor: pointer; padding: 12px 0; font-weight: 600; min-height: 44px; }
.embed-box[open] { padding-bottom: 14px; }
.embed-box p { font-size: .95rem; margin: 0 0 8px; }
.embed-opts { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 8px; font-size: .95rem; }
.embed-opts input[type=number] { width: 6.5em; margin-left: 6px; min-height: 40px; font: inherit; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; }
.embed-auto { display: flex; gap: 6px; align-items: center; }
.embed-code { display: block; width: 100%; box-sizing: border-box; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; padding: 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; resize: vertical; }

/* ── 首頁「近期該算的」 ── */
.season-list a { position: relative; }
.season-month { display: inline-block; font-style: normal; font-size: .85rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; margin-bottom: 4px; }
.season-month.is-now { color: #fff; background: var(--brand); border-color: var(--brand); }

/* ── 嵌入版（/embed/<slug>/）：只留標題、隱私說明與工具區，其他（說明文章、FAQ、跳轉選單等）隱藏 ── */
html.embed body { background: var(--bg); }
.embed-main { padding-top: 4px; padding-bottom: 8px; }
.embed-main > :not(h1):not(.privacy-note):not(.tool):not(.tool-note):not(.embed-credit):not(.mw-now):not(.mw-now + .hint):not([class$="-fun"]):not([class$="-warn"]):not(.en-note):not(.pt-honest):not(.ns-asof):not(.ns-asof + .hint):not(.st-next):not(script):not(link):not(style) { display: none !important; }
/* 最低工資頁：表單上方的現行與明年數字卡（含說明）是查詢主體，嵌入版也保留 */
/* 各頁主程式上方的提醒句（-fun 娛樂參考、-warn 注意事項、en-note、pt-honest、ns-asof 適用年度、st-next 下一個節氣）嵌入版也要顯示，不能只留工具本體 */
.embed-main > h1 { font-size: 1.3rem; margin: .5rem 0; }
.embed-main .ad-slot { display: none !important; }
.embed-credit { margin: 1rem 0 0; font-size: .9rem; color: var(--muted); text-align: right; }
.embed-credit img { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; border-radius: 4px; }
/* 24 小時制時間下拉（assets/js/time24.js 取代原生時間欄位） */
.t24 { display: flex; align-items: center; gap: 6px; margin-top: 4px; max-width: 260px; }
.t24 select { display: block; flex: 1 1 0; width: auto; min-width: 0; margin: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; background: #fff; color: var(--fg); }
.t24 select:disabled { background: var(--soft); color: var(--muted); }
@media print { .t24 { display: none; } }
@media (max-width: 600px) { .tool { margin-left: -10px; margin-right: -10px; padding-left: 10px; padding-right: 10px; } } /* 手機：工具框往兩側多佔一點，內容不被頁面留白＋外框＋內距三層擠窄（2026-10-14） */
.content p, .content li { overflow-wrap: break-word; } /* 說明區長網址、長英文名稱在 320 寬撐出畫面，讓超長字串換行；用 break-word 不改表格與一般排版（2026-10-14） */
.ad-card.ad-card-in-result { grid-column: 1 / -1; width: 100%; } /* 結果區廣告卡插在格狀清單（國旗、電話吉凶、幸運色）裡時佔滿整列，不被縮成一格寬（2026-10-15） */

/* PWA（2026-10-20）：離線提示條＋頁尾「加到主畫面」小按鈕，都由 assets/js/pwa.js 動態插入 */
.pwa-offline { background: #fff7ed; border-bottom: 1px solid #fed7aa; color: var(--warn); font-size: .95rem; line-height: 1.5; padding: 8px 16px; text-align: center; }
.pwa-install-row { margin: .5rem 0 0; }
.pwa-install { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; color: var(--brand); font: inherit; font-size: .95rem; cursor: pointer; }
.pwa-install:hover { border-color: var(--brand); }
/* 「加到桌面」按鈕（pwa.js 插在 .embed-cta 那一排、與嵌入按鈕同尺寸；點了開 <dialog> 安裝教學，不改變版面） */
.embed-cta { display: flex; flex-wrap: wrap; gap: 8px; }
.pwa-add-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 7px; background: #047857; color: #fff; font-size: .95rem; font-weight: 600; text-decoration: none; box-shadow: 0 2px 6px rgba(4, 120, 87, .28); }
.pwa-add-btn svg { width: 18px; height: 18px; fill: currentColor; flex: 0 0 18px; }
.pwa-add-btn:hover { filter: brightness(.92); }
.pwa-add-btn:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
.pwa-guide { width: min(92vw, 520px); max-height: 86vh; overflow-y: auto; overscroll-behavior: contain; padding: 0; border: 0; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25); color: var(--fg); }
.pwa-guide::backdrop { background: rgba(0,0,0,.45); }
.pwa-guide-in { position: relative; padding: 18px 20px 14px; font-size: 1rem; }
.pwa-guide h2 { margin: 0 32px .5rem 0; font-size: 1.25rem; }
.pwa-guide ul, .pwa-guide ol { margin: .25rem 0 .75rem; padding-left: 1.4em; }
.pwa-guide-x { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; background: none; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; }
.pwa-guide-foot { margin: .75rem 0 0; text-align: right; }
.pwa-steps h3 { font-size: 1.05rem; margin: .75rem 0 .25rem; }
.pwa-inapp { background: #fff7ed; border-radius: 8px; padding: 8px 12px; color: var(--warn); }
.pwa-other > summary { cursor: pointer; color: var(--brand); }
