/* ============================================================
   配色工具通用样式（2026-10-28）
   适用于：颜色转换 / CSS渐变 / 对比度检测 / 色盲模拟 / 配色迁移
   ============================================================ */

.tk-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 8px 0 60px;
}

/* 标题区 */
.tk-head {
    text-align: center;
    padding: 28px 16px 22px;
}
.tk-head h2 {
    font-size: 26px;
    color: #1c2b5c;
    margin: 0 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.tk-head h2 i {
    color: #4a63c8;
    font-size: 22px;
}
.tk-head p {
    margin: 0;
    color: #7a839c;
    font-size: 14px;
    line-height: 1.7;
}

/* 面板 */
.tk-panel {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(28, 43, 92, .07);
    padding: 22px;
    margin-bottom: 18px;
}
.tk-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #1c2b5c;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tk-panel-title i {
    color: #4a63c8;
}

/* 两栏 */
.tk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
}

/* 表单 */
.tk-field {
    margin-bottom: 14px;
}
.tk-field:last-child {
    margin-bottom: 0;
}
.tk-label {
    display: block;
    font-size: 12px;
    color: #7a839c;
    margin-bottom: 6px;
}
.tk-input,
.tk-select {
    width: 100%;
    padding: 0px 12px;
    border: 1px solid #dde3f0;
    border-radius: 9px;
    font-size: 14px;
    color: #1f2740;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}
.tk-input:focus,
.tk-select:focus {
    border-color: #4a63c8;
    box-shadow: 0 0 0 3px rgba(74, 99, 200, .12);
}
.tk-input[type="color"] {
    padding: 4px;
    height: 44px;
    cursor: pointer;
}
.tk-input-row {
    display: flex;
    gap: 10px;
}
.tk-input-row .tk-input {
    flex: 1;
}
.tk-input-row .tk-input[type="color"] {
    flex: 0 0 64px;
}

/* 按钮 */
.tk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 0;
    border-radius: 9px;
    background: #2d3f7a;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s, transform .1s;
}
.tk-btn:hover {
    background: #233059;
}
.tk-btn:active {
    transform: translateY(1px);
}
.tk-btn-light {
    background: #eef2fb;
    color: #2d3f7a;
}
.tk-btn-light:hover {
    background: #e2e9f8;
}
.tk-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 7px;
}

/* 结果行 */
.tk-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tk-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8faff;
    border: 1px solid #eef1f8;
    border-radius: 10px;
}
.tk-row .tk-key {
    flex: 0 0 74px;
    font-size: 12px;
    color: #7a839c;
    font-weight: 600;
}
.tk-row .tk-val {
    flex: 1;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 13px;
    color: #1f2740;
    word-break: break-all;
}
.tk-copy {
    flex: 0 0 auto;
    border: 0;
    background: #eef2fb;
    color: #2d3f7a;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 7px;
    cursor: pointer;
}
.tk-copy:hover {
    background: #dde5f7;
}

/* 色块预览 */
.tk-swatch {
    width: 100%;
    height: 84px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, .06);
}
.tk-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
}
.tk-swatches .item {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eef1f8;
    cursor: pointer;
}
.tk-swatches .item .c {
    height: 62px;
}
.tk-swatches .item .t {
    padding: 6px 8px;
    font-size: 11px;
    color: #5a6480;
    font-family: ui-monospace, Consolas, monospace;
    text-align: center;
    background: #fff;
}

/* 提示条 */
.tk-note {
    background: #f0f4ff;
    border-left: 3px solid #4a63c8;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: #5a6480;
    line-height: 1.7;
    margin-top: 14px;
}
.tk-note.warn {
    background: #fff8ee;
    border-left-color: #e0a33e;
    color: #8a6a3a;
}
.tk-note.ok {
    background: #eefaf2;
    border-left-color: #2fa35b;
    color: #2b6e46;
}

/* 徽标 */
.tk-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.tk-badge.pass {
    background: #e8f6ee;
    color: #1f9254;
}
.tk-badge.fail {
    background: #fdecea;
    color: #c0392b;
}
.tk-badge.mid {
    background: #fff5e0;
    color: #b7791f;
}

/* 说明 / FAQ */
.tk-section {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(28, 43, 92, .07);
    padding: 22px;
    margin-bottom: 18px;
}
.tk-section h3 {
    font-size: 15px;
    color: #1c2b5c;
    margin: 0 0 14px;
}
.tk-section h3:not(:first-child) {
    margin-top: 22px;
}
.tk-section p,
.tk-section li {
    font-size: 13.5px;
    color: #5a6480;
    line-height: 1.85;
}
.tk-section ul {
    margin: 0;
    padding-left: 18px;
}
.tk-faq-item {
    border-bottom: 1px solid #f2f4fa;
    padding: 12px 0;
}
.tk-faq-item:last-child {
    border-bottom: 0;
}
.tk-faq-q {
    font-size: 14px;
    font-weight: 600;
    color: #2d3f7a;
    margin-bottom: 6px;
}
.tk-faq-a {
    font-size: 13px;
    color: #6b7590;
    line-height: 1.8;
}

/* 相关工具 */
.tk-related {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.tk-related a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f8faff;
    border: 1px solid #eef1f8;
    border-radius: 10px;
    color: #2d3f7a;
    font-size: 13.5px;
    text-decoration: none;
    transition: all .2s;
}
.tk-related a:hover {
    background: #eef2fb;
    border-color: #d6def5;
    transform: translateY(-1px);
}
.tk-related a i {
    color: #4a63c8;
}

/* 上传区 */
.tk-drop {
    border: 2px dashed #d6def5;
    border-radius: 12px;
    padding: 34px 20px;
    text-align: center;
    color: #8a93ab;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
    background: #fafbff;
}
.tk-drop:hover,
.tk-drop.dragover {
    border-color: #4a63c8;
    background: #f3f6ff;
    color: #2d3f7a;
}
.tk-drop i {
    display: block;
    font-size: 26px;
    margin-bottom: 10px;
    color: #4a63c8;
}

/* 结果画布 */
.tk-canvas-box {
    background: #f8faff;
    border: 1px solid #eef1f8;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}
.tk-canvas-box canvas,
.tk-canvas-box img {
    max-width: 100%;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

/* 加载中 */
.tk-loading {
    display: none;
    align-items: center;
    gap: 8px;
    color: #4a63c8;
    font-size: 13px;
    margin-top: 12px;
}
.tk-loading.on {
    display: flex;
}
.tk-spin {
    width: 14px;
    height: 14px;
    border: 2px solid #d6def5;
    border-top-color: #4a63c8;
    border-radius: 50%;
    animation: tk-spin .8s linear infinite;
}
@keyframes tk-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .tk-grid {
        grid-template-columns: 1fr;
    }
    .tk-head h2 {
        font-size: 21px;
    }
    .tk-head {
        padding: 18px 10px 16px;
    }
    .tk-panel,
    .tk-section {
        padding: 16px;
        border-radius: 12px;
    }
    .tk-row .tk-key {
        flex: 0 0 60px;
    }
}
