/*
 * 开发者工具箱
 *
 * 窗口壳的数值照 mtab 的 devtools-window（data-v-78553bb4）：
 * 侧栏 220px、#F7F8FA 底、#E6E9EE 分隔线、工具项 8px 14px / 14px 字。
 * 各工具内部的控件样式 mtab 是每个组件各写各的，这里合成一套通用的，
 * 免得 22 个工具抄 22 遍。
 */

/* ---------- 卡片 ---------- */

.app-card--dev {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* 1x1：骨架用链接图标的 .app-icon，图标满铺 */
.app-icon.dev-mini {
    border: 0;
    padding: 0;
    cursor: pointer;
    background: transparent;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .5),
        inset 0 -1px 1px rgba(15, 23, 42, .1),
        0 6px 14px rgba(15, 23, 42, .16),
        0 1px 3px rgba(15, 23, 42, .12);
    transition: transform .18s cubic-bezier(.2, .7, .3, 1), box-shadow .18s ease;
}

.app-icon.dev-mini:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .55),
        0 12px 22px rgba(15, 23, 42, .22);
}

.app-icon.dev-mini img {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    -webkit-user-drag: none;
}

/*
 * 2x2：174×180 的方卡，竖向排 —— 图标在上、标题、副标题、标签，
 * 整组垂直居中。mtab 那张是 2x4 横卡（左图右文），缩到这个尺寸会全挤在左上角，
 * 所以版式重排，配色和圆角照旧。
 */
.dev-card {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 16px 12px 14px;
    border-radius: var(--icon-radius);
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(150deg, #ffffff 0%, #eef2ff 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .8),
        0 6px 14px rgba(15, 23, 42, .16),
        0 1px 3px rgba(15, 23, 42, .12);
    transition: transform .18s cubic-bezier(.2, .7, .3, 1), box-shadow .18s ease;
}

.app-card--dev .dev-card:hover {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .85),
        0 14px 26px rgba(15, 23, 42, .22);
}

.dev-card-ico {
    flex: none;
    width: 56px;
    height: 56px;
    display: block;
    margin-bottom: 3px;
}

.dev-card-ico img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 15px;
}

.dev-card-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: .2px;
    color: #1f2329;
    white-space: nowrap;
}

.dev-card-sub {
    font-size: 11.5px;
    line-height: 1.2;
    color: #6b7484;
    white-space: nowrap;
}

.dev-card-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin-top: 5px;
}

.dev-card-tags i {
    font-style: normal;
    font-size: 10px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 5px;
    color: #4a63d8;
    background: rgba(99, 102, 241, .12);
}

/* ---------- 窗口 ---------- */

.dt-root {
    position: relative;
    width: min(1100px, 100%);
    height: min(680px, 100%);
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    background: #F7F8FA;
    box-shadow: 0 30px 80px rgba(8, 12, 22, .34);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #1a1a1a;
    /* 浮层里别继承壁纸模式的白字 */
    --text: #1a1a1a;
}

.dt-head {
    flex: none;
    height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    background: #fff;
    border-bottom: 1px solid #E6E9EE;
}

.dt-head-title {
    font-size: 14px;
    font-weight: 600;
}

.dt-head-sub {
    font-size: 12px;
    color: #97a0ad;
}

.dt-close {
    margin-left: auto;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    display: grid;
    place-items: center;
    color: #6b7484;
    background: #F1F3F5;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.dt-close:hover {
    color: #1a1a1a;
    background: #E6E9EE;
}

.devtools-window {
    flex: 1;
    min-height: 0;
    display: flex;
    background: #F7F8FA;
    overflow: hidden;
    -webkit-user-select: text;
    user-select: text;
}

.sidebar {
    width: 220px;
    min-width: 220px;
    background: #ffffff;
    padding: 16px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #E6E9EE;
    overflow-y: auto;
    -webkit-user-select: none;
    user-select: none;
}

.search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 2px;
    padding: 4px 12px;
    margin-bottom: 16px;
    border: 1px solid #D5DAE1;
    transition: border-color .12s cubic-bezier(.2, 0, 0, 1);
    flex-shrink: 0;
}

.search-box:focus-within {
    border-color: #1a1a1a;
}

.search-icon {
    font-size: 18px;
    color: #97a0ad;
    margin-right: 8px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #1a1a1a;
    outline: none;
    padding: 0;
    font-family: inherit;
}

.search-input::placeholder {
    color: #97a0ad;
}

.category-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.category-list::-webkit-scrollbar {
    width: 2px;
}

.category-list::-webkit-scrollbar-track {
    background: transparent;
}

.category-list::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 4px;
}

.category-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 14px 8px;
    font-size: 12px;
    color: #97a0ad;
    font-weight: 500;
    letter-spacing: .5px;
}

.tool-item {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 14px;
    margin-bottom: 2px;
    border-radius: 2px;
    cursor: pointer;
    color: #4b5563;
    transition: background-color .12s, color .12s;
}

.tool-item:hover {
    background: #F7F8FA;
    color: #1a1a1a;
}

.tool-item.active {
    background: #F1F3F5;
    color: #1a1a1a;
    font-weight: 500;
}

.tool-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #F7F8FA;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ---------- 工具面板（照 mtab 的 devTools 各组件，类名和数值原样搬） ---------- */

.dt-root .tool-panel{display:flex;flex-direction:column;gap:16px;height:100%;overflow-y:auto;overflow-x:hidden;padding-bottom:10px}
.dt-root .tool-panel::-webkit-scrollbar{display:none}
.dt-root .panel-header{display:flex;align-items:center;gap:12px;padding:8px 0;border-bottom:1px solid #E6E9EE;position:sticky;top:0;background:#F7F8FA;z-index:10;-webkit-user-select:none;-moz-user-select:none;user-select:none}
.dt-root .panel-title{font-size:16px;font-weight:600;color:#1a1a1a;margin:0;line-height:24px}
.dt-root .label{font-size:14px;font-weight:400;color:#6f7785;display:block;margin-bottom:8px}
.dt-root .input{width:100%;height:32px;padding:0 12px;border:1px solid #D5DAE1;border-radius:2px;font-size:14px;color:#1a1a1a;background:#ffffff;outline:none;box-sizing:border-box;transition:border-color .12s cubic-bezier(.2,0,0,1),background-color .12s cubic-bezier(.2,0,0,1)}
.dt-root .input:hover{border-color:#1a1a1a}
.dt-root .input:focus{border-color:#1a1a1a}
.dt-root .input::-moz-placeholder{color:#97a0ad}
.dt-root .input::placeholder{color:#97a0ad}
.dt-root .input.short{width:160px}
.dt-root .input.mono{font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:13px;font-variant-numeric:tabular-nums}
.dt-root .input.large{height:36px;font-size:14px;padding:0 14px}
.dt-root .input:-moz-read-only{background:#F7F8FA;color:#6f7785}
.dt-root .input:read-only{background:#F7F8FA;color:#6f7785}
.dt-root .textarea{width:100%;min-height:96px;padding:10px 12px;border:1px solid #D5DAE1;border-radius:2px;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:13px;line-height:22px;resize:none;outline:none;color:#1a1a1a;background:#ffffff;box-sizing:border-box;transition:border-color .12s cubic-bezier(.2,0,0,1),background-color .12s cubic-bezier(.2,0,0,1)}
.dt-root .textarea:hover{border-color:#1a1a1a}
.dt-root .textarea:focus{border-color:#1a1a1a}
.dt-root .textarea::-moz-placeholder{color:#97a0ad}
.dt-root .textarea::placeholder{color:#97a0ad}
.dt-root .textarea.h-full{flex:1;min-height:200px}
.dt-root .btn-group{display:flex;gap:12px;flex-wrap:wrap;padding-top:4px}
.dt-root .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:32px;padding:0 16px;border:1px solid transparent;border-radius:2px;font-size:14px;font-weight:500;font-family:inherit;line-height:1;cursor:pointer;transition:background-color .12s cubic-bezier(.2,0,0,1),border-color .12s cubic-bezier(.2,0,0,1),color .12s cubic-bezier(.2,0,0,1);white-space:nowrap}
.dt-root .btn:focus-visible{outline:2px solid #1A1A1A;outline-offset:2px}
.dt-root .btn.btn-sm{height:28px;padding:0 12px;font-size:12px}
.dt-root .btn-primary{background:#006DEA;border-color:#006dea;color:#fff}
.dt-root .btn-primary:hover{background:#0058C2;border-color:#0058c2}
.dt-root .btn-primary:active{background:#00449A;border-color:#00449a}
.dt-root .btn-info{background:transparent;border-color:#c3e7fe;color:#0057a8}
.dt-root .btn-info:hover{background:#E8F7FF}
.dt-root .btn-info:active{border-color:#0057a8}
.dt-root .btn-warning{background:transparent;border-color:#ffe4ba;color:#a64b00}
.dt-root .btn-warning:hover{background:#FFF7E8}
.dt-root .btn-warning:active{border-color:#a64b00}
.dt-root .btn-danger{background:#FF3D52;border-color:#ff3d52;color:#fff}
.dt-root .btn-danger:hover{background:#FF112D;border-color:#ff112d}
.dt-root .btn-danger:active{background:#D90E26;border-color:#d90e26}
.dt-root .btn-success{background:transparent;border-color:#aff0b5;color:#007a20}
.dt-root .btn-success:hover{background:#E8FFEA}
.dt-root .btn-success:active{border-color:#007a20}
.dt-root .btn-default{background:transparent;border-color:#d5dae1;color:#4b5563}
.dt-root .btn-default:hover{background:#F7F8FA;border-color:#1a1a1a}
.dt-root .btn-default:active{background:#F1F3F5;border-color:#1a1a1a}
.dt-root .copy-btn{display:inline-flex;align-items:center;gap:4px;padding:4px 12px;border:1px solid #C3E7FE;border-radius:2px;background:transparent;color:#0057a8;font-size:12px;font-weight:500;font-family:inherit;cursor:pointer;transition:background-color .12s cubic-bezier(.2,0,0,1),border-color .12s cubic-bezier(.2,0,0,1),color .12s cubic-bezier(.2,0,0,1)}
.dt-root .copy-btn:hover{background:#E8F7FF;border-color:#0057a8}
.dt-root .output-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.dt-root .output-box{flex:1;padding:14px 16px;background:#1A1A1A;color:#f1f3f5;border-radius:4px;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:13px;line-height:22px;white-space:pre-wrap;word-break:break-all;overflow:auto;margin:0;min-height:100px;-moz-user-select:text;user-select:text;-webkit-user-select:text}
.dt-root .error-msg{display:flex;align-items:center;gap:8px;padding:10px 14px;background:#FFECE8;border:1px solid #FDCDC5;border-radius:4px;color:#d93636;font-size:13px}
.dt-root .success-msg{display:flex;align-items:center;gap:8px;padding:10px 14px;background:#E8FFEA;border:1px solid #AFF0B5;border-radius:4px;color:#007a20;font-size:13px}
.dt-root .info-msg{padding:10px 14px;background:#F7F8FA;border:1px solid #E6E9EE;border-radius:4px;color:#6f7785;font-size:13px;line-height:22px}
.dt-root .two-col{display:flex;gap:20px;min-height:250px}
.dt-root .col{flex:1;display:flex;flex-direction:column;min-width:0}
.dt-root .section-card{background:#ffffff;border:1px solid #E6E9EE;border-radius:4px;padding:16px}
.dt-root .section-title{font-size:14px;font-weight:600;color:#1a1a1a;margin-bottom:12px}
.dt-root .hl-key{color:#006dea}
.dt-root .hl-string{color:#00b42a}
.dt-root .hl-number{color:#ff7d00}
.dt-root .hl-boolean{color:#722ed1}
.dt-root .hl-null{color:#97a0ad}
.dt-root .gen-controls{display:flex;gap:16px;align-items:flex-end;flex-wrap:wrap}
.dt-root .gen-option,.dt-root .gen-results{display:flex;flex-direction:column;gap:8px}
.dt-root .stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.dt-root .stat-card{background:#ffffff;border:1px solid #E6E9EE;border-radius:4px;padding:16px;text-align:center;transition:border-color .12s cubic-bezier(.2,0,0,1)}
.dt-root .stat-card:hover{border-color:#d5dae1}
.dt-root .stat-value{font-size:28px;font-weight:800;color:#006dea;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-variant-numeric:tabular-nums}
.dt-root .stat-label{font-size:12px;color:#97a0ad;margin-top:4px}
.dt-root .flex-1{flex:1}
.dt-root .mono{font-family:Monaco,Menlo,Ubuntu Mono,monospace}
.dt-root .ml-3{margin-left:12px}
.dt-root .mt-3{margin-top:12px}
.dt-root .align-bottom{align-self:flex-end}
.dt-root .flex-wrap{flex-wrap:wrap}
.dt-root .tool-panel{height:100%;overflow:hidden}
.dt-root .two-col{flex:1;min-height:0;overflow:hidden}
.dt-root .col{min-height:0;overflow:hidden}
.dt-root .output-actions{display:flex;gap:6px;align-items:center}
.dt-root .btn-spacer{flex:1}
.dt-root .tree-view{flex:1;padding:12px 0;background:#1a1a1a;border-radius:10px;overflow:auto;min-height:100px;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:13px;line-height:1.8}
.dt-root .tree-row{display:flex;align-items:center;padding:0 14px;cursor:default;white-space:nowrap;transition:background .1s;min-height:26px}
.dt-root .tree-row:hover{background:rgba(255,255,255,.06)}
.dt-root .tree-row.is-highlighted{background:rgba(48,128,252,.2)}
.dt-root .tree-row:has(.toggle-icon){cursor:pointer}
.dt-root .tree-gutter{display:inline-flex;align-items:center;justify-content:center;width:24px;flex-shrink:0}
.dt-root .tree-content{display:inline}
.dt-root .toggle-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;color:#888;transition:transform .2s;flex-shrink:0}
.dt-root .toggle-icon.collapsed{transform:rotate(0)}
.dt-root .toggle-icon:not(.collapsed){transform:rotate(90deg)}
.dt-root .node-key{color:#006dea}
.dt-root .node-colon{color:#888}
.dt-root .node-string{color:#27ae60}
.dt-root .node-number{color:#e67e22}
.dt-root .node-boolean{color:#8e44ad}
.dt-root .node-null{color:#999;font-style:italic}
.dt-root .node-bracket{color:#e0e0e0}
.dt-root .node-comma{color:#888}
.dt-root .collapsed-count{color:#888;font-size:11px;margin-left:8px;font-style:italic}
.dt-root .output-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:#1a1a1a;border-radius:10px;color:#555;font-size:13px;min-height:100px}
.dt-root .output-empty svg{opacity:.3}
.dt-root .radix-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.dt-root .radix-item{display:flex;flex-direction:column}
.dt-root .ref-table{width:100%;border-collapse:collapse;font-size:13px}
.dt-root .ref-table th,.dt-root .ref-table td{padding:6px 12px;text-align:center;border-bottom:1px solid #e0d6ca}
.dt-root .ref-table th{font-weight:600;color:#555;background:#f5f6f8}
.dt-root .ref-table td{font-family:Monaco,Menlo,monospace;color:#1a1a1a}
.dt-root .ref-table tr:hover td{background:#f5f6f8}
.dt-root .color-section{display:flex;gap:24px;align-items:flex-start}
.dt-root .color-inputs{flex:1;display:flex;flex-direction:column;gap:12px}
.dt-root .color-item{display:flex;flex-direction:column}
.dt-root .color-preview{width:160px;height:160px;border-radius:8px;display:flex;align-items:flex-end;justify-content:center;padding:12px;box-shadow:0 4px 16px #00000026;flex-shrink:0}
.dt-root .color-preview-text{font-size:12px;font-weight:600;color:#fff;text-shadow:0 1px 4px rgba(0,0,0,.5)}
.dt-root .hash-section,.dt-root .hash-results{display:flex;flex-direction:column;gap:12px}
.dt-root .hash-result-item{display:flex;flex-direction:column;gap:4px}
.dt-root .jwt-results{display:flex;flex-direction:column;gap:12px}
.dt-root .jwt-section{display:flex;flex-direction:column;gap:4px}
.dt-root .uuid-controls{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap}
.dt-root .control-group{display:flex;flex-direction:column;gap:6px}
.dt-root .uuid-controls .dev-select{min-width:220px}
.dt-root .input.short::-webkit-outer-spin-button,.dt-root .input.short::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.dt-root .input.short{-moz-appearance:textfield}
.dt-root .control-actions{display:flex;gap:8px;align-self:flex-end}
.dt-root .uuid-list{display:flex;flex-direction:column;gap:6px;margin-top:4px}
.dt-root .uuid-item{display:flex;align-items:center;gap:8px;padding:8px 12px;background:linear-gradient(135deg,#f8f9fa 0%,#f1f3f5 100%);border:1px solid #dee2e6;border-radius:8px;transition:all .2s ease}
.dt-root .uuid-item:hover{border-color:#006dea;box-shadow:0 2px 8px #3080fc1a}
.dt-root .uuid-index{color:#6c757d;font-size:12px;min-width:24px;font-weight:500}
.dt-root .uuid-value{flex:1;font-family:Monaco,Menlo,monospace;font-size:13px;color:#1e293b;word-break:break-all}
.dt-root .random-options{display:flex;flex-direction:column;gap:12px}
.dt-root .option-row{display:flex;flex-direction:column;gap:4px}
.dt-root .checkboxes{flex-direction:row;flex-wrap:wrap;gap:16px}
.dt-root .regex-inputs{display:flex;flex-direction:column;gap:12px}
.dt-root .regex-row{display:flex;align-items:center;gap:4px}
.dt-root .regex-slash{font-family:Monaco,Menlo,monospace;font-size:18px;color:#006dea;font-weight:700}
.dt-root .match-list{display:flex;flex-direction:column;gap:6px;margin-top:4px}
.dt-root .match-item{display:flex;align-items:center;gap:10px;padding:8px 12px;background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px}
.dt-root .match-index{color:#94a3b8;font-size:12px;font-weight:600;min-width:28px}
.dt-root .match-text{flex:1;font-family:Monaco,Menlo,monospace;font-size:13px;color:#059669;word-break:break-all}
.dt-root .match-pos{font-size:12px;color:#94a3b8;white-space:nowrap}
.dt-root .no-match{color:#94a3b8;font-size:13px;padding:12px;text-align:center}
.dt-root .common-regex-list{display:flex;flex-direction:column;gap:6px}
.dt-root .common-regex-item{display:flex;align-items:center;gap:12px;padding:8px 12px;border-radius:8px;cursor:pointer;transition:background .2s}
.dt-root .common-regex-item:hover{background:#f5f6f8}
.dt-root .regex-name{font-size:13px;font-weight:600;color:#1a1a1a;min-width:70px}
.dt-root .regex-pattern{flex:1;font-family:Monaco,Menlo,monospace;font-size:12px;color:#666;word-break:break-all}
.dt-root .regex-example{font-size:11px;color:#a89880;white-space:nowrap}
.dt-root .current-info{display:flex;gap:16px;flex-wrap:wrap;padding:14px;background:#F7F8FA;border:1px solid #E6E9EE;border-radius:4px}
.dt-root .info-item{flex:1;min-width:140px}
.dt-root .info-value{font-family:Monaco,Menlo,monospace;font-size:14px;font-weight:700;color:#4f46e5;margin-top:2px}
.dt-root .convert-section{display:flex;flex-direction:column;gap:8px}
.dt-root .convert-row{display:flex;gap:8px;align-items:center}
.dt-root .result-box{padding:10px 14px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;display:flex;flex-direction:column;gap:6px}
.dt-root .result-item{display:flex;gap:8px;font-size:13px}
.dt-root .result-label{color:#64748b;font-weight:600;white-space:nowrap}
.dt-root .result-value{color:#1e293b;font-family:Monaco,Menlo,monospace;font-size:13px}
.dt-root .format-ref-list{display:flex;flex-direction:column;gap:8px}
.dt-root .format-ref-item{display:flex;align-items:center;gap:12px;padding:6px 10px;border-radius:8px;background:#faf6f1}
.dt-root .format-label{font-size:13px;font-weight:600;color:#1a1a1a;min-width:140px}
.dt-root .format-example{font-family:Monaco,Menlo,monospace;font-size:12px;color:#555;background:#f0e8dd;padding:2px 8px;border-radius:4px;white-space:nowrap}
.dt-root .format-desc{font-size:12px;color:#a89880}
.dt-root .fake-options{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap}
.dt-root .option-row{display:flex;flex-direction:column;gap:6px}
.dt-root .fake-options .dev-select{min-width:220px}
.dt-root .fake-results{margin-top:4px}
@media (max-width: 900px){
  .dt-root .two-col{flex-direction:column;min-height:auto}
  .dt-root .h-full{min-height:150px}
  .dt-root .stats-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 900px){
  .dt-root .two-col{flex-direction:column;min-height:auto}
  .dt-root .h-full{min-height:150px}
  .dt-root .stats-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 900px){
  .dt-root .two-col{flex-direction:column;min-height:auto}
  .dt-root .h-full{min-height:150px}
  .dt-root .stats-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 900px){
  .dt-root .two-col{flex-direction:column;min-height:auto}
  .dt-root .h-full{min-height:150px}
  .dt-root .stats-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 900px){
  .dt-root .two-col{flex-direction:column;min-height:auto}
  .dt-root .h-full{min-height:150px}
  .dt-root .stats-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 900px){
  .dt-root .color-section{flex-direction:column}
  .dt-root .color-preview{width:100%;height:80px}
}
@media (max-width: 900px){
  .dt-root .two-col{flex-direction:column;min-height:auto}
  .dt-root .h-full{min-height:150px}
  .dt-root .stats-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 900px){
  .dt-root .two-col{flex-direction:column;min-height:auto}
  .dt-root .h-full{min-height:150px}
  .dt-root .stats-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 900px){
  .dt-root .two-col{flex-direction:column;min-height:auto}
  .dt-root .h-full{min-height:150px}
  .dt-root .stats-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 900px){
  .dt-root .two-col{flex-direction:column;min-height:auto}
  .dt-root .h-full{min-height:150px}
  .dt-root .stats-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 900px){
  .dt-root .two-col{flex-direction:column;min-height:auto}
  .dt-root .h-full{min-height:150px}
  .dt-root .stats-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 900px){
  .dt-root .two-col{flex-direction:column;min-height:auto}
  .dt-root .h-full{min-height:150px}
  .dt-root .stats-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 900px){
  .dt-root .two-col{flex-direction:column;min-height:auto}
  .dt-root .h-full{min-height:150px}
  .dt-root .stats-grid{grid-template-columns:repeat(2,1fr)}
}
/* ---------- 原生控件补丁 ---------- */

/*
 * mtab 那边的下拉、复选框、日期选择都是自家 Vue 组件，
 * 这里换成原生控件，外观按组件的样式对一遍（尺寸、圆角、颜色照抄），
 * 保证「看起来是同一套东西」而不是不同风格的控件混在一起。
 */

.dt-root .dt-host {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* JSON 工具右侧输出区的插槽：树 / 代码块 / 空状态都撑满剩余高度 */
.dt-root .jf-slot {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.dt-root .dt-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 220px;
}

.dt-root .dt-select-wrap select.dev-select {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 32px;
    padding: 0 30px 0 12px;
    border: 1px solid #D5DAE1;
    border-radius: 2px;
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    color: #4b5563;
    cursor: pointer;
    outline: none;
    transition: border-color .12s cubic-bezier(.2, 0, 0, 1);
}

.dt-root .dt-select-wrap select.dev-select:hover,
.dt-root .dt-select-wrap select.dev-select:focus {
    border-color: #1a1a1a;
}

/* 箭头单独画：data URI 的 background-image 会被 .input 的 background 简写压掉 */
.dt-root .dt-select-caret {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: #4b5563;
}

/* 复选框：方块 + 对勾，选中是 mtab 那个蓝 */
.dt-root .dt-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.dt-root .dt-check-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid #d5d5db;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .2s;
}

.dt-root .dt-check:hover .dt-check-box {
    border-color: #3080fc;
}

.dt-root .dt-check.on .dt-check-box {
    background: #3080FC;
    border-color: #3080fc;
}

.dt-root .dt-check-box svg {
    width: 12px;
    height: 12px;
    color: #fff;
    opacity: 0;
    transition: opacity .15s;
}

.dt-root .dt-check.on .dt-check-box svg {
    opacity: 1;
}

/* 正则匹配结果：mtab 那份是 .match-list 直接跟在 .output-header 后面 */
.dt-root .match-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

/* 假数据的输出框 */
.dt-root .fake-results {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* 代码块不撑破弹窗 */
.dt-root .output-box {
    overflow: auto;
    max-height: 100%;
}

/* 工具面板在 main-content 里撑满，滚动交给里面的 .tool-panel */
.dt-root .main-content > .dt-host > .tool-panel {
    flex: 1;
    min-height: 0;
}

/* 右键菜单是 fixed 贴鼠标的，挂在 body 上，不能加 .dt-root 前缀 */
.json-context-menu {
    position: fixed;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
    z-index: 99999;
    min-width: 140px;
    padding: 4px;
}

.json-context-menu-item {
    padding: 8px 16px;
    color: #ddd;
    font-size: 13px;
    cursor: pointer;
    transition: background .1s;
    white-space: nowrap;
    border-radius: 6px;
}

.json-context-menu-item:hover {
    background: #3080FC;
    color: #fff;
}

/* ---------- 进制参考：小卡片网格 ---------- */

/*
 * 原来那张四列宽表格在窄窗口里会被右边切掉（老卢截过图）。
 * 改成一块块小卡：十进制当标题，下面 0b/0o/0x 三个值并排，
 * auto-fill 自动折行，任何宽度都不会横向溢出。
 */
.dt-root .radix-ref {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 8px;
}

.dt-root .radix-ref-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 8px 10px;
    background: #F7F8FA;
    border: 1px solid #E6E9EE;
    border-radius: 4px;
}

.dt-root .radix-ref-item b {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: #1a1a1a;
}

.dt-root .radix-ref-item span {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    min-width: 0;
    font-family: Monaco, Menlo, Ubuntu Mono, monospace;
    font-size: 12px;
    color: #6f7785;
}

.dt-root .radix-ref-item i {
    font-style: normal;
    overflow-wrap: anywhere;
}

/* ---------- 横向溢出兜底 ---------- */

/*
 * 工具内容一律不许撑出右侧栏：容器给 min-width:0（flex 子项默认 auto，
 * 里面一长串不换行的内容就会把整行顶宽），长串自己断行。
 */
.dt-root .main-content {
    overflow-x: hidden;
}

.dt-root .tool-panel > * {
    min-width: 0;
    max-width: 100%;
}

.dt-root .two-col > .col,
.dt-root .color-inputs,
.dt-root .hash-section,
.dt-root .jwt-results,
.dt-root .fake-results {
    min-width: 0;
}

.dt-root .uuid-value {
    min-width: 0;
    flex: 1 1 auto;
}

.dt-root .hash-result-item .input {
    min-width: 0;
}

.dt-root .info-msg,
.dt-root .section-card,
.dt-root .error-msg {
    box-sizing: border-box;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/*
 * 内容比面板高的时候，底边给一条很淡的渐变，提示「还能往下滚」。
 * 滚动条是藏起来的（跟 mtab 一样），不然最后一个块看着就像被窗口切掉了。
 * 滚到底就撤掉，免得最后一行也被蒙住 —— 由 openTool 里的滚动监听切 class。
 */
.dt-root .tool-panel.is-more {
    -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 26px), transparent);
    mask-image: linear-gradient(180deg, #000 calc(100% - 26px), transparent);
}

/*
 * 手机端：左边的工具列表改成顶部一条横滑。
 * 220px 的侧栏在 390 屏上要吃掉一半多，右栏只剩一百来像素，
 * JSON 框里每行只能放几个字符，按钮也被挤成三行。
 */
@media (max-width: 720px) {
    .devtools-window {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        flex: none;
        padding: 10px 12px 6px;
        border-right: 0;
        border-bottom: 1px solid #E6E9EE;
        overflow: visible;
    }

    .search-box {
        margin-bottom: 8px;
    }

    /* 横条里放不下分组标题，工具名自己就是标签 */
    .category-name {
        display: none;
    }

    .category-list {
        flex: none;
        display: flex;
        gap: 6px;
        padding-bottom: 4px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .category-list::-webkit-scrollbar {
        display: none;
    }

    .tool-item {
        flex: none;
        margin-bottom: 0;
        padding: 6px 12px;
        border-radius: 999px;
        background: #F1F3F5;
        font-size: 13px;
        white-space: nowrap;
    }

    .tool-item.active {
        background: #1a1a1a;
        color: #fff;
    }

    .main-content {
        flex: 1;
        min-height: 0;
    }
}
