/* 繁簡中文轉換與字數統計：頁面樣式（取代 index.html 內嵌 <style>） */
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  --tc-bg:#f4f7fc;--tc-panel:#fff;--tc-fg:#1a2438;--tc-muted:#5c6a80;--tc-border:#dce4f0;--tc-accent:#1659ae;--tc-accent2:#2f7be0;--tc-soft:#e9f1fc;--tc-on:#fff;--tc-ok:#12805c;--tc-field:#f8fafd;--tc-shadow:0 10px 28px rgba(22,89,174,.08);
  margin:0;background:var(--tc-bg);color:var(--tc-fg);font-family:system-ui,-apple-system,"Noto Sans TC","Microsoft JhengHei",sans-serif;line-height:1.6}
body.dark{
  --tc-bg:#0f1624;--tc-panel:#18263d;--tc-fg:#e8eef9;--tc-muted:#a9b8cf;--tc-border:#33445f;--tc-accent:#7db3ff;--tc-accent2:#a7ccff;--tc-soft:#223556;--tc-on:#0b1730;--tc-ok:#5fd3a4;--tc-field:#132039;--tc-shadow:none}

/* 頂部列 */
.tc-top{background:var(--tc-panel);border-bottom:1px solid var(--tc-border)}
.tc-top-inner{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:1100px;min-height:64px;margin:auto;padding:0 20px}
.tc-top a{color:var(--tc-fg);text-decoration:none}
.tc-top a:hover{color:var(--tc-accent)}
.tc-brand{font-weight:800}
.tc-top-actions{display:flex;align-items:center;gap:16px}
.tc-theme{border:1px solid var(--tc-border);background:var(--tc-panel);color:var(--tc-fg);border-radius:10px;padding:7px 12px;font:inherit;cursor:pointer}
.tc-theme:hover{border-color:var(--tc-accent)}

.tc{max-width:1100px;margin:0 auto;padding:22px 20px 40px;color:var(--tc-fg)}

/* Hero */
.tc .tc-hero{padding:28px 30px;border:1px solid var(--tc-border);border-radius:22px;background:linear-gradient(120deg,var(--tc-panel) 35%,var(--tc-soft))}
.tc .tc-eyebrow{color:var(--tc-accent);font-size:.8rem;font-weight:800;letter-spacing:.12em}
.tc .tc-hero h1{font-size:clamp(1.6rem,3.6vw,2.3rem);line-height:1.3;margin:6px 0 10px}
.tc .tc-hero p{color:var(--tc-muted);max-width:680px;margin:0}
.tc .tc-pills{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
.tc .tc-pills a,.tc .tc-pills span{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--tc-border);border-radius:999px;padding:4px 13px;font-size:.82rem;background:var(--tc-panel);color:var(--tc-fg);text-decoration:none}
.tc .tc-pills a:hover{border-color:var(--tc-accent);color:var(--tc-accent)}
.tc .tc-pills .ok::before{content:"✓";color:var(--tc-ok);font-weight:800}

/* 區塊卡片 */
.tc .tc-card{margin:18px 0;padding:22px;background:var(--tc-panel);border:1px solid var(--tc-border);border-radius:18px;box-shadow:var(--tc-shadow);scroll-margin-top:14px}
.tc .tc-head{display:flex;align-items:center;gap:10px;margin-bottom:6px}
.tc .tc-head h2{display:flex;align-items:center;gap:10px;margin:0;font-size:1.22rem}
.tc .num{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:50%;background:linear-gradient(135deg,var(--tc-accent),var(--tc-accent2));color:var(--tc-on);font-size:.82rem;font-weight:800}
body.dark .tc .num{background:var(--tc-accent)}
.tc .tc-sub{color:var(--tc-muted);margin:0 0 14px;font-size:.92rem}

/* 按鈕與表單 */
.tc button,.tc select,.tc textarea{font:inherit}
.tc button,.tc select{border:1px solid var(--tc-border);border-radius:10px;padding:9px 14px;background:var(--tc-panel);color:var(--tc-fg);transition:border-color .12s,background .12s,transform .1s}
.tc button{cursor:pointer}
.tc button:hover:not(:disabled),.tc select:hover{border-color:var(--tc-accent)}
.tc button:active:not(:disabled){transform:scale(.98)}
.tc button:disabled{opacity:.42;cursor:not-allowed}
.tc button.primary{background:linear-gradient(135deg,var(--tc-accent),var(--tc-accent2));color:var(--tc-on);border-color:transparent;font-weight:700;box-shadow:0 6px 16px rgba(22,89,174,.25)}
body.dark .tc button.primary{background:var(--tc-accent);box-shadow:none}
.tc button.primary:hover:not(:disabled){filter:brightness(1.07);border-color:transparent}
.tc button:focus-visible,.tc textarea:focus-visible,.tc select:focus-visible,.tc input:focus-visible+.track,.tc-top a:focus-visible,.tc-theme:focus-visible{outline:3px solid #3b82f6;outline-offset:2px}

.tc .tc-controls{display:flex;flex-wrap:wrap;align-items:flex-end;gap:14px 18px;margin:12px 0 16px;padding:14px 16px;border:1px solid var(--tc-border);border-radius:14px;background:var(--tc-field)}
.tc .tc-field{display:flex;flex-direction:column;gap:5px}
.tc .tc-field label{font-size:.8rem;font-weight:650;color:var(--tc-muted)}
.tc .tc-actions{display:flex;flex-wrap:wrap;gap:8px;margin-left:auto}
.tc .tc-actions .primary{padding:10px 22px}

/* 開關 */
.tc .switch{display:inline-flex;align-items:center;gap:10px;cursor:pointer;font-size:.92rem;padding:9px 0}
.tc .switch input{position:absolute;opacity:0;width:1px;height:1px}
.tc .track{position:relative;flex:none;width:40px;height:23px;border-radius:999px;background:var(--tc-border);transition:background .15s}
.tc .track::after{content:"";position:absolute;left:3px;top:3px;width:17px;height:17px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .15s}
.tc .switch input:checked+.track{background:var(--tc-accent)}
.tc .switch input:checked+.track::after{transform:translateX(17px)}

/* 雙欄編輯區 */
.tc .tc-editors{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.tc .tc-col{min-width:0}
.tc .tc-label{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.tc .tc-label label{font-weight:650}
.tc .tc-count{font-size:.78rem;color:var(--tc-muted);background:var(--tc-soft);border-radius:999px;padding:1px 10px;min-height:1.5em;font-variant-numeric:tabular-nums}
.tc .tc-count:empty{visibility:hidden}
.tc textarea{display:block;width:100%;min-height:250px;resize:vertical;border:1px solid var(--tc-border);border-radius:12px;padding:14px;background:var(--tc-field);color:inherit;line-height:1.75}
.tc textarea:focus{border-color:var(--tc-accent);background:var(--tc-panel)}
.tc textarea.out{background:var(--tc-soft)}
.tc .tc-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.tc .tc-status{min-height:1.5em;margin:12px 0 4px;color:var(--tc-ok);font-weight:650;font-size:.9rem}
.tc .tc-note{margin:8px 0 0;font-size:.86rem;line-height:1.7;color:var(--tc-muted)}
.tc kbd{font:inherit;font-size:.8rem;border:1px solid var(--tc-border);border-bottom-width:2px;border-radius:6px;padding:0 6px;background:var(--tc-panel)}

/* 統計卡片 */
.tc .tc-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:16px}
.tc .tc-stat{padding:10px 14px;border:1px solid var(--tc-border);border-radius:12px;background:var(--tc-field)}
.tc .tc-stat strong{display:block;font-size:1.4rem;line-height:1.3;color:var(--tc-accent);font-variant-numeric:tabular-nums}
.tc .tc-stat small{display:block;color:var(--tc-muted);font-size:.76rem;line-height:1.35}
.tc #statsSource{min-height:150px}
.tc details.tc-note summary{cursor:pointer}

/* 整理區 */
.tc .tc-group{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.tc .tc-feedback{margin:8px 0 0;color:var(--tc-muted);font-size:.9rem;min-height:1.5em}

.tc-foot{max-width:1100px;margin:0 auto;padding:6px 20px 36px;text-align:center;color:var(--tc-muted);font-size:.85rem}
.tc-foot a{color:inherit}

/* 提示 toast */
.tc-toast{position:fixed;left:50%;bottom:26px;transform:translate(-50%,10px);max-width:90vw;text-align:center;padding:9px 18px;border-radius:999px;background:#1a2438;color:#fff;font-size:.88rem;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:30}
.tc-toast.show{opacity:1;transform:translate(-50%,0)}
body.dark .tc-toast{background:#e8eef9;color:#0b1730}

@media(max-width:800px){
  .tc .tc-editors{grid-template-columns:1fr}
  .tc textarea{min-height:190px}
  .tc .tc-actions{margin-left:0;width:100%}
  .tc .tc-actions .primary{flex:1}
  .tc .tc-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:480px){
  .tc{padding:16px 13px 32px}
  .tc-top-inner{padding:0 13px}
  .tc .tc-hero{padding:22px 18px;border-radius:18px}
  .tc .tc-card{padding:16px}
  .tc .tc-controls{padding:12px}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
