/* ─── DK Text Sidebar ─────────────────────────────────────────────── */

#dk-text-sidebar {
    display: none;
    position: fixed;
    /* 高于 #dkShell（10,000,010）确保弹窗浮在底部导航之上。
       参考 DK-SHELL-CORE-PRINCIPLES 准则 5（渲染主权）。 */
    z-index: 10000020;
    /* PC 端：右侧居中悬浮 */
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
}

.dk-tsb-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #1a1a1a;
}

/* ─── Header ─────────────────────────────────────────────────────── */

.dk-tsb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.dk-tsb-title {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.dk-tsb-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #888;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}

.dk-tsb-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #333;
}

/* ─── Section ─────────────────────────────────────────────────────── */

.dk-tsb-section {
    margin-bottom: 14px;
}

.dk-tsb-section:last-child {
    margin-bottom: 0;
}

.dk-tsb-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* ─── Textarea ───────────────────────────────────────────────────── */

#dk-tsb-text {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    background: rgba(255, 255, 255, 0.7);
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.15s;
    line-height: 1.5;
}

#dk-tsb-text:focus {
    border-color: #4f8ef7;
}

/* ─── Font Select ────────────────────────────────────────────────── */

#dk-tsb-font {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.7);
    color: #1a1a1a;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath fill='%23888' d='M6 7L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    transition: border-color 0.15s;
}

#dk-tsb-font:focus {
    border-color: #4f8ef7;
}

/* ─── Color Swatches ─────────────────────────────────────────────── */

#dk-tsb-colors {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#dk-tsb-colors li {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

#dk-tsb-colors li:hover {
    transform: scale(1.12);
}

#dk-tsb-colors li.active {
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #4f8ef7, 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: scale(1.08);
}

/* ─── Radius Slider ──────────────────────────────────────────────── */

#dk-tsb-radius-section {
    display: none;
}

#dk-tsb-radius {
    width: 100%;
    margin-top: 4px;
    accent-color: #4f8ef7;
    cursor: pointer;
}

#dk-tsb-radius-val {
    font-weight: 700;
    color: #4f8ef7;
    margin-left: 4px;
}

/* ─── 隐藏 Lumise 原生 Text Effects 工具项 ───────────────────────── */

#lumise-top-tools li[data-tool="text-effect"] {
    display: none !important;
}

/* ─── 移动端：底部抽屉样式 ───────────────────────────────────────── */

@media (max-width: 768px) {
    #dk-text-sidebar {
        right: 0;
        left: 0;
        top: auto;
        bottom: 0;
        transform: none;
        width: 100%;
    }

    .dk-tsb-card {
        border-radius: 16px 16px 0 0;
        /* padding-bottom：使用 dk-shell 的导航栏高度变量（含 safe-area-inset-bottom），
           确保颜色色板等底部内容不被四大金刚导航栏遮挡。
           fallback 70px 适配未加载 dk-shell.css 的降级场景。 */
        padding: 18px 16px calc(var(--dk-nav-h, 70px) + 16px);
    }

    #dk-tsb-colors li {
        width: 36px;
        height: 36px;
    }
}
