/* 工具頁使用說明（2026-11-13）：頂列按鈕＋置中彈窗 */
.navbar-ctrl-btn.th-open-btn { width: auto; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 8px; border-radius: 999px;
    background: color-mix(in srgb, var(--color-accent) 16%, transparent); color: var(--color-accent); border: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent); }
.navbar-ctrl-btn.th-open-btn:hover { background: color-mix(in srgb, var(--color-accent) 26%, transparent); color: var(--color-accent); }
.th-open-btn i { font-size: 1.1rem; }
.th-open-txt { font-size: .82rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 860px) { .th-open-txt { display: none; } .navbar-ctrl-btn.th-open-btn { padding: 0; width: 40px; height: 40px; justify-content: center; } }

.th-dialog { position: fixed; inset: 0; margin: auto; height: fit-content; max-height: calc(100dvh - 24px); width: min(640px, calc(100vw - 20px)); overflow-y: auto;
             padding: 0; border-radius: 22px; border: 1px solid rgba(255,255,255,.14); background: #17171d; color: var(--color-text); box-shadow: 0 30px 100px rgba(0,0,0,.65); }
.th-dialog::backdrop { background: rgba(0,0,0,.6); }
.th-dialog [hidden] { display: none !important; }
.th-inner { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px 0; }
.th-head { display: flex; align-items: center; gap: 12px; }
.th-ico { flex: none; width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 1.5rem;
          background: color-mix(in srgb, var(--color-accent) 18%, transparent); color: var(--color-accent); }
.th-head-txt { flex: 1; min-width: 0; }
.th-head-txt small { display: block; font-size: .74rem; color: var(--color-text-muted); }
.th-head-txt h2 { margin: 2px 0 0; font-size: 1.3rem; }
.th-x { width: 36px; height: 36px; border-radius: 11px; border: 0; background: transparent; color: var(--color-text-muted); cursor: pointer; display: grid; place-items: center; font-size: 1.15rem; align-self: flex-start; }
.th-x:hover { background: rgba(255,255,255,.08); color: var(--color-text); }
.th-summary { margin: -4px 0 0; color: var(--color-text-secondary); line-height: 1.7; font-size: .92rem; }
.th-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.08); }
.th-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border: 0; border-radius: 10px; background: transparent;
                  color: var(--color-text-secondary); font: inherit; font-size: .88rem; cursor: pointer; }
.th-tabs button:hover { color: var(--color-text); background: rgba(255,255,255,.06); }
.th-tabs button.is-on { background: var(--color-accent); color: var(--color-accent-text, #111); font-weight: 600; }
.th-pane { display: flex; flex-direction: column; gap: 12px; }
.th-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; counter-reset: th; }
.th-steps li { position: relative; display: flex; gap: 12px; padding: 0 0 16px; counter-increment: th; }
.th-steps li:not(:last-child)::before { content: ""; position: absolute; left: 19px; top: 42px; bottom: 2px; width: 2px; background: rgba(255,255,255,.1); }
.th-step-ico { position: relative; flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem;
               background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: var(--color-accent); }
.th-step-ico::after { content: counter(th); position: absolute; right: -6px; top: -6px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
                      font-size: .66rem; font-weight: 600; background: var(--color-accent); color: var(--color-accent-text, #111); }
.th-steps b { display: block; font-size: .95rem; margin: 2px 0 4px; }
.th-steps p { margin: 0; font-size: .84rem; color: var(--color-text-secondary); line-height: 1.65; }
.th-tips { padding: 12px 12px; border-radius: 14px; background: rgba(252,211,77,.06); border: 1px solid rgba(252,211,77,.18); }
.th-tips > b { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: #FCD34D; }
.th-tips ul { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.th-tips li { font-size: .82rem; color: var(--color-text-secondary); line-height: 1.6; }
.th-ai-how { margin: 0; font-size: .86rem; color: var(--color-text-secondary); line-height: 1.7; }
.th-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px; background: rgba(0,0,0,.3); width: fit-content; }
.th-seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--color-text-secondary); font: inherit; font-size: .84rem; cursor: pointer; }
.th-seg button.is-on { background: rgba(255,255,255,.14); color: var(--color-text); font-weight: 600; }
.th-code { position: relative; }
.th-code textarea { width: 100%; resize: vertical; min-height: 180px; padding: 12px 12px 56px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.35);
                    color: var(--color-text-secondary); font: .76rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color-scheme: dark; }
.th-copy { position: absolute; right: 10px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; border: 0;
           background: var(--color-accent); color: var(--color-accent-text, #111); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; }
.th-copy.is-done { background: #4ADE80; }
.th-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 -24px; padding: 12px 24px 16px;
           background: #17171d; border-top: 1px solid rgba(255,255,255,.08); }
.th-again { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--color-text-muted); cursor: pointer; }
.th-again input { accent-color: var(--color-accent); }
.th-ok { height: 42px; padding: 0 20px; border-radius: 12px; border: 0; background: var(--color-accent); color: var(--color-accent-text, #111); font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 600px) {
    .th-inner { padding: 16px 16px 0; gap: 12px; }
    .th-foot { margin: 0 -16px; padding: 12px 16px 12px; }
    .th-ok { flex: 1; }
    .th-head-txt h2 { font-size: 1.15rem; }
}

/* 寬版（內容多的工具，例如行程規劃）：步驟排兩欄 */
.th-dialog.th-wide { width: min(960px, calc(100vw - 20px)); }
@media (min-width: 760px) {
    .th-wide .th-steps { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
    .th-wide .th-steps li::before { display: none; }
}

/* 重點功能區塊（例如 AI 接管）：標題＋三張卡，最後一張是招牌 */
.th-feature { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px;
              background: linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 16%, transparent), rgba(255,255,255,.02));
              border: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent); }
.th-feature-head { display: flex; gap: 12px; align-items: flex-start; }
.th-feature-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem;
                  background: var(--color-accent); color: var(--color-accent-text, #111); }
.th-feature-head b { display: block; font-size: 1.02rem; margin: 1px 0 4px; }
.th-feature-head p { margin: 0; font-size: .84rem; color: var(--color-text-secondary); line-height: 1.6; }
.th-feature-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.th-fcard { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.1); }
.th-fcard.is-star { border-color: color-mix(in srgb, var(--color-accent) 65%, transparent); background: color-mix(in srgb, var(--color-accent) 10%, rgba(0,0,0,.22)); }
.th-fcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.th-fcard-top i { font-size: 1.2rem; color: var(--color-accent); }
.th-fcard-top em { font-style: normal; font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--color-text-secondary); }
.th-fcard.is-star .th-fcard-top em { background: var(--color-accent); color: var(--color-accent-text, #111); }
.th-fcard b { font-size: .9rem; }
.th-fcard p { margin: 0; font-size: .8rem; line-height: 1.6; color: var(--color-text-secondary); }
.th-feature-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: .76rem; line-height: 1.6; color: var(--color-text-muted); }
.th-feature-note i { margin-top: 2px; }
@media (max-width: 759px) { .th-feature-cards { grid-template-columns: 1fr; } }
