/* ==========================================================================
   小妖工具箱 · 全站样式表
   设计原则：明快、干净、信息优先。无弹窗、无浮层、无强制登录。
   ========================================================================== */

/* ---------- 1. 变量 ---------- */
:root{
  --brand:        #16a34a;
  --brand-dark:   #15803d;
  --brand-hover:  #149040;
  --brand-light:  #f0fdf4;
  --brand-border: #bbf7d0;
  --brand-text:   #166534;

  --ink:    #0f172a;
  --ink-2:  #475569;
  --ink-3:  #94a3b8;
  --ink-4:  #cbd5e1;

  --line:   #e2e8f0;
  --line-2: #f1f5f9;
  --bg:     #f8fafc;
  --card:   #ffffff;

  --warn-bg:   #fffbeb;
  --warn-line: #fcd34d;
  --warn-text: #92400e;
  --err-bg:    #fef2f2;
  --err-line:  #fca5a5;
  --err-text:  #b91c1c;
  --info-bg:   #eff6ff;
  --info-line: #bfdbfe;
  --info-text: #1e40af;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;

  --shadow-1: 0 1px 2px rgba(15,23,42,.04);
  --shadow-2: 0 2px 8px rgba(15,23,42,.06);
  --shadow-3: 0 8px 24px rgba(15,23,42,.08);

  --nav-h: 60px;
  --wrap:  1200px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono",
          Menlo, monospace;
}

/* ---------- 2. Reset ---------- */
*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
body{
  margin:0;
  font-family:var(--font);
  font-size:15px;
  line-height:1.7;
  color:var(--ink);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
h1,h2,h3,h4,h5,h6,p,figure,blockquote,dl,dd{ margin:0; }
ul,ol{ margin:0; padding:0; list-style:none; }
img,svg,video{ display:block; max-width:100%; }
a{ color:inherit; text-decoration:none; }
button,input,select,textarea{ font:inherit; color:inherit; }
button{ cursor:pointer; background:none; border:none; padding:0; }
table{ border-collapse:collapse; width:100%; }
code,kbd,pre{ font-family:var(--mono); }

.wrap{ max-width:var(--wrap); margin:0 auto; padding:0 20px; }
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* ---------- 3. 顶栏 ---------- */
.topbar{
  position:sticky; top:0; z-index:50;
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--line);
}
.topbar-in{
  height:var(--nav-h);
  display:flex; align-items:center; gap:24px;
  max-width:var(--wrap); margin:0 auto; padding:0 20px;
}
.logo{ display:flex; align-items:center; gap:9px; flex:none; }
/* 站点小妖形象。图是透明底的头部特写，小尺寸下比全身半身更能看清脸 */
.logo-img{
  width:40px; height:40px; flex:none;
  object-fit:contain;
  transition:transform .18s ease;
}
.logo:hover .logo-img{ transform:translateY(-1px) scale(1.04); }
.logo-text{ font-size:16px; font-weight:600; letter-spacing:-.01em; white-space:nowrap; }
.logo-text em{ font-style:normal; color:var(--brand); }

.topnav{ display:flex; align-items:center; gap:2px; flex:1; min-width:0; overflow:hidden; }
.topnav a{
  padding:7px 11px; border-radius:var(--r-sm); font-size:14px;
  color:var(--ink-2); white-space:nowrap; transition:background .15s, color .15s;
}
.topnav a:hover{ background:var(--line-2); color:var(--ink); }
.topnav a.active{ background:var(--brand-light); color:var(--brand-text); font-weight:500; }

.topsearch{ position:relative; flex:none; width:230px; }
.topsearch input{
  width:100%; height:36px; padding:0 12px 0 34px;
  border:1px solid var(--line); border-radius:18px;
  background:var(--bg); font-size:14px; outline:none;
  transition:border-color .15s, background .15s;
}
.topsearch input:focus{ border-color:var(--brand); background:#fff; box-shadow:0 0 0 3px var(--brand-light); }
.topsearch svg{ position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--ink-3); pointer-events:none; }

.nav-toggle{ display:none; width:36px; height:36px; border-radius:var(--r-sm);
  align-items:center; justify-content:center; color:var(--ink-2); }
.nav-toggle:hover{ background:var(--line-2); }

.mobilenav{ display:none; border-top:1px solid var(--line); background:#fff; padding:10px 20px 16px; }
.mobilenav.open{ display:block; }
.mobilenav a{ display:block; padding:9px 4px; font-size:14px; color:var(--ink-2); border-bottom:1px solid var(--line-2); }

/* ---------- 4. 通用区块 ---------- */
.section{ padding:34px 0 6px; }
.section-head{ display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.section-head h2{ font-size:19px; font-weight:600; letter-spacing:-.01em; display:flex; align-items:center; gap:9px; }
.section-head h2::before{
  content:""; width:3px; height:17px; border-radius:2px; background:var(--brand); flex:none;
}
/* 标题前带图标方块时，就不再重复那条绿杠 */
.section-head .sico + h2::before{ display:none; }
.section-head .cnt{
  font-size:12px; color:var(--brand-text); background:var(--brand-light);
  border:1px solid var(--brand-border); padding:1px 8px; border-radius:20px; font-weight:500;
}
.section-head .more{ margin-left:auto; font-size:13px; color:var(--ink-3); }
.section-head .more:hover{ color:var(--brand); }
.section-sub{ font-size:13.5px; color:var(--ink-3); margin:-8px 0 16px; }

/* ---------- 5. 首页 Hero ---------- */
.hero{
  background:linear-gradient(180deg,#f0fdf4 0%,var(--bg) 100%);
  border-bottom:1px solid var(--line);
  padding:46px 0 40px;
}
.hero h1{
  font-size:31px; font-weight:700; letter-spacing:-.02em; line-height:1.3;
  margin-bottom:10px;
}
.hero h1 em{ font-style:normal; color:var(--brand); }
.hero p{ font-size:15px; color:var(--ink-2); max-width:640px; margin-bottom:22px; }

.hero-search{ position:relative; max-width:560px; margin-bottom:24px; }
.hero-search input{
  width:100%; height:48px; padding:0 18px 0 46px;
  border:1px solid var(--line); border-radius:24px; background:#fff;
  font-size:15px; outline:none; box-shadow:var(--shadow-1);
  transition:border-color .15s, box-shadow .15s;
}
.hero-search input:focus{ border-color:var(--brand); box-shadow:0 0 0 4px var(--brand-light); }
.hero-search svg{ position:absolute; left:17px; top:50%; transform:translateY(-50%); color:var(--ink-3); }

.hero-stats{ display:flex; flex-wrap:wrap; gap:28px; }
.hero-stats div{ font-size:13px; color:var(--ink-3); }
.hero-stats strong{ display:block; font-size:20px; font-weight:600; color:var(--ink); line-height:1.35; font-variant-numeric:tabular-nums; }

/* ---------- 6. 工具卡片网格 ---------- */
.grid{ display:grid; gap:12px; }
.grid.cols-3{ grid-template-columns:repeat(3,minmax(0,1fr)); }
.grid.cols-4{ grid-template-columns:repeat(4,minmax(0,1fr)); }
.grid.cols-2{ grid-template-columns:repeat(2,minmax(0,1fr)); }

.tool-card{
  display:flex; align-items:flex-start; gap:12px;
  background:var(--card); border:1px solid var(--line); border-radius:var(--r);
  padding:14px 16px; transition:border-color .15s, box-shadow .15s, transform .15s;
}
.tool-card:hover{
  border-color:var(--brand-border); box-shadow:var(--shadow-2); transform:translateY(-1px);
}
.tool-card .ico{
  width:34px; height:34px; border-radius:9px; flex:none;
  display:flex; align-items:center; justify-content:center;
  background:var(--brand-light); color:var(--brand-dark);
  border:1px solid var(--brand-border);
  font-size:14px; font-weight:600;
}
.tool-card .ico svg{ display:block; }
/* 悬停时图标块变实心，给一点反馈 */
.tool-card:hover .ico{ background:var(--brand); color:#fff; border-color:var(--brand); }
.tool-card .txt{ min-width:0; flex:1; }
.tool-card .nm{
  font-size:14.5px; font-weight:500; color:var(--ink);
  margin-bottom:3px; display:block;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.tool-card .ds{
  font-size:12.5px; color:var(--ink-3); line-height:1.55; margin:0;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.tool-card.compact .ds{ display:none; }
.tool-card.compact{ padding:11px 14px; }
.tool-card.compact .ico{ width:28px; height:28px; border-radius:8px; font-size:12px; }

/* ---------- 7. 分类页头 ---------- */
.page-head{ background:#fff; border-bottom:1px solid var(--line); padding:26px 0 24px; }
.crumb{ font-size:13px; color:var(--ink-3); margin-bottom:12px; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.crumb a:hover{ color:var(--brand); }
.crumb span{ color:var(--ink-4); }
.page-head h1{ font-size:26px; font-weight:700; letter-spacing:-.015em; margin-bottom:8px; }
.page-head .lede{ font-size:14.5px; color:var(--ink-2); max-width:720px; }
.page-head .meta{ margin-top:12px; font-size:13px; color:var(--ink-3); display:flex; gap:16px; flex-wrap:wrap; }

/* ---------- 8. 工具页：头部 ---------- */
.tool-head{ background:#fff; border-bottom:1px solid var(--line); padding:24px 0 20px; }
.tool-head h1{ font-size:25px; font-weight:700; letter-spacing:-.015em; margin-bottom:9px; }
.tool-head .lede{ font-size:14.5px; color:var(--ink-2); max-width:800px; }
.tool-head .badges{ margin-top:12px; display:flex; gap:8px; flex-wrap:wrap; }
.badge{
  font-size:12px; padding:2px 9px; border-radius:20px;
  background:var(--line-2); color:var(--ink-2); border:1px solid var(--line);
}
.badge.green{ background:var(--brand-light); color:var(--brand-text); border-color:var(--brand-border); }

/* ---------- 8b. 图标方块（分类头 / 工具页头 / 区块头共用） ---------- */
.pico,.sico{
  display:flex; align-items:center; justify-content:center; flex:none;
  background:var(--brand-light); color:var(--brand-dark);
  border:1px solid var(--brand-border);
}
.pico svg,.sico svg{ display:block; }
.sico{ width:28px; height:28px; border-radius:8px; }
/* 标题 + 图标并排 */
.head-title{ display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.head-title h1{ margin-bottom:0; }
.pico{ width:38px; height:38px; border-radius:11px; }
.pico.lg{ width:45px; height:45px; border-radius:13px; }

/* ---------- 9. 同族工具标签栏 ---------- */
.grouptabs{
  background:#fff; border-bottom:1px solid var(--line);
  position:sticky; top:var(--nav-h); z-index:40;
}
.grouptabs-in{
  display:flex; align-items:center; gap:6px;
  overflow-x:auto; scrollbar-width:none; padding:9px 0;
}
.grouptabs-in::-webkit-scrollbar{ display:none; }
.grouptabs .gt-label{ font-size:12px; color:var(--ink-3); flex:none; padding-right:4px; }
.grouptabs a{
  flex:none; font-size:13.5px; padding:5px 12px; border-radius:16px;
  color:var(--ink-2); border:1px solid transparent; white-space:nowrap;
  transition:background .15s, color .15s;
}
.grouptabs a:hover{ background:var(--line-2); color:var(--ink); }
.grouptabs a.on{
  background:var(--brand-light); color:var(--brand-text); font-weight:500;
  border-color:var(--brand-border);
}
.grouptabs .more-btn{ color:var(--brand); font-weight:500; }
.grouptabs .more-btn:hover{ background:var(--brand-light); }

/* ---------- 10. 工具面板 ---------- */
.tool-panel{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r-lg);
  padding:20px; margin:24px 0 0;
}
.panel-label{
  font-size:13px; font-weight:500; color:var(--ink-2);
  margin-bottom:8px; display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.panel-label .hint{ font-weight:400; color:var(--ink-3); font-size:12.5px; }

textarea.field, input.field, select.field{
  width:100%; border:1px solid var(--line); border-radius:var(--r);
  background:var(--bg); padding:11px 13px; font-size:14px; outline:none;
  transition:border-color .15s, background .15s, box-shadow .15s;
}
textarea.field{ min-height:190px; resize:vertical; font-family:var(--mono); font-size:13.5px; line-height:1.65; }
input.field, select.field{ height:40px; border-radius:var(--r-sm); }
select.field{ cursor:pointer; padding-right:32px;
  appearance:none;
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center;
}
textarea.field:focus, input.field:focus, select.field:focus{
  border-color:var(--brand); background:#fff; box-shadow:0 0 0 3px var(--brand-light);
}
textarea.field::placeholder, input.field::placeholder{ color:var(--ink-4); }

.actions{ display:flex; flex-wrap:wrap; gap:8px; margin:14px 0 0; }
.btn{
  height:36px; padding:0 16px; border-radius:var(--r-sm);
  border:1px solid var(--line); background:#fff; color:var(--ink-2);
  font-size:13.5px; display:inline-flex; align-items:center; gap:6px;
  transition:border-color .15s, background .15s, color .15s;
}
.btn:hover{ border-color:var(--ink-4); color:var(--ink); background:var(--bg); }
.btn.primary{ background:var(--brand); border-color:var(--brand); color:#fff; font-weight:500; }
.btn.primary:hover{ background:var(--brand-hover); border-color:var(--brand-hover); color:#fff; }
.btn.ghost{ background:transparent; border-color:transparent; color:var(--ink-3); }
.btn.ghost:hover{ background:var(--line-2); color:var(--ink-2); }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

/* ---------- 11. 表单计算型 ---------- */
.form-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.form-grid.one{ grid-template-columns:1fr; }
.form-item label{ display:block; font-size:13px; font-weight:500; color:var(--ink-2); margin-bottom:6px; }
.form-item .fhint{ font-size:12px; color:var(--ink-3); margin-top:5px; line-height:1.5; }
.form-item.full{ grid-column:1 / -1; }
.input-group{ display:flex; gap:8px; }
.input-group select{ flex:none; width:150px; }

input[type=range]{ width:100%; height:6px; border-radius:3px; appearance:none;
  background:var(--line); outline:none; margin:12px 0; }
input[type=range]::-webkit-slider-thumb{
  appearance:none; width:18px; height:18px; border-radius:50%;
  background:var(--brand); border:2px solid #fff; box-shadow:var(--shadow-2); cursor:pointer;
}
input[type=range]::-moz-range-thumb{
  width:18px; height:18px; border-radius:50%; background:var(--brand);
  border:2px solid #fff; cursor:pointer;
}
.range-row{ display:flex; align-items:center; gap:12px; }
.range-row .rv{ font-size:13px; font-weight:600; color:var(--brand-text);
  background:var(--brand-light); padding:3px 10px; border-radius:var(--r-sm);
  font-variant-numeric:tabular-nums; flex:none; min-width:52px; text-align:center; }

.check-row{ display:flex; flex-wrap:wrap; gap:8px 18px; }
.check-row label{ display:flex; align-items:center; gap:7px; font-size:13.5px; color:var(--ink-2); cursor:pointer; }
.check-row input[type=checkbox]{ width:16px; height:16px; accent-color:var(--brand); cursor:pointer; }

/* ---------- 12. 结果面板 ---------- */
.result-box{
  margin-top:16px; border:1px solid var(--line); border-radius:var(--r);
  background:var(--bg); overflow:hidden;
}
.result-box .rb-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 14px; border-bottom:1px solid var(--line); background:#fff;
}
.result-box .rb-title{ font-size:13px; font-weight:500; color:var(--ink-2); }
.result-box .rb-body{ padding:14px; }
.result-box pre{
  margin:0; font-size:13.5px; line-height:1.7; white-space:pre-wrap;
  word-break:break-all; max-height:380px; overflow:auto; color:var(--ink);
}
.result-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px;
  background:var(--line); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; }
.result-grid .rg-item{ background:#fff; padding:12px 15px; }
.result-grid .rg-item.full{ grid-column:1 / -1; }
.result-grid dt{ font-size:12.5px; color:var(--ink-3); margin-bottom:4px; }
.result-grid dd{ font-size:15px; font-weight:600; color:var(--ink); font-variant-numeric:tabular-nums; word-break:break-all; }
.result-grid dd.mono{ font-family:var(--mono); font-size:14px; font-weight:500; }

.msg{ padding:11px 15px; border-radius:var(--r-sm); font-size:13.5px; line-height:1.6; margin-top:14px; display:none; }
.msg.show{ display:block; }
.msg.warn{ background:var(--warn-bg); border:1px solid var(--warn-line); color:var(--warn-text); }
.msg.error{ background:var(--err-bg); border:1px solid var(--err-line); color:var(--err-text); }
.msg.info{ background:var(--info-bg); border:1px solid var(--info-line); color:var(--info-text); }
.msg.ok{ background:var(--brand-light); border:1px solid var(--brand-border); color:var(--brand-text); }

/* ---------- 13. 文件上传 ---------- */
.dropzone{
  border:1.5px dashed var(--line); border-radius:var(--r-lg); background:var(--bg);
  padding:34px 20px; text-align:center; cursor:pointer;
  transition:border-color .15s, background .15s;
}
.dropzone:hover,.dropzone.over{ border-color:var(--brand); background:var(--brand-light); }
.dropzone .dz-ico{ width:42px; height:42px; margin:0 auto 12px; border-radius:12px;
  background:#fff; border:1px solid var(--line); display:flex; align-items:center; justify-content:center; color:var(--brand); }
.dropzone .dz-main{ font-size:14.5px; font-weight:500; margin-bottom:5px; }
.dropzone .dz-sub{ font-size:12.5px; color:var(--ink-3); }
.dropzone .privacy{ display:inline-flex; align-items:center; gap:5px; margin-top:12px;
  font-size:12px; color:var(--brand-text); background:var(--brand-light);
  border:1px solid var(--brand-border); padding:3px 10px; border-radius:20px; }

.file-list{ margin-top:16px; display:flex; flex-direction:column; gap:8px; }
.file-row{
  display:flex; align-items:center; gap:12px; padding:10px 14px;
  border:1px solid var(--line); border-radius:var(--r-sm); background:#fff;
}
.file-row .fr-name{ flex:1; min-width:0; font-size:13.5px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-row .fr-size{ font-size:12.5px; color:var(--ink-3); flex:none; font-variant-numeric:tabular-nums; }
.file-row .fr-save{ font-size:12.5px; color:var(--brand-text); font-weight:500; flex:none; }
.file-row .fr-save:hover{ text-decoration:underline; }
.file-row .fr-thumb{ width:38px; height:38px; border-radius:var(--r-sm); object-fit:cover;
  border:1px solid var(--line); flex:none; background:var(--bg); }

/* ---------- 14. 对照表 ---------- */
.table-tools{ display:flex; gap:10px; align-items:center; margin-bottom:14px; flex-wrap:wrap; }
.table-tools .ts-input{ position:relative; flex:1; min-width:200px; }
.table-tools input{
  width:100%; height:38px; padding:0 12px 0 36px; border:1px solid var(--line);
  border-radius:var(--r-sm); background:#fff; font-size:14px; outline:none;
}
.table-tools input:focus{ border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-light); }
.table-tools svg{ position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--ink-3); }
.table-tools .count{ font-size:12.5px; color:var(--ink-3); }

.datatable{ background:#fff; border:1px solid var(--line); border-radius:var(--r); overflow:hidden; }
.datatable-scroll{ overflow-x:auto; }
.datatable table{ min-width:640px; }
.datatable th{
  text-align:left; padding:11px 15px; font-size:12.5px; font-weight:600;
  color:var(--ink-2); background:var(--bg); border-bottom:1px solid var(--line);
  white-space:nowrap; position:sticky; top:0;
}
.datatable td{
  padding:11px 15px; font-size:13.5px; border-bottom:1px solid var(--line-2);
  vertical-align:top; line-height:1.65;
}
.datatable tr:last-child td{ border-bottom:none; }
.datatable tbody tr:hover{ background:var(--brand-light); }
.datatable td.mono{ font-family:var(--mono); font-size:12.5px; word-break:break-all; }
.datatable td.code-cell{ cursor:pointer; }
.datatable td.code-cell:hover{ color:var(--brand-dark); }
.datatable .cbadge{
  display:inline-block; font-family:var(--mono); font-size:12.5px; font-weight:600;
  padding:1px 8px; border-radius:var(--r-sm); background:var(--brand-light);
  color:var(--brand-text); border:1px solid var(--brand-border);
}
.datatable .empty{ padding:40px 20px; text-align:center; color:var(--ink-3); font-size:14px; }

/* ---------- 15. 文档区块 ---------- */
.doc{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r-lg);
  padding:22px 24px; margin-top:20px;
}
.doc h2{ font-size:17px; font-weight:600; margin-bottom:14px; display:flex; align-items:center; gap:9px; }
.doc h2::before{ content:""; width:3px; height:15px; border-radius:2px; background:var(--brand); flex:none; }
.doc ol{ counter-reset:step; }
.doc ol li{
  position:relative; padding-left:32px; margin-bottom:11px;
  font-size:14px; color:var(--ink-2); line-height:1.75;
}
.doc ol li::before{
  counter-increment:step; content:counter(step);
  position:absolute; left:0; top:3px; width:21px; height:21px; border-radius:50%;
  background:var(--brand-light); color:var(--brand-text);
  font-size:11.5px; font-weight:600; display:flex; align-items:center; justify-content:center;
}
.doc ul li{ position:relative; padding-left:18px; margin-bottom:9px; font-size:14px; color:var(--ink-2); }
.doc ul li::before{ content:""; position:absolute; left:2px; top:10px;
  width:5px; height:5px; border-radius:50%; background:var(--brand); }
.doc p{ font-size:14px; color:var(--ink-2); margin-bottom:12px; }

/* ---------- 16. FAQ ---------- */
.faq-list{ display:flex; flex-direction:column; gap:2px; }
.faq-item{ border-bottom:1px solid var(--line-2); }
.faq-item:last-child{ border-bottom:none; }
.faq-item summary{
  list-style:none; cursor:pointer; padding:13px 30px 13px 0; position:relative;
  font-size:14.5px; font-weight:500; color:var(--ink); line-height:1.6;
}
.faq-item summary::-webkit-details-marker{ display:none; }
.faq-item summary::after{
  content:""; position:absolute; right:6px; top:19px; width:8px; height:8px;
  border-right:1.5px solid var(--ink-3); border-bottom:1.5px solid var(--ink-3);
  transform:rotate(45deg); transition:transform .2s;
}
.faq-item[open] summary::after{ transform:rotate(-135deg); top:22px; }
.faq-item summary:hover{ color:var(--brand-dark); }
.faq-item .a{ padding:0 30px 15px 0; font-size:14px; color:var(--ink-2); line-height:1.8; }

/* ---------- 17. 相关工具 / 底部索引 ---------- */
.cat-index{ margin-top:22px; }
.cat-index details{
  background:var(--card); border:1px solid var(--line); border-radius:var(--r-lg); overflow:hidden;
}
.cat-index summary{
  list-style:none; cursor:pointer; padding:15px 22px; font-size:14.5px; font-weight:500;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.cat-index summary::-webkit-details-marker{ display:none; }
.cat-index summary::after{
  content:""; width:8px; height:8px; border-right:1.5px solid var(--ink-3);
  border-bottom:1.5px solid var(--ink-3); transform:rotate(45deg); transition:transform .2s; flex:none;
}
.cat-index details[open] summary::after{ transform:rotate(-135deg); }
.cat-index summary:hover{ color:var(--brand-dark); }
.cat-index .ci-body{ padding:0 22px 22px; border-top:1px solid var(--line-2); padding-top:18px; }

.link-cloud{ display:flex; flex-wrap:wrap; gap:6px 4px; }
.link-cloud a{
  font-size:13px; color:var(--ink-2); padding:3px 9px; border-radius:var(--r-sm);
  transition:background .15s, color .15s;
}
.link-cloud a:hover{ background:var(--brand-light); color:var(--brand-text); }

/* ---------- 18. 页脚 ---------- */
.footer{ margin-top:56px; border-top:1px solid var(--line); background:#fff; padding:34px 0 40px; }
.footer-grid{ display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr; gap:32px; margin-bottom:28px; }
.footer h3{ font-size:13px; font-weight:600; color:var(--ink); margin-bottom:12px; letter-spacing:.01em; }
.footer p{ font-size:13px; color:var(--ink-3); line-height:1.75; }
.footer ul li{ margin-bottom:8px; }
.footer ul a{ font-size:13px; color:var(--ink-2); }
.footer ul a:hover{ color:var(--brand); }
.footer-bottom{
  border-top:1px solid var(--line-2); padding-top:20px;
  display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap;
  font-size:12.5px; color:var(--ink-3);
}

/* ---------- 19. 搜索页/空状态 ---------- */
.empty-state{ padding:70px 20px; text-align:center; color:var(--ink-3); }
.empty-state .es-ico{ width:52px; height:52px; margin:0 auto 16px; border-radius:14px;
  background:var(--line-2); display:flex; align-items:center; justify-content:center; color:var(--ink-4); }
.empty-state h2{ font-size:17px; font-weight:600; color:var(--ink-2); margin-bottom:8px; }
.empty-state p{ font-size:14px; }

/* ---------- 20. 响应式 ---------- */
/* ---------- 21. 搜索下拉 ---------- */
.search-drop{
  position:absolute; top:calc(100% + 8px); left:0; right:0; z-index:60;
  background:#fff; border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow-3); padding:5px; max-height:352px; overflow:auto; display:none;
}
.search-drop.show{ display:block; }
.search-drop a{
  display:flex; align-items:center; justify-content:flex-start; gap:10px;
  padding:8px 10px; border-radius:var(--r-sm); font-size:13.5px; color:var(--ink);
}
.search-drop a:hover,.search-drop a.on{ background:var(--brand-light); color:var(--brand-text); }
.search-drop .sd-ico{
  width:26px; height:26px; border-radius:8px; flex:none;
  display:flex; align-items:center; justify-content:center;
  background:var(--brand-light); color:var(--brand-dark); border:1px solid var(--brand-border);
}
.search-drop .sd-ico svg{ display:block; }
.search-drop a:hover .sd-ico,.search-drop a.on .sd-ico{ background:var(--brand); color:#fff; border-color:var(--brand); }
.search-drop a .sd-name{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.search-drop a em{
  font-style:normal; color:var(--ink-3); font-size:12px; flex:none; max-width:44%;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.search-drop .sd-empty{ padding:18px; text-align:center; color:var(--ink-3); font-size:13px; }

@media (max-width:1080px){
  .grid.cols-4{ grid-template-columns:repeat(3,minmax(0,1fr)); }
  .topnav a:nth-child(n+7){ display:none; }
}
@media (max-width:900px){
  .grid.cols-3,.grid.cols-4{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .footer-grid{ grid-template-columns:1fr 1fr; gap:24px; }
  .topnav{ display:none; }
  .nav-toggle{ display:flex; }
  .topsearch{ width:170px; }
}
@media (max-width:680px){
  body{ font-size:14.5px; }
  .wrap{ padding:0 15px; }
  .hero{ padding:32px 0 28px; }
  .hero h1{ font-size:24px; }
  .hero-stats{ gap:20px; }
  .grid.cols-2,.grid.cols-3,.grid.cols-4{ grid-template-columns:1fr; }
  .tool-head h1{ font-size:21px; }
  .page-head h1{ font-size:22px; }
  .form-grid{ grid-template-columns:1fr; }
  .result-grid{ grid-template-columns:1fr; }
  .tool-panel{ padding:15px; border-radius:var(--r); }
  .doc{ padding:17px 16px; }
  .footer-grid{ grid-template-columns:1fr; }
  .topsearch{ display:none; }
  .logo-img{ width:34px; height:34px; }
  .logo-text{ font-size:15px; }
  .grouptabs{ top:var(--nav-h); }
  .actions .btn{ padding:0 13px; }
}

/* ==========================================================================
   交互型工具共用样式（skeleton: custom）
   游戏、画板、音频类工具的面板自己只写专属样式，通用件（工具条、计分条、
   棋盘格、虚拟键盘、画布外框）都在这里统一定义，避免每个面板重复一遍。
   面板内部不要用 data-act，避免和 app.js 的按钮绑定撞车。
   ========================================================================== */

.fx-bar{
  display:flex; flex-wrap:wrap; align-items:center; gap:8px;
  margin:0 0 14px;
}
.fx-bar.right{ justify-content:flex-end; }
.fx-bar .sp{ flex:1; }
.fx-bar label{ font-size:13.5px; color:var(--ink-2); display:flex; align-items:center; gap:6px; }
.fx-bar select.field,.fx-bar input.field{ width:auto; min-width:96px; }

/* 实时数据条：难度、分数、用时都放这里 */
.fx-stat{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(96px,1fr)); gap:1px;
  border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden;
  background:var(--line); margin:0 0 14px;
}
.fx-stat>div{ background:#fff; padding:9px 12px; }
.fx-stat dt,.fx-stat .k{ font-size:12px; color:var(--ink-3); margin-bottom:3px; }
.fx-stat dd,.fx-stat .v{
  font-size:17px; font-weight:600; color:var(--ink); margin:0;
  font-variant-numeric:tabular-nums; font-family:var(--mono);
}
.fx-stat .v.small{ font-size:14px; }

/* 舞台：棋盘、转盘、画布都居中放这里 */
.fx-stage{ display:flex; justify-content:center; padding:4px 0 2px; }
.fx-stage.wrap-it{ flex-wrap:wrap; gap:16px; align-items:flex-start; }

/* 方形格子网格：用 style="--n:4" 指定列数 */
.fx-grid{
  display:grid; gap:6px;
  grid-template-columns:repeat(var(--n,4),var(--cell,64px));
  touch-action:manipulation;
}
.fx-cell{
  width:var(--cell,64px); height:var(--cell,64px);
  display:flex; align-items:center; justify-content:center;
  border-radius:var(--r-sm); border:1px solid var(--line);
  background:#fff; font-size:calc(var(--cell,64px) * .34); font-weight:600;
  color:var(--ink); cursor:pointer; user-select:none;
  font-variant-numeric:tabular-nums; transition:background .12s, transform .06s;
}
.fx-cell:hover{ border-color:var(--brand-border); }
.fx-cell:active{ transform:scale(.97); }
.fx-cell.on{ background:var(--brand-light); border-color:var(--brand-border); color:var(--brand-text); }
.fx-cell.hit{ background:var(--brand); border-color:var(--brand); color:#fff; }
.fx-cell.dim{ color:var(--ink-4); background:var(--line-2); }
.fx-cell.flag{ background:#fef3c7; border-color:#fde68a; }
.fx-cell.mine{ background:#fee2e2; border-color:#fecaca; color:#b91c1c; }
.fx-cell.empty{ background:var(--line-2); border-color:var(--line); cursor:default; }

/* 虚拟键盘 / 数字键盘 */
.fx-pad{ display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.fx-key{
  min-width:44px; height:44px; padding:0 12px;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--line); border-radius:var(--r-sm); background:#fff;
  font-size:15px; font-weight:500; color:var(--ink); cursor:pointer;
  font-family:var(--mono); transition:background .12s, border-color .12s;
}
.fx-key:hover{ background:var(--bg); border-color:var(--ink-4); }
.fx-key:active{ background:var(--brand-light); border-color:var(--brand-border); }
.fx-key.wide{ min-width:88px; }
.fx-key.dark{ background:var(--ink); border-color:var(--ink); color:#fff; }
.fx-key.flat{ background:var(--line-2); border-color:transparent; }

/* 画布外框：白底、细边、圆角，导出时按画布内容走 */
.fx-canvas{
  display:block; max-width:100%; height:auto;
  border:1px solid var(--line); border-radius:var(--r-sm); background:#fff;
  touch-action:none;
}
.fx-canvas.checker{
  background-image:linear-gradient(45deg,var(--line-2) 25%,transparent 25%),
    linear-gradient(-45deg,var(--line-2) 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,var(--line-2) 75%),
    linear-gradient(-45deg,transparent 75%,var(--line-2) 75%);
  background-size:16px 16px; background-position:0 0,0 8px,8px -8px,-8px 0;
}

/* 选项片 */
.fx-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.fx-chip{
  padding:6px 13px; border:1px solid var(--line); border-radius:999px;
  background:#fff; font-size:13.5px; color:var(--ink-2); cursor:pointer;
  transition:all .13s;
}
.fx-chip:hover{ border-color:var(--brand-border); color:var(--ink); }
.fx-chip.on{ background:var(--brand-light); border-color:var(--brand-border); color:var(--brand-text); font-weight:500; }

/* 结果/提示文字 */
.fx-note{ font-size:13px; color:var(--ink-3); line-height:1.7; margin-top:12px; }
.fx-note b{ color:var(--ink-2); font-weight:600; }
.fx-big{ font-size:22px; font-weight:700; color:var(--ink); font-variant-numeric:tabular-nums; }
.fx-ok{ color:var(--brand-dark); font-weight:600; }
.fx-bad{ color:#b91c1c; font-weight:600; }
.fx-kbd{
  display:inline-block; padding:1px 6px; margin:0 1px;
  border:1px solid var(--line); border-bottom-width:2px; border-radius:5px;
  background:var(--bg); font-family:var(--mono); font-size:12px; color:var(--ink-2);
}
.fx-list{ list-style:none; padding:0; margin:12px 0 0; }
.fx-list li{
  padding:9px 13px; border:1px solid var(--line); border-radius:var(--r-sm);
  background:#fff; margin-bottom:8px; font-size:14px; color:var(--ink-2);
  display:flex; gap:10px; align-items:flex-start;
}
.fx-list li .n{ color:var(--ink-3); font-family:var(--mono); flex:none; }

@media (max-width:640px){
  .fx-grid{ --cell:52px; }
  .fx-key{ min-width:38px; height:40px; font-size:14px; }
  .fx-big{ font-size:19px; }
}
