/* ================================================================
   菜刀客在线工具页 · color-blindness-test.html 私有样式
   需在 /css/common.css 之后加载。
   ================================================================ */

/* ---- 顶部工具条 + 开关 ---- */
.cb-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 1px solid #eef0f4;
    background: #fbfcff;
}

.cb-toolbar .rate-tip {
    font-size: 12px;
    color: #9ca3af;
}

.cb-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.cb-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cb-switch-track {
    position: relative;
    width: 46px;
    height: 24px;
    border-radius: 999px;
    background: #d1d5db;
    transition: background 0.22s;
    flex: 0 0 auto;
}

.cb-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.22s;
}

.cb-switch input:checked + .cb-switch-track {
    background: #667eea;
}

.cb-switch input:checked + .cb-switch-track .cb-switch-thumb {
    transform: translateX(22px);
}

.cb-switch input:focus-visible + .cb-switch-track {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.cb-switch-text {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

/* ---- 测试分块 ---- */
.cb-block {
    padding: 16px 15px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.cb-block:last-child {
    border-bottom: none;
}

.cb-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 14px;
}

.cb-head::before {
    content: "";
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex: 0 0 auto;
}

.cb-level {
    font-size: 12px;
    font-weight: 500;
    color: #b45309;
    background: #fef3c7;
    padding: 2px 10px;
    border-radius: 999px;
}

/* ---- 图片网格 ---- */
.cb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.cb-item {
    margin: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #eef0f4;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.cb-item:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.cb-item img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #ffffff;
    cursor: zoom-in;
}

.cb-cap {
    padding: 9px 12px;
    font-size: 13px;
    line-height: 1.65;
    color: #4b5563;
    border-top: 1px dashed #eef0f4;
    flex: 1;
}

.cb-hide-caps .cb-cap {
    display: none;
}

/* ---- 放大预览 ---- */
.cb-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.75);
    z-index: 1000;
    padding: 30px 20px;
    overflow: auto;
}

.cb-modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.cb-modal-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 14px;
    max-width: 640px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.cb-modal-box img {
    display: block;
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}

.cb-modal-cap {
    margin: 12px 4px 8px;
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
}

.cb-modal-meta {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ---- 文章标题层级 ---- */
.seo-article h3 {
    font-size: 15px;
    color: #374151;
    margin: 16px 0 8px;
}

.seo-article h4 {
    font-size: 14px;
    color: #4b5563;
    margin: 12px 0 6px;
}

.seo-article p b {
    color: #374151;
}

/* ---- 小屏适配 ---- */
@media (max-width: 700px) {
    .cb-grid {
        grid-template-columns: 1fr;
    }

    .cb-item img {
        height: 190px;
    }
}
