/* 在线工具箱：Bootstrap 5 之上的一层自定义样式 */

:root{
  --site-primary:#16baaa;
  --site-primary-dark:#12a294;
  --site-dark:#23292e;
  --site-header-h:56px;
  --site-sidebar-w:220px;
}

body{background:#f5f5f5;font-family:system-ui,-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}

/* ---------- 主题色：把 Bootstrap 默认蓝换成青绿 ---------- */
.btn-primary{--bs-btn-bg:var(--site-primary);--bs-btn-border-color:var(--site-primary);--bs-btn-hover-bg:var(--site-primary-dark);--bs-btn-hover-border-color:var(--site-primary-dark);--bs-btn-active-bg:var(--site-primary-dark);--bs-btn-active-border-color:var(--site-primary-dark);--bs-btn-disabled-bg:var(--site-primary);--bs-btn-disabled-border-color:var(--site-primary);--bs-btn-focus-shadow-rgb:22,186,170}
.form-control:focus,.form-select:focus{border-color:#8fd9d2;box-shadow:0 0 0 .25rem rgba(22,186,170,.18)}
.form-check-input:checked{background-color:var(--site-primary);border-color:var(--site-primary)}
.breadcrumb{--bs-breadcrumb-divider-color:#adb5bd;--bs-breadcrumb-item-active-color:#6c757d;margin-bottom:0;font-size:.875rem}
/* 面包屑链接：去掉默认蓝色和下划线 */
.breadcrumb a{color:#6c757d;text-decoration:none}
.breadcrumb a:hover{color:var(--site-primary)}

/* ---------- 顶栏 ---------- */
.site-header{min-height:var(--site-header-h)}
.site-brand{color:var(--site-primary)!important;font-weight:700}
.site-top-link{padding:.375rem .75rem;border-radius:.25rem;color:rgba(255,255,255,.75);font-size:.875rem;text-decoration:none}
.site-top-link:hover,.site-top-link.active{color:#fff;background:rgba(255,255,255,.1)}

/* ---------- 布局：侧栏 + 主区 ---------- */
.site-layout{display:flex;align-items:stretch}
.site-sidebar{--bs-offcanvas-width:240px;--bs-offcanvas-color:#adb5bd;background:var(--site-dark)}
.site-sidebar .offcanvas-header{border-bottom:1px solid rgba(255,255,255,.08)}
.site-sidebar .offcanvas-title{color:#fff;font-size:1rem;font-weight:600}
.site-nav-wrap{background:var(--site-dark);min-height:100%}
.site-main{flex:1 1 auto;min-width:0;padding:1rem}
@media (min-width:992px){
  /* lg 以上侧栏常驻（Bootstrap 的 offcanvas-lg 此时已变成普通元素） */
  .site-sidebar{display:flex;flex:0 0 var(--site-sidebar-w);flex-direction:column;width:var(--site-sidebar-w);position:sticky;top:var(--site-header-h);align-self:flex-start;height:calc(100vh - var(--site-header-h));overflow-x:hidden;overflow-y:auto}
  .site-sidebar .offcanvas-body{flex:1 1 auto;flex-direction:column}
  .site-nav-wrap{flex:1 1 auto}
}
/* 锚点跳转别被吸顶顶栏挡住 */
[id]{scroll-margin-top:calc(var(--site-header-h) + .75rem)}

/* ---------- 左侧菜单：一级=分类，二级=工具 ---------- */
.site-nav{padding:.375rem 0}
.site-nav-group + .site-nav-group{border-top:1px solid rgba(255,255,255,.07)}

/* 一级：图标 + 加粗标题 + 折叠箭头（折叠交给 Bootstrap collapse） */
.site-nav-hd{display:flex;align-items:center;width:100%;padding:.8125rem 1rem;border:0;background:none;color:#fff;font:inherit;font-size:.875rem;font-weight:600;text-align:left;cursor:pointer}
.site-nav-hd:hover{background:rgba(255,255,255,.05)}
.site-nav-ico{flex:none;margin-right:.5rem;font-size:1.0625rem;color:var(--site-primary)}
.site-nav-caret{flex:none;margin-left:auto;font-size:1rem;color:#8b959e;transition:transform .2s}
.site-nav-hd[aria-expanded="false"] .site-nav-caret{transform:rotate(-90deg)}

/* 二级：缩进 + 竖线 + 小圆点 */
.site-nav-list{position:relative;margin:0;padding:0 0 .4375rem;list-style:none}
.site-nav-list:before{content:"";position:absolute;left:1.6875rem;top:0;bottom:.5625rem;width:1px;background:rgba(255,255,255,.1)}
.site-nav-list a{position:relative;display:block;padding:.5rem .875rem .5rem 2.375rem;color:#9fa9b2;font-size:.8125rem;line-height:1.5;text-decoration:none;transition:background .15s,color .15s}
.site-nav-list a:after{content:"";position:absolute;left:1.5rem;top:50%;width:7px;height:7px;margin-top:-3px;border-radius:50%;background:#5d6871;transition:background .15s}
.site-nav-list a:hover{color:#fff;background:rgba(255,255,255,.05)}
.site-nav-list a:hover:after{background:var(--site-primary)}
.site-nav-list a.is-active{color:#fff;background:rgba(22,186,170,.16)}
.site-nav-list a.is-active:before{content:"";position:absolute;left:0;top:0;bottom:0;width:2px;background:var(--site-primary)}
.site-nav-list a.is-active:after{background:var(--site-primary)}

/* ---------- 卡片 ---------- */
.card-header{background:#eef1f5;border-bottom:1px solid #e2e6ed;color:#333;font-weight:600}

/* 宫格卡片（首页 / 同类工具）：整张卡片都是链接，点哪都能进 */
.tool-card{height:100%;color:inherit;text-decoration:none}
.tool-card .card-body{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:1.375rem .625rem;text-align:center}
.tool-icon{display:block;margin-bottom:.5rem;font-size:2.125rem;line-height:1;color:var(--site-primary)}
.tool-name{display:block;width:100%;padding:.375rem .25rem;border-radius:.25rem;font-size:.9375rem;transition:color .15s}
.tool-card:hover .tool-name{color:var(--site-primary)}
.tool-card:hover .tool-icon{color:var(--site-primary-dark)}

/* ---------- 工具内页 ---------- */
.mono,textarea.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.sub{color:#8a9199;font-size:.8125rem}
.drop{display:block;padding:1.25rem;border:1px dashed #ced4da;border-radius:var(--bs-border-radius);background:#fafafa;color:#6c757d;text-align:center;cursor:pointer}
.drop:hover,.drop.hover{border-color:var(--site-primary);background:#f7fffd;color:var(--site-primary)}
.kv{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.5rem 0;border-bottom:1px dashed #e9ecef;font-size:.875rem}
.kv:last-child{border-bottom:0}
.kv-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kv-actions{display:flex;flex:none;align-items:center;gap:.5rem}

/* 哈希结果：长串换行显示 */
.hash-row{padding:.5rem 0;border-bottom:1px dashed #e9ecef}
.hash-row:last-child{border-bottom:0}
.hash-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.25rem}
.hash{display:block;color:#495057;font-size:.8125rem;word-break:break-all}

/* 二维码结果 */
.qr-box{display:inline-block;padding:1rem;border:1px solid #dee2e6;border-radius:.375rem;background:#fff}
.qr-box canvas,.qr-box img{display:block;max-width:100%;height:auto}

/* 结果区：默认 d-none，有结果时才出现 */
.site-result{animation:site-fade-in .18s ease-out}
@keyframes site-fade-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.site-result{animation:none}}

/* ---------- 提示层：toast + 加载遮罩 ---------- */
.site-toast{z-index:1090}
.site-busy{position:fixed;inset:0;z-index:1080;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.45)}
.site-busy-box{display:flex;align-items:center;gap:.5rem;padding:.75rem 1.25rem;border-radius:.375rem;background:rgba(33,37,41,.92);color:#fff;font-size:.875rem}

/* ---------- 404 ---------- */
.site-404-icon{display:block;margin-bottom:.75rem;font-size:2.75rem;line-height:1;color:#c9c9c9}

/* ---------- 小屏微调 ---------- */
@media (max-width:767.98px){
  .site-main{padding:.75rem}
  .tool-icon{font-size:1.875rem}
  .tool-name{font-size:.875rem}
}

/* 文件列表容器：没选文件时也显示，避免看起来像没加载 */
.file-list{border:1px solid #e2e6ed;border-radius:.375rem;background:#fafafa;padding:.6rem .75rem;min-height:3.25rem}
.file-list .kv:last-child{border-bottom:0}

/* 折叠按钮的箭头：展开时旋转 180° */
.param-caret{vertical-align:-2px;transition:transform .2s}
[aria-expanded="true"] .param-caret{transform:rotate(180deg)}

/* ---------- GIF 信息查看器：逐帧表格 + 帧缩略图 ---------- */
.table-frames{max-height:26rem;overflow-y:auto}
.table-frames table{margin-bottom:0;font-size:.8125rem;white-space:nowrap}
.table-frames thead th{position:sticky;top:0;z-index:1;background:#eef1f5;border-bottom:1px solid #e2e6ed;color:#333;font-weight:600}
.frame-strip{display:flex;flex-wrap:wrap;gap:.5rem}
.frame-thumb{width:88px;padding:.375rem;border:1px solid #e2e6ed;border-radius:.375rem;background:#fafafa;text-align:center}
.frame-thumb canvas{display:block;width:100%;height:auto;background:#fff;border:1px solid #eef1f5;border-radius:.25rem}
.frame-thumb span{display:block;margin-top:.25rem;color:#8a9199;font-size:.6875rem;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}

/* ---------- GIF 压缩器：结果列表 ---------- */
.cmp-thumb{flex:none;max-width:120px;max-height:88px;border:1px solid #dee2e6;border-radius:.375rem;background:#fff}
.cmp-info{flex:1 1 auto;min-width:0}
.cmp-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem}

/* ---------- 域名组合生成器：结果列表 ---------- */
.dom-list{max-height:26rem;overflow-y:auto;border:1px solid #e2e6ed;border-radius:.375rem;background:#fff;padding:.25rem .75rem}
.dom-row{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.4rem 0;border-bottom:1px dashed #e9ecef;font-size:.875rem}
.dom-row:last-child{border-bottom:0}
.dom-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:#212529}
.dom-tag{margin-left:.5rem;color:#8a9199;font-size:.75rem;font-family:system-ui,-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}

/* ---------- JSON 格式化：高亮代码 + 树形视图 ---------- */
.json-view{display:flex;align-items:flex-start;max-height:30rem;overflow:auto;border:1px solid #e2e6ed;border-radius:.375rem;background:#fafafa}
.json-lines,.json-code{margin:0;padding:.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.8125rem;line-height:1.55;white-space:pre}
.json-lines{position:sticky;left:0;color:#adb5bd;text-align:right;background:#f1f3f5;border-right:1px solid #e2e6ed;user-select:none}
.json-code{color:#212529}
.json-key{color:#0b7285;font-weight:600}
.json-str{color:#1a7f37}
.json-num{color:#b35900}
.json-bool{color:#6741d9}
.json-null{color:#868e96}
.json-tree{max-height:30rem;overflow:auto;padding:.5rem .75rem;border:1px solid #e2e6ed;border-radius:.375rem;background:#fff;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.8125rem}
.json-tree summary{padding:.1rem 0;cursor:pointer}
.json-tree summary:hover{color:var(--site-primary)}
.json-tree-children{margin-left:.5rem;padding-left:.75rem;border-left:1px dashed #dee2e6}
.json-tree-key{color:#0b7285}
.json-tree-leaf{padding:.05rem 0}
.json-leaf-string{color:#1a7f37}
.json-leaf-number{color:#b35900}
.json-leaf-boolean{color:#6741d9}
.json-leaf-null{color:#868e96}

/* ---------- 正则表达式测试 ---------- */
.re-preview{max-height:26rem;overflow:auto;margin:0;padding:.75rem;border:1px solid #e2e6ed;border-radius:.375rem;background:#fff;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.8125rem;line-height:1.7;white-space:pre-wrap;word-break:break-word}
mark.re-hit{padding:0;background:#ffe066;border-radius:2px;box-shadow:0 0 0 1px #ffd43b inset;color:inherit}
mark.re-hit.alt{background:#b2f2bb;box-shadow:0 0 0 1px #8ce99a inset}
mark.re-empty{border-left:2px solid #d6336c;margin-left:-1px;background:transparent;box-shadow:none}

/* ---------- HTTP 状态码速查 ---------- */
.http-item{display:flex;align-items:flex-start;gap:.875rem;padding:.7rem 0;border-bottom:1px dashed #e9ecef}
.http-item:last-child{border-bottom:0}
.http-code{flex:none;width:4.5rem;padding:.35rem 0;border-radius:.375rem;color:#fff;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:1.05rem;font-weight:600;text-align:center;background:#868e96}
.http-1{background:#4c6ef5}
.http-2{background:#12b886}
.http-3{background:#15aabf}
.http-4{background:#f08c00}
.http-5{background:#e03131}
.http-其他{background:#845ef7}
.http-body{flex:1 1 auto;min-width:0}
.http-title{font-size:.9375rem;font-weight:600;color:#212529}
.http-zh{margin-left:.5rem;font-size:.8125rem;font-weight:400;color:#495057}
.http-tag{margin-left:.5rem;padding:.05rem .4rem;border-radius:.25rem;background:#f1f3f5;color:#868e96;font-size:.6875rem;font-weight:400;vertical-align:.1rem}
.http-hit{padding:0;border-radius:2px;background:#ffe066;color:inherit}

/* ---------- 时间戳转换器 ---------- */
.ts-now{display:flex;flex-wrap:wrap;gap:.75rem}
.ts-box{flex:1 1 15rem;padding:.6rem .875rem;border:1px solid #e2e6ed;border-radius:.375rem;background:#fafafa}
.ts-label{display:block;color:#8a9199;font-size:.75rem}
.ts-num{display:inline-block;max-width:calc(100% - 3.5rem);margin-right:.5rem;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;color:#212529;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:1.25rem;font-weight:600}
.ts-num.small{font-size:.9375rem;font-weight:500;white-space:nowrap}
.ts-result{margin-top:.5rem;max-height:18rem;overflow-y:auto}
.ts-result .kv:first-child{border-top:0}

/* ---------- Word 提取图片：缩略图网格 ---------- */
.img-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:.75rem}
.img-card{display:flex;flex-direction:column;gap:.5rem;padding:.6rem;border:1px solid #e2e6ed;border-radius:.375rem;background:#fff}
.img-thumb{display:flex;align-items:center;justify-content:center;height:110px;overflow:hidden;border:1px solid #eef1f5;border-radius:.25rem;background:#fafafa}
.img-thumb img{max-width:100%;max-height:100%;object-fit:contain}
.img-ph{display:flex;flex-direction:column;align-items:center;gap:.25rem;color:#adb5bd}
.img-ph i{font-size:1.75rem;line-height:1}
.img-ph span{font-size:.75rem}
.img-info{min-width:0}
.img-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.8125rem}

/* ---------- Word 转 HTML：代码预览 + 效果预览 ---------- */
.html-item{padding:.75rem 0;border-bottom:1px dashed #e9ecef}
.html-item:last-child{border-bottom:0}
.html-code{margin-top:.5rem;height:10rem;font-size:.75rem}
.html-preview{width:100%;height:18rem;margin-top:.5rem;border:1px solid #e2e6ed;border-radius:.375rem;background:#fff}

/* ---------- Word 提取表格：预览表格 ---------- */
.table-wrap{max-height:22rem;overflow:auto;margin-top:.5rem;border:1px solid #e2e6ed;border-radius:.375rem}
.table-wrap table.docx-table{border-collapse:collapse;width:100%;font-size:.8125rem}
.table-wrap table.docx-table td{border:1px solid #ced4da;padding:4px 8px;vertical-align:top;white-space:pre-wrap;word-break:break-word}

/* ---------- 二维码美化：预览框 ---------- */
.qr-preview-box{display:inline-block;padding:12px;border:1px solid #e2e6ed;border-radius:.5rem;background:#fff}
.qr-preview-box canvas{display:block;width:280px;height:280px;max-width:100%}
