/* 站度网 · 屏幕坏点与外设自检 */
#app {
    --st-line: #e5e7eb;
    --st-soft: #f6f8fb;
    --u: 40px;
    --gap: 3px;
    --text-dim: #86868b;
}

/* 顶部标签 */
#app .st-tabs {
    display: flex;
    margin-bottom: 16px;
}

#app .st-tabs button {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

#app .st-tabs button .svg-icon,
#app .st-tabs button svg {
    width: 16px;
    height: 16px;
}

#app .st-panel[hidden] {
    display: none;
}

/* ---------- 屏幕色块 ---------- */
#app .st-swatches {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

#app .st-sw {
    position: relative;
    height: 74px;
    border: 1px solid var(--st-line);
    border-radius: 12px;
    cursor: pointer;
    background: var(--sw, #fff);
    padding: 0;
    overflow: hidden;
    transition: transform .14s ease, box-shadow .14s ease;
}

#app .st-sw span {
    position: absolute;
    left: 8px;
    bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}

#app .st-sw[data-test="white"] span,
#app .st-sw[data-test="yellow"] span,
#app .st-sw[data-test="cyan"] span,
#app .st-sw[data-test="green"] span {
    color: #1f2937;
    text-shadow: 0 1px 2px rgba(255, 255, 255, .9);
}

#app .st-sw:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(20, 30, 60, .14);
}

#app .st-sw-txt {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--st-soft);
    color: #374151;
    font-size: 13.5px;
    font-weight: 700;
    text-align: center;
}

#app .st-sw-txt:hover {
    background: #eef2ff;
    color: #2f4bd0;
}

/* ---------- 刷新率 ---------- */
#app .st-fps {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
}

#app .st-fps-num {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    color: #2f6bff;
    font-variant-numeric: tabular-nums;
}

#app .st-fps-num.idle {
    color: #cbd3e0;
}

#app .st-fps-unit {
    font-size: 15px;
    color: var(--text-dim);
    font-weight: 700;
}

#app .st-fps-bar {
    height: 8px;
    border-radius: 999px;
    background: #eef1f6;
    overflow: hidden;
    margin-bottom: 10px;
}

#app .st-fps-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #2f6bff, #6ea8ff);
    transition: width .1s linear;
}

/* ---------- 键盘 ---------- */
#app .st-kb-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    margin-bottom: 14px;
    font-size: 13.5px;
    color: #4b5563;
}

#app .st-kb-stat b {
    color: #111827;
    font-size: 15px;
}

#app .st-kb-reset {
    margin-left: auto;
    padding: 6px 16px;
    font-size: 13px;
}

#app .st-kb-scroll {
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}

#app .st-kb {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: max-content;
    padding: 4px 2px;
}

#app .st-kb-row {
    display: flex;
    gap: var(--gap);
    margin-bottom: var(--gap);
}

#app .st-kb-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--u);
    border: 1px solid #d8dee9;
    border-radius: 7px;
    background: #fbfcfe;
    color: #475569;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    user-select: none;
    transition: background .1s ease, color .1s ease, border-color .1s ease;
}

#app .st-kb-gap {
    display: inline-block;
    height: var(--u);
}

#app .st-kb-blank {
    background: transparent;
    border-color: transparent;
}

#app .st-kb-key.tested {
    background: #eaf7ee;
    border-color: #b7e3c5;
    color: #15803d;
}

#app .st-kb-key.down {
    background: #2f6bff;
    border-color: #2f6bff;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(47, 107, 255, .2);
    transform: translateY(1px);
}

#app .st-kb-nav {
    display: grid;
    grid-template-columns: repeat(3, var(--u));
    gap: var(--gap);
    margin-top: calc(var(--u) * 1.4);
}

#app .st-kb-nav .st-kb-key {
    width: var(--u);
}

#app .st-kb-np {
    display: grid;
    grid-template-columns: repeat(4, var(--u));
    gap: var(--gap);
    margin-top: calc(var(--u) * 1.4);
}

#app .st-kb-np .st-kb-key {
    width: auto;
}

#app .st-kb-log {
    padding: 12px 14px;
    border-radius: 10px;
    background: #f7f9fc;
    border: 1px dashed #dde3ec;
    color: #4b5563;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    min-height: 44px;
}

/* ---------- 鼠标 ---------- */
#app .st-mouse-pad {
    position: relative;
    height: 200px;
    border: 2px dashed #cfd8e6;
    border-radius: 14px;
    background: repeating-linear-gradient(45deg, #fbfcfe 0 10px, #f5f7fb 10px 20px);
    margin-bottom: 14px;
    overflow: hidden;
    cursor: crosshair;
}

#app .st-mouse-tip {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 13.5px;
    pointer-events: none;
}

#app .st-mouse-dot {
    position: absolute;
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    background: rgba(47, 107, 255, .85);
    box-shadow: 0 0 0 6px rgba(47, 107, 255, .14);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

#app .st-mouse-dot.on {
    opacity: 1;
}

#app .st-mouse-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

#app .st-m-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--st-line);
    border-radius: 11px;
    background: #fbfcfe;
}

#app .st-m-label {
    font-size: 12.5px;
    color: var(--text-dim);
}

#app .st-m-state {
    font-size: 14.5px;
    font-weight: 700;
    color: #6b7280;
}

#app .st-m-state.ok {
    color: #15803d;
}

#app .st-m-state.warn {
    color: #b45309;
}

#app .st-hz {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

#app .st-hz-num {
    font-size: 38px;
    font-weight: 800;
    color: #2f6bff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

#app .st-hz-unit {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dim);
    margin-right: auto;
}

/* ---------- 全屏覆盖层 ---------- */
body.st-lock {
    overflow: hidden;
}

.st-full {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    cursor: pointer;
}

.st-full[hidden] {
    display: none;
}

.st-full-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.st-full-inner .st-text-test {
    width: 100%;
    max-width: 900px;
    padding: 0 6vw;
    color: #111;
    text-align: left;
    font-family: -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.st-full-inner .st-text-test p {
    margin: 0 0 .5em;
    line-height: 1.4;
}

.st-full-tip {
    position: absolute;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 13px;
    letter-spacing: .3px;
    white-space: nowrap;
    transition: opacity .6s ease;
}

.st-full-tip.fade {
    opacity: .18;
}

@media (max-width: 900px) {
    #app .st-swatches {
        grid-template-columns: repeat(4, 1fr);
    }

    #app .st-sw {
        height: 64px;
    }

    #app .st-mouse-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #app {
        padding: 0;
        --u: 34px;
    }

    #app .st-tabs button {
        flex: 1 1 auto;
        font-size: 13px;
        padding: 8px 6px;
    }

    #app .st-swatches {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    #app .st-sw {
        height: 56px;
    }

    #app .st-sw span {
        font-size: 11px;
        left: 6px;
        bottom: 4px;
    }

    #app .st-fps-num {
        font-size: 32px;
    }

    #app .st-kb-meta {
        font-size: 12.5px;
        gap: 6px 12px;
    }

    #app .st-kb-reset {
        margin-left: 0;
    }

    #app .st-mouse-pad {
        height: 160px;
    }

    #app .st-mouse-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    #app .st-hz-num {
        font-size: 30px;
    }

    .st-full-tip {
        font-size: 12px;
        bottom: 20px;
        padding: 6px 12px;
    }
}
