/* ══════════════════════════════════════════════════════════════
   单页工具模板 · 共享样式（W1，2026-11-11）
   沿用站点 2027 星霓暖赛博令牌，只作用在本模板的 .tp- 前缀上。
   新增工具只需在 app.py 的 TOOL_PAGES 里加一条配置，不用改这里。
   ══════════════════════════════════════════════════════════════ */

.tp-hero{text-align:center;padding:8px 0 24px}
.tp-kicker{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;letter-spacing:1px;
  color:var(--gold-hi);border:1px solid var(--border);border-radius:20px;padding:6px 14px;
  background:var(--card);margin-bottom:16px;max-width:100%}
.tp-kicker .ic{width:15px;height:15px;flex:0 0 15px}
.tp-hero h1{font-size:clamp(26px,4.4vw,40px);font-weight:800;letter-spacing:1.5px;line-height:1.24;
  background:var(--gold-grad);-webkit-background-clip:text;background-clip:text;color:transparent;
  word-break:break-word}
.tp-sub{color:var(--muted);font-size:14.5px;line-height:1.85;max-width:760px;margin:14px auto 0}
.tp-badges{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin-top:16px;list-style:none;padding:0}
.tp-badges li{font-size:12px;color:var(--gold-hi);border:1px solid var(--border);background:var(--card);
  border-radius:18px;padding:5px 13px}

.tp-card{position:relative;border:1px solid var(--border);border-radius:var(--radius);background:var(--card);
  padding:22px;overflow:hidden;margin-bottom:16px;min-width:0}
.tp-card-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap;
  margin-bottom:14px}
.tp-card-head h2{font-size:17px;font-weight:700;letter-spacing:1px;color:var(--text);
  display:flex;align-items:center;gap:8px}
.tp-card-head h2 em{font-style:normal;font-size:12px;color:var(--gold-hi);border:1px solid var(--border);
  border-radius:12px;padding:2px 8px;background:rgba(244,114,182,.08)}
.tp-card-head span{font-size:12px;color:var(--muted)}

.tp-grid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:16px;align-items:start;
  margin-bottom:16px}
.tp-grid > .tp-card{margin-bottom:0}

/* 按钮：统一 44px 硬线 */
.tp-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 16px;
  border-radius:12px;font-size:14px;font-weight:600;border:1px solid var(--border);
  background:var(--card);color:var(--gold-hi);transition:all .18s ease;cursor:pointer;
  text-decoration:none;line-height:1.2;white-space:nowrap}
.tp-btn:hover{border-color:var(--border-hi);background:var(--card-hi);color:var(--gold-hi)}
.tp-btn:disabled,.tp-btn[aria-disabled="true"]{opacity:.45;cursor:not-allowed;transform:none!important}
.tp-btn-main{background:var(--gold-grad);color:#2a1035;border-color:transparent;
  box-shadow:0 4px 20px rgba(192,132,252,.32)}
.tp-btn-main:hover{color:#2a1035;transform:translateY(-1px);box-shadow:0 8px 26px rgba(192,132,252,.45)}
.tp-btn-ok{color:var(--ok);border-color:rgba(110,231,183,.35);background:rgba(110,231,183,.07)}
.tp-btn-ghost{color:var(--muted)}
.tp-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}

.tp-privacy{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--ok);
  border:1px solid rgba(110,231,183,.3);background:rgba(110,231,183,.06);border-radius:16px;
  padding:5px 11px;line-height:1.5}
.tp-privacy .ic{width:13px;height:13px;flex:0 0 13px}

.tp-err{margin-top:12px;font-size:13px;line-height:1.7;color:var(--danger);
  border:1px solid rgba(251,113,133,.35);background:rgba(251,113,133,.07);border-radius:10px;
  padding:10px 12px;white-space:pre-line}
.tp-err[hidden]{display:none}
.tp-hint{margin-top:10px;font-size:12px;color:var(--muted);line-height:1.7}

.tp-empty{display:flex;align-items:center;min-height:96px}
.tp-empty[hidden]{display:none}
.tp-empty p{font-size:13px;line-height:1.9;color:var(--muted)}
.tp-empty b{color:var(--gold-hi)}

/* 文件投放区（上传类工具共用） */
.tp-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;
  min-height:168px;border:2px dashed rgba(192,132,252,.32);border-radius:14px;
  background:rgba(16,9,26,.35);padding:22px 16px;text-align:center;cursor:pointer;
  transition:border-color .18s ease,background .18s ease}
.tp-drop:hover,.tp-drop.active{border-color:var(--border-hi);background:rgba(244,114,182,.08)}
.tp-drop b{font-size:15px;color:var(--text)}
.tp-drop small{font-size:12px;color:var(--muted);line-height:1.7}
.tp-drop .tp-btn{pointer-events:none}

/* 表格（预览类工具共用） */
.tp-table-wrap{max-height:420px;overflow:auto;border:1px solid var(--border);border-radius:12px;margin-top:12px}
.tp-table{width:100%;border-collapse:collapse;font-size:13px}
.tp-table th,.tp-table td{padding:9px 12px;text-align:left;border-bottom:1px solid rgba(192,132,252,.14);
  white-space:nowrap}
.tp-table th{position:sticky;top:0;background:#241534;color:var(--gold-hi);font-weight:600;z-index:1}
.tp-table td{color:var(--text)}
.tp-table tr:last-child td{border-bottom:0}
.tp-table td small{color:var(--muted);font-size:11.5px}
.tp-table .num{color:var(--muted);font-size:11.5px;font-family:"Consolas",monospace}

/* 下载页（EXE 类）共用 */
.tp-dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:4px 0 16px}
.tp-dl-item{font-size:12px;color:var(--muted);display:flex;flex-direction:column;gap:5px;min-width:0}
.tp-dl-item b{font-size:13.5px;color:var(--text);font-weight:600;line-height:1.5;word-break:break-word}
.tp-warn{border:1px solid rgba(251,191,36,.35);background:rgba(251,191,36,.07);border-radius:12px;
  padding:14px 16px;margin:12px 0}
.tp-warn h3{font-size:14px;color:#fcd34d;margin-bottom:8px;display:flex;align-items:center;gap:6px}
.tp-warn ol{margin:0;padding-left:20px;font-size:12.5px;line-height:1.9;color:var(--muted)}
.tp-warn li b{color:var(--text)}
.tp-hash{font-family:"Consolas",monospace;font-size:11.5px;color:var(--muted);word-break:break-all;
  background:rgba(16,9,26,.5);border:1px solid var(--border);border-radius:8px;padding:8px 10px;
  margin-top:6px;display:block;line-height:1.6}

/* 使用说明 */
.tp-steps{margin:0;padding-left:22px}
.tp-steps li{font-size:13px;line-height:1.95;color:var(--muted);margin-bottom:4px}
.tp-steps li b{color:var(--text)}

/* 名词解释 + ? 气泡 */
.tp-gloss-list{margin:0}
.tp-gloss-list > div{border-top:1px dashed rgba(192,132,252,.18);padding:12px 0}
.tp-gloss-list > div:first-child{border-top:0;padding-top:0}
.tp-gloss-list dt{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:600;color:var(--text);
  flex-wrap:wrap}
.tp-gloss-list dd{margin:6px 0 0;font-size:12.5px;line-height:1.8;color:var(--muted)}
.tp-q-wrap{position:relative;display:inline-flex}
.tp-q{width:22px;height:22px;flex:0 0 22px;border-radius:50%;border:1px solid var(--border);
  background:rgba(244,114,182,.10);color:var(--gold-hi);font-size:12px;font-weight:700;line-height:1;
  display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.tp-q:hover,.tp-q[aria-expanded="true"]{border-color:var(--border-hi);background:rgba(244,114,182,.2)}
.tp-tip{position:absolute;z-index:30;left:0;top:28px;width:min(320px,78vw);font-size:12.5px;line-height:1.8;
  color:var(--text);background:#241534;border:1px solid var(--border-hi);border-radius:12px;
  padding:10px 12px;box-shadow:0 12px 30px rgba(6,2,14,.6);font-weight:400}
.tp-tip[hidden]{display:none}

/* 信息栏 */
.tp-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}
.tp-meta-item{font-size:12px;color:var(--muted);display:flex;flex-direction:column;gap:5px;min-width:0}
.tp-meta-item b{font-size:13.5px;color:var(--text);font-weight:600;line-height:1.5;word-break:break-word}
.tp-meta-item a{color:var(--gold-hi);text-decoration:none}
.tp-meta-item a:hover{text-decoration:underline}

/* 作者 / 联系我们 */
.tp-cta{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.tp-cta-txt{font-size:13px;color:var(--muted);line-height:1.85;min-width:0}
.tp-cta-txt b{color:var(--gold-hi)}

/* 移动端 */
@media (max-width:820px){
  .tp-hero{padding:4px 0 18px}
  .tp-sub{font-size:13px}
  .tp-grid{grid-template-columns:1fr;gap:12px}
  .tp-card{padding:16px;border-radius:14px}
  .tp-actions .tp-btn{flex:1 1 auto}
  .tp-privacy{width:100%;justify-content:center}
  .tp-q{width:26px;height:26px;flex-basis:26px;position:relative}
  .tp-q::after{content:"";position:absolute;left:50%;top:50%;width:44px;height:44px;
    transform:translate(-50%,-50%)}
  .tp-gloss-list dt{flex-wrap:wrap}
  .tp-tip{position:static;left:auto;top:auto;width:100%;flex:1 0 100%;margin-top:8px;box-shadow:none}
  .tp-table-wrap{margin-left:-4px;margin-right:-4px}
}
@media (max-width:360px){
  .tp-hero h1{font-size:24px;letter-spacing:1px}
  .tp-badges li{font-size:11.5px;padding:4px 10px}
  .tp-card{padding:14px}
  .tp-btn{padding:0 13px;font-size:13.5px}
}
/* 分片下载进度（T53） */
.tp-prog{margin:10px 0 4px}
.tp-prog-bar{height:8px;border-radius:999px;background:rgba(255,255,255,.12);overflow:hidden}
.tp-prog-bar i{display:block;height:100%;width:0;border-radius:999px;
  background:linear-gradient(90deg,#3ee0c0,#5b9dff);transition:width .25s ease}
.tp-more{margin-top:12px;border-top:1px dashed rgba(255,255,255,.14);padding-top:10px}
.tp-more summary{cursor:pointer;font-size:13px;color:#8fd8ff;min-height:44px;display:flex;align-items:center}
.tp-more code{display:block;margin:6px 0}
@media(max-width:480px){.tp-more summary{min-height:44px}}

/* ══════════════════ 看讲解（可复用片段 _watch.html 专用） ══════════════════ */
.tp-watch{border:1px solid var(--border);border-radius:var(--radius);background:var(--card);
  padding:20px 22px 22px;margin-bottom:16px;min-width:0}
.tp-watch-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;
  flex-wrap:wrap;margin:0 0 14px}
.tp-watch-head h2{margin:0;font-size:17px}
.tp-watch-head span{color:var(--muted);font-size:12.5px}
.tp-watch-grid{display:grid;grid-template-columns:minmax(0,1.62fr) minmax(0,1fr);gap:18px;align-items:start}
/* 圆角 18px；边框交给被嵌页面自己画，避免双层描边 */
.tp-watch-frame{position:relative;width:100%;aspect-ratio:16/9;border-radius:18px;overflow:hidden;
  background:#0d0713}
.tp-watch-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0;display:block}
.tp-watch-hold{display:grid;place-items:center;background:
  radial-gradient(340px 180px at 26% 24%,rgba(244,114,182,.22),transparent 62%),
  radial-gradient(320px 170px at 76% 78%,rgba(129,90,255,.24),transparent 64%),#0d0713}
.tp-watch-hold-in{text-align:center;padding:16px 14px;color:var(--muted);font-size:12.5px;line-height:1.7}
.tp-watch-hold-in b{display:block;color:var(--text);font-size:13.5px;margin:6px 0 4px}
.tp-watch-hold-in i{display:block;font-style:normal;max-width:34em}
.tp-watch-dot{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:50%;
  background:rgba(244,114,182,.18);color:var(--gold-hi);font-size:13px}
.tp-watch-side{min-width:0}
.tp-watch-side h3{margin:2px 0 8px;font-size:14.5px}
.tp-watch-side p{margin:0 0 12px;color:var(--muted);font-size:13px;line-height:1.7}
.tp-watch-dl{width:100%;justify-content:center;text-align:center;min-height:46px}
.tp-watch-note{margin:8px 0 0;font-size:11.5px;color:var(--muted);text-align:center}
.tp-watch-hint{margin:12px 0 0}
/* 主持稿文字稿：次级灰字链接，视觉上让位于主 PDF 按钮 */
.tp-watch-txt{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:40px;
  margin-top:2px;font-size:12px;color:var(--muted);text-decoration:underline;
  text-underline-offset:3px;text-decoration-thickness:1px;border-radius:10px;transition:color .18s ease}
.tp-watch-txt:hover,.tp-watch-txt:focus-visible{color:var(--gold-hi)}
@media (max-width:879px){ .tp-watch-grid{grid-template-columns:1fr} }
@media (max-width:520px){
  /* 320 下播放器满屏宽（16:9 = 180px），整块做横向出血，文字仍留 14px 内边距 */
  .tp-watch{margin-left:-13px;margin-right:-13px;border-radius:0;border-left:0;border-right:0;
    padding:16px 0 18px}
  .tp-watch-head{padding:0 14px;margin-bottom:12px}
  .tp-watch-side{padding:0 14px}
}

/* ══════════════════ 工具页统一折叠（默认收起） ══════════════════
   结构：.tp-fold[data-fold=key] > button.tp-fold-btn + div.tp-fold-body
   收起用 hidden，不占位、不残留高度；标题条整行可点，最小 52px。 */
.tp-fold{padding:0}
.tp-fold-btn{display:flex;align-items:center;gap:10px;width:100%;min-height:56px;
  padding:15px 20px;background:none;border:0;border-radius:var(--radius);color:var(--text);
  font:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}
.tp-fold-btn:hover,.tp-fold-btn:focus-visible{color:var(--gold-hi)}
.tp-fold-btn:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}
.tp-fold-title{font-size:17px;font-weight:700;letter-spacing:1px;line-height:1.4;min-width:0}
.tp-fold-note{margin-left:auto;font-size:12.5px;color:var(--muted);line-height:1.5;text-align:right;
  min-width:0;word-break:break-word}
.tp-fold-mark{position:relative;flex:0 0 24px;width:24px;height:24px;margin-left:8px;
  border-radius:50%;border:1px solid var(--border);background:rgba(244,114,182,.10);
  transition:background .18s ease,border-color .18s ease}
.tp-fold-mark::before,.tp-fold-mark::after{content:"";position:absolute;left:50%;top:50%;
  background:var(--gold-hi);border-radius:2px;transform:translate(-50%,-50%)}
.tp-fold-mark::before{width:11px;height:2px}
.tp-fold-mark::after{width:2px;height:11px;transition:transform .18s ease,opacity .18s ease}
.tp-fold[data-open="1"] .tp-fold-mark{background:rgba(244,114,182,.22);border-color:var(--border-hi)}
.tp-fold[data-open="1"] .tp-fold-mark::after{opacity:0;transform:translate(-50%,-50%) rotate(90deg)}
.tp-fold-body{padding:0 20px 20px;min-width:0}
.tp-fold-body[hidden]{display:none}

/* 全部展开 / 收起 */
.tp-foldbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 14px;padding:0 2px}
.tp-foldbar-t{font-size:12.5px;color:var(--muted);line-height:1.6;min-width:0}
.tp-foldbar-btns{margin-left:auto;display:flex;gap:8px}
.tp-foldbar-btn{min-height:44px;padding:0 14px;border-radius:999px;cursor:pointer;
  border:1px solid var(--border);background:rgba(53,32,69,.5);color:var(--text);font-size:13px;
  font-family:inherit;line-height:1;transition:all .18s ease}
.tp-foldbar-btn:hover{color:var(--gold-hi);border-color:var(--border-hi);background:var(--card-hi)}
.tp-foldbar-btn:focus-visible{outline:2px solid var(--gold);outline-offset:2px}

@media (max-width:820px){
  .tp-fold-btn{padding:14px 16px;min-height:54px}
}
@media (max-width:520px){
  .tp-fold-btn{flex-wrap:nowrap;padding:13px 14px;min-height:52px;gap:8px}
  .tp-fold-title{font-size:15.5px;flex:0 0 auto}
  .tp-fold-mark{order:3;margin-left:2px}
  .tp-fold-note{order:2;flex:1 1 auto;margin:0;text-align:right;font-size:11px;min-width:0;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .tp-fold-body{padding:0 14px 16px}
  .tp-foldbar{gap:8px}
  .tp-foldbar-t{order:2;flex:1 1 100%;font-size:11.5px}
  .tp-foldbar-btns{order:1;flex:1 1 100%}
  .tp-foldbar-btn{flex:1 1 0}
  /* 看讲解折叠后：标题条跟着出血，正文回到 14px 内边距 */
  .tp-watch.tp-fold{padding:0}
  .tp-watch .tp-fold-body{padding:0 14px 16px}
}

/* ══════════════════ 一键分享（模板层通用，全站工具页自动带上） ══════════════════ */
.tp-share{display:flex;align-items:center;justify-content:space-between;gap:20px;
  border:1px solid var(--border);border-radius:var(--radius);background:var(--card);
  padding:16px 18px;margin:0 0 16px;min-width:0}
.tp-share-txt{min-width:0}
.tp-share-title{font-size:15px;font-weight:700;letter-spacing:1px;color:var(--text)}
.tp-share-desc{margin-top:6px;font-size:12.5px;line-height:1.7;color:var(--muted)}
.tp-share-url{margin-top:6px;font-size:11.5px;line-height:1.6;color:var(--muted);
  word-break:break-all;opacity:.85}
.tp-share-acts{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}
.tp-share-fig{flex:0 0 auto;margin:0;text-align:center;min-width:0}
.tp-share-qr{width:112px;height:112px;padding:5px;box-sizing:border-box;border-radius:12px;
  background:#fff;border:1px solid var(--border);overflow:hidden}
.tp-share-qr img{display:block;width:100%;height:100%;image-rendering:pixelated}
.tp-share-cap{margin-top:6px;font-size:11px;line-height:1.5;color:var(--muted);white-space:nowrap}
.tp-copy-tmp{position:fixed;left:-9999px;top:0;opacity:0;pointer-events:none}

@media (max-width:640px){
  .tp-share{flex-wrap:wrap;gap:12px;padding:14px}
  .tp-share-fig{order:1;width:auto;display:flex;flex-direction:column;align-items:center;gap:6px}
  .tp-share-qr{width:100px;height:100px}
  .tp-share-cap{margin:0;font-size:10.5px;line-height:1.4;white-space:nowrap;max-width:none}
  .tp-share-txt{order:2;flex:1 1 0;min-width:0}
  .tp-share-desc,.tp-share-url{display:none}
  .tp-share-acts{flex-direction:column;gap:8px;margin-top:10px}
  .tp-share-acts .tp-btn{width:100%}
}
@media (max-width:360px){
  .tp-share{padding:12px}
  .tp-share-qr{width:92px;height:92px}
}
